reactjs-tiptap-editor 0.0.5 → 0.0.7

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 (167) hide show
  1. package/README.md +8 -0
  2. package/lib/index.d.cts +707 -0
  3. package/lib/index.d.ts +707 -4
  4. package/lib/reactjs-tiptap-editor.cjs +1 -0
  5. package/lib/reactjs-tiptap-editor.js +5456 -1
  6. package/lib/{vendor-DlmsfAkr.js → vendor-B-W_3NKN.cjs} +162 -162
  7. package/lib/{vendor-B_w0TZys.mjs → vendor-D8S0CsNZ.js} +2712 -2754
  8. package/package.json +66 -60
  9. package/lib/components/ActionButton.d.ts +0 -20
  10. package/lib/components/ActionMenuButton.d.ts +0 -14
  11. package/lib/components/ColorPicker.d.ts +0 -12
  12. package/lib/components/RcTiptapEditor.d.ts +0 -26
  13. package/lib/components/Toolbar.d.ts +0 -2
  14. package/lib/components/icons/AspectRatio.d.ts +0 -3
  15. package/lib/components/icons/Blockquote.d.ts +0 -1
  16. package/lib/components/icons/DeleteColumn.d.ts +0 -4
  17. package/lib/components/icons/DeleteRow.d.ts +0 -4
  18. package/lib/components/icons/FileWordOutline.d.ts +0 -3
  19. package/lib/components/icons/Icon.d.ts +0 -7
  20. package/lib/components/icons/LineHeight.d.ts +0 -3
  21. package/lib/components/icons/MenuDown.d.ts +0 -3
  22. package/lib/components/icons/SizeL.d.ts +0 -3
  23. package/lib/components/icons/SizeM.d.ts +0 -3
  24. package/lib/components/icons/SizeS.d.ts +0 -3
  25. package/lib/components/icons/icons.d.ts +0 -2
  26. package/lib/components/menus/bubble.d.ts +0 -56
  27. package/lib/components/menus/components/BubbleMenuLink.d.ts +0 -2
  28. package/lib/components/menus/components/BubbleMenuMedia.d.ts +0 -9
  29. package/lib/components/menus/components/BubbleMenuText.d.ts +0 -8
  30. package/lib/components/menus/components/ContentMenu.d.ts +0 -2
  31. package/lib/components/menus/components/TableBubbleMenu.d.ts +0 -2
  32. package/lib/components/ui/button.d.ts +0 -11
  33. package/lib/components/ui/dropdown-menu.d.ts +0 -27
  34. package/lib/components/ui/input.d.ts +0 -5
  35. package/lib/components/ui/label.d.ts +0 -5
  36. package/lib/components/ui/popover.d.ts +0 -6
  37. package/lib/components/ui/separator.d.ts +0 -4
  38. package/lib/components/ui/switch.d.ts +0 -4
  39. package/lib/components/ui/tabs.d.ts +0 -7
  40. package/lib/components/ui/toast.d.ts +0 -15
  41. package/lib/components/ui/toaster.d.ts +0 -1
  42. package/lib/components/ui/toggle.d.ts +0 -12
  43. package/lib/components/ui/tooltip.d.ts +0 -7
  44. package/lib/components/ui/use-toast.d.ts +0 -44
  45. package/lib/constants/index.d.ts +0 -44
  46. package/lib/extensions/BaseKit.d.ts +0 -111
  47. package/lib/extensions/Blockquote/Blockquote.d.ts +0 -6
  48. package/lib/extensions/Blockquote/index.d.ts +0 -1
  49. package/lib/extensions/Bold/Bold.d.ts +0 -6
  50. package/lib/extensions/Bold/index.d.ts +0 -1
  51. package/lib/extensions/BulletList/BulletList.d.ts +0 -6
  52. package/lib/extensions/BulletList/index.d.ts +0 -1
  53. package/lib/extensions/Clear/Clear.d.ts +0 -6
  54. package/lib/extensions/Clear/index.d.ts +0 -1
  55. package/lib/extensions/Code/Code.d.ts +0 -6
  56. package/lib/extensions/Code/index.d.ts +0 -1
  57. package/lib/extensions/CodeBlock/CodeBlock.d.ts +0 -6
  58. package/lib/extensions/CodeBlock/index.d.ts +0 -1
  59. package/lib/extensions/Color/Color.d.ts +0 -6
  60. package/lib/extensions/Color/components/ColorActionButton.d.ts +0 -13
  61. package/lib/extensions/Color/index.d.ts +0 -1
  62. package/lib/extensions/Document/Document.d.ts +0 -2
  63. package/lib/extensions/Document/index.d.ts +0 -1
  64. package/lib/extensions/FontFamily/FontFamily.d.ts +0 -3
  65. package/lib/extensions/FontFamily/components/FontFamilyButton.d.ts +0 -26
  66. package/lib/extensions/FontFamily/index.d.ts +0 -1
  67. package/lib/extensions/FontSize/FontSize.d.ts +0 -32
  68. package/lib/extensions/FontSize/components/FontSizeMenuButton.d.ts +0 -23
  69. package/lib/extensions/FontSize/index.d.ts +0 -1
  70. package/lib/extensions/FormatPainter/FormatPainter.d.ts +0 -24
  71. package/lib/extensions/FormatPainter/index.d.ts +0 -1
  72. package/lib/extensions/Heading/Heading.d.ts +0 -6
  73. package/lib/extensions/Heading/components/HeadingButton.d.ts +0 -26
  74. package/lib/extensions/Heading/index.d.ts +0 -1
  75. package/lib/extensions/Highlight/Highlight.d.ts +0 -6
  76. package/lib/extensions/Highlight/components/HighlightActionButton.d.ts +0 -14
  77. package/lib/extensions/Highlight/index.d.ts +0 -1
  78. package/lib/extensions/History/History.d.ts +0 -6
  79. package/lib/extensions/History/components/HistoryActionButton.d.ts +0 -20
  80. package/lib/extensions/History/index.d.ts +0 -1
  81. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +0 -6
  82. package/lib/extensions/HorizontalRule/index.d.ts +0 -1
  83. package/lib/extensions/Iframe/Iframe.d.ts +0 -23
  84. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +0 -2
  85. package/lib/extensions/Iframe/embed.d.ts +0 -23
  86. package/lib/extensions/Iframe/index.d.ts +0 -1
  87. package/lib/extensions/Image/Image.d.ts +0 -25
  88. package/lib/extensions/Image/components/ImageView.d.ts +0 -2
  89. package/lib/extensions/Image/index.d.ts +0 -1
  90. package/lib/extensions/ImageUpload/ImageUpload.d.ts +0 -16
  91. package/lib/extensions/ImageUpload/components/ImageUploader.d.ts +0 -2
  92. package/lib/extensions/ImageUpload/index.d.ts +0 -1
  93. package/lib/extensions/Indent/Indent.d.ts +0 -23
  94. package/lib/extensions/Indent/index.d.ts +0 -1
  95. package/lib/extensions/Italic/Italic.d.ts +0 -6
  96. package/lib/extensions/Italic/index.d.ts +0 -1
  97. package/lib/extensions/LineHeight/LineHeight.d.ts +0 -17
  98. package/lib/extensions/LineHeight/components/LineHeightDropdown.d.ts +0 -12
  99. package/lib/extensions/LineHeight/index.d.ts +0 -1
  100. package/lib/extensions/Link/Link.d.ts +0 -6
  101. package/lib/extensions/Link/components/LinkEditBlock.d.ts +0 -6
  102. package/lib/extensions/Link/components/LinkEditPopover.d.ts +0 -14
  103. package/lib/extensions/Link/components/LinkViewBlock.d.ts +0 -8
  104. package/lib/extensions/Link/index.d.ts +0 -1
  105. package/lib/extensions/ListItem/ListItem.d.ts +0 -1
  106. package/lib/extensions/ListItem/index.d.ts +0 -1
  107. package/lib/extensions/MoreMark/MoreMark.d.ts +0 -20
  108. package/lib/extensions/MoreMark/components/ActionMoreButton.d.ts +0 -25
  109. package/lib/extensions/MoreMark/index.d.ts +0 -1
  110. package/lib/extensions/MultiColumn/Column.d.ts +0 -4
  111. package/lib/extensions/MultiColumn/ColumnToolbar.d.ts +0 -3
  112. package/lib/extensions/MultiColumn/Columns.d.ts +0 -22
  113. package/lib/extensions/MultiColumn/index.d.ts +0 -3
  114. package/lib/extensions/MultiColumn/menus/ColumnsMenu.d.ts +0 -6
  115. package/lib/extensions/MultiColumn/menus/index.d.ts +0 -1
  116. package/lib/extensions/OrderedList/OrderedList.d.ts +0 -6
  117. package/lib/extensions/OrderedList/index.d.ts +0 -1
  118. package/lib/extensions/Selection/Selection.d.ts +0 -4
  119. package/lib/extensions/Selection/index.d.ts +0 -1
  120. package/lib/extensions/SlashCommand/SlashCommand.d.ts +0 -4
  121. package/lib/extensions/SlashCommand/components/CommandsList.d.ts +0 -4
  122. package/lib/extensions/SlashCommand/groups.d.ts +0 -3
  123. package/lib/extensions/SlashCommand/index.d.ts +0 -1
  124. package/lib/extensions/SlashCommand/types.d.ts +0 -25
  125. package/lib/extensions/Strike/Strike.d.ts +0 -6
  126. package/lib/extensions/Strike/index.d.ts +0 -1
  127. package/lib/extensions/Subscript/Subscript.d.ts +0 -23
  128. package/lib/extensions/Subscript/index.d.ts +0 -1
  129. package/lib/extensions/Table/cell-background.d.ts +0 -19
  130. package/lib/extensions/Table/components/CreateTablePopover.d.ts +0 -14
  131. package/lib/extensions/Table/components/TableActionButton.d.ts +0 -13
  132. package/lib/extensions/Table/index.d.ts +0 -5
  133. package/lib/extensions/Table/table.d.ts +0 -24
  134. package/lib/extensions/TaskList/TaskList.d.ts +0 -12
  135. package/lib/extensions/TaskList/index.d.ts +0 -1
  136. package/lib/extensions/TextAlign/TextAlign.d.ts +0 -18
  137. package/lib/extensions/TextAlign/components/TextAlignMenuButton.d.ts +0 -27
  138. package/lib/extensions/TextAlign/index.d.ts +0 -1
  139. package/lib/extensions/TextBubble/TextBubble.d.ts +0 -7
  140. package/lib/extensions/TextBubble/components/TextDropdown.d.ts +0 -10
  141. package/lib/extensions/TextBubble/index.d.ts +0 -1
  142. package/lib/extensions/TrailingNode/TrailingNode.d.ts +0 -12
  143. package/lib/extensions/TrailingNode/index.d.ts +0 -1
  144. package/lib/extensions/UnderLine/Underline.d.ts +0 -6
  145. package/lib/extensions/UnderLine/index.d.ts +0 -1
  146. package/lib/extensions/Video/Video.d.ts +0 -55
  147. package/lib/extensions/Video/index.d.ts +0 -1
  148. package/lib/extensions/VideoUpload/VideoUpload.d.ts +0 -14
  149. package/lib/extensions/VideoUpload/components/VideoUploaderView.d.ts +0 -2
  150. package/lib/extensions/VideoUpload/index.d.ts +0 -1
  151. package/lib/extensions/index.d.ts +0 -64
  152. package/lib/lib/utils.d.ts +0 -3
  153. package/lib/locales/en.d.ts +0 -2
  154. package/lib/locales/index.d.ts +0 -35
  155. package/lib/locales/vi.d.ts +0 -2
  156. package/lib/locales/zh-cn.d.ts +0 -127
  157. package/lib/plugins/image-upload.d.ts +0 -12
  158. package/lib/reactjs-tiptap-editor.mjs +0 -5441
  159. package/lib/theme/theme.d.ts +0 -4
  160. package/lib/types.d.ts +0 -80
  161. package/lib/utils/getRenderContainer.d.ts +0 -4
  162. package/lib/utils/indent.d.ts +0 -15
  163. package/lib/utils/is-mobile.d.ts +0 -19
  164. package/lib/utils/line-height.d.ts +0 -7
  165. package/lib/utils/mitt.d.ts +0 -24
  166. package/lib/utils/plateform.d.ts +0 -11
  167. package/lib/utils/utils.d.ts +0 -17
@@ -1,16 +1,16 @@
1
- "use strict";var bS=Object.defineProperty;var vS=(t,e,n)=>e in t?bS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ns=(t,e,n)=>vS(t,typeof e!="symbol"?e+"":e,n);const _=require("react"),T=require("react/jsx-runtime"),Pa=require("react-dom");function Wy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const v=Wy(_),uf=Wy(Pa);function Ge(t){this.content=t}Ge.prototype={constructor:Ge,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Ge(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ge(n)},addToStart:function(t,e){return new Ge([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ge(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Ge(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ge.from(t),t.size?new Ge(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ge.from(t),t.size?new Ge(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ge.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ge.from=function(t){if(t instanceof Ge)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ge(e)};function Uy(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=Uy(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Ky(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),l=e.child(--i),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;c<u&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let c=Ky(s.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class P{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,l=0;l<n;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,o+l,i||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new P(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let l=this.content[i],a=s+l.nodeSize;a>e&&((s<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),o+=l.nodeSize),s=a}return new P(r,o)}cutByIndex(e,n){return e==n?P.empty:e==0&&n==this.content.length?this:new P(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new P(o,i)}addToStart(e){return new P([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new P(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Uy(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ky(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ds(0,e);if(e==this.size)return Ds(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?Ds(r+1,s):Ds(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return P.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new P(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return P.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new P(n||e,r)}static from(e){if(!e)return P.empty;if(e instanceof P)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new P([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}P.empty=new P([],0);const Ac={index:0,offset:0};function Ds(t,e){return Ac.index=t,Ac.offset=e,Ac}function Tl(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Tl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Tl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let pe=class Lu{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Tl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Lu.none;if(e instanceof Lu)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};pe.none=[];class Ol extends Error{}class B{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=qy(this.content,e+this.openStart,n);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,n){return new B(Gy(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return B.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(P.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new B(e,r,o)}}B.empty=new B(P.empty,0,0);function Gy(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(o==e||i.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Gy(i.content,e-o-1,n-o-1)))}function qy(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=qy(s.content,e-i-1,n);return l&&t.replaceChild(o,s.copy(l))}function wS(t,e,n){if(n.openStart>t.depth)throw new Ol("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ol("Inconsistent open depths");return Jy(t,e,n,0)}function Jy(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Jy(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return Br(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=xS(n,t);return Br(i,Xy(t,s,l,e,r))}else return Br(i,Al(t,e,r))}function Yy(t,e){if(!e.type.compatibleContent(t.type))throw new Ol("Cannot join "+e.type.name+" onto "+t.type.name)}function $u(t,e,n){let r=t.node(n);return Yy(r,e.node(n)),r}function $r(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function vi(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&($r(t.nodeAfter,r),i++));for(let l=i;l<s;l++)$r(o.child(l),r);e&&e.depth==n&&e.textOffset&&$r(e.nodeBefore,r)}function Br(t,e){return t.type.checkContent(e),t.copy(e)}function Xy(t,e,n,r,o){let i=t.depth>o&&$u(t,e,o+1),s=r.depth>o&&$u(n,r,o+1),l=[];return vi(null,t,o,l),i&&s&&e.index(o)==n.index(o)?(Yy(i,s),$r(Br(i,Xy(t,e,n,r,o+1)),l)):(i&&$r(Br(i,Al(t,e,o+1)),l),vi(e,n,o,l),s&&$r(Br(s,Al(n,r,o+1)),l)),vi(r,null,o,l),new P(l)}function Al(t,e,n){let r=[];if(vi(null,t,n,r),t.depth>n){let o=$u(t,e,n+1);$r(Br(o,Al(t,e,n+1)),r)}return vi(e,null,n,r),new P(r)}function xS(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(P.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class Pi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return pe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Li(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(i),c=i-a;if(r.push(s,l,o+a),!c||(s=s.child(l),s.isText))break;i=c-1,o+=a+1}return new Pi(n,r,i)}static resolveCached(e,n){let r=Qh.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Qh.set(e,r=new SS);let o=r.elts[r.i]=Pi.resolve(e,n);return r.i=(r.i+1)%CS,o}}class SS{constructor(){this.elts=[],this.i=0}}const CS=12,Qh=new WeakMap;class Li{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ES=Object.create(null);let Fr=class Bu{constructor(e,n,r,o=pe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||P.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Tl(this.attrs,n||e.defaultAttrs||ES)&&pe.sameSet(this.marks,r||pe.none)}copy(e=null){return e==this.content?this:new Bu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Bu(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return B.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),l=o.start(s),c=o.node(s).content.cut(o.pos-l,i.pos-l);return new B(c,o.depth-s,i.depth-s)}replace(e,n,r){return wS(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return Pi.resolveCached(this,e)}resolveNoCache(e){return Pi.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Zy(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=P.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=P.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Fr.prototype.text=void 0;class Rl extends Fr{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Rl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Rl(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Zy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ur{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kS(e,n);if(r.next==null)return Ur.empty;let o=Qy(r);r.next&&r.err("Unexpected trailing text");let i=DS(NS(o));return _S(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,l){let a=s.matchFragment(e,r);if(a&&(!n||a.validEnd))return P.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let l=o;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:l,next:a}=i.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
- `)}}Ur.empty=new Ur(!0);class kS{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Qy(t){let e=[];do e.push(MS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function MS(t){let e=[];do e.push(TS(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function TS(t){let e=RS(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=OS(t,e);else break;return e}function ep(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function OS(t,e){let n=ep(t),r=n;return t.eat(",")&&(t.next!="}"?r=ep(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function AS(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function RS(t){if(t.eat("(")){let e=Qy(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=AS(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function NS(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,a),u),a=u}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let u=n();r(a,u),o(i(s.expr,a),u),a=u}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function eb(t,e){return e-t}function tp(t,e){let n=[];return r(e),n.sort(eb);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function DS(t){let e=Object.create(null);return n(tp(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<o.length;u++)o[u][0]==l&&(c=o[u][1]);tp(t,a).forEach(u=>{c||o.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Ur(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(eb);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function _S(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function tb(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function nb(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function rb(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function ob(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new PS(t,r,e[r]);return n}let np=class ib{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ob(e,r.attrs),this.defaultAttrs=tb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ur.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:nb(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Fr(this,this.computeAttrs(e),P.from(n),pe.setFrom(r))}createChecked(e=null,n,r){return n=P.from(n),this.checkContent(n),new Fr(this,this.computeAttrs(e),n,pe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=P.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(P.empty,!0);return i?new Fr(this,e,n.append(i),pe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){rb(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:pe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new ib(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function IS(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class PS{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?IS(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class La{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=ob(e,o.attrs),this.excluded=null;let i=tb(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,nb(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new La(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){rb(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sb{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Ge.from(e.nodes),n.marks=Ge.from(e.marks||{}),this.nodes=np.compile(this.spec.nodes,this),this.marks=La.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Ur.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?rp(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:rp(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof np){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Rl(r,r.defaultAttrs,e,pe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Fr.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function rp(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(o=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function LS(t){return t.tag!=null}function $S(t){return t.style!=null}let wi=class Fu{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(LS(o))this.tags.push(o);else if($S(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new ip(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new ip(this,n,!0);return r.addAll(e,n.from,n.to),B.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(jS(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=sp(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=sp(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Fu(e,Fu.schemaRules(e)))}};const lb={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},BS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ab={ol:!0,ul:!0},Nl=1,Dl=2,xi=4;function op(t,e,n){return e!=null?(e?Nl:0)|(e==="full"?Dl:0):t&&t.whitespace=="pre"?Nl|Dl:n&~xi}class _s{constructor(e,n,r,o,i,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=l,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=s||(l&xi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(P.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Nl)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=P.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):HS(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!lb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ip{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=op(null,n.preserveWhitespace,0)|(r?xi:0);o?i=new _s(o.type,o.attrs,pe.none,pe.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new _s(null,null,pe.none,pe.none,!0,null,s):i=new _s(e.schema.topNodeType,null,pe.none,pe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let o=this.readStyles(e.style);if(!o)return;let[i,s]=o,l=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],l);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);n();for(let a=0;a<i.length;a++)this.removePendingMark(i[a],l);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Dl||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Nl)r.options&Dl?n=n.replace(/\r\n?/g,`
1
+ "use strict";var bS=Object.defineProperty;var vS=(t,e,n)=>e in t?bS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ns=(t,e,n)=>vS(t,typeof e!="symbol"?e+"":e,n);const P=require("react"),T=require("react/jsx-runtime"),Ia=require("react-dom");function Wy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const v=Wy(P),df=Wy(Ia);function Ge(t){this.content=t}Ge.prototype={constructor:Ge,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Ge(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ge(n)},addToStart:function(t,e){return new Ge([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ge(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Ge(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ge.from(t),t.size?new Ge(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ge.from(t),t.size?new Ge(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ge.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ge.from=function(t){if(t instanceof Ge)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ge(e)};function Uy(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=Uy(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Ky(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),l=e.child(--i),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;c<u&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let c=Ky(s.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class I{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,l=0;l<n;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,o+l,i||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new I(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let l=this.content[i],a=s+l.nodeSize;a>e&&((s<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),o+=l.nodeSize),s=a}return new I(r,o)}cutByIndex(e,n){return e==n?I.empty:e==0&&n==this.content.length?this:new I(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new I(o,i)}addToStart(e){return new I([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new I(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Uy(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ky(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ds(0,e);if(e==this.size)return Ds(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?Ds(r+1,s):Ds(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return I.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new I(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return I.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new I(n||e,r)}static from(e){if(!e)return I.empty;if(e instanceof I)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new I([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}I.empty=new I([],0);const Ac={index:0,offset:0};function Ds(t,e){return Ac.index=t,Ac.offset=e,Ac}function Ml(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ml(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ml(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let pe=class $u{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ml(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $u.none;if(e instanceof $u)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};pe.none=[];class Tl extends Error{}class B{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=qy(this.content,e+this.openStart,n);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,n){return new B(Gy(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return B.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(I.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new B(e,r,o)}}B.empty=new B(I.empty,0,0);function Gy(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(o==e||i.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Gy(i.content,e-o-1,n-o-1)))}function qy(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=qy(s.content,e-i-1,n);return l&&t.replaceChild(o,s.copy(l))}function wS(t,e,n){if(n.openStart>t.depth)throw new Tl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Tl("Inconsistent open depths");return Jy(t,e,n,0)}function Jy(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Jy(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return $r(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=xS(n,t);return $r(i,Xy(t,s,l,e,r))}else return $r(i,Ol(t,e,r))}function Yy(t,e){if(!e.type.compatibleContent(t.type))throw new Tl("Cannot join "+e.type.name+" onto "+t.type.name)}function Bu(t,e,n){let r=t.node(n);return Yy(r,e.node(n)),r}function Lr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function vi(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Lr(t.nodeAfter,r),i++));for(let l=i;l<s;l++)Lr(o.child(l),r);e&&e.depth==n&&e.textOffset&&Lr(e.nodeBefore,r)}function $r(t,e){return t.type.checkContent(e),t.copy(e)}function Xy(t,e,n,r,o){let i=t.depth>o&&Bu(t,e,o+1),s=r.depth>o&&Bu(n,r,o+1),l=[];return vi(null,t,o,l),i&&s&&e.index(o)==n.index(o)?(Yy(i,s),Lr($r(i,Xy(t,e,n,r,o+1)),l)):(i&&Lr($r(i,Ol(t,e,o+1)),l),vi(e,n,o,l),s&&Lr($r(s,Ol(n,r,o+1)),l)),vi(r,null,o,l),new I(l)}function Ol(t,e,n){let r=[];if(vi(null,t,n,r),t.depth>n){let o=Bu(t,e,n+1);Lr($r(o,Ol(t,e,n+1)),r)}return vi(e,null,n,r),new I(r)}function xS(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(I.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class Pi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return pe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Li(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(i),c=i-a;if(r.push(s,l,o+a),!c||(s=s.child(l),s.isText))break;i=c-1,o+=a+1}return new Pi(n,r,i)}static resolveCached(e,n){let r=Qh.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Qh.set(e,r=new SS);let o=r.elts[r.i]=Pi.resolve(e,n);return r.i=(r.i+1)%CS,o}}class SS{constructor(){this.elts=[],this.i=0}}const CS=12,Qh=new WeakMap;class Li{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ES=Object.create(null);let Br=class Fu{constructor(e,n,r,o=pe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||I.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ml(this.attrs,n||e.defaultAttrs||ES)&&pe.sameSet(this.marks,r||pe.none)}copy(e=null){return e==this.content?this:new Fu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Fu(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return B.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),l=o.start(s),c=o.node(s).content.cut(o.pos-l,i.pos-l);return new B(c,o.depth-s,i.depth-s)}replace(e,n,r){return wS(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return Pi.resolveCached(this,e)}resolveNoCache(e){return Pi.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Zy(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=I.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=I.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Br.prototype.text=void 0;class Al extends Br{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Al(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Al(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Zy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Wr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kS(e,n);if(r.next==null)return Wr.empty;let o=Qy(r);r.next&&r.err("Unexpected trailing text");let i=DS(NS(o));return _S(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,l){let a=s.matchFragment(e,r);if(a&&(!n||a.validEnd))return I.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let l=o;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:l,next:a}=i.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
+ `)}}Wr.empty=new Wr(!0);class kS{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Qy(t){let e=[];do e.push(MS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function MS(t){let e=[];do e.push(TS(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function TS(t){let e=RS(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=OS(t,e);else break;return e}function ep(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function OS(t,e){let n=ep(t),r=n;return t.eat(",")&&(t.next!="}"?r=ep(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function AS(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function RS(t){if(t.eat("(")){let e=Qy(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=AS(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function NS(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,a),u),a=u}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let u=n();r(a,u),o(i(s.expr,a),u),a=u}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function eb(t,e){return e-t}function tp(t,e){let n=[];return r(e),n.sort(eb);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function DS(t){let e=Object.create(null);return n(tp(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<o.length;u++)o[u][0]==l&&(c=o[u][1]);tp(t,a).forEach(u=>{c||o.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Wr(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(eb);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function _S(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function tb(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function nb(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function rb(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function ob(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new PS(t,r,e[r]);return n}let np=class ib{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ob(e,r.attrs),this.defaultAttrs=tb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Wr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:nb(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Br(this,this.computeAttrs(e),I.from(n),pe.setFrom(r))}createChecked(e=null,n,r){return n=I.from(n),this.checkContent(n),new Br(this,this.computeAttrs(e),n,pe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=I.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(I.empty,!0);return i?new Br(this,e,n.append(i),pe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){rb(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:pe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new ib(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function IS(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class PS{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?IS(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Pa{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=ob(e,o.attrs),this.excluded=null;let i=tb(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,nb(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Pa(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){rb(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sb{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Ge.from(e.nodes),n.marks=Ge.from(e.marks||{}),this.nodes=np.compile(this.spec.nodes,this),this.marks=Pa.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Wr.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?rp(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:rp(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof np){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Al(r,r.defaultAttrs,e,pe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Br.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function rp(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(o=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function LS(t){return t.tag!=null}function $S(t){return t.style!=null}let wi=class ju{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(LS(o))this.tags.push(o);else if($S(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new ip(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new ip(this,n,!0);return r.addAll(e,n.from,n.to),B.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(jS(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=sp(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=sp(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ju(e,ju.schemaRules(e)))}};const lb={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},BS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ab={ol:!0,ul:!0},Rl=1,Nl=2,xi=4;function op(t,e,n){return e!=null?(e?Rl:0)|(e==="full"?Nl:0):t&&t.whitespace=="pre"?Rl|Nl:n&~xi}class _s{constructor(e,n,r,o,i,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=l,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=s||(l&xi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(I.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Rl)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=I.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(I.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):HS(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!lb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ip{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=op(null,n.preserveWhitespace,0)|(r?xi:0);o?i=new _s(o.type,o.attrs,pe.none,pe.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new _s(null,null,pe.none,pe.none,!0,null,s):i=new _s(e.schema.topNodeType,null,pe.none,pe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let o=this.readStyles(e.style);if(!o)return;let[i,s]=o,l=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],l);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);n();for(let a=0;a<i.length;a++)this.removePendingMark(i[a],l);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Nl||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Rl)r.options&Nl?n=n.replace(/\r\n?/g,`
3
3
  `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=e.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),o;ab.hasOwnProperty(r)&&this.parser.normalizeLists&&FS(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));if(i?i.ignore:BS.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let s,l=this.top,a=this.needsBlock;if(lb.hasOwnProperty(r))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),s=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}i&&i.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,i,i.consuming===!1?o:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=pe.none,r=pe.none;if(e.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=e.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{a.clearMark(c)&&(r=c.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)l=a;else break}}return[n,r]}addElementByRule(e,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(e):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a)}o&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=op(e,o,i.options);i.options&xi&&i.content.length==0&&(s|=xi),this.nodes.push(new _s(e,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=zS(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function FS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ab.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function jS(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function sp(t){let e={};for(let n in t)e[n]=t[n];return e}function HS(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function zS(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class no{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Rc(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let l=0,a=0;for(;l<i.length&&a<s.marks.length;){let c=s.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)o=i.pop()[1];for(;a<s.marks.length;){let c=s.marks[a++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=dl(Rc(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&dl(Rc(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return dl(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new no(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=lp(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return lp(e.marks)}}function lp(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Rc(t){return t.document||window.document}const ap=new WeakMap;function VS(t){let e=ap.get(t);return e===void 0&&ap.set(t,e=WS(t)),e}function WS(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function dl(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=VS(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let l,a=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=dl(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const cb=65535,ub=Math.pow(2,16);function US(t,e){return t+e*ub}function cp(t){return t&cb}function KS(t){return(t-(t&cb))/ub}const db=1,fb=2,fl=4,hb=8;class ju{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&hb)>0}get deletedBefore(){return(this.delInfo&(db|fl))>0}get deletedAfter(){return(this.delInfo&(fb|fl))>0}get deletedAcross(){return(this.delInfo&fl)>0}}class vt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&vt.empty)return vt.empty}recover(e){let n=0,r=cp(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+KS(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,h=a+o+(f<0?0:u);if(r)return h;let p=e==(n<0?a:d)?null:US(l/3,e-a),m=e==a?fb:e==d?db:fl;return(n<0?e!=a:e!=d)&&(m|=hb),new ju(h,m,p)}o+=u-c}return r?e+o:new ju(e+o,0,null)}touches(e,n){let r=0,o=cp(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],l=s-(this.inverted?i:0),a=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new vt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?vt.empty:new vt(e<0?[0,-e,0]:[0,0,e])}}vt.empty=new vt([]);class To{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new To(this.maps,this.mirror,e,n)}copy(){return new To(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new To;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],l=s.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this.maps[a].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new ju(e,o,null)}}const Nc=Object.create(null);class ot{getMap(){return vt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Nc[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Nc)throw new RangeError("Duplicate use of step JSON ID "+e);return Nc[e]=n,n.prototype.jsonID=e,n}}class _e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new _e(e,null)}static fail(e){return new _e(null,e)}static fromReplace(e,n,r,o){try{return _e.ok(e.replace(n,r,o))}catch(i){if(i instanceof Ol)return _e.fail(i.message);throw i}}}function df(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(df(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return P.fromArray(r)}class rr extends ot{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new B(df(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,i)}invert(){return new tn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new rr(n.pos,r.pos,this.mark)}merge(e){return e instanceof rr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new rr(n.from,n.to,e.markFromJSON(n.mark))}}ot.jsonID("addMark",rr);class tn extends ot{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new B(df(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,r)}invert(){return new rr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new tn(n.from,n.to,e.markFromJSON(n.mark))}}ot.jsonID("removeMark",tn);class or extends ot{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new B(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new or(this.pos,n.marks[o]);return new or(this.pos,this.mark)}}return new Io(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new or(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new or(n.pos,e.markFromJSON(n.mark))}}ot.jsonID("addNodeMark",or);class Io extends ot{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new B(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new or(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Io(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Io(n.pos,e.markFromJSON(n.mark))}}ot.jsonID("removeNodeMark",Io);class ze extends ot{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Hu(e,this.from,this.to)?_e.fail("Structure replace would overwrite content"):_e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new vt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ze(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ze(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,B.fromJSON(e,n.slice),!!n.structure)}}ot.jsonID("replace",ze);class Ve extends ot{constructor(e,n,r,o,i,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Hu(e,this.from,this.gapFrom)||Hu(e,this.gapTo,this.to)))return _e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _e.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_e.fromReplace(e,this.from,this.to,r):_e.fail("Content does not fit in gap")}getMap(){return new vt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ve(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Ve(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ve(n.from,n.to,n.gapFrom,n.gapTo,B.fromJSON(e,n.slice),n.insert,!!n.structure)}}ot.jsonID("replaceAround",Ve);function Hu(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function GS(t,e,n,r){let o=[],i=[],s,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,n),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(s&&s.to==f&&s.mark.eq(d[m])?s.to=h:o.push(s=new tn(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new rr(f,h,r))}}),o.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function qS(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;i++;let a=null;if(r instanceof La){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<o.length;h++){let p=o[h];p.step==i-1&&d.eq(o[h].style)&&(f=p)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),o.forEach(s=>t.step(new tn(s.from,s.to,s.style)))}function pb(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new ze(l,u,B.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new tn(l,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new B(P.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new ze(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(P.empty,!0);t.replace(l,l,new B(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function JS(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!JS(o,i,s))break}return null}function YS(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=P.empty,d=0;for(let p=i,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=P.from(r.node(p).copy(u)),d++):a--;let f=P.empty,h=0;for(let p=i,m=!1;p>n;p--)m||o.after(p+1)<o.end(p)?(m=!0,f=P.from(o.node(p).copy(f)),h++):c++;t.step(new Ve(a,c,s,l,new B(u.append(f),d,h),u.size-d,!0))}function ff(t,e,n=null,r=t){let o=XS(t,e),i=o&&ZS(r,e);return i?o.map(up).concat({type:e,attrs:n}).concat(i.map(up)):null}function up(t){return{type:t,attrs:null}}function XS(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function ZS(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:s}function QS(t,e,n){let r=P.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=P.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new Ve(o,i,o,i,new B(r,0,0),n.length,!0))}function eC(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&rC(t.doc,t.mapping.slice(i).map(l),r)){let a=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!h?a=!1:!f&&h&&(a=!0)}a===!1&&nC(t,s,l,i),pb(t,t.mapping.slice(i).map(l,1),r,void 0,a===null);let c=t.mapping.slice(i),u=c.map(l,1),d=c.map(l+s.nodeSize,1);return t.step(new Ve(u,d,u+1,d-1,new B(P.from(r.create(o,null,s.marks)),0,0),1,!0)),a===!0&&tC(t,s,l,i),!1}})}function tC(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let a=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function nC(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
5
- `))}})}function rC(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function oC(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ve(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new B(P.from(s),0,0),1,!0))}function Oo(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function iC(t,e,n=1,r){let o=t.doc.resolve(e),i=P.empty,s=P.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=P.from(o.node(l).copy(i));let u=r&&r[c];s=P.from(u?u.type.create(u.attrs,s):o.node(l).copy(s))}t.step(new ze(e,e,new B(i.append(s),n,n),!0))}function xr(t,e){let n=t.resolve(e),r=n.index();return mb(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function mb(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function $a(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&mb(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function sC(t,e,n){let r=new ze(e-n,e+n,B.empty,!0);t.step(r)}function lC(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function gb(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(a,a,o);else{let d=c.contentMatchAt(a).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Ba(t,e,n=e,r=B.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return yb(o,i,r)?new ze(e,n,r):new aC(o,i,r).fit()}function yb(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class aC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=P.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=P.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new B(i,s,l);return e>-1?new Ve(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ze(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Dc(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(P.from(s),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Dc(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new B(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Dc(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new B(mi(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new B(mi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let m=0;m<o.childCount;m++)u.push(o.child(m));d=d.matchFragment(o)}let h=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let m=l.child(c),g=d.matchType(m.type);if(!g)break;c++,(c>1||a==0||m.content.size)&&(d=g,u.push(bb(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=gi(this.placed,n,P.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m<h;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?e==0?B.empty:new B(mi(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new B(mi(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!_c(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=_c(e,n,o,r,i);if(s){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=_c(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=gi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=gi(this.placed,this.depth,P.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(P.empty,!0);n.childCount&&(this.placed=gi(this.placed,this.frontier.length,n))}}function mi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(mi(t.firstChild.content,e-1,n)))}function gi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(gi(t.lastChild.content,e-1,n)))}function Dc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function bb(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,bb(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(P.empty,!0)))),t.copy(r)}function _c(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!cC(n,i.content,s)?l:null}function cC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function uC(t){return t.spec.defining||t.spec.definingForContent}function dC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(yb(o,i,r))return t.step(new ze(e,n,r));let s=wb(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let p=o.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(f)>-1?l=f:o.before(f)==h&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=uC(h.type);if(p&&!h.sameMarkup(o.node(Math.abs(l)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m<s.length;m++){let g=s[(m+a)%s.length],y=!0;g<0&&(y=!1,g=-g);let x=o.node(g-1),S=o.index(g-1);if(x.canReplaceWith(S,S,p.type,p.marks))return t.replace(o.before(g),y?i.after(g):n,new B(vb(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=s[f];h<0||(e=o.before(h),n=i.after(h))}}function vb(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(vb(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(P.empty,!0))}return t}function fC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=lC(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new B(P.from(r),0,0))}function hC(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=wb(r,o);for(let s=0;s<i.length;s++){let l=i[s],a=s==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function wb(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Ao extends ot{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return _e.fromReplace(e,this.pos,this.pos+1,new B(P.from(o),0,n.isLeaf?0:1))}getMap(){return vt.empty}invert(e){return new Ao(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ao(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ao(n.pos,n.attr,n.value)}}ot.jsonID("attr",Ao);class $i extends ot{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return _e.ok(r)}getMap(){return vt.empty}invert(e){return new $i(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $i(n.attr,n.value)}}ot.jsonID("docAttr",$i);let Po=class extends Error{};Po=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Po.prototype=Object.create(Error.prototype);Po.prototype.constructor=Po;Po.prototype.name="TransformError";class hf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new To}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Po(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=B.empty){let o=Ba(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new B(P.from(r),0,0))}delete(e,n){return this.replace(e,n,B.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return dC(this,e,n,r),this}replaceRangeWith(e,n,r){return fC(this,e,n,r),this}deleteRange(e,n){return hC(this,e,n),this}lift(e,n){return YS(this,e,n),this}join(e,n=1){return sC(this,e,n),this}wrap(e,n){return QS(this,e,n),this}setBlockType(e,n=e,r,o=null){return eC(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return oC(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Ao(e,n,r)),this}setDocAttribute(e,n){return this.step(new $i(e,n)),this}addNodeMark(e,n){return this.step(new or(e,n)),this}removeNodeMark(e,n){if(!(n instanceof pe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Io(e,n)),this}split(e,n=1,r){return iC(this,e,n,r),this}addMark(e,n,r){return GS(this,e,n,r),this}removeMark(e,n,r){return qS(this,e,n,r),this}clearIncompatible(e,n,r){return pb(this,e,n,r),this}}const Ic=Object.create(null);class Q{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new pf(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=B.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?B.empty:n),l==0&&hp(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:l}=o[i],a=e.mapping.slice(r),c=a.map(s.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),hp(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new X(e):wo(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?wo(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):wo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nt(e.node(0))}static atStart(e){return wo(e,e,0,0,1)||new Nt(e)}static atEnd(e){return wo(e,e,e.content.size,e.childCount,-1)||new Nt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ic[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ic)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ic[e]=n,n.prototype.jsonID=e,n}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}}Q.prototype.visible=!0;class pf{constructor(e,n){this.$from=e,this.$to=n}}let dp=!1;function fp(t){!dp&&!t.parent.inlineContent&&(dp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class X extends Q{constructor(e,n=e){fp(e),fp(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Q.near(r);let o=e.resolve(n.map(this.anchor));return new X(o.parent.inlineContent?o:r,r)}replace(e,n=B.empty){if(super.replace(e,n),n==B.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof X&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Fa(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Q.findFrom(n,r,!0)||Q.findFrom(n,-r,!0);if(i)n=i.$head;else return Q.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Q.findFrom(e,-r,!0)||Q.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new X(e,n)}}Q.jsonID("text",X);class Fa{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Fa(e.map(this.anchor),e.map(this.head))}resolve(e){return X.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends Q{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?Q.near(i):new J(i)}content(){return new B(P.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new mf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1;Q.jsonID("node",J);class mf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Fa(r,r):new mf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):Q.near(n)}}class Nt extends Q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=B.empty){if(n==B.empty){e.delete(0,e.doc.content.size);let r=Q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Nt(e)}map(e){return new Nt(e)}eq(e){return e instanceof Nt}getBookmark(){return pC}}Q.jsonID("all",Nt);const pC={map(){return this},resolve(t){return new Nt(t)}};function wo(t,e,n,r,o,i=!1){if(e.inlineContent)return X.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let l=e.child(s);if(l.isAtom){if(!i&&J.isSelectable(l))return J.create(t,n-(o<0?l.nodeSize:0))}else{let a=wo(t,l,n+o,o<0?l.childCount:0,o,i);if(a)return a}n+=l.nodeSize*o}return null}function hp(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof ze||o instanceof Ve))return;let i=t.mapping.maps[r],s;i.forEach((l,a,c,u)=>{s==null&&(s=u)}),t.setSelection(Q.near(t.doc.resolve(s),n))}const pp=1,Is=2,mp=4;let mC=class extends hf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|pp)&~Is,this.storedMarks=null,this}get selectionSet(){return(this.updated&pp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Is,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Is)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Is,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||pe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Q.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=mp,this}get scrolledIntoView(){return(this.updated&mp)>0}};function gp(t,e){return!e||!t?t:t.bind(e)}class yi{constructor(e,n,r){this.name=e,this.init=gp(n.init,r),this.apply=gp(n.apply,r)}}const gC=[new yi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new yi("selection",{init(t,e){return t.selection||Q.atStart(e.doc)},apply(t){return t.selection}}),new yi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new yi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Pc{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=gC.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new yi(r.key,r.spec.state,r))})}}class ko{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=o?o[s].n:0,c=o?o[s].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ko(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new mC(this)}static create(e){let n=new Pc(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ko(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Pc(this.schema,e.plugins),r=n.fields,o=new ko(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Pc(e.schema,e.plugins),i=new ko(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Fr.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Q.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[s.name]=c.fromJSON.call(a,e,n[l],i);return}}i[s.name]=s.init(e,i)}}),i}}function xb(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=xb(o,e,{})),n[r]=o}return n}class ke{constructor(e){this.spec=e,this.props={},e.props&&xb(e.props,this,this.props),this.key=e.key?e.key.key:Sb("plugin")}getState(e){return e[this.key]}}const Lc=Object.create(null);function Sb(t){return t in Lc?t+"$"+ ++Lc[t]:(Lc[t]=0,t+"$")}class we{constructor(e="key"){this.key=Sb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const qe=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Bi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let zu=null;const Cn=function(t,e,n){let r=zu||(zu=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},yC=function(){zu=null},Kr=function(t,e,n,r){return n&&(yp(t,e,n,r,-1)||yp(t,e,n,r,1))},bC=/^(img|br|input|textarea|hr)$/i;function yp(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Qt(t))){let i=t.parentNode;if(!i||i.nodeType!=1||gs(t)||bC.test(t.nodeName)||t.contentEditable=="false")return!1;e=qe(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Qt(t):0}else return!1}}function Qt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vC(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Qt(t)}else if(t.parentNode&&!gs(t))e=qe(t),t=t.parentNode;else return null}}function wC(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!gs(t))e=qe(t)+1,t=t.parentNode;else return null}}function xC(t,e,n){for(let r=e==0,o=e==Qt(t);r||o;){if(t==n)return!0;let i=qe(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==Qt(t)}}function gs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ja=function(t){return t.focusNode&&Kr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Nr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function SC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function CC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const ln=typeof navigator<"u"?navigator:null,bp=typeof document<"u"?document:null,Sr=ln&&ln.userAgent||"",Vu=/Edge\/(\d+)/.exec(Sr),Cb=/MSIE \d/.exec(Sr),Wu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Sr),ft=!!(Cb||Wu||Vu),ar=Cb?document.documentMode:Wu?+Wu[1]:Vu?+Vu[1]:0,zt=!ft&&/gecko\/(\d+)/i.test(Sr);zt&&+(/Firefox\/(\d+)/.exec(Sr)||[0,0])[1];const Uu=!ft&&/Chrome\/(\d+)/.exec(Sr),et=!!Uu,Eb=Uu?+Uu[1]:0,lt=!ft&&!!ln&&/Apple Computer/.test(ln.vendor),Lo=lt&&(/Mobile\/\w+/.test(Sr)||!!ln&&ln.maxTouchPoints>2),At=Lo||(ln?/Mac/.test(ln.platform):!1),EC=ln?/Win/.test(ln.platform):!1,jt=/Android \d/.test(Sr),ys=!!bp&&"webkitFontSmoothing"in bp.documentElement.style,kC=ys?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function MC(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function bn(t,e){return typeof t=="number"?t:t[e]}function TC(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function vp(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Bi(s)){if(s.nodeType!=1)continue;let l=s,a=l==i.body,c=a?MC(i):TC(l),u=0,d=0;if(e.top<c.top+bn(r,"top")?d=-(c.top-e.top+bn(o,"top")):e.bottom>c.bottom-bn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+bn(o,"top")-c.top:e.bottom-c.bottom+bn(o,"bottom")),e.left<c.left+bn(r,"left")?u=-(c.left-e.left+bn(o,"left")):e.right>c.right-bn(r,"right")&&(u=e.right-c.right+bn(o,"right")),u||d)if(a)i.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,h=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let p=l.scrollLeft-f,m=l.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function OC(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(i,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:kb(t.dom)}}function kb(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Bi(r));return e}function AC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Mb(n,r==0?0:r-e)}function Mb(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let fo=null;function RC(t){if(t.setActive)return t.setActive();if(fo)return t.focus(fo);let e=kb(t);t.focus(fo==null?{get preventScroll(){return fo={preventScroll:!0},!0}}:void 0),fo||(fo=!1,Mb(e,0))}function Tb(t,e){let n,r=2e8,o,i=0,s=e.top,l=e.top,a,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Cn(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=s&&p.bottom>=l){s=Math.max(p.bottom,s),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(m<r){n=u,r=m,o=m&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&m&&(i=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!n&&a&&(n=a,o=c,r=0),n&&n.nodeType==3?NC(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Tb(n,o)}function NC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=Kn(r,1);if(i.top!=i.bottom&&gf(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function gf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function DC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function _C(t,e,n){let{node:r,offset:o}=Tb(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function IC(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?o=l.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(o=l.posAfter),s=!0),!l.contentDOM&&o<0&&!l.node.isText)return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter}i=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Ob(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(gf(e,c))return Ob(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function PC(t,e){let n=t.dom.ownerDocument,r,o=0,i=CC(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!gf(e,c)||(s=Ob(t.dom,e,c),!s))return null}if(lt)for(let c=s;r&&c;c=Bi(c))c.draggable&&(r=void 0);if(s=DC(s,e),r){if(zt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;ys&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=IC(t,r,o,e))}l==null&&(l=_C(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function wp(t){return t.top<t.bottom||t.left<t.right}function Kn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(wp(r))return r}return Array.prototype.find.call(n,wp)||t.getBoundingClientRect()}const LC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ab(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=ys||zt;if(r.nodeType==3)if(s&&(LC.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=Kn(Cn(r,o,o),n);if(zt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Kn(Cn(r,o-1,o-1),-1);if(c.top==a.top){let u=Kn(Cn(r,o,o+1),-1);if(u.top!=a.top)return ci(u,u.left<c.left)}}return a}else{let a=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(a--,u=1):n<0?a--:c++,ci(Kn(Cn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Qt(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return $c(a.getBoundingClientRect(),!1)}if(i==null&&o<Qt(r)){let a=r.childNodes[o];if(a.nodeType==1)return $c(a.getBoundingClientRect(),!0)}return $c(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Qt(r))){let a=r.childNodes[o-1],c=a.nodeType==3?Cn(a,Qt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return ci(Kn(c,1),!1)}if(i==null&&o<Qt(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?Cn(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return ci(Kn(c,-1),!0)}return ci(Kn(r.nodeType==3?Cn(r):r,-n),n>=0)}function ci(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function $c(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Rb(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function $C(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Rb(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let s=Ab(t,o.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Cn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const BC=/[\u0590-\u08ac]/;function FC(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=t.domSelection();return!BC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:s:Rb(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let xp=null,Sp=null,Cp=!1;function jC(t,e,n){return xp==e&&Sp==n?Cp:(xp=e,Sp=n,Cp=n=="up"||n=="down"?$C(t,e,n):FC(t,e,n))}const Dt=0,Ep=1,_r=2,an=3;class bs{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Dt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>qe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(l>e||s instanceof Db){o=e-i;break}i=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Nb&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?qe(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?qe(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,l=0;;l++){let a=this.children[l],c=s+a.size;if(o==-1&&e<=c){let u=s+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=qe(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=qe(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,h=0;f<this.children.length;f++){let p=this.children[f],m=h+p.size;if(i>h&&s<m)return p.setSelection(e-h-p.border,n-h-p.border,r,o);h=m}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((zt||lt)&&e==n){let{node:f,offset:h}=l;if(f.nodeType==3){if(u=!!(h&&f.nodeValue[h-1]==`
6
- `),u&&h==f.nodeValue.length)for(let p=f,m;p;p=p.parentNode){if(m=p.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:qe(m)+1});break}let g=p.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let p=f.childNodes[h-1];u=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(zt&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&lt)&&Kr(l.node,l.offset,c.anchorNode,c.anchorOffset)&&Kr(a.node,a.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||e==n)&&!u){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),d=!0}catch{}}if(!d){if(e>n){let h=l;l=a,a=h}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?_r:Ep,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=an:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?_r:an}r=s}this.dirty=_r}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?_r:Ep;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Nb extends bs{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Dt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class HC extends bs{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Gr extends bs{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=no.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Gr(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&an||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=an&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Dt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Dt}}slice(e,n,r){let o=Gr.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=qu(i,n,s,r)),e>0&&(i=qu(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}}class cr extends bs{constructor(e,n,r,o,i,s,l,a,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=no.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Pb(u,r,n),c?a=new zC(e,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Ha(e,n,r,o,u,f,i):new cr(e,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>P.empty)}return e}matchesNode(e,n,r){return this.dirty==Dt&&e.eq(this.node)&&Gu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new WC(this,s&&s.node,e);GC(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?pe.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,o)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let h;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(h=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,d,h,e)||a.updateNextNode(c,u,d,e,f,o)||a.addNode(c,u,d,e,o),o+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==_r)&&(s&&this.protectLocalComposition(e,s),_b(this.contentDOM,this.children,e),Lo&&qC(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof X)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,l=JC(this.node.content,s,r-n,o-n);return l<0?null:{node:i,pos:l,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new HC(this,i,n,o);e.input.compositionNodes.push(s),this.children=qu(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==an||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Dt}updateOuterDeco(e){if(Gu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Ib(this.dom,this.nodeDOM,Ku(this.outerDeco,this.node,n),Ku(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function kp(t,e,n,r,o){Pb(r,e,t);let i=new cr(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ha extends cr{constructor(e,n,r,o,i,s,l){super(e,n,r,o,i,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==an||this.dirty!=Dt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Dt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Dt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Ha(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=an)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Db extends bs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Dt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zC extends cr{constructor(e,n,r,o,i,s,l,a,c,u){super(e,n,r,o,i,s,l,c,u),this.spec=a}update(e,n,r,o){if(this.dirty==an)return!1;if(this.spec.update){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function _b(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=Mp(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(s instanceof Gr){let a=r?r.previousSibling:t.lastChild;_b(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=Mp(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Si=function(t){t&&(this.nodeName=t)};Si.prototype=Object.create(null);const Ir=[new Si];function Ku(t,e,n){if(t.length==0)return Ir;let r=n?Ir[0]:new Si,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Si(s.nodeName));for(let l in s){let a=s[l];a!=null&&(n&&o.length==1&&o.push(r=new Si(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return o}function Ib(t,e,n,r){if(n==Ir&&r==Ir)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],l=n[i];if(i){let a;l&&l.nodeName==s.nodeName&&o!=t&&(a=o.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(o),l=Ir[0]),o=a}VC(o,l||Ir[0],s)}return o}function VC(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Pb(t,e,n){return Ib(t,t,Ir,Ku(e,n,t.nodeType!=1))}function Gu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Mp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class WC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=UC(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Dt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Gr.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==an&&s.dom==s.contentDOM&&(s.dirty=_r),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof cr){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,d,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=an&&Gu(n,a.outerDeco));if(!f&&a.update(e,n,r,o))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=_r,d.updateChildren(o,s+1),d.dirty=Dt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let l=cr.create(this.top,n,r,o,i,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,o,i){let s=cr.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Nb(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Gr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ha)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((lt||et)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Db(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function UC(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Gr)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}function KC(t,e){return t.type.side-e.type.side}function GC(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let g=o[s++];g.widget&&(u?(d||(d=[u])).push(g):u=g)}if(u)if(d){d.sort(KC);for(let g=0;g<d.length;g++)n(d[g],c,!!a)}else n(u,c,!!a);let f,h;if(a)h=-1,f=a,a=null;else if(c<t.childCount)h=c,f=t.child(c++);else break;for(let g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let p=i+f.nodeSize;if(f.isText){let g=p;s<o.length&&o[s].from<g&&(g=o[s].from);for(let y=0;y<l.length;y++)l[y].to<g&&(g=l[y].to);g<p&&(a=f.cut(g-i),f=f.cut(0,g-i),p=g,h=-1)}else for(;s<o.length&&o[s].to<p;)s++;let m=f.isInline&&!f.isLeaf?l.filter(g=>!g.inline):l.slice();r(f,m,e.forChild(i,f),h),i=p}}function qC(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function JC(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function qu(t,e,n,r,o){let i=[];for(let s=0,l=0;s<t.length;s++){let a=t[s],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function yf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(ja(n)){for(a=l;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&J.isSelectable(u)&&o.parent&&!(u.isInline&&xC(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new J(s==d?l:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=bf(t,a,l,u)}return c}function Lb(t){return t.editable?t.hasFocus():Bb(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Tn(t,e=!1){let n=t.state.selection;if($b(t,n),!!Lb(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&et){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Kr(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)XC(t);else{let{anchor:r,head:o}=n,i,s;Tp&&!(n instanceof X)&&(n.$from.parent.inlineContent||(i=Op(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Op(t,n.to))),t.docView.setSelection(r,o,t.root,e),Tp&&(i&&Ap(i),s&&Ap(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&YC(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tp=lt||et&&Eb<63;function Op(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(lt&&o&&o.contentEditable=="false")return Bc(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Bc(o);if(i)return Bc(i)}}function Bc(t){return t.contentEditable="true",lt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ap(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function YC(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Lb(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function XC(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,qe(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&ft&&ar<=11&&(r.disabled=!0,r.disabled=!1)}function $b(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Rp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Rp(t)}function Rp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function bf(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||X.between(e,n,r)}function Np(t){return t.editable&&!t.hasFocus()?!1:Bb(t)}function Bb(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ZC(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Kr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ju(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Q.findFrom(i,e)}function qn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Dp(t,e,n){let r=t.state.selection;if(r instanceof X)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return qn(t,new X(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Ju(t.state,e);return o&&o instanceof J?qn(t,o):!1}else if(!(At&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let l=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?J.isSelectable(i)?qn(t,new J(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):ys?qn(t,new X(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return qn(t,new X(e>0?r.$to:r.$from));{let o=Ju(t.state,e);return o?qn(t,o):!1}}}function _l(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ci(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ho(t,e){return e<0?QC(t):eE(t)}function QC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(zt&&n.nodeType==1&&r<_l(n)&&Ci(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Ci(l,-1))o=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Fb(n))break;{let l=n.previousSibling;for(;l&&Ci(l,-1);)o=n.parentNode,i=qe(l),l=l.previousSibling;if(l)n=l,r=_l(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Yu(t,n,r):o&&Yu(t,o,i)}function eE(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=_l(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Ci(l,1))i=n,s=++r;else break}else{if(Fb(n))break;{let l=n.nextSibling;for(;l&&Ci(l,1);)i=l.parentNode,s=qe(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=_l(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&Yu(t,i,s)}function Fb(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function tE(t,e){for(;t&&e==t.childNodes.length&&!gs(t);)e=qe(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function nE(t,e){for(;t&&!e&&!gs(t);)e=qe(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Yu(t,e,n){if(e.nodeType!=3){let i,s;(s=tE(e,n))?(e=s,n=0):(i=nE(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(ja(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Tn(t)},50)}function _p(t,e){let n=t.state.doc.resolve(e);if(!(et||EC)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Ip(t,e,n){let r=t.state.selection;if(r instanceof X&&!r.empty||n.indexOf("s")>-1||At&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ju(t.state,e);if(s&&s instanceof J)return qn(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,l=r instanceof Nt?Q.near(s,e):Q.findFrom(s,e);return l?qn(t,l):!1}return!1}function Pp(t,e){if(!(t.state.selection instanceof X))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function Lp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function rE(t){if(!lt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Lp(t,r,"true"),setTimeout(()=>Lp(t,r,"false"),20)}return!1}function oE(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function iE(t,e){let n=e.keyCode,r=oE(e);if(n==8||At&&n==72&&r=="c")return Pp(t,-1)||ho(t,-1);if(n==46&&!e.shiftKey||At&&n==68&&r=="c")return Pp(t,1)||ho(t,1);if(n==13||n==27)return!0;if(n==37||At&&n==66&&r=="c"){let o=n==37?_p(t,t.state.selection.from)=="ltr"?-1:1:-1;return Dp(t,o,r)||ho(t,o)}else if(n==39||At&&n==70&&r=="c"){let o=n==39?_p(t,t.state.selection.from)=="ltr"?1:-1:1;return Dp(t,o,r)||ho(t,o)}else{if(n==38||At&&n==80&&r=="c")return Ip(t,-1,r)||ho(t,-1);if(n==40||At&&n==78&&r=="c")return rE(t)||Ip(t,1,r)||ho(t,1);if(r==(At?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function jb(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||no.fromSchema(t.state.schema),l=Kb(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Ub[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
4
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=pe.none,r=pe.none;if(e.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=e.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{a.clearMark(c)&&(r=c.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)l=a;else break}}return[n,r]}addElementByRule(e,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(e):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a)}o&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=op(e,o,i.options);i.options&xi&&i.content.length==0&&(s|=xi),this.nodes.push(new _s(e,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=zS(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function FS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ab.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function jS(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function sp(t){let e={};for(let n in t)e[n]=t[n];return e}function HS(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function zS(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class to{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Rc(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let l=0,a=0;for(;l<i.length&&a<s.marks.length;){let c=s.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)o=i.pop()[1];for(;a<s.marks.length;){let c=s.marks[a++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ul(Rc(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ul(Rc(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return ul(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new to(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=lp(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return lp(e.marks)}}function lp(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Rc(t){return t.document||window.document}const ap=new WeakMap;function VS(t){let e=ap.get(t);return e===void 0&&ap.set(t,e=WS(t)),e}function WS(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function ul(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=VS(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let l,a=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=ul(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const cb=65535,ub=Math.pow(2,16);function US(t,e){return t+e*ub}function cp(t){return t&cb}function KS(t){return(t-(t&cb))/ub}const db=1,fb=2,dl=4,hb=8;class Hu{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&hb)>0}get deletedBefore(){return(this.delInfo&(db|dl))>0}get deletedAfter(){return(this.delInfo&(fb|dl))>0}get deletedAcross(){return(this.delInfo&dl)>0}}class vt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&vt.empty)return vt.empty}recover(e){let n=0,r=cp(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+KS(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,h=a+o+(f<0?0:u);if(r)return h;let p=e==(n<0?a:d)?null:US(l/3,e-a),m=e==a?fb:e==d?db:dl;return(n<0?e!=a:e!=d)&&(m|=hb),new Hu(h,m,p)}o+=u-c}return r?e+o:new Hu(e+o,0,null)}touches(e,n){let r=0,o=cp(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],l=s-(this.inverted?i:0),a=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new vt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?vt.empty:new vt(e<0?[0,-e,0]:[0,0,e])}}vt.empty=new vt([]);class Mo{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new Mo(this.maps,this.mirror,e,n)}copy(){return new Mo(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Mo;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],l=s.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this.maps[a].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new Hu(e,o,null)}}const Nc=Object.create(null);class ot{getMap(){return vt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Nc[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Nc)throw new RangeError("Duplicate use of step JSON ID "+e);return Nc[e]=n,n.prototype.jsonID=e,n}}class _e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new _e(e,null)}static fail(e){return new _e(null,e)}static fromReplace(e,n,r,o){try{return _e.ok(e.replace(n,r,o))}catch(i){if(i instanceof Tl)return _e.fail(i.message);throw i}}}function ff(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(ff(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return I.fromArray(r)}class rr extends ot{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new B(ff(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,i)}invert(){return new tn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new rr(n.pos,r.pos,this.mark)}merge(e){return e instanceof rr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new rr(n.from,n.to,e.markFromJSON(n.mark))}}ot.jsonID("addMark",rr);class tn extends ot{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new B(ff(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,r)}invert(){return new rr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new tn(n.from,n.to,e.markFromJSON(n.mark))}}ot.jsonID("removeMark",tn);class or extends ot{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new B(I.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new or(this.pos,n.marks[o]);return new or(this.pos,this.mark)}}return new Io(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new or(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new or(n.pos,e.markFromJSON(n.mark))}}ot.jsonID("addNodeMark",or);class Io extends ot{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new B(I.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new or(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Io(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Io(n.pos,e.markFromJSON(n.mark))}}ot.jsonID("removeNodeMark",Io);class ze extends ot{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&zu(e,this.from,this.to)?_e.fail("Structure replace would overwrite content"):_e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new vt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ze(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ze(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,B.fromJSON(e,n.slice),!!n.structure)}}ot.jsonID("replace",ze);class Ve extends ot{constructor(e,n,r,o,i,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=l}apply(e){if(this.structure&&(zu(e,this.from,this.gapFrom)||zu(e,this.gapTo,this.to)))return _e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _e.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_e.fromReplace(e,this.from,this.to,r):_e.fail("Content does not fit in gap")}getMap(){return new vt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ve(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Ve(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ve(n.from,n.to,n.gapFrom,n.gapTo,B.fromJSON(e,n.slice),n.insert,!!n.structure)}}ot.jsonID("replaceAround",Ve);function zu(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function GS(t,e,n,r){let o=[],i=[],s,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,n),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(s&&s.to==f&&s.mark.eq(d[m])?s.to=h:o.push(s=new tn(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new rr(f,h,r))}}),o.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function qS(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;i++;let a=null;if(r instanceof Pa){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<o.length;h++){let p=o[h];p.step==i-1&&d.eq(o[h].style)&&(f=p)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),o.forEach(s=>t.step(new tn(s.from,s.to,s.style)))}function pb(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new ze(l,u,B.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new tn(l,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new B(I.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new ze(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(I.empty,!0);t.replace(l,l,new B(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function JS(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!JS(o,i,s))break}return null}function YS(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=I.empty,d=0;for(let p=i,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=I.from(r.node(p).copy(u)),d++):a--;let f=I.empty,h=0;for(let p=i,m=!1;p>n;p--)m||o.after(p+1)<o.end(p)?(m=!0,f=I.from(o.node(p).copy(f)),h++):c++;t.step(new Ve(a,c,s,l,new B(u.append(f),d,h),u.size-d,!0))}function hf(t,e,n=null,r=t){let o=XS(t,e),i=o&&ZS(r,e);return i?o.map(up).concat({type:e,attrs:n}).concat(i.map(up)):null}function up(t){return{type:t,attrs:null}}function XS(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function ZS(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:s}function QS(t,e,n){let r=I.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=I.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new Ve(o,i,o,i,new B(r,0,0),n.length,!0))}function eC(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&rC(t.doc,t.mapping.slice(i).map(l),r)){let a=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!h?a=!1:!f&&h&&(a=!0)}a===!1&&nC(t,s,l,i),pb(t,t.mapping.slice(i).map(l,1),r,void 0,a===null);let c=t.mapping.slice(i),u=c.map(l,1),d=c.map(l+s.nodeSize,1);return t.step(new Ve(u,d,u+1,d-1,new B(I.from(r.create(o,null,s.marks)),0,0),1,!0)),a===!0&&tC(t,s,l,i),!1}})}function tC(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let a=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function nC(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
5
+ `))}})}function rC(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function oC(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ve(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new B(I.from(s),0,0),1,!0))}function To(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function iC(t,e,n=1,r){let o=t.doc.resolve(e),i=I.empty,s=I.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=I.from(o.node(l).copy(i));let u=r&&r[c];s=I.from(u?u.type.create(u.attrs,s):o.node(l).copy(s))}t.step(new ze(e,e,new B(i.append(s),n,n),!0))}function xr(t,e){let n=t.resolve(e),r=n.index();return mb(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function mb(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function La(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&mb(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function sC(t,e,n){let r=new ze(e-n,e+n,B.empty,!0);t.step(r)}function lC(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function gb(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(a,a,o);else{let d=c.contentMatchAt(a).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function $a(t,e,n=e,r=B.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return yb(o,i,r)?new ze(e,n,r):new aC(o,i,r).fit()}function yb(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class aC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=I.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=I.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new B(i,s,l);return e>-1?new Ve(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ze(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Dc(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(I.from(s),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Dc(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new B(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Dc(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new B(mi(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new B(mi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let m=0;m<o.childCount;m++)u.push(o.child(m));d=d.matchFragment(o)}let h=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let m=l.child(c),g=d.matchType(m.type);if(!g)break;c++,(c>1||a==0||m.content.size)&&(d=g,u.push(bb(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=gi(this.placed,n,I.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m<h;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?e==0?B.empty:new B(mi(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new B(mi(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!_c(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=_c(e,n,o,r,i);if(s){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=_c(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=gi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=gi(this.placed,this.depth,I.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(I.empty,!0);n.childCount&&(this.placed=gi(this.placed,this.frontier.length,n))}}function mi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(mi(t.firstChild.content,e-1,n)))}function gi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(gi(t.lastChild.content,e-1,n)))}function Dc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function bb(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,bb(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(I.empty,!0)))),t.copy(r)}function _c(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!cC(n,i.content,s)?l:null}function cC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function uC(t){return t.spec.defining||t.spec.definingForContent}function dC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(yb(o,i,r))return t.step(new ze(e,n,r));let s=wb(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let p=o.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(f)>-1?l=f:o.before(f)==h&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=uC(h.type);if(p&&!h.sameMarkup(o.node(Math.abs(l)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m<s.length;m++){let g=s[(m+a)%s.length],y=!0;g<0&&(y=!1,g=-g);let w=o.node(g-1),S=o.index(g-1);if(w.canReplaceWith(S,S,p.type,p.marks))return t.replace(o.before(g),y?i.after(g):n,new B(vb(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=s[f];h<0||(e=o.before(h),n=i.after(h))}}function vb(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(vb(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(I.empty,!0))}return t}function fC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=lC(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new B(I.from(r),0,0))}function hC(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=wb(r,o);for(let s=0;s<i.length;s++){let l=i[s],a=s==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function wb(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Oo extends ot{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return _e.fromReplace(e,this.pos,this.pos+1,new B(I.from(o),0,n.isLeaf?0:1))}getMap(){return vt.empty}invert(e){return new Oo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Oo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Oo(n.pos,n.attr,n.value)}}ot.jsonID("attr",Oo);class $i extends ot{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return _e.ok(r)}getMap(){return vt.empty}invert(e){return new $i(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $i(n.attr,n.value)}}ot.jsonID("docAttr",$i);let Po=class extends Error{};Po=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Po.prototype=Object.create(Error.prototype);Po.prototype.constructor=Po;Po.prototype.name="TransformError";class pf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Mo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Po(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=B.empty){let o=$a(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new B(I.from(r),0,0))}delete(e,n){return this.replace(e,n,B.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return dC(this,e,n,r),this}replaceRangeWith(e,n,r){return fC(this,e,n,r),this}deleteRange(e,n){return hC(this,e,n),this}lift(e,n){return YS(this,e,n),this}join(e,n=1){return sC(this,e,n),this}wrap(e,n){return QS(this,e,n),this}setBlockType(e,n=e,r,o=null){return eC(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return oC(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Oo(e,n,r)),this}setDocAttribute(e,n){return this.step(new $i(e,n)),this}addNodeMark(e,n){return this.step(new or(e,n)),this}removeNodeMark(e,n){if(!(n instanceof pe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Io(e,n)),this}split(e,n=1,r){return iC(this,e,n,r),this}addMark(e,n,r){return GS(this,e,n,r),this}removeMark(e,n,r){return qS(this,e,n,r),this}clearIncompatible(e,n,r){return pb(this,e,n,r),this}}const Ic=Object.create(null);class Q{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new mf(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=B.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?B.empty:n),l==0&&hp(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:l}=o[i],a=e.mapping.slice(r),c=a.map(s.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),hp(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Z(e):vo(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?vo(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):vo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nt(e.node(0))}static atStart(e){return vo(e,e,0,0,1)||new Nt(e)}static atEnd(e){return vo(e,e,e.content.size,e.childCount,-1)||new Nt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ic[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ic)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ic[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Z.between(this.$anchor,this.$head).getBookmark()}}Q.prototype.visible=!0;class mf{constructor(e,n){this.$from=e,this.$to=n}}let dp=!1;function fp(t){!dp&&!t.parent.inlineContent&&(dp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Z extends Q{constructor(e,n=e){fp(e),fp(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Q.near(r);let o=e.resolve(n.map(this.anchor));return new Z(o.parent.inlineContent?o:r,r)}replace(e,n=B.empty){if(super.replace(e,n),n==B.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Z&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ba(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Z(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Q.findFrom(n,r,!0)||Q.findFrom(n,-r,!0);if(i)n=i.$head;else return Q.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Q.findFrom(e,-r,!0)||Q.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Z(e,n)}}Q.jsonID("text",Z);class Ba{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ba(e.map(this.anchor),e.map(this.head))}resolve(e){return Z.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends Q{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?Q.near(i):new Y(i)}content(){return new B(I.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new gf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(n.anchor))}static create(e,n){return new Y(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1;Q.jsonID("node",Y);class gf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ba(r,r):new gf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Y.isSelectable(r)?new Y(n):Q.near(n)}}class Nt extends Q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=B.empty){if(n==B.empty){e.delete(0,e.doc.content.size);let r=Q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Nt(e)}map(e){return new Nt(e)}eq(e){return e instanceof Nt}getBookmark(){return pC}}Q.jsonID("all",Nt);const pC={map(){return this},resolve(t){return new Nt(t)}};function vo(t,e,n,r,o,i=!1){if(e.inlineContent)return Z.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let l=e.child(s);if(l.isAtom){if(!i&&Y.isSelectable(l))return Y.create(t,n-(o<0?l.nodeSize:0))}else{let a=vo(t,l,n+o,o<0?l.childCount:0,o,i);if(a)return a}n+=l.nodeSize*o}return null}function hp(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof ze||o instanceof Ve))return;let i=t.mapping.maps[r],s;i.forEach((l,a,c,u)=>{s==null&&(s=u)}),t.setSelection(Q.near(t.doc.resolve(s),n))}const pp=1,Is=2,mp=4;let mC=class extends pf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|pp)&~Is,this.storedMarks=null,this}get selectionSet(){return(this.updated&pp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Is,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Is)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Is,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||pe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Q.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=mp,this}get scrolledIntoView(){return(this.updated&mp)>0}};function gp(t,e){return!e||!t?t:t.bind(e)}class yi{constructor(e,n,r){this.name=e,this.init=gp(n.init,r),this.apply=gp(n.apply,r)}}const gC=[new yi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new yi("selection",{init(t,e){return t.selection||Q.atStart(e.doc)},apply(t){return t.selection}}),new yi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new yi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Pc{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=gC.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new yi(r.key,r.spec.state,r))})}}class Eo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=o?o[s].n:0,c=o?o[s].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Eo(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new mC(this)}static create(e){let n=new Pc(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Eo(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Pc(this.schema,e.plugins),r=n.fields,o=new Eo(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Pc(e.schema,e.plugins),i=new Eo(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Br.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Q.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[s.name]=c.fromJSON.call(a,e,n[l],i);return}}i[s.name]=s.init(e,i)}}),i}}function xb(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=xb(o,e,{})),n[r]=o}return n}class ke{constructor(e){this.spec=e,this.props={},e.props&&xb(e.props,this,this.props),this.key=e.key?e.key.key:Sb("plugin")}getState(e){return e[this.key]}}const Lc=Object.create(null);function Sb(t){return t in Lc?t+"$"+ ++Lc[t]:(Lc[t]=0,t+"$")}class we{constructor(e="key"){this.key=Sb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const qe=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Bi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Vu=null;const Cn=function(t,e,n){let r=Vu||(Vu=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},yC=function(){Vu=null},Ur=function(t,e,n,r){return n&&(yp(t,e,n,r,-1)||yp(t,e,n,r,1))},bC=/^(img|br|input|textarea|hr)$/i;function yp(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Qt(t))){let i=t.parentNode;if(!i||i.nodeType!=1||gs(t)||bC.test(t.nodeName)||t.contentEditable=="false")return!1;e=qe(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Qt(t):0}else return!1}}function Qt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vC(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Qt(t)}else if(t.parentNode&&!gs(t))e=qe(t),t=t.parentNode;else return null}}function wC(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!gs(t))e=qe(t)+1,t=t.parentNode;else return null}}function xC(t,e,n){for(let r=e==0,o=e==Qt(t);r||o;){if(t==n)return!0;let i=qe(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==Qt(t)}}function gs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Fa=function(t){return t.focusNode&&Ur(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Nr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function SC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function CC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const ln=typeof navigator<"u"?navigator:null,bp=typeof document<"u"?document:null,Sr=ln&&ln.userAgent||"",Wu=/Edge\/(\d+)/.exec(Sr),Cb=/MSIE \d/.exec(Sr),Uu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Sr),ft=!!(Cb||Uu||Wu),ar=Cb?document.documentMode:Uu?+Uu[1]:Wu?+Wu[1]:0,zt=!ft&&/gecko\/(\d+)/i.test(Sr);zt&&+(/Firefox\/(\d+)/.exec(Sr)||[0,0])[1];const Ku=!ft&&/Chrome\/(\d+)/.exec(Sr),et=!!Ku,Eb=Ku?+Ku[1]:0,lt=!ft&&!!ln&&/Apple Computer/.test(ln.vendor),Lo=lt&&(/Mobile\/\w+/.test(Sr)||!!ln&&ln.maxTouchPoints>2),At=Lo||(ln?/Mac/.test(ln.platform):!1),EC=ln?/Win/.test(ln.platform):!1,jt=/Android \d/.test(Sr),ys=!!bp&&"webkitFontSmoothing"in bp.documentElement.style,kC=ys?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function MC(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function bn(t,e){return typeof t=="number"?t:t[e]}function TC(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function vp(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Bi(s)){if(s.nodeType!=1)continue;let l=s,a=l==i.body,c=a?MC(i):TC(l),u=0,d=0;if(e.top<c.top+bn(r,"top")?d=-(c.top-e.top+bn(o,"top")):e.bottom>c.bottom-bn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+bn(o,"top")-c.top:e.bottom-c.bottom+bn(o,"bottom")),e.left<c.left+bn(r,"left")?u=-(c.left-e.left+bn(o,"left")):e.right>c.right-bn(r,"right")&&(u=e.right-c.right+bn(o,"right")),u||d)if(a)i.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,h=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let p=l.scrollLeft-f,m=l.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function OC(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(i,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:kb(t.dom)}}function kb(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Bi(r));return e}function AC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Mb(n,r==0?0:r-e)}function Mb(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let uo=null;function RC(t){if(t.setActive)return t.setActive();if(uo)return t.focus(uo);let e=kb(t);t.focus(uo==null?{get preventScroll(){return uo={preventScroll:!0},!0}}:void 0),uo||(uo=!1,Mb(e,0))}function Tb(t,e){let n,r=2e8,o,i=0,s=e.top,l=e.top,a,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Cn(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=s&&p.bottom>=l){s=Math.max(p.bottom,s),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(m<r){n=u,r=m,o=m&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&m&&(i=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!n&&a&&(n=a,o=c,r=0),n&&n.nodeType==3?NC(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Tb(n,o)}function NC(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=Kn(r,1);if(i.top!=i.bottom&&yf(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function yf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function DC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function _C(t,e,n){let{node:r,offset:o}=Tb(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function IC(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?o=l.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(o=l.posAfter),s=!0),!l.contentDOM&&o<0&&!l.node.isText)return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter}i=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Ob(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(yf(e,c))return Ob(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function PC(t,e){let n=t.dom.ownerDocument,r,o=0,i=CC(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!yf(e,c)||(s=Ob(t.dom,e,c),!s))return null}if(lt)for(let c=s;r&&c;c=Bi(c))c.draggable&&(r=void 0);if(s=DC(s,e),r){if(zt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;ys&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=IC(t,r,o,e))}l==null&&(l=_C(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function wp(t){return t.top<t.bottom||t.left<t.right}function Kn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(wp(r))return r}return Array.prototype.find.call(n,wp)||t.getBoundingClientRect()}const LC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ab(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=ys||zt;if(r.nodeType==3)if(s&&(LC.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=Kn(Cn(r,o,o),n);if(zt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Kn(Cn(r,o-1,o-1),-1);if(c.top==a.top){let u=Kn(Cn(r,o,o+1),-1);if(u.top!=a.top)return ci(u,u.left<c.left)}}return a}else{let a=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(a--,u=1):n<0?a--:c++,ci(Kn(Cn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Qt(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return $c(a.getBoundingClientRect(),!1)}if(i==null&&o<Qt(r)){let a=r.childNodes[o];if(a.nodeType==1)return $c(a.getBoundingClientRect(),!0)}return $c(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Qt(r))){let a=r.childNodes[o-1],c=a.nodeType==3?Cn(a,Qt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return ci(Kn(c,1),!1)}if(i==null&&o<Qt(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?Cn(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return ci(Kn(c,-1),!0)}return ci(Kn(r.nodeType==3?Cn(r):r,-n),n>=0)}function ci(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function $c(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Rb(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function $C(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Rb(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let s=Ab(t,o.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Cn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const BC=/[\u0590-\u08ac]/;function FC(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=t.domSelection();return!BC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:s:Rb(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let xp=null,Sp=null,Cp=!1;function jC(t,e,n){return xp==e&&Sp==n?Cp:(xp=e,Sp=n,Cp=n=="up"||n=="down"?$C(t,e,n):FC(t,e,n))}const Dt=0,Ep=1,_r=2,an=3;class bs{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Dt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>qe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(l>e||s instanceof Db){o=e-i;break}i=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Nb&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?qe(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?qe(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,l=0;;l++){let a=this.children[l],c=s+a.size;if(o==-1&&e<=c){let u=s+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=qe(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=qe(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,h=0;f<this.children.length;f++){let p=this.children[f],m=h+p.size;if(i>h&&s<m)return p.setSelection(e-h-p.border,n-h-p.border,r,o);h=m}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((zt||lt)&&e==n){let{node:f,offset:h}=l;if(f.nodeType==3){if(u=!!(h&&f.nodeValue[h-1]==`
6
+ `),u&&h==f.nodeValue.length)for(let p=f,m;p;p=p.parentNode){if(m=p.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:qe(m)+1});break}let g=p.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let p=f.childNodes[h-1];u=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(zt&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&lt)&&Ur(l.node,l.offset,c.anchorNode,c.anchorOffset)&&Ur(a.node,a.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||e==n)&&!u){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),d=!0}catch{}}if(!d){if(e>n){let h=l;l=a,a=h}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?_r:Ep,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=an:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?_r:an}r=s}this.dirty=_r}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?_r:Ep;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Nb extends bs{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Dt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class HC extends bs{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Kr extends bs{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=to.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Kr(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&an||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=an&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Dt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Dt}}slice(e,n,r){let o=Kr.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Ju(i,n,s,r)),e>0&&(i=Ju(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}}class cr extends bs{constructor(e,n,r,o,i,s,l,a,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=to.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Pb(u,r,n),c?a=new zC(e,n,r,o,u,d||null,f,c,i,s+1):n.isText?new ja(e,n,r,o,u,f,i):new cr(e,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>I.empty)}return e}matchesNode(e,n,r){return this.dirty==Dt&&e.eq(this.node)&&qu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new WC(this,s&&s.node,e);GC(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?pe.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,o)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let h;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(h=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,d,h,e)||a.updateNextNode(c,u,d,e,f,o)||a.addNode(c,u,d,e,o),o+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==_r)&&(s&&this.protectLocalComposition(e,s),_b(this.contentDOM,this.children,e),Lo&&qC(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Z)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,l=JC(this.node.content,s,r-n,o-n);return l<0?null:{node:i,pos:l,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new HC(this,i,n,o);e.input.compositionNodes.push(s),this.children=Ju(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==an||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Dt}updateOuterDeco(e){if(qu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Ib(this.dom,this.nodeDOM,Gu(this.outerDeco,this.node,n),Gu(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function kp(t,e,n,r,o){Pb(r,e,t);let i=new cr(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class ja extends cr{constructor(e,n,r,o,i,s,l){super(e,n,r,o,i,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==an||this.dirty!=Dt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Dt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Dt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new ja(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=an)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Db extends bs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Dt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zC extends cr{constructor(e,n,r,o,i,s,l,a,c,u){super(e,n,r,o,i,s,l,c,u),this.spec=a}update(e,n,r,o){if(this.dirty==an)return!1;if(this.spec.update){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function _b(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=Mp(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(s instanceof Kr){let a=r?r.previousSibling:t.lastChild;_b(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=Mp(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Si=function(t){t&&(this.nodeName=t)};Si.prototype=Object.create(null);const Ir=[new Si];function Gu(t,e,n){if(t.length==0)return Ir;let r=n?Ir[0]:new Si,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Si(s.nodeName));for(let l in s){let a=s[l];a!=null&&(n&&o.length==1&&o.push(r=new Si(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return o}function Ib(t,e,n,r){if(n==Ir&&r==Ir)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],l=n[i];if(i){let a;l&&l.nodeName==s.nodeName&&o!=t&&(a=o.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(o),l=Ir[0]),o=a}VC(o,l||Ir[0],s)}return o}function VC(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Pb(t,e,n){return Ib(t,t,Ir,Gu(e,n,t.nodeType!=1))}function qu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Mp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class WC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=UC(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Dt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Kr.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==an&&s.dom==s.contentDOM&&(s.dirty=_r),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof cr){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,d,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=an&&qu(n,a.outerDeco));if(!f&&a.update(e,n,r,o))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=_r,d.updateChildren(o,s+1),d.dirty=Dt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let l=cr.create(this.top,n,r,o,i,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,o,i){let s=cr.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Nb(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Kr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ja)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((lt||et)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Db(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function UC(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Kr)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}function KC(t,e){return t.type.side-e.type.side}function GC(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let g=o[s++];g.widget&&(u?(d||(d=[u])).push(g):u=g)}if(u)if(d){d.sort(KC);for(let g=0;g<d.length;g++)n(d[g],c,!!a)}else n(u,c,!!a);let f,h;if(a)h=-1,f=a,a=null;else if(c<t.childCount)h=c,f=t.child(c++);else break;for(let g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let p=i+f.nodeSize;if(f.isText){let g=p;s<o.length&&o[s].from<g&&(g=o[s].from);for(let y=0;y<l.length;y++)l[y].to<g&&(g=l[y].to);g<p&&(a=f.cut(g-i),f=f.cut(0,g-i),p=g,h=-1)}else for(;s<o.length&&o[s].to<p;)s++;let m=f.isInline&&!f.isLeaf?l.filter(g=>!g.inline):l.slice();r(f,m,e.forChild(i,f),h),i=p}}function qC(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function JC(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Ju(t,e,n,r,o){let i=[];for(let s=0,l=0;s<t.length;s++){let a=t[s],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function bf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Fa(n)){for(a=l;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&Y.isSelectable(u)&&o.parent&&!(u.isInline&&xC(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new Y(s==d?l:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=vf(t,a,l,u)}return c}function Lb(t){return t.editable?t.hasFocus():Bb(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Tn(t,e=!1){let n=t.state.selection;if($b(t,n),!!Lb(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&et){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Ur(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)XC(t);else{let{anchor:r,head:o}=n,i,s;Tp&&!(n instanceof Z)&&(n.$from.parent.inlineContent||(i=Op(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Op(t,n.to))),t.docView.setSelection(r,o,t.root,e),Tp&&(i&&Ap(i),s&&Ap(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&YC(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Tp=lt||et&&Eb<63;function Op(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(lt&&o&&o.contentEditable=="false")return Bc(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Bc(o);if(i)return Bc(i)}}function Bc(t){return t.contentEditable="true",lt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ap(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function YC(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Lb(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function XC(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,qe(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&ft&&ar<=11&&(r.disabled=!0,r.disabled=!1)}function $b(t,e){if(e instanceof Y){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Rp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Rp(t)}function Rp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function vf(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Z.between(e,n,r)}function Np(t){return t.editable&&!t.hasFocus()?!1:Bb(t)}function Bb(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ZC(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ur(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Yu(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Q.findFrom(i,e)}function qn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Dp(t,e,n){let r=t.state.selection;if(r instanceof Z)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return qn(t,new Z(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Yu(t.state,e);return o&&o instanceof Y?qn(t,o):!1}else if(!(At&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let l=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?Y.isSelectable(i)?qn(t,new Y(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):ys?qn(t,new Z(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Y&&r.node.isInline)return qn(t,new Z(e>0?r.$to:r.$from));{let o=Yu(t.state,e);return o?qn(t,o):!1}}}function Dl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ci(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function fo(t,e){return e<0?QC(t):eE(t)}function QC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(zt&&n.nodeType==1&&r<Dl(n)&&Ci(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Ci(l,-1))o=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Fb(n))break;{let l=n.previousSibling;for(;l&&Ci(l,-1);)o=n.parentNode,i=qe(l),l=l.previousSibling;if(l)n=l,r=Dl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Xu(t,n,r):o&&Xu(t,o,i)}function eE(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Dl(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Ci(l,1))i=n,s=++r;else break}else{if(Fb(n))break;{let l=n.nextSibling;for(;l&&Ci(l,1);)i=l.parentNode,s=qe(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=Dl(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&Xu(t,i,s)}function Fb(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function tE(t,e){for(;t&&e==t.childNodes.length&&!gs(t);)e=qe(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function nE(t,e){for(;t&&!e&&!gs(t);)e=qe(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Xu(t,e,n){if(e.nodeType!=3){let i,s;(s=tE(e,n))?(e=s,n=0):(i=nE(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(Fa(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Tn(t)},50)}function _p(t,e){let n=t.state.doc.resolve(e);if(!(et||EC)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Ip(t,e,n){let r=t.state.selection;if(r instanceof Z&&!r.empty||n.indexOf("s")>-1||At&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Yu(t.state,e);if(s&&s instanceof Y)return qn(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,l=r instanceof Nt?Q.near(s,e):Q.findFrom(s,e);return l?qn(t,l):!1}return!1}function Pp(t,e){if(!(t.state.selection instanceof Z))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function Lp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function rE(t){if(!lt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Lp(t,r,"true"),setTimeout(()=>Lp(t,r,"false"),20)}return!1}function oE(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function iE(t,e){let n=e.keyCode,r=oE(e);if(n==8||At&&n==72&&r=="c")return Pp(t,-1)||fo(t,-1);if(n==46&&!e.shiftKey||At&&n==68&&r=="c")return Pp(t,1)||fo(t,1);if(n==13||n==27)return!0;if(n==37||At&&n==66&&r=="c"){let o=n==37?_p(t,t.state.selection.from)=="ltr"?-1:1:-1;return Dp(t,o,r)||fo(t,o)}else if(n==39||At&&n==70&&r=="c"){let o=n==39?_p(t,t.state.selection.from)=="ltr"?1:-1:1;return Dp(t,o,r)||fo(t,o)}else{if(n==38||At&&n==80&&r=="c")return Ip(t,-1,r)||fo(t,-1);if(n==40||At&&n==78&&r=="c")return rE(t)||Ip(t,1,r)||fo(t,1);if(r==(At?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function jb(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||to.fromSchema(t.state.schema),l=Kb(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Ub[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
7
7
 
8
- `);return{dom:a,text:f,slice:e}}function Hb(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return e?new B(P.from(t.state.schema.text(e.replace(/\r\n?/g,`
9
- `))),0,0):B.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)l=d;else{let f=o.marks(),{schema:h}=t.state,p=no.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=aE(n),ys&&cE(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||wi.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!sE.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=uE($p(l,+u[1],+u[2]),u[4]);else if(l=B.maxOpen(lE(l.content,o),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=$p(l,d,f)}return t.someProp("transformPasted",d=>{l=d(l,t)}),l}const sE=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function lE(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&Vb(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Wb(s[s.length-1],i.length));let u=zb(l,a);s.push(u),o=o.matchType(u.type),i=a}}),s)return P.from(s)}return t}function zb(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,P.from(t));return t}function Vb(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Vb(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(P.from(zb(n,t,o+1))))}}function Wb(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Wb(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(P.empty,!0);return t.copy(n.append(r))}function Xu(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=Xu(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(P.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function $p(t,e,n){return e<t.openStart&&(t=new B(Xu(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new B(Xu(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ub={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Bp=null;function Kb(){return Bp||(Bp=document.implementation.createHTMLDocument("title"))}function aE(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Kb().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Ub[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=t,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function cE(t){let e=t.querySelectorAll(et?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function uE(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=P.from(a.create(r[l+1],o)),i++,s++}return new B(o,i,s)}const at={},ct={},dE={touchstart:!0,touchmove:!0};class fE{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function hE(t){for(let e in at){let n=at[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{mE(t,r)&&!vf(t,r)&&(t.editable||!(r.type in ct))&&n(t,r)},dE[e]?{passive:!0}:void 0)}lt&&t.dom.addEventListener("input",()=>null),Zu(t)}function ir(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function pE(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Zu(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>vf(t,r))})}function vf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function mE(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function gE(t,e){!vf(t,e)&&at[e.type]&&(t.editable||!(e.type in ct))&&at[e.type](t,e)}ct.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!qb(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(jt&&et&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Lo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Nr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||iE(t,n)?n.preventDefault():ir(t,"key")};ct.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ct.keypress=(t,e)=>{let n=e;if(qb(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||At&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof X)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function za(t){return{left:t.clientX,top:t.clientY}}function yE(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function wf(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,l=>s>i.depth?l(t,n,i.nodeAfter,i.before(s),o,!0):l(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Ro(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function bE(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(Ro(t,new J(n)),!0):!1}function vE(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let l=s>i.depth?i.nodeAfter:i.node(s);if(J.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Ro(t,J.create(t.state.doc,o)),!0):!1}function wE(t,e,n,r,o){return wf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?vE(t,n):bE(t,n))}function xE(t,e,n,r){return wf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function SE(t,e,n,r){return wf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||CE(t,n,r)}function CE(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ro(t,X.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),l=o.before(i);if(s.inlineContent)Ro(t,X.create(r,l+1,l+1+s.content.size));else if(J.isSelectable(s))Ro(t,J.create(r,l));else continue;return!0}}function xf(t){return Il(t)}const Gb=At?"metaKey":"ctrlKey";at.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=xf(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&yE(n,t.input.lastClick)&&!n[Gb]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(za(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new EE(t,s,n,!!r)):(i=="doubleClick"?xE:SE)(t,s.pos,s.inside,n)?n.preventDefault():ir(t,"pointer"))};class EE{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Gb],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const l=o?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof J&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&zt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ir(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Tn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(za(e))),this.updateAllowDefault(e),this.allowDefault||!n?ir(this.view,"pointer"):wE(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||lt&&this.mightDrag&&!this.mightDrag.node.isAtom||et&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ro(this.view,Q.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ir(this.view,"pointer")}move(e){this.updateAllowDefault(e),ir(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}at.touchstart=t=>{t.input.lastTouch=Date.now(),xf(t),ir(t,"pointer")};at.touchmove=t=>{t.input.lastTouch=Date.now(),ir(t,"pointer")};at.contextmenu=t=>xf(t);function qb(t,e){return t.composing?!0:lt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const kE=jt?5e3:-1;ct.compositionstart=ct.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Il(t,!0),t.markCursor=null;else if(Il(t),zt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}Jb(t,kE)};ct.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Jb(t,20))};function Jb(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Il(t),e))}function Yb(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=TE());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ME(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=vC(e.focusNode,e.focusOffset),r=wC(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function TE(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Il(t,e=!1){if(!(jt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Yb(t),e||t.docView&&t.docView.dirty){let n=yf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function OE(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Fi=ft&&ar<15||Lo&&kC<604;at.copy=ct.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=Fi?null:n.clipboardData,s=r.content(),{dom:l,text:a}=jb(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):OE(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function AE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function RE(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ji(t,r.value,null,o,e):ji(t,r.textContent,r.innerHTML,o,e)},50)}function ji(t,e,n,r,o){let i=Hb(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,o,i||B.empty)))return!0;if(!i)return!1;let s=AE(i),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Xb(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ct.paste=(t,e)=>{let n=e;if(t.composing&&!jt)return;let r=Fi?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ji(t,Xb(r),r.getData("text/html"),o,n)?n.preventDefault():RE(t,n)};class Zb{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Qb=At?"altKey":"ctrlKey";at.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(za(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof J?o.to-1:o.to))){if(r&&r.mightDrag)s=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=J.create(t.state.doc,d.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:c,slice:u}=jb(t,l);(!n.dataTransfer.files.length||!et||Eb>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Fi?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Fi||n.dataTransfer.setData("text/plain",c),t.dragging=new Zb(u,!n[Qb],s)};at.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ct.dragover=ct.dragenter=(t,e)=>e.preventDefault();ct.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(za(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=Hb(t,Xb(n.dataTransfer),Fi?null:n.dataTransfer.getData("text/html"),!1,i);let l=!!(r&&!n[Qb]);if(t.someProp("handleDrop",p=>p(t,n,s||B.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?gb(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let c=t.state.tr;if(l){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&J.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new J(h));else{let p=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,x)=>p=x),c.setSelection(bf(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};at.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Tn(t)},20))};at.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};at.beforeinput=(t,e)=>{if(et&&jt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Nr(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in ct)at[t]=ct[t];function Hi(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Pl{constructor(e,n){this.toDOM=e,this.spec=n||jr,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Le(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Pl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Hi(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ur{constructor(e,n){this.attrs=e,this.spec=n||jr}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Le(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ur&&Hi(this.attrs,e.attrs)&&Hi(this.spec,e.spec)}static is(e){return e.type instanceof ur}destroy(){}}class Sf{constructor(e,n){this.attrs=e,this.spec=n||jr}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Le(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Sf&&Hi(this.attrs,e.attrs)&&Hi(this.spec,e.spec)}destroy(){}}class Le{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Le(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Le(e,e,new Pl(n,r))}static inline(e,n,r,o){return new Le(e,n,new ur(r,o))}static node(e,n,r,o){return new Le(e,n,new Sf(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ur}get widget(){return this.type instanceof Pl}}const xo=[],jr={};class me{constructor(e,n){this.local=e.length?e:xo,this.children=n.length?n:xo}static create(e,n){return n.length?Ll(n,e,0,jr):Qe}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,o+l,i)}}map(e,n,r){return this==Qe||e.maps.length==0?this:this.mapInner(e,n,0,0,r||jr)}mapInner(e,n,r,o,i){let s;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,o);a&&a.type.valid(n,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?NE(this.children,s||[],e,n,r,o,i):s?new me(s.sort(Hr),xo):Qe}add(e,n){return n.length?this==Qe?me.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=t0(n,l,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<a;)i+=3;o[i]==a?o[i+2]=o[i+2].addInner(l,u,c+1):o.splice(i,0,a,a+l.nodeSize,Ll(u,l,c+1,jr)),i+=3}});let s=e0(i?n0(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new me(s.length?this.local.concat(s).sort(Hr):this.local,o||this.children)}remove(e){return e.length==0||this==Qe?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,l=r[i]+n,a=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,l+1);c!=Qe?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let l=0;l<o.length;l++)o[l].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new me(o,r):Qe}forChild(e,n){if(this==Qe)return this;if(n.isLeaf)return me.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,s=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<s&&a.to>i&&a.type instanceof ur){let c=Math.max(i,a.from)-i,u=Math.min(s,a.to)-i;c<u&&(o||(o=[])).push(a.copy(c,u))}}if(o){let l=new me(o.sort(Hr),xo);return r?new Qn([l,r]):l}return r||Qe}eq(e){if(this==e)return!0;if(!(e instanceof me)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Cf(this.localsInner(e))}localsInner(e){if(this==Qe)return xo;if(e.inlineContent||!this.local.some(ur.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ur||n.push(this.local[r]);return n}}me.empty=new me([],[]);me.removeOverlap=Cf;const Qe=me.empty;class Qn{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,jr));return Qn.from(r)}forChild(e,n){if(n.isLeaf)return me.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Qe&&(i instanceof Qn?r=r.concat(i.members):r.push(i))}return Qn.from(r)}eq(e){if(!(e instanceof Qn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Cf(r?n:n.sort(Hr)):xo}static from(e){switch(e.length){case 0:return Qe;case 1:return e[0];default:return new Qn(e.every(n=>n instanceof me)?e:e.reduce((n,r)=>n.concat(r instanceof me?r:r.members),[]))}}}function NE(t,e,n,r,o,i,s){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,m)=>{let g=m-p-(h-f);for(let y=0;y<l.length;y+=3){let x=l[y+1];if(x<0||f>x+u-d)continue;let S=l[y]+u-d;h>=S?l[y+1]=f<=S?-2:-1:f>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+i,-1),h=f-o,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==h){let y=l[c+2].mapInner(n,g,u+1,t[c]+i+1,s);y!=Qe?(l[c]=d,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=DE(l,t,e,n,o,i,s),u=Ll(c,r,0,s);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new me(e.sort(Hr),l)}function e0(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Le(o.from+e,o.to+e,o.type))}return n}function DE(t,e,n,r,o,i,s){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function t0(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function n0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ll(t,e,n,r){let o=[],i=!1;e.forEach((l,a)=>{let c=t0(t,l,a+n);if(c){i=!0;let u=Ll(c,l,n+a+1,r);u!=Qe&&o.push(a,a+l.nodeSize,u)}});let s=e0(i?n0(t):t,-n).sort(Hr);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||o.length?new me(s,o):Qe}function Hr(t,e){return t.from-e.from||t.to-e.to}function Cf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Fp(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Fp(e,o,r.copy(i.from,r.to)));break}}}return e}function Fp(t,e,n){for(;e<t.length&&Hr(n,t[e])>0;)e++;t.splice(e,0,n)}function Fc(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Qe&&e.push(r)}),t.cursorWrapper&&e.push(me.create(t.state.doc,[t.cursorWrapper.deco])),Qn.from(e)}const _E={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},IE=ft&&ar<=11;class PE{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class LE{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new PE,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);ft&&ar<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),IE&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,_E)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Np(this.view)){if(this.suppressingSelectionUpdates)return Tn(this.view);if(ft&&ar<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Kr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Bi(i))n.add(i);for(let i=e.anchorNode;i;i=Bi(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Np(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],a);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(l=!0))}if(zt&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||FE(e,d)!=h)&&f.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ja(r)&&(c=yf(e))&&c.eq(Q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tn(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),$E(e)),this.handleDOMChange(i,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Tn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(ft&&ar<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?qe(o)+1:0,l=r.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?qe(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let jp=new WeakMap,Hp=!1;function $E(t){if(!jp.has(t)&&(jp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=zt,Hp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Hp=!0}}function zp(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Kr(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function BE(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return zp(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?zp(t,n):null}function FE(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function jE(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],ja(a)||c.push({node:a.focusNode,offset:a.focusOffset})),et&&t.input.lastKeyCode===8)for(let g=i;g>o;g--){let y=r.childNodes[g-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){i=g;break}if(!x||x.size)break}let d=t.state.doc,f=t.someProp("domParser")||wi.fromSchema(t.state.schema),h=d.resolve(s),p=null,m=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:HE,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+s,head:y+s}}return{doc:m,sel:p,from:s,to:l}}function HE(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(lt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||lt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const zE=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function VE(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let E=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=yf(t,E);if(O&&!t.state.selection.eq(O)){if(et&&jt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,Nr(13,"Enter"))))return;let I=t.state.tr.setSelection(O);E=="pointer"?I.setMeta("pointer",!0):E=="key"&&I.scrollIntoView(),i&&I.setMeta("composition",i),t.dispatch(I)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=jE(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,h="end"):(f=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=KE(d.content,c.doc.content,c.from,f,h);if((Lo&&t.input.lastIOSEnter>Date.now()-225||jt)&&o.some(E=>E.nodeType==1&&!zE.test(E.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",E=>E(t,Nr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof X&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let E=Vp(t,t.state.doc,c.sel);if(E&&!E.eq(t.state.selection)){let O=t.state.tr.setSelection(E);i&&O.setMeta("composition",i),t.dispatch(O)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof X&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),ft&&ar<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA,S;if((Lo&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!x&&m.pos<c.doc.content.size&&!m.sameParent(g)&&(S=Q.findFrom(c.doc.resolve(m.pos+1),1,!0))&&S.head==g.pos)&&t.someProp("handleKeyDown",E=>E(t,Nr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&UE(u,p.start,p.endA,m,g)&&t.someProp("handleKeyDown",E=>E(t,Nr(8,"Backspace")))){jt&&et&&t.domObserver.suppressSelectionUpdates();return}et&&jt&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),jt&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(E){return E(t,Nr(13,"Enter"))})},20));let b=p.start,C=p.endA,w,k,R;if(x){if(m.pos==g.pos)ft&&ar<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),w=t.state.tr.delete(b,C),k=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(R=WE(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))w=t.state.tr,R.type=="add"?w.addMark(b,C,R.mark):w.removeMark(b,C,R.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let E=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",O=>O(t,b,C,E)))return;w=t.state.tr.insertText(E,b,C)}}if(w||(w=t.state.tr.replace(b,C,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let E=Vp(t,w.doc,c.sel);E&&!(et&&jt&&t.composing&&E.empty&&(p.start!=p.endB||t.input.lastAndroidDelete<Date.now()-100)&&(E.head==b||E.head==w.mapping.map(C)-1)||ft&&E.empty&&E.head==b)&&w.setSelection(E)}k&&w.ensureMarks(k),i&&w.setMeta("composition",i),t.dispatch(w.scrollIntoView())}function Vp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:bf(t,e.resolve(n.anchor),e.resolve(n.head))}function WE(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,l,a;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)l=o[0],s="add",a=u=>u.mark(l.addToSet(u.marks));else if(o.length==0&&i.length==1)l=i[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(P.from(c).eq(t))return{mark:l,type:s}}function UE(t,e,n,r,o){if(n-e<=o.pos-r.pos||jc(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(jc(i,!0,!0));return!s.parent.isTextblock||s.pos>n||jc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function jc(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function KE(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let a=Math.max(0,i-Math.min(s,l));r-=s+a-i}if(s<i&&t.size<e.size){let a=r<=i&&r>=s?i-r:0;i-=a,i&&i<e.size&&Wp(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-s),s=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&Wp(t.textBetween(i-1,i+1))&&(i+=a?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}function Wp(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class GE{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new fE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Jp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Gp(this),Kp(this),this.nodeViews=qp(this),this.docView=kp(this.state.doc,Up(this),Fc(this),this.dom,this),this.domObserver=new LE(this,(r,o,i,s)=>VE(this,r,o,i,s)),this.domObserver.start(),hE(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Zu(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jp),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Yb(this),s=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=qp(this);JE(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Zu(this),this.editable=Gp(this),Kp(this);let a=Fc(this),c=Up(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&OC(this);if(s){this.domObserver.stop();let h=d&&(ft||et)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&qE(o.selection,e.selection);if(d){let p=et?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ME(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=kp(e.doc,c,a,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ZC(this))?Tn(this,h):($b(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&AC(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&vp(this,n.getBoundingClientRect(),e)}else vp(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Zb(e.slice,e.move,o<0?void 0:J.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(o=n?n(l):l))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let l=i[s].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(ft){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&RC(this.dom),Tn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return PC(this,e)}coordsAtPos(e,n=1){return Ab(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return jC(this,n||this.state,e)}pasteHTML(e,n){return ji(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ji(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(pE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Fc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,yC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return gE(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return lt&&this.root.nodeType===11&&SC(this.dom.ownerDocument)==this.dom&&BE(this,e)||e}domSelection(){return this.root.getSelection()}}function Up(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Le.node(0,t.state.doc.content.size,e)]}function Kp(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Le.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Gp(t){return!t.someProp("editable",e=>e(t.state)===!1)}function qE(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function qp(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function JE(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Jp(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var dr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},$l={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},YE=typeof navigator<"u"&&/Mac/.test(navigator.platform),XE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Je=0;Je<10;Je++)dr[48+Je]=dr[96+Je]=String(Je);for(var Je=1;Je<=24;Je++)dr[Je+111]="F"+Je;for(var Je=65;Je<=90;Je++)dr[Je]=String.fromCharCode(Je+32),$l[Je]=String.fromCharCode(Je);for(var Hc in dr)$l.hasOwnProperty(Hc)||($l[Hc]=dr[Hc]);function ZE(t){var e=YE&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||XE&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?$l:dr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const QE=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function ek(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))QE?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function tk(t){let e=Object.create(null);for(let n in t)e[ek(n)]=t[n];return e}function zc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function nk(t){return new ke({props:{handleKeyDown:Ef(t)}})}function Ef(t){let e=tk(t);return function(n,r){let o=ZE(r),i,s=e[zc(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[zc(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=dr[r.keyCode])&&i!=o){let l=e[zc(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const r0=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function o0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const rk=(t,e,n)=>{let r=o0(t,n);if(!r)return!1;let o=kf(r);if(!o){let s=r.blockRange(),l=s&&Qo(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let i=o.nodeBefore;if(a0(t,o,e,-1))return!0;if(r.parent.content.size==0&&($o(i,"end")||J.isSelectable(i)))for(let s=r.depth;;s--){let l=Ba(t.doc,r.before(s),r.after(s),B.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection($o(i,"end")?Q.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):J.create(a.doc,o.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},ok=(t,e,n)=>{let r=o0(t,n);if(!r)return!1;let o=kf(r);return o?i0(t,o,e):!1},ik=(t,e,n)=>{let r=s0(t,n);if(!r)return!1;let o=Mf(r);return o?i0(t,o,e):!1};function i0(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,l=s,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Ba(t.doc,i,a,B.empty);if(!c||c.from!=i||c instanceof ze&&c.slice.size>=a-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(X.create(u.doc,i)),n(u.scrollIntoView())}return!0}function $o(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const sk=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=kf(r)}let s=i&&i.nodeBefore;return!s||!J.isSelectable(s)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function kf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function s0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const lk=(t,e,n)=>{let r=s0(t,n);if(!r)return!1;let o=Mf(r);if(!o)return!1;let i=o.nodeAfter;if(a0(t,o,e,1))return!0;if(r.parent.content.size==0&&($o(i,"start")||J.isSelectable(i))){let s=Ba(t.doc,r.before(),r.after(),B.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection($o(i,"start")?Q.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):J.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},ak=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Mf(r)}let s=i&&i.nodeAfter;return!s||!J.isSelectable(s)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos)).scrollIntoView()),!0)};function Mf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const ck=(t,e)=>{let n=t.selection,r=n instanceof J,o;if(r){if(n.node.isTextblock||!xr(t.doc,n.from))return!1;o=n.from}else if(o=$a(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(J.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},uk=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!xr(t.doc,n.to))return!1;r=n.to}else if(r=$a(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},dk=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Qo(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},fk=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
10
- `).scrollIntoView()),!0)};function l0(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const hk=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=l0(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(Q.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},pk=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Nt||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=l0(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(X.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},mk=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Oo(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Qo(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},gk=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,o))),!0)};function yk(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||xr(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function a0(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&yk(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=P.empty;for(let y=s.length-1;y>=0;y--)p=P.from(s[y].create(null,p));p=P.from(o.copy(p));let m=t.tr.step(new Ve(e.pos-1,h,e.pos,h,new B(p,1,0),s.length,!0)),g=h+2*s.length;xr(m.doc,g)&&m.join(g),n(m.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:Q.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Qo(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&$o(i,"start",!0)&&$o(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let y=P.empty;for(let S=p.length-1;S>=0;S--)y=P.from(p[S].copy(y));let x=t.tr.step(new Ve(e.pos-p.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new B(y,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function c0(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(X.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const bk=c0(-1),vk=c0(1);function wk(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&ff(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Yp(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function xk(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);a=new Li(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Li(o,n.doc.resolve(i.end(s.depth)),s.depth)),l=!0}let c=ff(a,t,e,s);return c?(r&&r(Sk(n.tr,s,c,l,t).scrollIntoView()),!0):!1}}function Sk(t,e,n,r,o){let i=P.empty;for(let u=n.length-1;u>=0;u--)i=P.from(n[u].type.create(n[u].attrs,i));t.step(new Ve(e.start-(r?2:0),e.end,e.start,e.end,new B(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let l=n.length-s,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Oo(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function Ck(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?Ek(e,n,t,i):kk(e,n,i):!0:!1}}function Ek(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Ve(i-1,s,i,s,new B(P.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Li(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const l=Qo(r);if(l==null)return!1;o.lift(r,l);let a=o.mapping.map(i,-1)-1;return xr(o.doc,a)&&o.join(a),e(o.scrollIntoView()),!0}function kk(t,e,n){let r=t.tr,o=n.parent;for(let h=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?P.empty:P.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new Ve(d-(l?1:0),f+(a?1:0),d+1,f-1,new B((l?P.empty:P.from(o.copy(P.empty))).append(a?P.empty:P.from(o.copy(P.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Mk(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=P.from(c?t.create():null),d=new B(P.from(t.create(null,P.from(l.type.create(null,u)))),c?3:1,0),f=i.start,h=i.end;n(e.tr.step(new Ve(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function Va(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class Wa{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,l=[],a=!!e,c=e||i.tr,u=()=>(!a&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(c,n),y=h(...m)(g);return l.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,l={tr:e,editor:o,view:s,state:Va({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class Tk{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function V(t,e,n){return t.config[e]===void 0&&t.parent?V(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?V(t.parent,e,n):null}):t.config[e]}function Ua(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function u0(t){const e=[],{nodeExtensions:n,markExtensions:r}=Ua(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:o},a=V(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...i,...h}})})})})}),o.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=V(s,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...i,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function Ue(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function le(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const l=i?i.split(" "):[],a=r[o]?r[o].split(" "):[],c=l.filter(u=>!a.includes(u));r[o]=[...a,...c].join(" ")}else o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function Qu(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>le(n,r),{})}function d0(t){return typeof t=="function"}function se(t,e=void 0,...n){return d0(t)?e?t.bind(e)(...n):t(...n):t}function Ok(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Ak(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Xp(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):Ak(n.getAttribute(s.name));return l==null?i:{...i,[s.name]:l}},{});return{...r,...o}}}}function Zp(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Ok(n)?!1:n!=null))}function Rk(t,e){var n;const r=u0(t),{nodeExtensions:o,markExtensions:i}=Ua(t),s=(n=o.find(c=>V(c,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(o.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,x)=>{const S=V(x,"extendNodeSchema",d);return{...y,...S?S(c):{}}},{}),h=Zp({...f,content:se(V(c,"content",d)),marks:se(V(c,"marks",d)),group:se(V(c,"group",d)),inline:se(V(c,"inline",d)),atom:se(V(c,"atom",d)),selectable:se(V(c,"selectable",d)),draggable:se(V(c,"draggable",d)),code:se(V(c,"code",d)),whitespace:se(V(c,"whitespace",d)),defining:se(V(c,"defining",d)),isolating:se(V(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var x;return[y.name,{default:(x=y==null?void 0:y.attribute)===null||x===void 0?void 0:x.default}]}))}),p=se(V(c,"parseHTML",d));p&&(h.parseDOM=p.map(y=>Xp(y,u)));const m=V(c,"renderHTML",d);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:Qu(y,u)}));const g=V(c,"renderText",d);return g&&(h.toText=g),[c.name,h]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((g,y)=>{const x=V(y,"extendMarkSchema",d);return{...g,...x?x(c):{}}},{}),h=Zp({...f,inclusive:se(V(c,"inclusive",d)),excludes:se(V(c,"excludes",d)),group:se(V(c,"group",d)),spanning:se(V(c,"spanning",d)),code:se(V(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),p=se(V(c,"parseHTML",d));p&&(h.parseDOM=p.map(g=>Xp(g,u)));const m=V(c,"renderHTML",d);return m&&(h.toDOM=g=>m({mark:g,HTMLAttributes:Qu(g,u)})),[c.name,h]}));return new sb({topNode:s,nodes:l,marks:a})}function Vc(t,e){return e.nodes[t]||e.marks[t]||null}function Qp(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const Nk=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;const u=((c=(a=o.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function Tf(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ka{constructor(e){this.find=e.find,this.handler=e.handler}}const Dk=(t,e)=>{if(Tf(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ps(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=Nk(c)+i;return s.forEach(f=>{if(u)return;const h=Dk(d,f.find);if(!h)return;const p=a.state.tr,m=Va({state:a.state,transaction:p}),g={from:r-(h[0].length-i.length),to:o},{commands:y,chain:x,can:S}=new Wa({editor:n,state:m});f.handler({state:m,range:g,match:h,commands:y,chain:x,can:S})===null||!p.steps.length||(p.setMeta(l,{transform:p,from:r,to:o,text:i}),a.dispatch(p),u=!0)}),u}function _k(t){const{editor:e,rules:n}=t,r=new ke({state:{init(){return null},apply(o,i){const s=o.getMeta(r);if(s)return s;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{const{from:c,text:u}=l,d=c+u.length;Ps({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return Ps({editor:e,from:i,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Ps({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Ps({editor:e,from:s.pos,to:s.pos,text:`
11
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Ik(t){return typeof t=="number"}class Pk{constructor(e){this.find=e.find,this.handler=e.handler}}const Lk=(t,e,n)=>{if(Tf(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function $k(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Wa({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(r,p),g=Math.min(o,p+h.content.size),y=h.textBetween(m-p,g-p,void 0,"");Lk(y,i.find,s).forEach(S=>{if(S.index===void 0)return;const b=m+S.index+1,C=b+S[0].length,w={from:n.tr.mapping.map(b),to:n.tr.mapping.map(C)},k=i.handler({state:n,range:w,match:S,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(k)})}),d.every(h=>h!==null)}const Bk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function Fk(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l=typeof DragEvent<"u"?new DragEvent("drop"):null;const a=({state:u,from:d,to:f,rule:h,pasteEvt:p})=>{const m=u.tr,g=Va({state:u,transaction:m});if(!(!$k({editor:e,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:l})||!m.steps.length))return l=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return n.map(u=>new ke({view(d){const f=h=>{var p;r=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(d,f)=>(i=r===d.dom.parentElement,l=f,!1),paste:(d,f)=>{var h;const p=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=f,o=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!o,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),x=!!y;if(!m&&!g&&!x)return;if(x){const{from:C,text:w}=y,k=C+w.length,R=Bk(w);return a({rule:u,state:h,from:C,to:{b:k},pasteEvt:R})}const S=f.doc.content.findDiffStart(h.doc.content),b=f.doc.content.findDiffEnd(h.doc.content);if(!(!Ik(S)||!b||S===b.b))return a({rule:u,state:h,from:S,to:b,pasteEvt:s})}}))}function jk(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Mo{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Mo.resolve(e),this.schema=Rk(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Mo.sort(Mo.flatten(e)),r=jk(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=V(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=V(r,"priority")||100,s=V(o,"priority")||100;return i>s?-1:i<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Vc(n.name,this.schema)},o=V(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=Mo.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:Vc(s.name,this.schema)},a=[],c=V(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&V(s,"exitable",l)&&(u.ArrowRight=()=>nt.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:e})]));u={...u,...m}}const d=nk(u);a.push(d);const f=V(s,"addInputRules",l);Qp(s,e.options.enableInputRules)&&f&&r.push(...f());const h=V(s,"addPasteRules",l);Qp(s,e.options.enablePasteRules)&&h&&o.push(...h());const p=V(s,"addProseMirrorPlugins",l);if(p){const m=p();a.push(...m)}return a}).flat();return[_k({editor:e,rules:r}),...Fk({editor:e,rules:o}),...i]}get attributes(){return u0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Ua(this.extensions);return Object.fromEntries(n.filter(r=>!!V(r,"addNodeView")).map(r=>{const o=this.attributes.filter(a=>a.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ue(r.name,this.schema)},s=V(r,"addNodeView",i);if(!s)return[];const l=(a,c,u,d)=>{const f=Qu(a,o);return s()({editor:e,node:a,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Vc(e.name,this.schema)};e.type==="mark"&&(!((n=se(V(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=V(e,"onBeforeCreate",r),i=V(e,"onCreate",r),s=V(e,"onUpdate",r),l=V(e,"onSelectionUpdate",r),a=V(e,"onTransaction",r),c=V(e,"onFocus",r),u=V(e,"onBlur",r),d=V(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}function Hk(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ls(t){return Hk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Ga(t,e){const n={...t};return Ls(t)&&Ls(e)&&Object.keys(e).forEach(r=>{Ls(e[r])&&Ls(t[r])?n[r]=Ga(t[r],e[r]):n[r]=e[r]}),n}class Ie{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ie(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ga(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ie({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=se(V(n,"addOptions",{name:n.name})),n.storage=se(V(n,"addStorage",{name:n.name,options:n.options})),n}}function f0(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=`
8
+ `);return{dom:a,text:f,slice:e}}function Hb(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return e?new B(I.from(t.state.schema.text(e.replace(/\r\n?/g,`
9
+ `))),0,0):B.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)l=d;else{let f=o.marks(),{schema:h}=t.state,p=to.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=aE(n),ys&&cE(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||wi.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!sE.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=uE($p(l,+u[1],+u[2]),u[4]);else if(l=B.maxOpen(lE(l.content,o),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d<l.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=$p(l,d,f)}return t.someProp("transformPasted",d=>{l=d(l,t)}),l}const sE=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function lE(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&Vb(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Wb(s[s.length-1],i.length));let u=zb(l,a);s.push(u),o=o.matchType(u.type),i=a}}),s)return I.from(s)}return t}function zb(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,I.from(t));return t}function Vb(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Vb(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(I.from(zb(n,t,o+1))))}}function Wb(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Wb(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(I.empty,!0);return t.copy(n.append(r))}function Zu(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=Zu(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(I.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function $p(t,e,n){return e<t.openStart&&(t=new B(Zu(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new B(Zu(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ub={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Bp=null;function Kb(){return Bp||(Bp=document.implementation.createHTMLDocument("title"))}function aE(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Kb().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Ub[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=t,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function cE(t){let e=t.querySelectorAll(et?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function uE(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=I.from(a.create(r[l+1],o)),i++,s++}return new B(o,i,s)}const at={},ct={},dE={touchstart:!0,touchmove:!0};class fE{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function hE(t){for(let e in at){let n=at[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{mE(t,r)&&!wf(t,r)&&(t.editable||!(r.type in ct))&&n(t,r)},dE[e]?{passive:!0}:void 0)}lt&&t.dom.addEventListener("input",()=>null),Qu(t)}function ir(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function pE(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Qu(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>wf(t,r))})}function wf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function mE(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function gE(t,e){!wf(t,e)&&at[e.type]&&(t.editable||!(e.type in ct))&&at[e.type](t,e)}ct.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!qb(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(jt&&et&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Lo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Nr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||iE(t,n)?n.preventDefault():ir(t,"key")};ct.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ct.keypress=(t,e)=>{let n=e;if(qb(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||At&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Z)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Ha(t){return{left:t.clientX,top:t.clientY}}function yE(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function xf(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,l=>s>i.depth?l(t,n,i.nodeAfter,i.before(s),o,!0):l(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Ao(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function bE(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(Ao(t,new Y(n)),!0):!1}function vE(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Y&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let l=s>i.depth?i.nodeAfter:i.node(s);if(Y.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Ao(t,Y.create(t.state.doc,o)),!0):!1}function wE(t,e,n,r,o){return xf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?vE(t,n):bE(t,n))}function xE(t,e,n,r){return xf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function SE(t,e,n,r){return xf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||CE(t,n,r)}function CE(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ao(t,Z.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),l=o.before(i);if(s.inlineContent)Ao(t,Z.create(r,l+1,l+1+s.content.size));else if(Y.isSelectable(s))Ao(t,Y.create(r,l));else continue;return!0}}function Sf(t){return _l(t)}const Gb=At?"metaKey":"ctrlKey";at.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Sf(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&yE(n,t.input.lastClick)&&!n[Gb]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(Ha(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new EE(t,s,n,!!r)):(i=="doubleClick"?xE:SE)(t,s.pos,s.inside,n)?n.preventDefault():ir(t,"pointer"))};class EE{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Gb],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const l=o?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Y&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&zt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ir(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Tn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ha(e))),this.updateAllowDefault(e),this.allowDefault||!n?ir(this.view,"pointer"):wE(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||lt&&this.mightDrag&&!this.mightDrag.node.isAtom||et&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ao(this.view,Q.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ir(this.view,"pointer")}move(e){this.updateAllowDefault(e),ir(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}at.touchstart=t=>{t.input.lastTouch=Date.now(),Sf(t),ir(t,"pointer")};at.touchmove=t=>{t.input.lastTouch=Date.now(),ir(t,"pointer")};at.contextmenu=t=>Sf(t);function qb(t,e){return t.composing?!0:lt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const kE=jt?5e3:-1;ct.compositionstart=ct.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),_l(t,!0),t.markCursor=null;else if(_l(t),zt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}Jb(t,kE)};ct.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Jb(t,20))};function Jb(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>_l(t),e))}function Yb(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=TE());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ME(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=vC(e.focusNode,e.focusOffset),r=wC(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function TE(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function _l(t,e=!1){if(!(jt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Yb(t),e||t.docView&&t.docView.dirty){let n=bf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function OE(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Fi=ft&&ar<15||Lo&&kC<604;at.copy=ct.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=Fi?null:n.clipboardData,s=r.content(),{dom:l,text:a}=jb(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):OE(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function AE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function RE(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ji(t,r.value,null,o,e):ji(t,r.textContent,r.innerHTML,o,e)},50)}function ji(t,e,n,r,o){let i=Hb(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,o,i||B.empty)))return!0;if(!i)return!1;let s=AE(i),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Xb(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ct.paste=(t,e)=>{let n=e;if(t.composing&&!jt)return;let r=Fi?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ji(t,Xb(r),r.getData("text/html"),o,n)?n.preventDefault():RE(t,n)};class Zb{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Qb=At?"altKey":"ctrlKey";at.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Ha(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Y?o.to-1:o.to))){if(r&&r.mightDrag)s=Y.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Y.create(t.state.doc,d.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:c,slice:u}=jb(t,l);(!n.dataTransfer.files.length||!et||Eb>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Fi?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Fi||n.dataTransfer.setData("text/plain",c),t.dragging=new Zb(u,!n[Qb],s)};at.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ct.dragover=ct.dragenter=(t,e)=>e.preventDefault();ct.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Ha(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=Hb(t,Xb(n.dataTransfer),Fi?null:n.dataTransfer.getData("text/html"),!1,i);let l=!!(r&&!n[Qb]);if(t.someProp("handleDrop",p=>p(t,n,s||B.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?gb(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let c=t.state.tr;if(l){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&Y.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Y(h));else{let p=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,w)=>p=w),c.setSelection(vf(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};at.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Tn(t)},20))};at.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};at.beforeinput=(t,e)=>{if(et&&jt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Nr(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in ct)at[t]=ct[t];function Hi(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Il{constructor(e,n){this.toDOM=e,this.spec=n||Fr,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Le(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Il&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Hi(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ur{constructor(e,n){this.attrs=e,this.spec=n||Fr}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Le(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ur&&Hi(this.attrs,e.attrs)&&Hi(this.spec,e.spec)}static is(e){return e.type instanceof ur}destroy(){}}class Cf{constructor(e,n){this.attrs=e,this.spec=n||Fr}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Le(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Cf&&Hi(this.attrs,e.attrs)&&Hi(this.spec,e.spec)}destroy(){}}class Le{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Le(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Le(e,e,new Il(n,r))}static inline(e,n,r,o){return new Le(e,n,new ur(r,o))}static node(e,n,r,o){return new Le(e,n,new Cf(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ur}get widget(){return this.type instanceof Il}}const wo=[],Fr={};class me{constructor(e,n){this.local=e.length?e:wo,this.children=n.length?n:wo}static create(e,n){return n.length?Pl(n,e,0,Fr):Qe}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,o+l,i)}}map(e,n,r){return this==Qe||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Fr)}mapInner(e,n,r,o,i){let s;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,o);a&&a.type.valid(n,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?NE(this.children,s||[],e,n,r,o,i):s?new me(s.sort(jr),wo):Qe}add(e,n){return n.length?this==Qe?me.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=t0(n,l,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<a;)i+=3;o[i]==a?o[i+2]=o[i+2].addInner(l,u,c+1):o.splice(i,0,a,a+l.nodeSize,Pl(u,l,c+1,Fr)),i+=3}});let s=e0(i?n0(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new me(s.length?this.local.concat(s).sort(jr):this.local,o||this.children)}remove(e){return e.length==0||this==Qe?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,l=r[i]+n,a=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,l+1);c!=Qe?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let l=0;l<o.length;l++)o[l].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new me(o,r):Qe}forChild(e,n){if(this==Qe)return this;if(n.isLeaf)return me.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,s=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<s&&a.to>i&&a.type instanceof ur){let c=Math.max(i,a.from)-i,u=Math.min(s,a.to)-i;c<u&&(o||(o=[])).push(a.copy(c,u))}}if(o){let l=new me(o.sort(jr),wo);return r?new Qn([l,r]):l}return r||Qe}eq(e){if(this==e)return!0;if(!(e instanceof me)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Ef(this.localsInner(e))}localsInner(e){if(this==Qe)return wo;if(e.inlineContent||!this.local.some(ur.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ur||n.push(this.local[r]);return n}}me.empty=new me([],[]);me.removeOverlap=Ef;const Qe=me.empty;class Qn{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Fr));return Qn.from(r)}forChild(e,n){if(n.isLeaf)return me.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Qe&&(i instanceof Qn?r=r.concat(i.members):r.push(i))}return Qn.from(r)}eq(e){if(!(e instanceof Qn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Ef(r?n:n.sort(jr)):wo}static from(e){switch(e.length){case 0:return Qe;case 1:return e[0];default:return new Qn(e.every(n=>n instanceof me)?e:e.reduce((n,r)=>n.concat(r instanceof me?r:r.members),[]))}}}function NE(t,e,n,r,o,i,s){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,m)=>{let g=m-p-(h-f);for(let y=0;y<l.length;y+=3){let w=l[y+1];if(w<0||f>w+u-d)continue;let S=l[y]+u-d;h>=S?l[y+1]=f<=S?-2:-1:f>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+i,-1),h=f-o,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==h){let y=l[c+2].mapInner(n,g,u+1,t[c]+i+1,s);y!=Qe?(l[c]=d,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=DE(l,t,e,n,o,i,s),u=Pl(c,r,0,s);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<l.length&&l[f]<h;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new me(e.sort(jr),l)}function e0(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Le(o.from+e,o.to+e,o.type))}return n}function DE(t,e,n,r,o,i,s){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function t0(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function n0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Pl(t,e,n,r){let o=[],i=!1;e.forEach((l,a)=>{let c=t0(t,l,a+n);if(c){i=!0;let u=Pl(c,l,n+a+1,r);u!=Qe&&o.push(a,a+l.nodeSize,u)}});let s=e0(i?n0(t):t,-n).sort(jr);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||o.length?new me(s,o):Qe}function jr(t,e){return t.from-e.from||t.to-e.to}function Ef(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Fp(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Fp(e,o,r.copy(i.from,r.to)));break}}}return e}function Fp(t,e,n){for(;e<t.length&&jr(n,t[e])>0;)e++;t.splice(e,0,n)}function Fc(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Qe&&e.push(r)}),t.cursorWrapper&&e.push(me.create(t.state.doc,[t.cursorWrapper.deco])),Qn.from(e)}const _E={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},IE=ft&&ar<=11;class PE{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class LE{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new PE,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);ft&&ar<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),IE&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,_E)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Np(this.view)){if(this.suppressingSelectionUpdates)return Tn(this.view);if(ft&&ar<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ur(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Bi(i))n.add(i);for(let i=e.anchorNode;i;i=Bi(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Np(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],a);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(l=!0))}if(zt&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||FE(e,d)!=h)&&f.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Fa(r)&&(c=bf(e))&&c.eq(Q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tn(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),$E(e)),this.handleDOMChange(i,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Tn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(ft&&ar<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?qe(o)+1:0,l=r.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?qe(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let jp=new WeakMap,Hp=!1;function $E(t){if(!jp.has(t)&&(jp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=zt,Hp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Hp=!0}}function zp(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Ur(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function BE(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return zp(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?zp(t,n):null}function FE(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function jE(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Fa(a)||c.push({node:a.focusNode,offset:a.focusOffset})),et&&t.input.lastKeyCode===8)for(let g=i;g>o;g--){let y=r.childNodes[g-1],w=y.pmViewDesc;if(y.nodeName=="BR"&&!w){i=g;break}if(!w||w.size)break}let d=t.state.doc,f=t.someProp("domParser")||wi.fromSchema(t.state.schema),h=d.resolve(s),p=null,m=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:HE,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+s,head:y+s}}return{doc:m,sel:p,from:s,to:l}}function HE(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(lt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||lt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const zE=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function VE(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let E=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=bf(t,E);if(O&&!t.state.selection.eq(O)){if(et&&jt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",L=>L(t,Nr(13,"Enter"))))return;let _=t.state.tr.setSelection(O);E=="pointer"?_.setMeta("pointer",!0):E=="key"&&_.scrollIntoView(),i&&_.setMeta("composition",i),t.dispatch(_)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=jE(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,h="end"):(f=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=KE(d.content,c.doc.content,c.from,f,h);if((Lo&&t.input.lastIOSEnter>Date.now()-225||jt)&&o.some(E=>E.nodeType==1&&!zE.test(E.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",E=>E(t,Nr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof Z&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let E=Vp(t,t.state.doc,c.sel);if(E&&!E.eq(t.state.selection)){let O=t.state.tr.setSelection(E);i&&O.setMeta("composition",i),t.dispatch(O)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof Z&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),ft&&ar<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),w=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA,S;if((Lo&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!w&&m.pos<c.doc.content.size&&!m.sameParent(g)&&(S=Q.findFrom(c.doc.resolve(m.pos+1),1,!0))&&S.head==g.pos)&&t.someProp("handleKeyDown",E=>E(t,Nr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&UE(u,p.start,p.endA,m,g)&&t.someProp("handleKeyDown",E=>E(t,Nr(8,"Backspace")))){jt&&et&&t.domObserver.suppressSelectionUpdates();return}et&&jt&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),jt&&!w&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(E){return E(t,Nr(13,"Enter"))})},20));let b=p.start,C=p.endA,x,k,A;if(w){if(m.pos==g.pos)ft&&ar<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),x=t.state.tr.delete(b,C),k=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(A=WE(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))x=t.state.tr,A.type=="add"?x.addMark(b,C,A.mark):x.removeMark(b,C,A.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let E=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",O=>O(t,b,C,E)))return;x=t.state.tr.insertText(E,b,C)}}if(x||(x=t.state.tr.replace(b,C,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let E=Vp(t,x.doc,c.sel);E&&!(et&&jt&&t.composing&&E.empty&&(p.start!=p.endB||t.input.lastAndroidDelete<Date.now()-100)&&(E.head==b||E.head==x.mapping.map(C)-1)||ft&&E.empty&&E.head==b)&&x.setSelection(E)}k&&x.ensureMarks(k),i&&x.setMeta("composition",i),t.dispatch(x.scrollIntoView())}function Vp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:vf(t,e.resolve(n.anchor),e.resolve(n.head))}function WE(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,l,a;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)l=o[0],s="add",a=u=>u.mark(l.addToSet(u.marks));else if(o.length==0&&i.length==1)l=i[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(I.from(c).eq(t))return{mark:l,type:s}}function UE(t,e,n,r,o){if(n-e<=o.pos-r.pos||jc(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(jc(i,!0,!0));return!s.parent.isTextblock||s.pos>n||jc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function jc(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function KE(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let a=Math.max(0,i-Math.min(s,l));r-=s+a-i}if(s<i&&t.size<e.size){let a=r<=i&&r>=s?i-r:0;i-=a,i&&i<e.size&&Wp(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-s),s=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&Wp(t.textBetween(i-1,i+1))&&(i+=a?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}function Wp(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class GE{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new fE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Jp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Gp(this),Kp(this),this.nodeViews=qp(this),this.docView=kp(this.state.doc,Up(this),Fc(this),this.dom,this),this.domObserver=new LE(this,(r,o,i,s)=>VE(this,r,o,i,s)),this.domObserver.start(),hE(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Qu(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jp),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Yb(this),s=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=qp(this);JE(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Qu(this),this.editable=Gp(this),Kp(this);let a=Fc(this),c=Up(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&OC(this);if(s){this.domObserver.stop();let h=d&&(ft||et)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&qE(o.selection,e.selection);if(d){let p=et?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ME(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=kp(e.doc,c,a,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ZC(this))?Tn(this,h):($b(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&AC(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Y){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&vp(this,n.getBoundingClientRect(),e)}else vp(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Zb(e.slice,e.move,o<0?void 0:Y.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(o=n?n(l):l))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let l=i[s].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(ft){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&RC(this.dom),Tn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return PC(this,e)}coordsAtPos(e,n=1){return Ab(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return jC(this,n||this.state,e)}pasteHTML(e,n){return ji(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ji(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(pE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Fc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,yC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return gE(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return lt&&this.root.nodeType===11&&SC(this.dom.ownerDocument)==this.dom&&BE(this,e)||e}domSelection(){return this.root.getSelection()}}function Up(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Le.node(0,t.state.doc.content.size,e)]}function Kp(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Le.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Gp(t){return!t.someProp("editable",e=>e(t.state)===!1)}function qE(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function qp(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function JE(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Jp(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var dr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ll={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},YE=typeof navigator<"u"&&/Mac/.test(navigator.platform),XE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Je=0;Je<10;Je++)dr[48+Je]=dr[96+Je]=String(Je);for(var Je=1;Je<=24;Je++)dr[Je+111]="F"+Je;for(var Je=65;Je<=90;Je++)dr[Je]=String.fromCharCode(Je+32),Ll[Je]=String.fromCharCode(Je);for(var Hc in dr)Ll.hasOwnProperty(Hc)||(Ll[Hc]=dr[Hc]);function ZE(t){var e=YE&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||XE&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ll:dr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const QE=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function ek(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))QE?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function tk(t){let e=Object.create(null);for(let n in t)e[ek(n)]=t[n];return e}function zc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function nk(t){return new ke({props:{handleKeyDown:kf(t)}})}function kf(t){let e=tk(t);return function(n,r){let o=ZE(r),i,s=e[zc(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[zc(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=dr[r.keyCode])&&i!=o){let l=e[zc(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const r0=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function o0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const rk=(t,e,n)=>{let r=o0(t,n);if(!r)return!1;let o=Mf(r);if(!o){let s=r.blockRange(),l=s&&Qo(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let i=o.nodeBefore;if(a0(t,o,e,-1))return!0;if(r.parent.content.size==0&&($o(i,"end")||Y.isSelectable(i)))for(let s=r.depth;;s--){let l=$a(t.doc,r.before(s),r.after(s),B.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection($o(i,"end")?Q.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):Y.create(a.doc,o.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},ok=(t,e,n)=>{let r=o0(t,n);if(!r)return!1;let o=Mf(r);return o?i0(t,o,e):!1},ik=(t,e,n)=>{let r=s0(t,n);if(!r)return!1;let o=Tf(r);return o?i0(t,o,e):!1};function i0(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,l=s,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=$a(t.doc,i,a,B.empty);if(!c||c.from!=i||c instanceof ze&&c.slice.size>=a-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Z.create(u.doc,i)),n(u.scrollIntoView())}return!0}function $o(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const sk=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Mf(r)}let s=i&&i.nodeBefore;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Mf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function s0(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const lk=(t,e,n)=>{let r=s0(t,n);if(!r)return!1;let o=Tf(r);if(!o)return!1;let i=o.nodeAfter;if(a0(t,o,e,1))return!0;if(r.parent.content.size==0&&($o(i,"start")||Y.isSelectable(i))){let s=$a(t.doc,r.before(),r.after(),B.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection($o(i,"start")?Q.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):Y.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},ak=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Tf(r)}let s=i&&i.nodeAfter;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,i.pos)).scrollIntoView()),!0)};function Tf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const ck=(t,e)=>{let n=t.selection,r=n instanceof Y,o;if(r){if(n.node.isTextblock||!xr(t.doc,n.from))return!1;o=n.from}else if(o=La(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Y.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},uk=(t,e)=>{let n=t.selection,r;if(n instanceof Y){if(n.node.isTextblock||!xr(t.doc,n.to))return!1;r=n.to}else if(r=La(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},dk=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Qo(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},fk=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
10
+ `).scrollIntoView()),!0)};function l0(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const hk=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=l0(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(Q.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},pk=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Nt||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=l0(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(Z.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},mk=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(To(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Qo(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},gk=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Y.create(t.doc,o))),!0)};function yk(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||xr(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function a0(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&yk(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=I.empty;for(let y=s.length-1;y>=0;y--)p=I.from(s[y].create(null,p));p=I.from(o.copy(p));let m=t.tr.step(new Ve(e.pos-1,h,e.pos,h,new B(p,1,0),s.length,!0)),g=h+2*s.length;xr(m.doc,g)&&m.join(g),n(m.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:Q.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Qo(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&$o(i,"start",!0)&&$o(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let y=I.empty;for(let S=p.length-1;S>=0;S--)y=I.from(p[S].copy(y));let w=t.tr.step(new Ve(e.pos-p.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new B(y,p.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function c0(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Z.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const bk=c0(-1),vk=c0(1);function wk(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&hf(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Yp(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function xk(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);a=new Li(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Li(o,n.doc.resolve(i.end(s.depth)),s.depth)),l=!0}let c=hf(a,t,e,s);return c?(r&&r(Sk(n.tr,s,c,l,t).scrollIntoView()),!0):!1}}function Sk(t,e,n,r,o){let i=I.empty;for(let u=n.length-1;u>=0;u--)i=I.from(n[u].type.create(n[u].attrs,i));t.step(new Ve(e.start-(r?2:0),e.end,e.start,e.end,new B(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let l=n.length-s,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&To(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function Ck(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?Ek(e,n,t,i):kk(e,n,i):!0:!1}}function Ek(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Ve(i-1,s,i,s,new B(I.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Li(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const l=Qo(r);if(l==null)return!1;o.lift(r,l);let a=o.mapping.map(i,-1)-1;return xr(o.doc,a)&&o.join(a),e(o.scrollIntoView()),!0}function kk(t,e,n){let r=t.tr,o=n.parent;for(let h=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?I.empty:I.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new Ve(d-(l?1:0),f+(a?1:0),d+1,f-1,new B((l?I.empty:I.from(o.copy(I.empty))).append(a?I.empty:I.from(o.copy(I.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Mk(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=I.from(c?t.create():null),d=new B(I.from(t.create(null,I.from(l.type.create(null,u)))),c?3:1,0),f=i.start,h=i.end;n(e.tr.step(new Ve(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function za(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class Va{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,l=[],a=!!e,c=e||i.tr,u=()=>(!a&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(c,n),y=h(...m)(g);return l.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,l={tr:e,editor:o,view:s,state:za({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class Tk{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function V(t,e,n){return t.config[e]===void 0&&t.parent?V(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?V(t.parent,e,n):null}):t.config[e]}function Wa(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function u0(t){const e=[],{nodeExtensions:n,markExtensions:r}=Wa(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:o},a=V(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...i,...h}})})})})}),o.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=V(s,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...i,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function Ue(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function le(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const l=i?i.split(" "):[],a=r[o]?r[o].split(" "):[],c=l.filter(u=>!a.includes(u));r[o]=[...a,...c].join(" ")}else o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function ed(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>le(n,r),{})}function d0(t){return typeof t=="function"}function ie(t,e=void 0,...n){return d0(t)?e?t.bind(e)(...n):t(...n):t}function Ok(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Ak(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Xp(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):Ak(n.getAttribute(s.name));return l==null?i:{...i,[s.name]:l}},{});return{...r,...o}}}}function Zp(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Ok(n)?!1:n!=null))}function Rk(t,e){var n;const r=u0(t),{nodeExtensions:o,markExtensions:i}=Wa(t),s=(n=o.find(c=>V(c,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(o.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,w)=>{const S=V(w,"extendNodeSchema",d);return{...y,...S?S(c):{}}},{}),h=Zp({...f,content:ie(V(c,"content",d)),marks:ie(V(c,"marks",d)),group:ie(V(c,"group",d)),inline:ie(V(c,"inline",d)),atom:ie(V(c,"atom",d)),selectable:ie(V(c,"selectable",d)),draggable:ie(V(c,"draggable",d)),code:ie(V(c,"code",d)),whitespace:ie(V(c,"whitespace",d)),defining:ie(V(c,"defining",d)),isolating:ie(V(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var w;return[y.name,{default:(w=y==null?void 0:y.attribute)===null||w===void 0?void 0:w.default}]}))}),p=ie(V(c,"parseHTML",d));p&&(h.parseDOM=p.map(y=>Xp(y,u)));const m=V(c,"renderHTML",d);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:ed(y,u)}));const g=V(c,"renderText",d);return g&&(h.toText=g),[c.name,h]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((g,y)=>{const w=V(y,"extendMarkSchema",d);return{...g,...w?w(c):{}}},{}),h=Zp({...f,inclusive:ie(V(c,"inclusive",d)),excludes:ie(V(c,"excludes",d)),group:ie(V(c,"group",d)),spanning:ie(V(c,"spanning",d)),code:ie(V(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),p=ie(V(c,"parseHTML",d));p&&(h.parseDOM=p.map(g=>Xp(g,u)));const m=V(c,"renderHTML",d);return m&&(h.toDOM=g=>m({mark:g,HTMLAttributes:ed(g,u)})),[c.name,h]}));return new sb({topNode:s,nodes:l,marks:a})}function Vc(t,e){return e.nodes[t]||e.marks[t]||null}function Qp(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const Nk=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;const u=((c=(a=o.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function Of(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ua{constructor(e){this.find=e.find,this.handler=e.handler}}const Dk=(t,e)=>{if(Of(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ps(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=Nk(c)+i;return s.forEach(f=>{if(u)return;const h=Dk(d,f.find);if(!h)return;const p=a.state.tr,m=za({state:a.state,transaction:p}),g={from:r-(h[0].length-i.length),to:o},{commands:y,chain:w,can:S}=new Va({editor:n,state:m});f.handler({state:m,range:g,match:h,commands:y,chain:w,can:S})===null||!p.steps.length||(p.setMeta(l,{transform:p,from:r,to:o,text:i}),a.dispatch(p),u=!0)}),u}function _k(t){const{editor:e,rules:n}=t,r=new ke({state:{init(){return null},apply(o,i){const s=o.getMeta(r);if(s)return s;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{const{from:c,text:u}=l,d=c+u.length;Ps({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return Ps({editor:e,from:i,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Ps({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Ps({editor:e,from:s.pos,to:s.pos,text:`
11
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Ik(t){return typeof t=="number"}class Pk{constructor(e){this.find=e.find,this.handler=e.handler}}const Lk=(t,e,n)=>{if(Of(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function $k(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Va({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(r,p),g=Math.min(o,p+h.content.size),y=h.textBetween(m-p,g-p,void 0,"");Lk(y,i.find,s).forEach(S=>{if(S.index===void 0)return;const b=m+S.index+1,C=b+S[0].length,x={from:n.tr.mapping.map(b),to:n.tr.mapping.map(C)},k=i.handler({state:n,range:x,match:S,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(k)})}),d.every(h=>h!==null)}const Bk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function Fk(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l=typeof DragEvent<"u"?new DragEvent("drop"):null;const a=({state:u,from:d,to:f,rule:h,pasteEvt:p})=>{const m=u.tr,g=za({state:u,transaction:m});if(!(!$k({editor:e,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:l})||!m.steps.length))return l=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return n.map(u=>new ke({view(d){const f=h=>{var p;r=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(d,f)=>(i=r===d.dom.parentElement,l=f,!1),paste:(d,f)=>{var h;const p=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=f,o=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!o,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),w=!!y;if(!m&&!g&&!w)return;if(w){const{from:C,text:x}=y,k=C+x.length,A=Bk(x);return a({rule:u,state:h,from:C,to:{b:k},pasteEvt:A})}const S=f.doc.content.findDiffStart(h.doc.content),b=f.doc.content.findDiffEnd(h.doc.content);if(!(!Ik(S)||!b||S===b.b))return a({rule:u,state:h,from:S,to:b,pasteEvt:s})}}))}function jk(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class ko{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=ko.resolve(e),this.schema=Rk(this.extensions,n),this.setupExtensions()}static resolve(e){const n=ko.sort(ko.flatten(e)),r=jk(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=V(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=V(r,"priority")||100,s=V(o,"priority")||100;return i>s?-1:i<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Vc(n.name,this.schema)},o=V(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=ko.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:Vc(s.name,this.schema)},a=[],c=V(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&V(s,"exitable",l)&&(u.ArrowRight=()=>nt.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:e})]));u={...u,...m}}const d=nk(u);a.push(d);const f=V(s,"addInputRules",l);Qp(s,e.options.enableInputRules)&&f&&r.push(...f());const h=V(s,"addPasteRules",l);Qp(s,e.options.enablePasteRules)&&h&&o.push(...h());const p=V(s,"addProseMirrorPlugins",l);if(p){const m=p();a.push(...m)}return a}).flat();return[_k({editor:e,rules:r}),...Fk({editor:e,rules:o}),...i]}get attributes(){return u0(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Wa(this.extensions);return Object.fromEntries(n.filter(r=>!!V(r,"addNodeView")).map(r=>{const o=this.attributes.filter(a=>a.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ue(r.name,this.schema)},s=V(r,"addNodeView",i);if(!s)return[];const l=(a,c,u,d)=>{const f=ed(a,o);return s()({editor:e,node:a,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Vc(e.name,this.schema)};e.type==="mark"&&(!((n=ie(V(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=V(e,"onBeforeCreate",r),i=V(e,"onCreate",r),s=V(e,"onUpdate",r),l=V(e,"onSelectionUpdate",r),a=V(e,"onTransaction",r),c=V(e,"onFocus",r),u=V(e,"onBlur",r),d=V(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}function Hk(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ls(t){return Hk(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Ka(t,e){const n={...t};return Ls(t)&&Ls(e)&&Object.keys(e).forEach(r=>{Ls(e[r])&&Ls(t[r])?n[r]=Ka(t[r],e[r]):n[r]=e[r]}),n}class Ie{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(V(this,"addOptions",{name:this.name}))),this.storage=ie(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ie(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ka(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ie({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(V(n,"addOptions",{name:n.name})),n.storage=ie(V(n,"addStorage",{name:n.name,options:n.options})),n}}function f0(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=`
12
12
 
13
- `,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,o,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=i);const h=s==null?void 0:s[a.type.name];if(h)return u&&(l+=h({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,o-c))}),l}function h0(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const zk=Ie.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ke({key:new we("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),a=h0(n);return f0(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Vk=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Wk=(t=!1)=>({commands:e})=>e.setContent("",t),Uk=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Qo(h);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Kk=t=>e=>t(e),Gk=()=>({state:t,dispatch:e})=>pk(t,e),qk=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new X(r.doc.resolve(s-1))),!0},Jk=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const l=o.before(i),a=o.after(i);t.delete(l,a).scrollIntoView()}return!0}return!1},Yk=t=>({tr:e,state:n,dispatch:r})=>{const o=Ue(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const a=i.before(s),c=i.after(s);e.delete(a,c).scrollIntoView()}return!0}return!1},Xk=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},Zk=()=>({state:t,dispatch:e})=>r0(t,e),Qk=()=>({commands:t})=>t.keyboardShortcut("Enter"),eM=()=>({state:t,dispatch:e})=>hk(t,e);function Bl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Tf(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function ed(t,e,n={}){return t.find(r=>r.type===e&&Bl(r.attrs,n))}function tM(t,e,n={}){return!!ed(t,e,n)}function qa(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=ed([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,l=i+1,a=s+r.node.nodeSize;for(ed([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&tM([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function Cr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const nM=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Cr(t,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:u}=l;if(o){const d=qa(a,i,e);if(d&&d.from<=c&&d.to>=u){const f=X.create(s,d.from,d.to);n.setSelection(f)}}return!0},rM=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Of(t){return t instanceof X}function kn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function p0(t,e=null){if(!e)return null;const n=Q.atStart(t),r=Q.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,i=r.to;return e==="all"?X.create(t,kn(0,o,i),kn(t.content.size,o,i)):X.create(t,kn(e,o,i),kn(e,o,i))}function Ja(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const oM=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Ja()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!Of(n.state.selection))return s(),!0;const l=p0(o.doc,t)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},iM=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),sM=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),m0=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&m0(r)}return t};function $s(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return m0(n)}function Fl(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?P.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Fl("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,l="";const a=new sb({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?wi.fromSchema(a).parseSlice($s(t),n.parseOptions):wi.fromSchema(a).parse($s(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=wi.fromSchema(e);return n.slice?i.parseSlice($s(t),n.parseOptions).content:i.parse($s(t),n.parseOptions)}return Fl("",e,n)}function lM(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof ze||o instanceof Ve))return;const i=t.mapping.maps[r];let s=0;i.forEach((l,a,c,u)=>{s===0&&(s=u)}),t.setSelection(Q.near(t.doc.resolve(s),n))}const aM=t=>!("type"in t),cM=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=Fl(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(p){return i.emit("contentError",{editor:i,error:p,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:a,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((aM(l)?l:[l]).forEach(p=>{p.check(),u=u?p.isText&&p.marks.length===0:!1,d=d?p.isBlock:!1}),a===c&&d){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,c+=1)}let h;u?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,a,c)):(h=l,r.replaceWith(a,c,h)),n.updateSelection&&lM(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:h})}return!0},uM=()=>({state:t,dispatch:e})=>ck(t,e),dM=()=>({state:t,dispatch:e})=>uk(t,e),fM=()=>({state:t,dispatch:e})=>rk(t,e),hM=()=>({state:t,dispatch:e})=>lk(t,e),pM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=$a(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},mM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=$a(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},gM=()=>({state:t,dispatch:e})=>ok(t,e),yM=()=>({state:t,dispatch:e})=>ik(t,e);function g0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function bM(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))Ja()||g0()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const vM=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=bM(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function zi(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Ue(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),p=Math.min(o,f+d.nodeSize);l.push({node:d,from:h,to:p})});const a=o-r,c=l.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Bl(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const wM=(t,e={})=>({state:n,dispatch:r})=>{const o=Ue(t,n.schema);return zi(n,o,e)?dk(n,r):!1},xM=()=>({state:t,dispatch:e})=>mk(t,e),SM=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return Ck(r)(e,n)},CM=()=>({state:t,dispatch:e})=>fk(t,e);function Ya(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function em(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const EM=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=Ya(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(i=Ue(t,r.schema)),l==="mark"&&(s=Cr(t,r.schema)),o&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,em(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(em(d.attrs,e)))})})}),!0):!1},kM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),MM=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),TM=()=>({state:t,dispatch:e})=>sk(t,e),OM=()=>({state:t,dispatch:e})=>ak(t,e),AM=()=>({state:t,dispatch:e})=>gk(t,e),RM=()=>({state:t,dispatch:e})=>vk(t,e),NM=()=>({state:t,dispatch:e})=>bk(t,e);function td(t,e,n={},r={}){return Fl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const DM=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{var a,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const d=td(t,o.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function vs(t,e){const n=Cr(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,a=>{s.push(...a.marks)});const l=s.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function _M(t,e){const n=new hf(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function IM(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function nd(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function PM(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function y0(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Af(t){return e=>y0(e.$from,t)}function LM(t,e){const n=no.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function $M(t,e){const n={from:0,to:t.content.size};return f0(t,n,e)}function BM(t,e){const n=Ue(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});const s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function b0(t,e){const n=Ya(typeof e=="string"?e:e.name,t.schema);return n==="node"?BM(t,e):n==="mark"?vs(t,e):{}}function FM(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function jM(t){const e=FM(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function HM(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{const{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),jM(r)}function Rf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=qa(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function hl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function rd(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Cr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Bl(d.attrs,n,{strict:!1}));let s=0;const l=[];if(o.forEach(({$from:d,$to:f})=>{const h=d.pos,p=f.pos;t.doc.nodesBetween(h,p,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,g),x=Math.min(p,g+m.nodeSize),S=x-y;s+=S,l.push(...m.marks.map(b=>({mark:b,from:y,to:x})))})}),s===0)return!1;const a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Bl(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=s}function v0(t,e,n={}){if(!e)return zi(t,null,n)||rd(t,null,n);const r=Ya(e,t.schema);return r==="node"?zi(t,e,n):r==="mark"?rd(t,e,n):!1}function od(t,e){const{nodeExtensions:n}=Ua(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=se(V(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Nf(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Nf(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function w0(t){return t instanceof J}function zM(t,e,n){const o=t.state.doc.content.size,i=kn(e,0,o),s=kn(n,0,o),l=t.coordsAtPos(i),a=t.coordsAtPos(s,-1),c=Math.min(l.top,a.top),u=Math.max(l.bottom,a.bottom),d=Math.min(l.left,a.left),f=Math.max(l.right,a.right),h=f-d,p=u-c,y={top:c,bottom:u,left:d,right:f,width:h,height:p,x:d,y:c};return{...y,toJSON:()=>y}}function VM(t,e,n){var r;const{selection:o}=e;let i=null;if(Of(o)&&(i=o.$cursor),i){const l=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(l)||!l.some(a=>a.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=h&&p}return!c}),c})}const WM=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:l}=i,a=Cr(t,r.schema);if(o)if(s){const c=vs(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),m=Math.min(h+f.nodeSize,d);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&n.addMark(p,m,a.create({...y.attrs,...e}))}):n.addMark(p,m,a.create(e))})});return VM(r,n,a)},UM=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),KM=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Ue(t,n.schema);return i.isTextblock?o().command(({commands:s})=>Yp(i,e)(n)?!0:s.clearNodes()).command(({state:s})=>Yp(i,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},GM=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=kn(t,0,r.content.size),i=J.create(r,o);e.setSelection(i)}return!0},qM=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=X.atStart(r).from,l=X.atEnd(r).to,a=kn(o,s,l),c=kn(i,s,l),u=X.create(r,a,c);e.setSelection(u)}return!0},JM=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return Mk(r)(e,n)};function tm(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const YM=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:l,$to:a}=i,c=o.extensionManager.attributes,u=hl(c,l.node().type.name,l.node().attrs);if(i instanceof J&&i.node.isBlock)return!l.parentOffset||!Oo(s,l.pos)?!1:(r&&(t&&tm(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:IM(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=Oo(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&Oo(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(p&&(i instanceof X&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&tm(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return p},XM=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=Ue(t,n.schema),{$from:l,$to:a}=n.selection,c=n.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==s)return!1;const d=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let g=P.empty;const y=l.index(-1)?1:l.index(-2)?2:3;for(let k=l.depth-y;k>=l.depth-3;k-=1)g=P.from(l.node(k).copy(g));const x=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,S=hl(d,l.node().type.name,l.node().attrs),b=((i=s.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(S))||void 0;g=g.append(P.from(s.createAndFill(null,b)||void 0));const C=l.before(l.depth-(y-1));e.replace(C,l.after(-x),new B(g,4-y,0));let w=-1;e.doc.nodesBetween(C,e.doc.content.size,(k,R)=>{if(w>-1)return!1;k.isTextblock&&k.content.size===0&&(w=R+1)}),w>-1&&e.setSelection(X.near(e.doc.resolve(w))),e.scrollIntoView()}return!0}const f=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,h=hl(d,u.type.name,u.attrs),p=hl(d,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const m=f?[{type:s,attrs:h},{type:f,attrs:p}]:[{type:s,attrs:h}];if(!Oo(e.doc,l.pos,2))return!1;if(r){const{selection:g,storedMarks:y}=n,{splittableMarks:x}=o.extensionManager,S=y||g.$to.parentOffset&&g.$from.marks();if(e.split(l.pos,2,m).scrollIntoView(),!S||!r)return!0;const b=S.filter(C=>x.includes(C.type.name));e.ensureMarks(b)}return!0},Wc=(t,e)=>{const n=Af(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&xr(t.doc,n.pos)&&t.join(n.pos),!0},Uc=(t,e)=>{const n=Af(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&xr(t.doc,r)&&t.join(r),!0},ZM=(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,h=Ue(t,s.schema),p=Ue(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:x}=m,S=y.blockRange(x),b=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;const C=Af(w=>od(w.type.name,d))(m);if(S.depth>=1&&C&&S.depth-C.depth<=1){if(C.node.type===h)return c.liftListItem(p);if(od(C.node.type.name,d)&&h.validContent(C.node.content)&&l)return a().command(()=>(i.setNodeMarkup(C.pos,h),!0)).command(()=>Wc(i,h)).command(()=>Uc(i,h)).run()}return!n||!b||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>Wc(i,h)).command(()=>Uc(i,h)).run():a().command(()=>{const w=u().wrapInList(h,r),k=b.filter(R=>f.includes(R.type.name));return i.ensureMarks(k),w?!0:c.clearNodes()}).wrapInList(h,r).command(()=>Wc(i,h)).command(()=>Uc(i,h)).run()},QM=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Cr(t,r.schema);return rd(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},eT=(t,e,n={})=>({state:r,commands:o})=>{const i=Ue(t,r.schema),s=Ue(e,r.schema);return zi(r,i,n)?o.setNode(s):o.setNode(i,n)},tT=(t,e={})=>({state:n,commands:r})=>{const o=Ue(t,n.schema);return zi(n,o,e)?r.lift(o):r.wrapIn(o,e)},nT=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,l=i.transform;for(let a=l.steps.length-1;a>=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,a))}else s.delete(i.from,i.to)}return!0}}return!1},rT=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},oT=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,a=Cr(t,r.schema),{$from:c,empty:u,ranges:d}=l;if(!o)return!0;if(u&&s){let{from:f,to:h}=l;const p=(i=c.marks().find(g=>g.type===a))===null||i===void 0?void 0:i.attrs,m=qa(c,a,p);m&&(f=m.from,h=m.to),n.removeMark(f,h,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},iT=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=Ya(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(i=Ue(t,r.schema)),l==="mark"&&(s=Cr(t,r.schema)),o&&n.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{i&&i===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(h=>{if(s===h.type){const p=Math.max(f,c),m=Math.min(f+d.nodeSize,u);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},sT=(t,e={})=>({state:n,dispatch:r})=>{const o=Ue(t,n.schema);return wk(o,e)(n,r)},lT=(t,e={})=>({state:n,dispatch:r})=>{const o=Ue(t,n.schema);return xk(o,e)(n,r)};var aT=Object.freeze({__proto__:null,blur:Vk,clearContent:Wk,clearNodes:Uk,command:Kk,createParagraphNear:Gk,cut:qk,deleteCurrentNode:Jk,deleteNode:Yk,deleteRange:Xk,deleteSelection:Zk,enter:Qk,exitCode:eM,extendMarkRange:nM,first:rM,focus:oM,forEach:iM,insertContent:sM,insertContentAt:cM,joinBackward:fM,joinDown:dM,joinForward:hM,joinItemBackward:pM,joinItemForward:mM,joinTextblockBackward:gM,joinTextblockForward:yM,joinUp:uM,keyboardShortcut:vM,lift:wM,liftEmptyBlock:xM,liftListItem:SM,newlineInCode:CM,resetAttributes:EM,scrollIntoView:kM,selectAll:MM,selectNodeBackward:TM,selectNodeForward:OM,selectParentNode:AM,selectTextblockEnd:RM,selectTextblockStart:NM,setContent:DM,setMark:WM,setMeta:UM,setNode:KM,setNodeSelection:GM,setTextSelection:qM,sinkListItem:JM,splitBlock:YM,splitListItem:XM,toggleList:ZM,toggleMark:QM,toggleNode:eT,toggleWrap:tT,undoInputRule:nT,unsetAllMarks:rT,unsetMark:oT,updateAttributes:iT,wrapIn:sT,wrapInList:lT});const cT=Ie.create({name:"commands",addCommands(){return{...aT}}}),uT=Ie.create({name:"editable",addProseMirrorPlugins(){return[new ke({key:new we("editable"),props:{editable:()=>this.editor.options.editable}})]}}),dT=Ie.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ke({key:new we("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),fT=Ie.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:Q.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ja()||g0()?i:o},addProseMirrorPlugins(){return[new ke({key:new we("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:o,from:i,to:s}=e.selection,l=Q.atStart(e.doc).from,a=Q.atEnd(e.doc).to;if(o||!(i===l&&s===a)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const d=n.tr,f=Va({state:n,transaction:d}),{commands:h}=new Wa({editor:this.editor,state:f});if(h.clearNodes(),!!d.steps.length)return d}})]}}),hT=Ie.create({name:"tabindex",addProseMirrorPlugins(){return[new ke({key:new we("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Dr{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Dr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Dr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Dr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=this.pos+r+1,s=this.resolvedPos.doc.resolve(i);if(!o&&s.depth<=this.depth)return;const l=new Dr(s,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new Dr(s,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const a=s[l];if(i[a]!==n[a])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(a=>n[a]===s.node.attrs[a])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const pT=`.ProseMirror {
13
+ `,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,o,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=i);const h=s==null?void 0:s[a.type.name];if(h)return u&&(l+=h({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,o-c))}),l}function h0(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const zk=Ie.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ke({key:new we("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),a=h0(n);return f0(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Vk=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Wk=(t=!1)=>({commands:e})=>e.setContent("",t),Uk=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Qo(h);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Kk=t=>e=>t(e),Gk=()=>({state:t,dispatch:e})=>pk(t,e),qk=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Z(r.doc.resolve(s-1))),!0},Jk=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const l=o.before(i),a=o.after(i);t.delete(l,a).scrollIntoView()}return!0}return!1},Yk=t=>({tr:e,state:n,dispatch:r})=>{const o=Ue(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const a=i.before(s),c=i.after(s);e.delete(a,c).scrollIntoView()}return!0}return!1},Xk=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},Zk=()=>({state:t,dispatch:e})=>r0(t,e),Qk=()=>({commands:t})=>t.keyboardShortcut("Enter"),eM=()=>({state:t,dispatch:e})=>hk(t,e);function $l(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Of(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function td(t,e,n={}){return t.find(r=>r.type===e&&$l(r.attrs,n))}function tM(t,e,n={}){return!!td(t,e,n)}function Ga(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=td([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,l=i+1,a=s+r.node.nodeSize;for(td([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&tM([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function Cr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const nM=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Cr(t,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:u}=l;if(o){const d=Ga(a,i,e);if(d&&d.from<=c&&d.to>=u){const f=Z.create(s,d.from,d.to);n.setSelection(f)}}return!0},rM=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Af(t){return t instanceof Z}function kn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function p0(t,e=null){if(!e)return null;const n=Q.atStart(t),r=Q.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,i=r.to;return e==="all"?Z.create(t,kn(0,o,i),kn(t.content.size,o,i)):Z.create(t,kn(e,o,i),kn(e,o,i))}function qa(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const oM=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{qa()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!Af(n.state.selection))return s(),!0;const l=p0(o.doc,t)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},iM=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),sM=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),m0=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&m0(r)}return t};function $s(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return m0(n)}function Bl(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?I.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Bl("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,l="";const a=new sb({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?wi.fromSchema(a).parseSlice($s(t),n.parseOptions):wi.fromSchema(a).parse($s(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=wi.fromSchema(e);return n.slice?i.parseSlice($s(t),n.parseOptions).content:i.parse($s(t),n.parseOptions)}return Bl("",e,n)}function lM(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof ze||o instanceof Ve))return;const i=t.mapping.maps[r];let s=0;i.forEach((l,a,c,u)=>{s===0&&(s=u)}),t.setSelection(Q.near(t.doc.resolve(s),n))}const aM=t=>!("type"in t),cM=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=Bl(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(p){return i.emit("contentError",{editor:i,error:p,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:a,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((aM(l)?l:[l]).forEach(p=>{p.check(),u=u?p.isText&&p.marks.length===0:!1,d=d?p.isBlock:!1}),a===c&&d){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,c+=1)}let h;u?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,a,c)):(h=l,r.replaceWith(a,c,h)),n.updateSelection&&lM(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:h})}return!0},uM=()=>({state:t,dispatch:e})=>ck(t,e),dM=()=>({state:t,dispatch:e})=>uk(t,e),fM=()=>({state:t,dispatch:e})=>rk(t,e),hM=()=>({state:t,dispatch:e})=>lk(t,e),pM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=La(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},mM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=La(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},gM=()=>({state:t,dispatch:e})=>ok(t,e),yM=()=>({state:t,dispatch:e})=>ik(t,e);function g0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function bM(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))qa()||g0()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const vM=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=bM(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function zi(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Ue(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),p=Math.min(o,f+d.nodeSize);l.push({node:d,from:h,to:p})});const a=o-r,c=l.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>$l(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const wM=(t,e={})=>({state:n,dispatch:r})=>{const o=Ue(t,n.schema);return zi(n,o,e)?dk(n,r):!1},xM=()=>({state:t,dispatch:e})=>mk(t,e),SM=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return Ck(r)(e,n)},CM=()=>({state:t,dispatch:e})=>fk(t,e);function Ja(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function em(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const EM=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=Ja(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(i=Ue(t,r.schema)),l==="mark"&&(s=Cr(t,r.schema)),o&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,em(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(em(d.attrs,e)))})})}),!0):!1},kM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),MM=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),TM=()=>({state:t,dispatch:e})=>sk(t,e),OM=()=>({state:t,dispatch:e})=>ak(t,e),AM=()=>({state:t,dispatch:e})=>gk(t,e),RM=()=>({state:t,dispatch:e})=>vk(t,e),NM=()=>({state:t,dispatch:e})=>bk(t,e);function nd(t,e,n={},r={}){return Bl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const DM=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{var a,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const d=nd(t,o.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function vs(t,e){const n=Cr(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,a=>{s.push(...a.marks)});const l=s.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function _M(t,e){const n=new pf(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function IM(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function rd(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function PM(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function y0(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Rf(t){return e=>y0(e.$from,t)}function LM(t,e){const n=to.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function $M(t,e){const n={from:0,to:t.content.size};return f0(t,n,e)}function BM(t,e){const n=Ue(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});const s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function b0(t,e){const n=Ja(typeof e=="string"?e:e.name,t.schema);return n==="node"?BM(t,e):n==="mark"?vs(t,e):{}}function FM(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function jM(t){const e=FM(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function HM(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{const{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),jM(r)}function Nf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=Ga(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function fl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function od(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Cr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>$l(d.attrs,n,{strict:!1}));let s=0;const l=[];if(o.forEach(({$from:d,$to:f})=>{const h=d.pos,p=f.pos;t.doc.nodesBetween(h,p,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,g),w=Math.min(p,g+m.nodeSize),S=w-y;s+=S,l.push(...m.marks.map(b=>({mark:b,from:y,to:w})))})}),s===0)return!1;const a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>$l(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=s}function v0(t,e,n={}){if(!e)return zi(t,null,n)||od(t,null,n);const r=Ja(e,t.schema);return r==="node"?zi(t,e,n):r==="mark"?od(t,e,n):!1}function id(t,e){const{nodeExtensions:n}=Wa(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=ie(V(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Df(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Df(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function w0(t){return t instanceof Y}function zM(t,e,n){const o=t.state.doc.content.size,i=kn(e,0,o),s=kn(n,0,o),l=t.coordsAtPos(i),a=t.coordsAtPos(s,-1),c=Math.min(l.top,a.top),u=Math.max(l.bottom,a.bottom),d=Math.min(l.left,a.left),f=Math.max(l.right,a.right),h=f-d,p=u-c,y={top:c,bottom:u,left:d,right:f,width:h,height:p,x:d,y:c};return{...y,toJSON:()=>y}}function VM(t,e,n){var r;const{selection:o}=e;let i=null;if(Af(o)&&(i=o.$cursor),i){const l=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(l)||!l.some(a=>a.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=h&&p}return!c}),c})}const WM=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:l}=i,a=Cr(t,r.schema);if(o)if(s){const c=vs(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),m=Math.min(h+f.nodeSize,d);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&n.addMark(p,m,a.create({...y.attrs,...e}))}):n.addMark(p,m,a.create(e))})});return VM(r,n,a)},UM=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),KM=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Ue(t,n.schema);return i.isTextblock?o().command(({commands:s})=>Yp(i,e)(n)?!0:s.clearNodes()).command(({state:s})=>Yp(i,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},GM=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=kn(t,0,r.content.size),i=Y.create(r,o);e.setSelection(i)}return!0},qM=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=Z.atStart(r).from,l=Z.atEnd(r).to,a=kn(o,s,l),c=kn(i,s,l),u=Z.create(r,a,c);e.setSelection(u)}return!0},JM=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return Mk(r)(e,n)};function tm(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const YM=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:l,$to:a}=i,c=o.extensionManager.attributes,u=fl(c,l.node().type.name,l.node().attrs);if(i instanceof Y&&i.node.isBlock)return!l.parentOffset||!To(s,l.pos)?!1:(r&&(t&&tm(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:IM(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=To(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&To(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(p&&(i instanceof Z&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&tm(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return p},XM=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const l=Ue(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let y=I.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-w;A>=a.depth-3;A-=1)y=I.from(a.node(A).copy(y));const S=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,b={...fl(f,a.node().type.name,a.node().attrs),...e},C=((s=l.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;y=y.append(I.from(l.createAndFill(null,C)||void 0));const x=a.before(a.depth-(w-1));n.replace(x,a.after(-S),new B(y,4-w,0));let k=-1;n.doc.nodesBetween(x,n.doc.content.size,(A,E)=>{if(k>-1)return!1;A.isTextblock&&A.content.size===0&&(k=E+1)}),k>-1&&n.setSelection(Z.near(n.doc.resolve(k))),n.scrollIntoView()}return!0}const h=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,p={...fl(f,d.type.name,d.attrs),...e},m={...fl(f,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const g=h?[{type:l,attrs:p},{type:h,attrs:m}]:[{type:l,attrs:p}];if(!To(n.doc,a.pos,2))return!1;if(o){const{selection:y,storedMarks:w}=r,{splittableMarks:S}=i.extensionManager,b=w||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!b||!o)return!0;const C=b.filter(x=>S.includes(x.type.name));n.ensureMarks(C)}return!0},Wc=(t,e)=>{const n=Rf(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&xr(t.doc,n.pos)&&t.join(n.pos),!0},Uc=(t,e)=>{const n=Rf(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&xr(t.doc,r)&&t.join(r),!0},ZM=(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,h=Ue(t,s.schema),p=Ue(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:w}=m,S=y.blockRange(w),b=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;const C=Rf(x=>id(x.type.name,d))(m);if(S.depth>=1&&C&&S.depth-C.depth<=1){if(C.node.type===h)return c.liftListItem(p);if(id(C.node.type.name,d)&&h.validContent(C.node.content)&&l)return a().command(()=>(i.setNodeMarkup(C.pos,h),!0)).command(()=>Wc(i,h)).command(()=>Uc(i,h)).run()}return!n||!b||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>Wc(i,h)).command(()=>Uc(i,h)).run():a().command(()=>{const x=u().wrapInList(h,r),k=b.filter(A=>f.includes(A.type.name));return i.ensureMarks(k),x?!0:c.clearNodes()}).wrapInList(h,r).command(()=>Wc(i,h)).command(()=>Uc(i,h)).run()},QM=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Cr(t,r.schema);return od(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},eT=(t,e,n={})=>({state:r,commands:o})=>{const i=Ue(t,r.schema),s=Ue(e,r.schema);return zi(r,i,n)?o.setNode(s):o.setNode(i,n)},tT=(t,e={})=>({state:n,commands:r})=>{const o=Ue(t,n.schema);return zi(n,o,e)?r.lift(o):r.wrapIn(o,e)},nT=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,l=i.transform;for(let a=l.steps.length-1;a>=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,a))}else s.delete(i.from,i.to)}return!0}}return!1},rT=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},oT=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,a=Cr(t,r.schema),{$from:c,empty:u,ranges:d}=l;if(!o)return!0;if(u&&s){let{from:f,to:h}=l;const p=(i=c.marks().find(g=>g.type===a))===null||i===void 0?void 0:i.attrs,m=Ga(c,a,p);m&&(f=m.from,h=m.to),n.removeMark(f,h,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},iT=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=Ja(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(i=Ue(t,r.schema)),l==="mark"&&(s=Cr(t,r.schema)),o&&n.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{i&&i===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(h=>{if(s===h.type){const p=Math.max(f,c),m=Math.min(f+d.nodeSize,u);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},sT=(t,e={})=>({state:n,dispatch:r})=>{const o=Ue(t,n.schema);return wk(o,e)(n,r)},lT=(t,e={})=>({state:n,dispatch:r})=>{const o=Ue(t,n.schema);return xk(o,e)(n,r)};var aT=Object.freeze({__proto__:null,blur:Vk,clearContent:Wk,clearNodes:Uk,command:Kk,createParagraphNear:Gk,cut:qk,deleteCurrentNode:Jk,deleteNode:Yk,deleteRange:Xk,deleteSelection:Zk,enter:Qk,exitCode:eM,extendMarkRange:nM,first:rM,focus:oM,forEach:iM,insertContent:sM,insertContentAt:cM,joinBackward:fM,joinDown:dM,joinForward:hM,joinItemBackward:pM,joinItemForward:mM,joinTextblockBackward:gM,joinTextblockForward:yM,joinUp:uM,keyboardShortcut:vM,lift:wM,liftEmptyBlock:xM,liftListItem:SM,newlineInCode:CM,resetAttributes:EM,scrollIntoView:kM,selectAll:MM,selectNodeBackward:TM,selectNodeForward:OM,selectParentNode:AM,selectTextblockEnd:RM,selectTextblockStart:NM,setContent:DM,setMark:WM,setMeta:UM,setNode:KM,setNodeSelection:GM,setTextSelection:qM,sinkListItem:JM,splitBlock:YM,splitListItem:XM,toggleList:ZM,toggleMark:QM,toggleNode:eT,toggleWrap:tT,undoInputRule:nT,unsetAllMarks:rT,unsetMark:oT,updateAttributes:iT,wrapIn:sT,wrapInList:lT});const cT=Ie.create({name:"commands",addCommands(){return{...aT}}}),uT=Ie.create({name:"editable",addProseMirrorPlugins(){return[new ke({key:new we("editable"),props:{editable:()=>this.editor.options.editable}})]}}),dT=Ie.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ke({key:new we("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),fT=Ie.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:Q.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return qa()||g0()?i:o},addProseMirrorPlugins(){return[new ke({key:new we("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:o,from:i,to:s}=e.selection,l=Q.atStart(e.doc).from,a=Q.atEnd(e.doc).to;if(o||!(i===l&&s===a)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const d=n.tr,f=za({state:n,transaction:d}),{commands:h}=new Va({editor:this.editor,state:f});if(h.clearNodes(),!!d.steps.length)return d}})]}}),hT=Ie.create({name:"tabindex",addProseMirrorPlugins(){return[new ke({key:new we("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Dr{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Dr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Dr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Dr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=this.pos+r+1,s=this.resolvedPos.doc.resolve(i);if(!o&&s.depth<=this.depth)return;const l=new Dr(s,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new Dr(s,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const a=s[l];if(i[a]!==n[a])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(a=>n[a]===s.node.attrs[a])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const pT=`.ProseMirror {
14
14
  position: relative;
15
15
  }
16
16
 
@@ -39,8 +39,8 @@ img.ProseMirror-separator {
39
39
  display: inline !important;
40
40
  border: none !important;
41
41
  margin: 0 !important;
42
- width: 1px !important;
43
- height: 1px !important;
42
+ width: 0 !important;
43
+ height: 0 !important;
44
44
  }
45
45
 
46
46
  .ProseMirror-gapcursor {
@@ -84,323 +84,323 @@ img.ProseMirror-separator {
84
84
 
85
85
  .tippy-box[data-animation=fade][data-state=hidden] {
86
86
  opacity: 0
87
- }`;function mT(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let gT=class extends Tk{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=mT(pT,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=d0(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[uT,zk.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),cT,dT,fT,hT]:[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Mo(o,this)}createCommandManager(){this.commandManager=new Wa({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=td(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=td(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=p0(e,this.options.autofocus);this.view=new GE(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ko.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return b0(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return v0(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return LM(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
87
+ }`;function mT(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}class gT extends Tk{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=mT(pT,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=d0(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[uT,zk.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),cT,dT,fT,hT]:[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new ko(o,this)}createCommandManager(){this.commandManager=new Va({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=nd(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=nd(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=p0(e,this.options.autofocus);this.view=new GE(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Eo.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return b0(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return v0(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return LM(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
88
88
 
89
- `,textSerializers:r={}}=e||{};return $M(this.state.doc,{blockSeparator:n,textSerializers:{...h0(this.schema),...r}})}get isEmpty(){return Nf(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Dr(n,this)}get $doc(){return this.$pos(0)}};function qr(t){return new Ka({find:t.find,handler:({state:e,range:n,match:r})=>{const o=se(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],l=r[0];if(s){const a=l.search(/\S/),c=n.from+l.indexOf(s),u=c+s.length;if(Rf(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+a,c);const f=n.from+a+s.length;i.addMark(n.from+a,f,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function x0(t){return new Ka({find:t.find,handler:({state:e,range:n,match:r})=>{const o=se(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let l=n.to;const a=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()}})}function id(t){return new Ka({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=se(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Bo(t){return new Ka({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=se(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),c=a&&ff(a,t.type,i);if(!c)return null;if(s.wrap(a,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>h.includes(g.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&xr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class nt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ga(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new nt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=se(V(n,"addOptions",{name:n.name})),n.storage=se(V(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=s.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}let Ne=class sd{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=se(V(this,"addOptions",{name:this.name}))),this.storage=se(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new sd(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ga(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new sd(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=se(V(n,"addOptions",{name:n.name})),n.storage=se(V(n,"addStorage",{name:n.name,options:n.options})),n}};function yT(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class bT{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,o,i,s,l,a;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let f=0,h=0;if(this.dom!==d){const g=this.dom.getBoundingClientRect(),y=d.getBoundingClientRect(),x=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,S=(s=e.offsetY)!==null&&s!==void 0?s:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;f=y.x-g.x+x,h=y.y-g.y+S}(a=e.dataTransfer)===null||a===void 0||a.setDragImage(this.dom,f,h);const p=J.create(c.state.doc,this.getPos()),m=c.state.tr.setSelection(p);c.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=J.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!u&&d&&i&&e.preventDefault(),u&&i&&!c)return e.preventDefault(),!1;if(u&&a&&!c&&m){const g=r.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||f||h||p||m&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Ja()||yT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function fr(t){return new Pk({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=se(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),d=n.from+a.indexOf(l),f=d+l.length;if(Rf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+u,d),c=n.from+u+l.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function vT(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const wT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ST=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,CT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ET=nt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[qr({find:wT,type:this.type}),qr({find:ST,type:this.type})]},addPasteRules(){return[fr({find:xT,type:this.type}),fr({find:CT,type:this.type})]}});/**
90
- * @license lucide-react v0.417.0 - ISC
89
+ `,textSerializers:r={}}=e||{};return $M(this.state.doc,{blockSeparator:n,textSerializers:{...h0(this.schema),...r}})}get isEmpty(){return Df(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Dr(n,this)}get $doc(){return this.$pos(0)}}function Gr(t){return new Ua({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],l=r[0];if(s){const a=l.search(/\S/),c=n.from+l.indexOf(s),u=c+s.length;if(Nf(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+a,c);const f=n.from+a+s.length;i.addMark(n.from+a,f,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function x0(t){return new Ua({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let l=n.to;const a=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()}})}function sd(t){return new Ua({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=ie(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Bo(t){return new Ua({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=ie(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),c=a&&hf(a,t.type,i);if(!c)return null;if(s.wrap(a,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>h.includes(g.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&xr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class nt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(V(this,"addOptions",{name:this.name}))),this.storage=ie(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ka(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new nt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(V(n,"addOptions",{name:n.name})),n.storage=ie(V(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=s.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}let Ne=class ld{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(V(this,"addOptions",{name:this.name}))),this.storage=ie(V(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ld(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ka(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ld(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(V(n,"addOptions",{name:n.name})),n.storage=ie(V(n,"addStorage",{name:n.name,options:n.options})),n}};function yT(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class bT{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,o,i,s,l,a;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let f=0,h=0;if(this.dom!==d){const g=this.dom.getBoundingClientRect(),y=d.getBoundingClientRect(),w=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,S=(s=e.offsetY)!==null&&s!==void 0?s:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;f=y.x-g.x+w,h=y.y-g.y+S}(a=e.dataTransfer)===null||a===void 0||a.setDragImage(this.dom,f,h);const p=Y.create(c.state.doc,this.getPos()),m=c.state.tr.setSelection(p);c.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=Y.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!u&&d&&i&&e.preventDefault(),u&&i&&!c)return e.preventDefault(),!1;if(u&&a&&!c&&m){const g=r.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||f||h||p||m&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(qa()||yT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function fr(t){return new Pk({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=ie(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),d=n.from+a.indexOf(l),f=d+l.length;if(Nf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+u,d),c=n.from+u+l.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function vT(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const wT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ST=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,CT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ET=nt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Gr({find:wT,type:this.type}),Gr({find:ST,type:this.type})]},addPasteRules(){return[fr({find:xT,type:this.type}),fr({find:CT,type:this.type})]}});function kT(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Ya(...t){return e=>t.forEach(n=>kT(n,e))}function $e(...t){return v.useCallback(Ya(...t),t)}var qr=v.forwardRef((t,e)=>{const{children:n,...r}=t,o=v.Children.toArray(n),i=o.find(MT);if(i){const s=i.props.children,l=o.map(a=>a===i?v.Children.count(s)>1?v.Children.only(null):v.isValidElement(s)?s.props.children:null:a);return T.jsx(ad,{...r,ref:e,children:v.isValidElement(s)?v.cloneElement(s,void 0,l):null})}return T.jsx(ad,{...r,ref:e,children:n})});qr.displayName="Slot";var ad=v.forwardRef((t,e)=>{const{children:n,...r}=t;if(v.isValidElement(n)){const o=OT(n);return v.cloneElement(n,{...TT(r,n.props),ref:e?Ya(e,o):o})}return v.Children.count(n)>1?v.Children.only(null):null});ad.displayName="SlotClone";var S0=({children:t})=>T.jsx(T.Fragment,{children:t});function MT(t){return v.isValidElement(t)&&t.type===S0}function TT(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function OT(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}/**
90
+ * @license lucide-react v0.427.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const kT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S0=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/**
95
- * @license lucide-react v0.417.0 - ISC
94
+ */const AT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),C0=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/**
95
+ * @license lucide-react v0.427.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */var MT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
100
- * @license lucide-react v0.417.0 - ISC
99
+ */var RT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
100
+ * @license lucide-react v0.427.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const TT=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...l},a)=>_.createElement("svg",{ref:a,...MT,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:S0("lucide",o),...l},[...s.map(([c,u])=>_.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
105
- * @license lucide-react v0.417.0 - ISC
104
+ */const NT=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...l},a)=>P.createElement("svg",{ref:a,...RT,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:C0("lucide",o),...l},[...s.map(([c,u])=>P.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
105
+ * @license lucide-react v0.427.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const q=(t,e)=>{const n=_.forwardRef(({className:r,...o},i)=>_.createElement(TT,{ref:i,iconNode:e,className:S0(`lucide-${kT(t)}`,r),...o}));return n.displayName=`${t}`,n};/**
110
- * @license lucide-react v0.417.0 - ISC
109
+ */const q=(t,e)=>{const n=P.forwardRef(({className:r,...o},i)=>P.createElement(NT,{ref:i,iconNode:e,className:C0(`lucide-${AT(t)}`,r),...o}));return n.displayName=`${t}`,n};/**
110
+ * @license lucide-react v0.427.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const OT=q("BetweenHorizontalEnd",[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]]);/**
115
- * @license lucide-react v0.417.0 - ISC
114
+ */const DT=q("BetweenHorizontalEnd",[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]]);/**
115
+ * @license lucide-react v0.427.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const AT=q("BetweenHorizontalStart",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]);/**
120
- * @license lucide-react v0.417.0 - ISC
119
+ */const _T=q("BetweenHorizontalStart",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]);/**
120
+ * @license lucide-react v0.427.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const RT=q("BetweenVerticalEnd",[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]);/**
125
- * @license lucide-react v0.417.0 - ISC
124
+ */const IT=q("BetweenVerticalEnd",[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]);/**
125
+ * @license lucide-react v0.427.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const NT=q("BetweenVerticalStart",[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]]);/**
130
- * @license lucide-react v0.417.0 - ISC
129
+ */const PT=q("BetweenVerticalStart",[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]]);/**
130
+ * @license lucide-react v0.427.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const DT=q("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
135
- * @license lucide-react v0.417.0 - ISC
134
+ */const LT=q("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
135
+ * @license lucide-react v0.427.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const _T=q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
140
- * @license lucide-react v0.417.0 - ISC
139
+ */const $T=q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
140
+ * @license lucide-react v0.427.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const IT=q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
145
- * @license lucide-react v0.417.0 - ISC
144
+ */const BT=q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
145
+ * @license lucide-react v0.427.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const PT=q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
150
- * @license lucide-react v0.417.0 - ISC
149
+ */const FT=q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
150
+ * @license lucide-react v0.427.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const LT=q("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
155
- * @license lucide-react v0.417.0 - ISC
154
+ */const jT=q("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
155
+ * @license lucide-react v0.427.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const $T=q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
160
- * @license lucide-react v0.417.0 - ISC
159
+ */const HT=q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
160
+ * @license lucide-react v0.427.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const BT=q("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
165
- * @license lucide-react v0.417.0 - ISC
164
+ */const zT=q("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
165
+ * @license lucide-react v0.427.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const FT=q("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
170
- * @license lucide-react v0.417.0 - ISC
169
+ */const VT=q("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
170
+ * @license lucide-react v0.427.0 - ISC
171
171
  *
172
172
  * This source code is licensed under the ISC license.
173
173
  * See the LICENSE file in the root directory of this source tree.
174
- */const jT=q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
175
- * @license lucide-react v0.417.0 - ISC
174
+ */const WT=q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
175
+ * @license lucide-react v0.427.0 - ISC
176
176
  *
177
177
  * This source code is licensed under the ISC license.
178
178
  * See the LICENSE file in the root directory of this source tree.
179
- */const HT=q("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
180
- * @license lucide-react v0.417.0 - ISC
179
+ */const UT=q("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
180
+ * @license lucide-react v0.427.0 - ISC
181
181
  *
182
182
  * This source code is licensed under the ISC license.
183
183
  * See the LICENSE file in the root directory of this source tree.
184
- */const zT=q("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
185
- * @license lucide-react v0.417.0 - ISC
184
+ */const KT=q("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
185
+ * @license lucide-react v0.427.0 - ISC
186
186
  *
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
- */const VT=q("Columns4",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]]);/**
190
- * @license lucide-react v0.417.0 - ISC
189
+ */const GT=q("Columns4",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]]);/**
190
+ * @license lucide-react v0.427.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
- */const WT=q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
195
- * @license lucide-react v0.417.0 - ISC
194
+ */const qT=q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
195
+ * @license lucide-react v0.427.0 - ISC
196
196
  *
197
197
  * This source code is licensed under the ISC license.
198
198
  * See the LICENSE file in the root directory of this source tree.
199
- */const UT=q("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
200
- * @license lucide-react v0.417.0 - ISC
199
+ */const JT=q("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
200
+ * @license lucide-react v0.427.0 - ISC
201
201
  *
202
202
  * This source code is licensed under the ISC license.
203
203
  * See the LICENSE file in the root directory of this source tree.
204
- */const KT=q("Frame",[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]);/**
205
- * @license lucide-react v0.417.0 - ISC
204
+ */const YT=q("Frame",[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]);/**
205
+ * @license lucide-react v0.427.0 - ISC
206
206
  *
207
207
  * This source code is licensed under the ISC license.
208
208
  * See the LICENSE file in the root directory of this source tree.
209
- */const GT=q("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
210
- * @license lucide-react v0.417.0 - ISC
209
+ */const XT=q("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
210
+ * @license lucide-react v0.427.0 - ISC
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const qT=q("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
215
- * @license lucide-react v0.417.0 - ISC
214
+ */const ZT=q("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
215
+ * @license lucide-react v0.427.0 - ISC
216
216
  *
217
217
  * This source code is licensed under the ISC license.
218
218
  * See the LICENSE file in the root directory of this source tree.
219
- */const JT=q("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
220
- * @license lucide-react v0.417.0 - ISC
219
+ */const QT=q("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
220
+ * @license lucide-react v0.427.0 - ISC
221
221
  *
222
222
  * This source code is licensed under the ISC license.
223
223
  * See the LICENSE file in the root directory of this source tree.
224
- */const YT=q("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
225
- * @license lucide-react v0.417.0 - ISC
224
+ */const eO=q("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
225
+ * @license lucide-react v0.427.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
- */const XT=q("ImageUp",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
230
- * @license lucide-react v0.417.0 - ISC
229
+ */const tO=q("ImageUp",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
230
+ * @license lucide-react v0.427.0 - ISC
231
231
  *
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
- */const ZT=q("IndentDecrease",[["polyline",{points:"7 8 3 12 7 16",key:"2j60jr"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
235
- * @license lucide-react v0.417.0 - ISC
234
+ */const nO=q("IndentDecrease",[["polyline",{points:"7 8 3 12 7 16",key:"2j60jr"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
235
+ * @license lucide-react v0.427.0 - ISC
236
236
  *
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
- */const QT=q("IndentIncrease",[["polyline",{points:"3 8 7 12 3 16",key:"f3rxhf"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
240
- * @license lucide-react v0.417.0 - ISC
239
+ */const rO=q("IndentIncrease",[["polyline",{points:"3 8 7 12 3 16",key:"f3rxhf"}],["line",{x1:"21",x2:"11",y1:"12",y2:"12",key:"1fxxak"}],["line",{x1:"21",x2:"11",y1:"6",y2:"6",key:"asgu94"}],["line",{x1:"21",x2:"11",y1:"18",y2:"18",key:"13dsj7"}]]);/**
240
+ * @license lucide-react v0.427.0 - ISC
241
241
  *
242
242
  * This source code is licensed under the ISC license.
243
243
  * See the LICENSE file in the root directory of this source tree.
244
- */const eO=q("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
245
- * @license lucide-react v0.417.0 - ISC
244
+ */const oO=q("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
245
+ * @license lucide-react v0.427.0 - ISC
246
246
  *
247
247
  * This source code is licensed under the ISC license.
248
248
  * See the LICENSE file in the root directory of this source tree.
249
- */const tO=q("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
250
- * @license lucide-react v0.417.0 - ISC
249
+ */const iO=q("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
250
+ * @license lucide-react v0.427.0 - ISC
251
251
  *
252
252
  * This source code is licensed under the ISC license.
253
253
  * See the LICENSE file in the root directory of this source tree.
254
- */const nO=q("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
255
- * @license lucide-react v0.417.0 - ISC
254
+ */const sO=q("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
255
+ * @license lucide-react v0.427.0 - ISC
256
256
  *
257
257
  * This source code is licensed under the ISC license.
258
258
  * See the LICENSE file in the root directory of this source tree.
259
- */const rO=q("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
260
- * @license lucide-react v0.417.0 - ISC
259
+ */const lO=q("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
260
+ * @license lucide-react v0.427.0 - ISC
261
261
  *
262
262
  * This source code is licensed under the ISC license.
263
263
  * See the LICENSE file in the root directory of this source tree.
264
- */const oO=q("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
265
- * @license lucide-react v0.417.0 - ISC
264
+ */const aO=q("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
265
+ * @license lucide-react v0.427.0 - ISC
266
266
  *
267
267
  * This source code is licensed under the ISC license.
268
268
  * See the LICENSE file in the root directory of this source tree.
269
- */const iO=q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
270
- * @license lucide-react v0.417.0 - ISC
269
+ */const cO=q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
270
+ * @license lucide-react v0.427.0 - ISC
271
271
  *
272
272
  * This source code is licensed under the ISC license.
273
273
  * See the LICENSE file in the root directory of this source tree.
274
- */const sO=q("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
275
- * @license lucide-react v0.417.0 - ISC
274
+ */const uO=q("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
275
+ * @license lucide-react v0.427.0 - ISC
276
276
  *
277
277
  * This source code is licensed under the ISC license.
278
278
  * See the LICENSE file in the root directory of this source tree.
279
- */const lO=q("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
280
- * @license lucide-react v0.417.0 - ISC
279
+ */const dO=q("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
280
+ * @license lucide-react v0.427.0 - ISC
281
281
  *
282
282
  * This source code is licensed under the ISC license.
283
283
  * See the LICENSE file in the root directory of this source tree.
284
- */const aO=q("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
285
- * @license lucide-react v0.417.0 - ISC
284
+ */const fO=q("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
285
+ * @license lucide-react v0.427.0 - ISC
286
286
  *
287
287
  * This source code is licensed under the ISC license.
288
288
  * See the LICENSE file in the root directory of this source tree.
289
- */const cO=q("PaintRoller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]);/**
290
- * @license lucide-react v0.417.0 - ISC
289
+ */const hO=q("PaintRoller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]);/**
290
+ * @license lucide-react v0.427.0 - ISC
291
291
  *
292
292
  * This source code is licensed under the ISC license.
293
293
  * See the LICENSE file in the root directory of this source tree.
294
- */const uO=q("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
295
- * @license lucide-react v0.417.0 - ISC
294
+ */const pO=q("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
295
+ * @license lucide-react v0.427.0 - ISC
296
296
  *
297
297
  * This source code is licensed under the ISC license.
298
298
  * See the LICENSE file in the root directory of this source tree.
299
- */const dO=q("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
300
- * @license lucide-react v0.417.0 - ISC
299
+ */const mO=q("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
300
+ * @license lucide-react v0.427.0 - ISC
301
301
  *
302
302
  * This source code is licensed under the ISC license.
303
303
  * See the LICENSE file in the root directory of this source tree.
304
- */const fO=q("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
305
- * @license lucide-react v0.417.0 - ISC
304
+ */const gO=q("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
305
+ * @license lucide-react v0.427.0 - ISC
306
306
  *
307
307
  * This source code is licensed under the ISC license.
308
308
  * See the LICENSE file in the root directory of this source tree.
309
- */const hO=q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
310
- * @license lucide-react v0.417.0 - ISC
309
+ */const yO=q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
310
+ * @license lucide-react v0.427.0 - ISC
311
311
  *
312
312
  * This source code is licensed under the ISC license.
313
313
  * See the LICENSE file in the root directory of this source tree.
314
- */const pO=q("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
315
- * @license lucide-react v0.417.0 - ISC
314
+ */const bO=q("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
315
+ * @license lucide-react v0.427.0 - ISC
316
316
  *
317
317
  * This source code is licensed under the ISC license.
318
318
  * See the LICENSE file in the root directory of this source tree.
319
- */const mO=q("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
320
- * @license lucide-react v0.417.0 - ISC
319
+ */const vO=q("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
320
+ * @license lucide-react v0.427.0 - ISC
321
321
  *
322
322
  * This source code is licensed under the ISC license.
323
323
  * See the LICENSE file in the root directory of this source tree.
324
- */const gO=q("Replace",[["path",{d:"M14 4c0-1.1.9-2 2-2",key:"1mvvbw"}],["path",{d:"M20 2c1.1 0 2 .9 2 2",key:"1mj6oe"}],["path",{d:"M22 8c0 1.1-.9 2-2 2",key:"v1wql3"}],["path",{d:"M16 10c-1.1 0-2-.9-2-2",key:"821ux0"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5c0-1.7 1.3-3 3-3h1",key:"13af7h"}],["rect",{width:"8",height:"8",x:"2",y:"14",rx:"2",key:"17ihk4"}]]);/**
325
- * @license lucide-react v0.417.0 - ISC
324
+ */const wO=q("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);/**
325
+ * @license lucide-react v0.427.0 - ISC
326
326
  *
327
327
  * This source code is licensed under the ISC license.
328
328
  * See the LICENSE file in the root directory of this source tree.
329
- */const yO=q("SmilePlus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);/**
330
- * @license lucide-react v0.417.0 - ISC
329
+ */const xO=q("SmilePlus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);/**
330
+ * @license lucide-react v0.427.0 - ISC
331
331
  *
332
332
  * This source code is licensed under the ISC license.
333
333
  * See the LICENSE file in the root directory of this source tree.
334
- */const bO=q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
335
- * @license lucide-react v0.417.0 - ISC
334
+ */const SO=q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
335
+ * @license lucide-react v0.427.0 - ISC
336
336
  *
337
337
  * This source code is licensed under the ISC license.
338
338
  * See the LICENSE file in the root directory of this source tree.
339
- */const vO=q("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
340
- * @license lucide-react v0.417.0 - ISC
339
+ */const CO=q("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
340
+ * @license lucide-react v0.427.0 - ISC
341
341
  *
342
342
  * This source code is licensed under the ISC license.
343
343
  * See the LICENSE file in the root directory of this source tree.
344
- */const wO=q("Subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/**
345
- * @license lucide-react v0.417.0 - ISC
344
+ */const EO=q("Subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/**
345
+ * @license lucide-react v0.427.0 - ISC
346
346
  *
347
347
  * This source code is licensed under the ISC license.
348
348
  * See the LICENSE file in the root directory of this source tree.
349
- */const xO=q("Superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/**
350
- * @license lucide-react v0.417.0 - ISC
349
+ */const kO=q("Superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/**
350
+ * @license lucide-react v0.427.0 - ISC
351
351
  *
352
352
  * This source code is licensed under the ISC license.
353
353
  * See the LICENSE file in the root directory of this source tree.
354
- */const SO=q("TableCellsMerge",[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
355
- * @license lucide-react v0.417.0 - ISC
354
+ */const MO=q("TableCellsMerge",[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
355
+ * @license lucide-react v0.427.0 - ISC
356
356
  *
357
357
  * This source code is licensed under the ISC license.
358
358
  * See the LICENSE file in the root directory of this source tree.
359
- */const CO=q("TableCellsSplit",[["path",{d:"M12 15V9",key:"8c7uyn"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
360
- * @license lucide-react v0.417.0 - ISC
359
+ */const TO=q("TableCellsSplit",[["path",{d:"M12 15V9",key:"8c7uyn"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
360
+ * @license lucide-react v0.427.0 - ISC
361
361
  *
362
362
  * This source code is licensed under the ISC license.
363
363
  * See the LICENSE file in the root directory of this source tree.
364
- */const EO=q("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
365
- * @license lucide-react v0.417.0 - ISC
364
+ */const OO=q("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
365
+ * @license lucide-react v0.427.0 - ISC
366
366
  *
367
367
  * This source code is licensed under the ISC license.
368
368
  * See the LICENSE file in the root directory of this source tree.
369
- */const kO=q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
370
- * @license lucide-react v0.417.0 - ISC
369
+ */const AO=q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
370
+ * @license lucide-react v0.427.0 - ISC
371
371
  *
372
372
  * This source code is licensed under the ISC license.
373
373
  * See the LICENSE file in the root directory of this source tree.
374
- */const MO=q("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
375
- * @license lucide-react v0.417.0 - ISC
374
+ */const RO=q("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
375
+ * @license lucide-react v0.427.0 - ISC
376
376
  *
377
377
  * This source code is licensed under the ISC license.
378
378
  * See the LICENSE file in the root directory of this source tree.
379
- */const TO=q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
380
- * @license lucide-react v0.417.0 - ISC
379
+ */const NO=q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
380
+ * @license lucide-react v0.427.0 - ISC
381
381
  *
382
382
  * This source code is licensed under the ISC license.
383
383
  * See the LICENSE file in the root directory of this source tree.
384
- */const OO=q("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
385
- * @license lucide-react v0.417.0 - ISC
384
+ */const DO=q("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
385
+ * @license lucide-react v0.427.0 - ISC
386
386
  *
387
387
  * This source code is licensed under the ISC license.
388
388
  * See the LICENSE file in the root directory of this source tree.
389
- */const AO=q("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
390
- * @license lucide-react v0.417.0 - ISC
389
+ */const _O=q("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
390
+ * @license lucide-react v0.427.0 - ISC
391
391
  *
392
392
  * This source code is licensed under the ISC license.
393
393
  * See the LICENSE file in the root directory of this source tree.
394
- */const RO=q("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
395
- * @license lucide-react v0.417.0 - ISC
394
+ */const IO=q("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
395
+ * @license lucide-react v0.427.0 - ISC
396
396
  *
397
397
  * This source code is licensed under the ISC license.
398
398
  * See the LICENSE file in the root directory of this source tree.
399
- */const NO=q("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);function Xa(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var DO=["color"],_O=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,DO);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),IO=["color"],PO=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,IO);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),LO=["color"],$O=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,LO);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),BO=["color"],FO=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,BO);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function ee(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function Pt(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Er({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=jO({defaultProp:e,onChange:n}),i=t!==void 0,s=i?t:r,l=Pt(n),a=v.useCallback(c=>{if(i){const d=typeof c=="function"?c(t):c;d!==t&&l(d)}else o(c)},[i,t,o,l]);return[s,a]}function jO({defaultProp:t,onChange:e}){const n=v.useState(t),[r]=n,o=v.useRef(r),i=Pt(e);return v.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function HO(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Za(...t){return e=>t.forEach(n=>HO(n,e))}function $e(...t){return v.useCallback(Za(...t),t)}var Jr=v.forwardRef((t,e)=>{const{children:n,...r}=t,o=v.Children.toArray(n),i=o.find(zO);if(i){const s=i.props.children,l=o.map(a=>a===i?v.Children.count(s)>1?v.Children.only(null):v.isValidElement(s)?s.props.children:null:a);return T.jsx(ld,{...r,ref:e,children:v.isValidElement(s)?v.cloneElement(s,void 0,l):null})}return T.jsx(ld,{...r,ref:e,children:n})});Jr.displayName="Slot";var ld=v.forwardRef((t,e)=>{const{children:n,...r}=t;if(v.isValidElement(n)){const o=WO(n);return v.cloneElement(n,{...VO(r,n.props),ref:e?Za(e,o):o})}return v.Children.count(n)>1?v.Children.only(null):null});ld.displayName="SlotClone";var C0=({children:t})=>T.jsx(T.Fragment,{children:t});function zO(t){return v.isValidElement(t)&&t.type===C0}function VO(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}function WO(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var UO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ge=UO.reduce((t,e)=>{const n=v.forwardRef((r,o)=>{const{asChild:i,...s}=r,l=i?Jr:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(l,{...s,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function E0(t,e){t&&uf.flushSync(()=>t.dispatchEvent(e))}var KO="Toggle",k0=v.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=t,[s=!1,l]=Er({prop:n,onChange:o,defaultProp:r});return T.jsx(ge.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:ee(t.onClick,()=>{t.disabled||l(!s)})})});k0.displayName=KO;var GO=k0;function M0(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=M0(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function qO(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=M0(t))&&(r&&(r+=" "),r+=e);return r}const nm=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,rm=qO,JO=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return rm(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=nm(u)||nm(d);return o[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),a=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,g]=p;return Array.isArray(g)?g.includes({...i,...l}[m]):{...i,...l}[m]===g})?[...c,d,f]:c},[]);return rm(t,s,a,n==null?void 0:n.class,n==null?void 0:n.className)};function T0(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=T0(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function YO(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=T0(t))&&(r&&(r+=" "),r+=e);return r}const Df="-";function XO(t){const e=QO(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;function o(s){const l=s.split(Df);return l[0]===""&&l.length!==1&&l.shift(),O0(l,e)||ZO(s)}function i(s,l){const a=n[s]||[];return l&&r[s]?[...a,...r[s]]:a}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function O0(t,e){var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?O0(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(Df);return(s=e.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId}const om=/^\[(.+)\]$/;function ZO(t){if(om.test(t)){const e=om.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}function QO(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return tA(Object.entries(t.classGroups),n).forEach(([i,s])=>{ad(s,r,i,e)}),r}function ad(t,e,n,r){t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:im(e,o);i.classGroupId=n;return}if(typeof o=="function"){if(eA(o)){ad(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{ad(s,im(e,i),n,r)})})}function im(t,e){let n=t;return e.split(Df).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function eA(t){return t.isThemeGetter}function tA(t,e){return e?t.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[e+s,l])):i);return[n,o]}):t}function nA(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),e++,e>t&&(e=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const A0="!";function rA(t){const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],i=e.length;function s(l){const a=[];let c=0,u=0,d;for(let g=0;g<l.length;g++){let y=l[g];if(c===0){if(y===o&&(r||l.slice(g,g+i)===e)){a.push(l.slice(u,g)),u=g+i;continue}if(y==="/"){d=g;continue}}y==="["?c++:y==="]"&&c--}const f=a.length===0?l:l.substring(u),h=f.startsWith(A0),p=h?f.substring(1):f,m=d&&d>u?d-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}}return n?function(a){return n({className:a,parseClassName:s})}:s}function oA(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e}function iA(t){return{cache:nA(t.cacheSize),parseClassName:rA(t),...XO(t)}}const sA=/\s+/;function lA(t,e){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,i=new Set;return t.trim().split(sA).map(s=>{const{modifiers:l,hasImportantModifier:a,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=!!u,f=r(d?c.substring(0,u):c);if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};d=!1}const h=oA(l).join(":");return{isTailwindClass:!0,modifierId:a?h+A0:h,classGroupId:f,originalClassName:s,hasPostfixModifier:d}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:c}=s,u=l+a;return i.has(u)?!1:(i.add(u),o(a,c).forEach(d=>i.add(l+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function aA(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=R0(e))&&(r&&(r+=" "),r+=n);return r}function R0(t){if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=R0(t[r]))&&(n&&(n+=" "),n+=e);return n}function cA(t,...e){let n,r,o,i=s;function s(a){const c=e.reduce((u,d)=>d(u),t());return n=iA(c),r=n.cache.get,o=n.cache.set,i=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=lA(a,n);return o(a,u),u}return function(){return i(aA.apply(null,arguments))}}function xe(t){const e=n=>n[t]||[];return e.isThemeGetter=!0,e}const N0=/^\[(?:([a-z-]+):)?(.+)\]$/i,uA=/^\d+\/\d+$/,dA=new Set(["px","full","screen"]),fA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function vn(t){return Pr(t)||dA.has(t)||uA.test(t)}function zn(t){return ei(t,"length",EA)}function Pr(t){return!!t&&!Number.isNaN(Number(t))}function Bs(t){return ei(t,"number",Pr)}function ui(t){return!!t&&Number.isInteger(Number(t))}function yA(t){return t.endsWith("%")&&Pr(t.slice(0,-1))}function oe(t){return N0.test(t)}function Vn(t){return fA.test(t)}const bA=new Set(["length","size","percentage"]);function vA(t){return ei(t,bA,D0)}function wA(t){return ei(t,"position",D0)}const xA=new Set(["image","url"]);function SA(t){return ei(t,xA,MA)}function CA(t){return ei(t,"",kA)}function di(){return!0}function ei(t,e,n){const r=N0.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1}function EA(t){return hA.test(t)&&!pA.test(t)}function D0(){return!1}function kA(t){return mA.test(t)}function MA(t){return gA.test(t)}function TA(){const t=xe("colors"),e=xe("spacing"),n=xe("blur"),r=xe("brightness"),o=xe("borderColor"),i=xe("borderRadius"),s=xe("borderSpacing"),l=xe("borderWidth"),a=xe("contrast"),c=xe("grayscale"),u=xe("hueRotate"),d=xe("invert"),f=xe("gap"),h=xe("gradientColorStops"),p=xe("gradientColorStopPositions"),m=xe("inset"),g=xe("margin"),y=xe("opacity"),x=xe("padding"),S=xe("saturate"),b=xe("scale"),C=xe("sepia"),w=xe("skew"),k=xe("space"),R=xe("translate"),E=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",oe,e],L=()=>[oe,e],H=()=>["",vn,zn],U=()=>["auto",Pr,oe],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",oe],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Pr,Bs],ne=()=>[Pr,oe];return{cacheSize:500,separator:":",theme:{colors:[di],spacing:[vn,zn],blur:["none","",Vn,oe],brightness:Z(),borderColor:[t],borderRadius:["none","","full",Vn,oe],borderSpacing:L(),borderWidth:H(),contrast:Z(),grayscale:D(),hueRotate:ne(),invert:D(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[yA,zn],inset:I(),margin:I(),opacity:Z(),padding:L(),saturate:Z(),scale:Z(),sepia:D(),skew:ne(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[Vn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),oe]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ui,oe]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",ui,oe]}],"grid-cols":[{"grid-cols":[di]}],"col-start-end":[{col:["auto",{span:["full",ui,oe]},oe]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[di]}],"row-start-end":[{row:["auto",{span:[ui,oe]},oe]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,e]}],"min-w":[{"min-w":[oe,e,"min","max","fit"]}],"max-w":[{"max-w":[oe,e,"none","full","min","max","fit","prose",{screen:[Vn]},Vn]}],h:[{h:[oe,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Vn,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bs]}],"font-family":[{font:[di]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",oe]}],"line-clamp":[{"line-clamp":["none",Pr,Bs]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vn,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vn,zn]}],"underline-offset":[{"underline-offset":["auto",vn,oe]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),wA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},SA]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[vn,oe]}],"outline-w":[{outline:[vn,zn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[vn,zn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Vn,CA]}],"shadow-color":[{shadow:[di]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",Vn,oe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ui,oe]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[w]}],"skew-y":[{"skew-y":[w]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[vn,zn,Bs]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const OA=cA(TA);function In(t,e=[]){let n=[];function r(i,s){const l=v.createContext(s),a=n.length;n=[...n,s];function c(d){const{scope:f,children:h,...p}=d,m=(f==null?void 0:f[t][a])||l,g=v.useMemo(()=>p,Object.values(p));return T.jsx(m.Provider,{value:g,children:h})}function u(d,f){const h=(f==null?void 0:f[t][a])||l,p=v.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>v.createContext(s));return function(l){const a=(l==null?void 0:l[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...l,[t]:a}}),[l,a])}};return o.scopeName=t,[r,AA(o,...e)]}function AA(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:a,scopeName:c})=>{const d=a(i)[`__scope${c}`];return{...l,...d}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function RA(t,e=globalThis==null?void 0:globalThis.document){const n=Pt(t);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var NA="DismissableLayer",cd="dismissableLayer.update",DA="dismissableLayer.pointerDownOutside",_A="dismissableLayer.focusOutside",sm,_0=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qa=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...a}=t,c=v.useContext(_0),[u,d]=v.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=v.useState({}),p=$e(e,k=>d(k)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),x=u?m.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,b=x>=y,C=LA(k=>{const R=k.target,E=[...c.branches].some(O=>O.contains(R));!b||E||(o==null||o(k),s==null||s(k),k.defaultPrevented||l==null||l())},f),w=$A(k=>{const R=k.target;[...c.branches].some(O=>O.contains(R))||(i==null||i(k),s==null||s(k),k.defaultPrevented||l==null||l())},f);return RA(k=>{x===c.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),v.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(sm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),lm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sm)}},[u,f,n,c]),v.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),lm())},[u,c]),v.useEffect(()=>{const k=()=>h({});return document.addEventListener(cd,k),()=>document.removeEventListener(cd,k)},[]),T.jsx(ge.div,{...a,ref:p,style:{pointerEvents:S?b?"auto":"none":void 0,...t.style},onFocusCapture:ee(t.onFocusCapture,w.onFocusCapture),onBlurCapture:ee(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ee(t.onPointerDownCapture,C.onPointerDownCapture)})});Qa.displayName=NA;var IA="DismissableLayerBranch",PA=v.forwardRef((t,e)=>{const n=v.useContext(_0),r=v.useRef(null),o=$e(e,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),T.jsx(ge.div,{...t,ref:o})});PA.displayName=IA;function LA(t,e=globalThis==null?void 0:globalThis.document){const n=Pt(t),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let a=function(){I0(DA,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=a,e.addEventListener("click",o.current,{once:!0})):a()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function $A(t,e=globalThis==null?void 0:globalThis.document){const n=Pt(t),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&I0(_A,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lm(){const t=new CustomEvent(cd);document.dispatchEvent(t)}function I0(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?E0(o,i):o.dispatchEvent(i)}var Yr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},BA=v.useId||(()=>{}),FA=0;function hr(t){const[e,n]=v.useState(BA());return Yr(()=>{t||n(r=>r??String(FA++))},[t]),t||(e?`radix-${e}`:"")}const jA=["top","right","bottom","left"],nn=Math.min,bt=Math.max,jl=Math.round,Fs=Math.floor,pr=t=>({x:t,y:t}),HA={left:"right",right:"left",bottom:"top",top:"bottom"},zA={start:"end",end:"start"};function ud(t,e,n){return bt(t,nn(e,n))}function An(t,e){return typeof t=="function"?t(e):t}function Rn(t){return t.split("-")[0]}function ti(t){return t.split("-")[1]}function _f(t){return t==="x"?"y":"x"}function If(t){return t==="y"?"height":"width"}function mr(t){return["top","bottom"].includes(Rn(t))?"y":"x"}function Pf(t){return _f(mr(t))}function VA(t,e,n){n===void 0&&(n=!1);const r=ti(t),o=Pf(t),i=If(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Hl(s)),[s,Hl(s)]}function WA(t){const e=Hl(t);return[dd(t),e,dd(e)]}function dd(t){return t.replace(/start|end/g,e=>zA[e])}function UA(t,e,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?i:s;default:return[]}}function KA(t,e,n,r){const o=ti(t);let i=UA(Rn(t),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(dd)))),i}function Hl(t){return t.replace(/left|right|bottom|top/g,e=>HA[e])}function GA(t){return{top:0,right:0,bottom:0,left:0,...t}}function P0(t){return typeof t!="number"?GA(t):{top:t,right:t,bottom:t,left:t}}function zl(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function am(t,e,n){let{reference:r,floating:o}=t;const i=mr(e),s=Pf(e),l=If(s),a=Rn(e),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let h;switch(a){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ti(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const qA=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:d}=am(c,r,a),f=r,h={},p=0;for(let m=0;m<l.length;m++){const{name:g,fn:y}=l[m],{x,y:S,data:b,reset:C}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});u=x??u,d=S??d,h={...h,[g]:{...h[g],...b}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):C.rects),{x:u,y:d}=am(c,f,a)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Vi(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=An(e,t),p=P0(h),g=l[f?d==="floating"?"reference":"floating":d],y=zl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),x=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=zl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:S,strategy:a}):x);return{top:(y.top-C.top+p.top)/b.y,bottom:(C.bottom-y.bottom+p.bottom)/b.y,left:(y.left-C.left+p.left)/b.x,right:(C.right-y.right+p.right)/b.x}}const JA=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:u=0}=An(t,e)||{};if(c==null)return{};const d=P0(u),f={x:n,y:r},h=Pf(o),p=If(h),m=await s.getDimensions(c),g=h==="y",y=g?"top":"left",x=g?"bottom":"right",S=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[h]-f[h]-i.floating[p],C=f[h]-i.reference[h],w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=w?w[S]:0;(!k||!await(s.isElement==null?void 0:s.isElement(w)))&&(k=l.floating[S]||i.floating[p]);const R=b/2-C/2,E=k/2-m[p]/2-1,O=nn(d[y],E),I=nn(d[x],E),L=O,H=k-m[p]-I,U=k/2-m[p]/2+R,K=ud(L,U,H),j=!a.arrow&&ti(o)!=null&&U!==K&&i.reference[p]/2-(U<L?O:I)-m[p]/2<0,M=j?U<L?U-L:U-H:0;return{[h]:f[h]+M,data:{[h]:K,centerOffset:U-K-M,...j&&{alignmentOffset:M}},reset:j}}}),YA=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=An(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Rn(o),x=mr(l),S=Rn(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=f||(S||!m?[Hl(l)]:WA(l)),w=p!=="none";!f&&w&&C.push(...KA(l,m,p,b));const k=[l,...C],R=await Vi(e,g),E=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(R[y]),d){const U=VA(o,s,b);E.push(R[U[0]],R[U[1]])}if(O=[...O,{placement:o,overflows:E}],!E.every(U=>U<=0)){var I,L;const U=(((I=i.flip)==null?void 0:I.index)||0)+1,K=k[U];if(K)return{data:{index:U,overflows:O},reset:{placement:K}};let j=(L=O.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!j)switch(h){case"bestFit":{var H;const M=(H=O.filter(N=>{if(w){const D=mr(N.placement);return D===x||D==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(D=>D>0).reduce((D,z)=>D+z,0)]).sort((N,D)=>N[1]-D[1])[0])==null?void 0:H[0];M&&(j=M);break}case"initialPlacement":j=l;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function cm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function um(t){return jA.some(e=>t[e]>=0)}const XA=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=An(t,e);switch(r){case"referenceHidden":{const i=await Vi(e,{...o,elementContext:"reference"}),s=cm(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:um(s)}}}case"escaped":{const i=await Vi(e,{...o,altBoundary:!0}),s=cm(i,n.floating);return{data:{escapedOffsets:s,escaped:um(s)}}}default:return{}}}}};async function ZA(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Rn(n),l=ti(n),a=mr(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&a?-1:1,d=An(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return l&&typeof p=="number"&&(h=l==="end"?p*-1:p),a?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const QA=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=e,a=await ZA(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:s}}}}},eR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:y,y:x}=g;return{x:y,y:x}}},...a}=An(t,e),c={x:n,y:r},u=await Vi(e,a),d=mr(Rn(o)),f=_f(d);let h=c[f],p=c[d];if(i){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=h+u[g],S=h-u[y];h=ud(x,h,S)}if(s){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",x=p+u[g],S=p-u[y];p=ud(x,p,S)}const m=l.fn({...e,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},tR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=An(t,e),u={x:n,y:r},d=mr(o),f=_f(d);let h=u[f],p=u[d];const m=An(l,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const S=f==="y"?"height":"width",b=i.reference[f]-i.floating[S]+g.mainAxis,C=i.reference[f]+i.reference[S]-g.mainAxis;h<b?h=b:h>C&&(h=C)}if(c){var y,x;const S=f==="y"?"width":"height",b=["top","left"].includes(Rn(o)),C=i.reference[d]-i.floating[S]+(b&&((y=s.offset)==null?void 0:y[d])||0)+(b?0:g.crossAxis),w=i.reference[d]+i.reference[S]+(b?0:((x=s.offset)==null?void 0:x[d])||0)-(b?g.crossAxis:0);p<C?p=C:p>w&&(p=w)}return{[f]:h,[d]:p}}}},nR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:s=()=>{},...l}=An(t,e),a=await Vi(e,l),c=Rn(n),u=ti(n),d=mr(n)==="y",{width:f,height:h}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const g=h-a.top-a.bottom,y=f-a.left-a.right,x=nn(h-a[p],g),S=nn(f-a[m],y),b=!e.middlewareData.shift;let C=x,w=S;if(d?w=u||b?nn(S,y):y:C=u||b?nn(x,g):g,b&&!u){const R=bt(a.left,0),E=bt(a.right,0),O=bt(a.top,0),I=bt(a.bottom,0);d?w=f-2*(R!==0||E!==0?R+E:bt(a.left,a.right)):C=h-2*(O!==0||I!==0?O+I:bt(a.top,a.bottom))}await s({...e,availableWidth:w,availableHeight:C});const k=await o.getDimensions(i.floating);return f!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function ni(t){return L0(t)?(t.nodeName||"").toLowerCase():"#document"}function xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Pn(t){var e;return(e=(L0(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function L0(t){return t instanceof Node||t instanceof xt(t).Node}function Vt(t){return t instanceof Element||t instanceof xt(t).Element}function cn(t){return t instanceof HTMLElement||t instanceof xt(t).HTMLElement}function dm(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xt(t).ShadowRoot}function ws(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Wt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function rR(t){return["table","td","th"].includes(ni(t))}function ec(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Lf(t){const e=$f(),n=Vt(t)?Wt(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function oR(t){let e=gr(t);for(;cn(e)&&!Fo(e);){if(Lf(e))return e;if(ec(e))return null;e=gr(e)}return null}function $f(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fo(t){return["html","body","#document"].includes(ni(t))}function Wt(t){return xt(t).getComputedStyle(t)}function tc(t){return Vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gr(t){if(ni(t)==="html")return t;const e=t.assignedSlot||t.parentNode||dm(t)&&t.host||Pn(t);return dm(e)?e.host:e}function $0(t){const e=gr(t);return Fo(e)?t.ownerDocument?t.ownerDocument.body:t.body:cn(e)&&ws(e)?e:$0(e)}function Wi(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=$0(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),s=xt(o);return i?e.concat(s,s.visualViewport||[],ws(o)?o:[],s.frameElement&&n?Wi(s.frameElement):[]):e.concat(o,Wi(o,[],n))}function B0(t){const e=Wt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=cn(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,l=jl(n)!==i||jl(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Bf(t){return Vt(t)?t:t.contextElement}function No(t){const e=Bf(t);if(!cn(e))return pr(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=B0(e);let s=(i?jl(n.width):n.width)/r,l=(i?jl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const iR=pr(0);function F0(t){const e=xt(t);return!$f()||!e.visualViewport?iR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function sR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xt(t)?!1:e}function Xr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=Bf(t);let s=pr(1);e&&(r?Vt(r)&&(s=No(r)):s=No(t));const l=sR(i,n,r)?F0(i):pr(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=xt(i),h=r&&Vt(r)?xt(r):r;let p=f,m=p.frameElement;for(;m&&r&&h!==p;){const g=No(m),y=m.getBoundingClientRect(),x=Wt(m),S=y.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,b=y.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;a*=g.x,c*=g.y,u*=g.x,d*=g.y,a+=S,c+=b,p=xt(m),m=p.frameElement}}return zl({width:u,height:d,x:a,y:c})}function lR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i=o==="fixed",s=Pn(r),l=e?ec(e.floating):!1;if(r===s||l&&i)return n;let a={scrollLeft:0,scrollTop:0},c=pr(1);const u=pr(0),d=cn(r);if((d||!d&&!i)&&((ni(r)!=="body"||ws(s))&&(a=tc(r)),cn(r))){const f=Xr(r);c=No(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x,y:n.y*c.y-a.scrollTop*c.y+u.y}}function aR(t){return Array.from(t.getClientRects())}function j0(t){return Xr(Pn(t)).left+tc(t).scrollLeft}function cR(t){const e=Pn(t),n=tc(t),r=t.ownerDocument.body,o=bt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=bt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+j0(t);const l=-n.scrollTop;return Wt(r).direction==="rtl"&&(s+=bt(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function uR(t,e){const n=xt(t),r=Pn(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;const c=$f();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:s,x:l,y:a}}function dR(t,e){const n=Xr(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=cn(t)?No(t):pr(1),s=t.clientWidth*i.x,l=t.clientHeight*i.y,a=o*i.x,c=r*i.y;return{width:s,height:l,x:a,y:c}}function fm(t,e,n){let r;if(e==="viewport")r=uR(t,n);else if(e==="document")r=cR(Pn(t));else if(Vt(e))r=dR(e,n);else{const o=F0(t);r={...e,x:e.x-o.x,y:e.y-o.y}}return zl(r)}function H0(t,e){const n=gr(t);return n===e||!Vt(n)||Fo(n)?!1:Wt(n).position==="fixed"||H0(n,e)}function fR(t,e){const n=e.get(t);if(n)return n;let r=Wi(t,[],!1).filter(l=>Vt(l)&&ni(l)!=="body"),o=null;const i=Wt(t).position==="fixed";let s=i?gr(t):t;for(;Vt(s)&&!Fo(s);){const l=Wt(s),a=Lf(s);!a&&l.position==="fixed"&&(o=null),(i?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ws(s)&&!a&&H0(t,s))?r=r.filter(u=>u!==s):o=l,s=gr(s)}return e.set(t,r),r}function hR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?ec(e)?[]:fR(e,this._c):[].concat(n),r],l=s[0],a=s.reduce((c,u)=>{const d=fm(e,u,o);return c.top=bt(d.top,c.top),c.right=nn(d.right,c.right),c.bottom=nn(d.bottom,c.bottom),c.left=bt(d.left,c.left),c},fm(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function pR(t){const{width:e,height:n}=B0(t);return{width:e,height:n}}function mR(t,e,n){const r=cn(e),o=Pn(e),i=n==="fixed",s=Xr(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const a=pr(0);if(r||!r&&!i)if((ni(e)!=="body"||ws(o))&&(l=tc(e)),r){const d=Xr(e,!0,i,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else o&&(a.x=j0(o));const c=s.left+l.scrollLeft-a.x,u=s.top+l.scrollTop-a.y;return{x:c,y:u,width:s.width,height:s.height}}function Kc(t){return Wt(t).position==="static"}function hm(t,e){return!cn(t)||Wt(t).position==="fixed"?null:e?e(t):t.offsetParent}function z0(t,e){const n=xt(t);if(ec(t))return n;if(!cn(t)){let o=gr(t);for(;o&&!Fo(o);){if(Vt(o)&&!Kc(o))return o;o=gr(o)}return n}let r=hm(t,e);for(;r&&rR(r)&&Kc(r);)r=hm(r,e);return r&&Fo(r)&&Kc(r)&&!Lf(r)?n:r||oR(t)||n}const gR=async function(t){const e=this.getOffsetParent||z0,n=this.getDimensions,r=await n(t.floating);return{reference:mR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yR(t){return Wt(t).direction==="rtl"}const bR={convertOffsetParentRelativeRectToViewportRelativeRect:lR,getDocumentElement:Pn,getClippingRect:hR,getOffsetParent:z0,getElementRects:gR,getClientRects:aR,getDimensions:pR,getScale:No,isElement:Vt,isRTL:yR};function vR(t,e){let n=null,r;const o=Pn(t);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(l||e(),!d||!f)return;const h=Fs(u),p=Fs(o.clientWidth-(c+d)),m=Fs(o.clientHeight-(u+f)),g=Fs(c),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:bt(0,nn(1,a))||1};let S=!0;function b(C){const w=C[0].intersectionRatio;if(w!==a){if(!S)return s();w?s(!1,w):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(t)}return s(!0),i}function wR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Bf(t),u=o||i?[...c?Wi(c):[],...Wi(e)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&l?vR(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(y=>{let[x]=y;x&&x.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),n()}),c&&!a&&h.observe(c),h.observe(e));let p,m=a?Xr(t):null;a&&g();function g(){const y=Xr(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,p=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,a&&cancelAnimationFrame(p)}}const xR=QA,SR=eR,CR=YA,ER=nR,kR=XA,pm=JA,MR=tR,TR=(t,e,n)=>{const r=new Map,o={platform:bR,...n},i={...o.platform,_c:r};return qA(t,e,{...o,platform:i})};var pl=typeof document<"u"?_.useLayoutEffect:_.useEffect;function Vl(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Vl(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!Vl(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function V0(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function mm(t,e){const n=V0(t);return Math.round(e*n)/n}function gm(t){const e=v.useRef(t);return pl(()=>{e.current=t}),e}function OR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=t,[u,d]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=v.useState(r);Vl(f,r)||h(r);const[p,m]=v.useState(null),[g,y]=v.useState(null),x=v.useCallback(M=>{M!==w.current&&(w.current=M,m(M))},[]),S=v.useCallback(M=>{M!==k.current&&(k.current=M,y(M))},[]),b=i||p,C=s||g,w=v.useRef(null),k=v.useRef(null),R=v.useRef(u),E=a!=null,O=gm(a),I=gm(o),L=v.useCallback(()=>{if(!w.current||!k.current)return;const M={placement:e,strategy:n,middleware:f};I.current&&(M.platform=I.current),TR(w.current,k.current,M).then(N=>{const D={...N,isPositioned:!0};H.current&&!Vl(R.current,D)&&(R.current=D,uf.flushSync(()=>{d(D)}))})},[f,e,n,I]);pl(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[c]);const H=v.useRef(!1);pl(()=>(H.current=!0,()=>{H.current=!1}),[]),pl(()=>{if(b&&(w.current=b),C&&(k.current=C),b&&C){if(O.current)return O.current(b,C,L);L()}},[b,C,L,O,E]);const U=v.useMemo(()=>({reference:w,floating:k,setReference:x,setFloating:S}),[x,S]),K=v.useMemo(()=>({reference:b,floating:C}),[b,C]),j=v.useMemo(()=>{const M={position:n,left:0,top:0};if(!K.floating)return M;const N=mm(K.floating,u.x),D=mm(K.floating,u.y);return l?{...M,transform:"translate("+N+"px, "+D+"px)",...V0(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:D}},[n,l,K.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:L,refs:U,elements:K,floatingStyles:j}),[u,L,U,K,j])}const AR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?pm({element:r.current,padding:o}).fn(n):{}:r?pm({element:r,padding:o}).fn(n):{}}}},RR=(t,e)=>({...xR(t),options:[t,e]}),NR=(t,e)=>({...SR(t),options:[t,e]}),DR=(t,e)=>({...MR(t),options:[t,e]}),_R=(t,e)=>({...CR(t),options:[t,e]}),IR=(t,e)=>({...ER(t),options:[t,e]}),PR=(t,e)=>({...kR(t),options:[t,e]}),LR=(t,e)=>({...AR(t),options:[t,e]});var $R="Arrow",W0=v.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...i}=t;return T.jsx(ge.svg,{...i,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});W0.displayName=$R;var BR=W0;function U0(t){const[e,n]=v.useState(void 0);return Yr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const a=i.borderBoxSize,c=Array.isArray(a)?a[0]:a;s=c.inlineSize,l=c.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Ff="Popper",[K0,ri]=In(Ff),[FR,G0]=K0(Ff),q0=t=>{const{__scopePopper:e,children:n}=t,[r,o]=v.useState(null);return T.jsx(FR,{scope:e,anchor:r,onAnchorChange:o,children:n})};q0.displayName=Ff;var J0="PopperAnchor",Y0=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=G0(J0,n),s=v.useRef(null),l=$e(e,s);return v.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:T.jsx(ge.div,{...o,ref:l})});Y0.displayName=J0;var jf="PopperContent",[jR,HR]=K0(jf),X0=v.forwardRef((t,e)=>{var Pe,Be,Oe,Ze,Bt,mn;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:a=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=t,g=G0(jf,n),[y,x]=v.useState(null),S=$e(e,mt=>x(mt)),[b,C]=v.useState(null),w=U0(b),k=(w==null?void 0:w.width)??0,R=(w==null?void 0:w.height)??0,E=r+(i!=="center"?"-"+i:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(c)?c:[c],L=I.length>0,H={padding:O,boundary:I.filter(VR),altBoundary:L},{refs:U,floatingStyles:K,placement:j,isPositioned:M,middlewareData:N}=OR({strategy:"fixed",placement:E,whileElementsMounted:(...mt)=>wR(...mt,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[RR({mainAxis:o+R,alignmentAxis:s}),a&&NR({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?DR():void 0,...H}),a&&_R({...H}),IR({...H,apply:({elements:mt,rects:Ct,availableWidth:gn,availableHeight:Fe})=>{const{width:yn,height:Kt}=Ct.reference,Y=mt.floating.style;Y.setProperty("--radix-popper-available-width",`${gn}px`),Y.setProperty("--radix-popper-available-height",`${Fe}px`),Y.setProperty("--radix-popper-anchor-width",`${yn}px`),Y.setProperty("--radix-popper-anchor-height",`${Kt}px`)}}),b&&LR({element:b,padding:l}),WR({arrowWidth:k,arrowHeight:R}),f&&PR({strategy:"referenceHidden",...H})]}),[D,z]=ev(j),Z=Pt(p);Yr(()=>{M&&(Z==null||Z())},[M,Z]);const ne=(Pe=N.arrow)==null?void 0:Pe.x,Te=(Be=N.arrow)==null?void 0:Be.y,De=((Oe=N.arrow)==null?void 0:Oe.centerOffset)!==0,[de,he]=v.useState();return Yr(()=>{y&&he(window.getComputedStyle(y).zIndex)},[y]),T.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:M?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(Ze=N.transformOrigin)==null?void 0:Ze.x,(Bt=N.transformOrigin)==null?void 0:Bt.y].join(" "),...((mn=N.hide)==null?void 0:mn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T.jsx(jR,{scope:n,placedSide:D,onArrowChange:C,arrowX:ne,arrowY:Te,shouldHideArrow:De,children:T.jsx(ge.div,{"data-side":D,"data-align":z,...m,ref:S,style:{...m.style,animation:M?void 0:"none"}})})})});X0.displayName=jf;var Z0="PopperArrow",zR={top:"bottom",right:"left",bottom:"top",left:"right"},Q0=v.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=HR(Z0,r),s=zR[i.placedSide];return T.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:T.jsx(BR,{...o,ref:n,style:{...o.style,display:"block"}})})});Q0.displayName=Z0;function VR(t){return t!==null}var WR=t=>({name:"transformOrigin",options:t,fn(e){var g,y,x;const{placement:n,rects:r,middlewareData:o}=e,s=((g=o.arrow)==null?void 0:g.centerOffset)!==0,l=s?0:t.arrowWidth,a=s?0:t.arrowHeight,[c,u]=ev(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=o.arrow)==null?void 0:y.x)??0)+l/2,h=(((x=o.arrow)==null?void 0:x.y)??0)+a/2;let p="",m="";return c==="bottom"?(p=s?d:`${f}px`,m=`${-a}px`):c==="top"?(p=s?d:`${f}px`,m=`${r.floating.height+a}px`):c==="right"?(p=`${-a}px`,m=s?d:`${h}px`):c==="left"&&(p=`${r.floating.width+a}px`,m=s?d:`${h}px`),{data:{x:p,y:m}}}});function ev(t){const[e,n="center"]=t.split("-");return[e,n]}var nc=q0,rc=Y0,Hf=X0,zf=Q0,UR="Portal",Vf=v.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,i]=v.useState(!1);Yr(()=>i(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?Pa.createPortal(T.jsx(ge.div,{...r,ref:e}),s):null});Vf.displayName=UR;function KR(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var Ln=t=>{const{present:e,children:n}=t,r=GR(e),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=$e(r.ref,qR(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};Ln.displayName="Presence";function GR(t){const[e,n]=v.useState(),r=v.useRef({}),o=v.useRef(t),i=v.useRef("none"),s=t?"mounted":"unmounted",[l,a]=KR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const c=js(r.current);i.current=l==="mounted"?c:"none"},[l]),Yr(()=>{const c=r.current,u=o.current;if(u!==t){const f=i.current,h=js(c);t?a("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,a]),Yr(()=>{if(e){const c=d=>{const h=js(r.current).includes(d.animationName);d.target===e&&h&&uf.flushSync(()=>a("ANIMATION_END"))},u=d=>{d.target===e&&(i.current=js(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:v.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function js(t){return(t==null?void 0:t.animationName)||"none"}function qR(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var JR="VisuallyHidden",tv=v.forwardRef((t,e)=>T.jsx(ge.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));tv.displayName=JR;var YR=tv,[oc,O4]=In("Tooltip",[ri]),ic=ri(),nv="TooltipProvider",XR=700,fd="tooltip.open",[ZR,Wf]=oc(nv),rv=t=>{const{__scopeTooltip:e,delayDuration:n=XR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,[s,l]=v.useState(!0),a=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),T.jsx(ZR,{scope:e,isOpenDelayed:s,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(c.current),l(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};rv.displayName=nv;var sc="Tooltip",[QR,lc]=oc(sc),ov=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=t,a=Wf(sc,t.__scopeTooltip),c=ic(e),[u,d]=v.useState(null),f=hr(),h=v.useRef(0),p=s??a.disableHoverableContent,m=l??a.delayDuration,g=v.useRef(!1),[y=!1,x]=Er({prop:r,defaultProp:o,onChange:k=>{k?(a.onOpen(),document.dispatchEvent(new CustomEvent(fd))):a.onClose(),i==null||i(k)}}),S=v.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),b=v.useCallback(()=>{window.clearTimeout(h.current),g.current=!1,x(!0)},[x]),C=v.useCallback(()=>{window.clearTimeout(h.current),x(!1)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,x(!0)},m)},[m,x]);return v.useEffect(()=>()=>window.clearTimeout(h.current),[]),T.jsx(nc,{...c,children:T.jsx(QR,{scope:e,contentId:f,open:y,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{a.isOpenDelayed?w():b()},[a.isOpenDelayed,w,b]),onTriggerLeave:v.useCallback(()=>{p?C():window.clearTimeout(h.current)},[C,p]),onOpen:b,onClose:C,disableHoverableContent:p,children:n})})};ov.displayName=sc;var hd="TooltipTrigger",iv=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=lc(hd,n),i=Wf(hd,n),s=ic(n),l=v.useRef(null),a=$e(e,l,o.onTriggerChange),c=v.useRef(!1),u=v.useRef(!1),d=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),T.jsx(rc,{asChild:!0,...s,children:T.jsx(ge.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:a,onPointerMove:ee(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ee(t.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ee(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ee(t.onFocus,()=>{c.current||o.onOpen()}),onBlur:ee(t.onBlur,o.onClose),onClick:ee(t.onClick,o.onClose)})})});iv.displayName=hd;var eN="TooltipPortal",[A4,tN]=oc(eN,{forceMount:void 0}),jo="TooltipContent",sv=v.forwardRef((t,e)=>{const n=tN(jo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=lc(jo,t.__scopeTooltip);return T.jsx(Ln,{present:r||s.open,children:s.disableHoverableContent?T.jsx(lv,{side:o,...i,ref:e}):T.jsx(nN,{side:o,...i,ref:e})})}),nN=v.forwardRef((t,e)=>{const n=lc(jo,t.__scopeTooltip),r=Wf(jo,t.__scopeTooltip),o=v.useRef(null),i=$e(e,o),[s,l]=v.useState(null),{trigger:a,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{l(null),d(!1)},[d]),h=v.useCallback((p,m)=>{const g=p.currentTarget,y={x:p.clientX,y:p.clientY},x=sN(y,g.getBoundingClientRect()),S=lN(y,x),b=aN(m.getBoundingClientRect()),C=uN([...S,...b]);l(C),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(a&&u){const p=g=>h(g,u),m=g=>h(g,a);return a.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{a.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[a,u,h,f]),v.useEffect(()=>{if(s){const p=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},x=(a==null?void 0:a.contains(g))||(u==null?void 0:u.contains(g)),S=!cN(y,s);x?f():S&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[a,u,s,c,f]),T.jsx(lv,{...t,ref:i})}),[rN,oN]=oc(sc,{isInside:!1}),lv=v.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=t,a=lc(jo,n),c=ic(n),{onClose:u}=a;return v.useEffect(()=>(document.addEventListener(fd,u),()=>document.removeEventListener(fd,u)),[u]),v.useEffect(()=>{if(a.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(a.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[a.trigger,u]),T.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:T.jsxs(Hf,{"data-state":a.stateAttribute,...c,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[T.jsx(C0,{children:r}),T.jsx(rN,{scope:n,isInside:!0,children:T.jsx(YR,{id:a.contentId,role:"tooltip",children:o||r})})]})})});sv.displayName=jo;var av="TooltipArrow",iN=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=ic(n);return oN(av,n).isInside?null:T.jsx(zf,{...o,...r,ref:e})});iN.displayName=av;function sN(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function lN(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function aN(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function cN(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const l=e[i].x,a=e[i].y,c=e[s].x,u=e[s].y;a>r!=u>r&&n<(c-l)*(r-a)/(u-a)+l&&(o=!o)}return o}function uN(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dN(e)}function dN(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var fN=rv,hN=ov,pN=iv,mN=sv;const gN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,yN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,vN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wN=nt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",le(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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qr({find:gN,type:this.type}),qr({find:bN,type:this.type})]},addPasteRules(){return[fr({find:yN,type:this.type}),fr({find:vN,type:this.type})]}}),xN=nt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),SN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,EN=nt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qr({find:SN,type:this.type})]},addPasteRules(){return[fr({find:CN,type:this.type})]}}),kN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,MN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,TN=nt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[qr({find:kN,type:this.type})]},addPasteRules(){return[fr({find:MN,type:this.type})]}}),ON=/^```([a-z]+)?[\s\n]$/,AN=/^~~~([a-z]+)?[\s\n]$/,RN=Ne.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",le(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
399
+ */const PO=q("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);function Xa(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var LO=["color"],$O=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,LO);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),P.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),BO=["color"],FO=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,BO);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),P.createElement("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),jO=["color"],HO=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,jO);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),P.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),zO=["color"],VO=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=Xa(t,zO);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),P.createElement("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function ee(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function Pt(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Er({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=WO({defaultProp:e,onChange:n}),i=t!==void 0,s=i?t:r,l=Pt(n),a=v.useCallback(c=>{if(i){const d=typeof c=="function"?c(t):c;d!==t&&l(d)}else o(c)},[i,t,o,l]);return[s,a]}function WO({defaultProp:t,onChange:e}){const n=v.useState(t),[r]=n,o=v.useRef(r),i=Pt(e);return v.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var UO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ge=UO.reduce((t,e)=>{const n=v.forwardRef((r,o)=>{const{asChild:i,...s}=r,l=i?qr:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(l,{...s,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function E0(t,e){t&&df.flushSync(()=>t.dispatchEvent(e))}var KO="Toggle",k0=v.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=t,[s=!1,l]=Er({prop:n,onChange:o,defaultProp:r});return T.jsx(ge.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:ee(t.onClick,()=>{t.disabled||l(!s)})})});k0.displayName=KO;var GO=k0;function M0(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=M0(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function qO(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=M0(t))&&(r&&(r+=" "),r+=e);return r}const nm=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,rm=qO,JO=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return rm(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=nm(u)||nm(d);return o[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),a=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[m,g]=p;return Array.isArray(g)?g.includes({...i,...l}[m]):{...i,...l}[m]===g})?[...c,d,f]:c},[]);return rm(t,s,a,n==null?void 0:n.class,n==null?void 0:n.className)};function T0(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=T0(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function YO(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=T0(t))&&(r&&(r+=" "),r+=e);return r}const _f="-",XO=t=>{const e=QO(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const l=s.split(_f);return l[0]===""&&l.length!==1&&l.shift(),O0(l,e)||ZO(s)},getConflictingClassGroupIds:(s,l)=>{const a=n[s]||[];return l&&r[s]?[...a,...r[s]]:a}}},O0=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?O0(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(_f);return(s=e.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId},om=/^\[(.+)\]$/,ZO=t=>{if(om.test(t)){const e=om.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},QO=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return tA(Object.entries(t.classGroups),n).forEach(([i,s])=>{cd(s,r,i,e)}),r},cd=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:im(e,o);i.classGroupId=n;return}if(typeof o=="function"){if(eA(o)){cd(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{cd(s,im(e,i),n,r)})})},im=(t,e)=>{let n=t;return e.split(_f).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},eA=t=>t.isThemeGetter,tA=(t,e)=>e?t.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[e+s,l])):i);return[n,o]}):t,nA=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},A0="!",rA=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],i=e.length,s=l=>{const a=[];let c=0,u=0,d;for(let g=0;g<l.length;g++){let y=l[g];if(c===0){if(y===o&&(r||l.slice(g,g+i)===e)){a.push(l.slice(u,g)),u=g+i;continue}if(y==="/"){d=g;continue}}y==="["?c++:y==="]"&&c--}const f=a.length===0?l:l.substring(u),h=f.startsWith(A0),p=h?f.substring(1):f,m=d&&d>u?d-u:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};return n?l=>n({className:l,parseClassName:s}):s},oA=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},iA=t=>({cache:nA(t.cacheSize),parseClassName:rA(t),...XO(t)}),sA=/\s+/,lA=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,i=[],s=t.trim().split(sA);let l="";for(let a=s.length-1;a>=0;a-=1){const c=s[a],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(c);let p=!!h,m=r(p?f.substring(0,h):f);if(!m){if(!p){l=c+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=c+(l.length>0?" "+l:l);continue}p=!1}const g=oA(u).join(":"),y=d?g+A0:g,w=y+m;if(i.includes(w))continue;i.push(w);const S=o(m,p);for(let b=0;b<S.length;++b){const C=S[b];i.push(y+C)}l=c+(l.length>0?" "+l:l)}return l};function aA(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=R0(e))&&(r&&(r+=" "),r+=n);return r}const R0=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=R0(t[r]))&&(n&&(n+=" "),n+=e);return n};function cA(t,...e){let n,r,o,i=s;function s(a){const c=e.reduce((u,d)=>d(u),t());return n=iA(c),r=n.cache.get,o=n.cache.set,i=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=lA(a,n);return o(a,u),u}return function(){return i(aA.apply(null,arguments))}}const xe=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},N0=/^\[(?:([a-z-]+):)?(.+)\]$/i,uA=/^\d+\/\d+$/,dA=new Set(["px","full","screen"]),fA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=t=>Ro(t)||dA.has(t)||uA.test(t),zn=t=>ei(t,"length",EA),Ro=t=>!!t&&!Number.isNaN(Number(t)),Kc=t=>ei(t,"number",Ro),ui=t=>!!t&&Number.isInteger(Number(t)),yA=t=>t.endsWith("%")&&Ro(t.slice(0,-1)),re=t=>N0.test(t),Vn=t=>fA.test(t),bA=new Set(["length","size","percentage"]),vA=t=>ei(t,bA,D0),wA=t=>ei(t,"position",D0),xA=new Set(["image","url"]),SA=t=>ei(t,xA,MA),CA=t=>ei(t,"",kA),di=()=>!0,ei=(t,e,n)=>{const r=N0.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},EA=t=>hA.test(t)&&!pA.test(t),D0=()=>!1,kA=t=>mA.test(t),MA=t=>gA.test(t),TA=()=>{const t=xe("colors"),e=xe("spacing"),n=xe("blur"),r=xe("brightness"),o=xe("borderColor"),i=xe("borderRadius"),s=xe("borderSpacing"),l=xe("borderWidth"),a=xe("contrast"),c=xe("grayscale"),u=xe("hueRotate"),d=xe("invert"),f=xe("gap"),h=xe("gradientColorStops"),p=xe("gradientColorStopPositions"),m=xe("inset"),g=xe("margin"),y=xe("opacity"),w=xe("padding"),S=xe("saturate"),b=xe("scale"),C=xe("sepia"),x=xe("skew"),k=xe("space"),A=xe("translate"),E=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",re,e],L=()=>[re,e],H=()=>["",vn,zn],U=()=>["auto",Ro,re],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",re],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>[Ro,re];return{cacheSize:500,separator:":",theme:{colors:[di],spacing:[vn,zn],blur:["none","",Vn,re],brightness:J(),borderColor:[t],borderRadius:["none","","full",Vn,re],borderSpacing:L(),borderWidth:H(),contrast:J(),grayscale:D(),hueRotate:J(),invert:D(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[yA,zn],inset:_(),margin:_(),opacity:J(),padding:L(),saturate:J(),scale:J(),sepia:D(),skew:J(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Vn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),re]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ui,re]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",ui,re]}],"grid-cols":[{"grid-cols":[di]}],"col-start-end":[{col:["auto",{span:["full",ui,re]},re]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[di]}],"row-start-end":[{row:["auto",{span:[ui,re]},re]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,e]}],"min-w":[{"min-w":[re,e,"min","max","fit"]}],"max-w":[{"max-w":[re,e,"none","full","min","max","fit","prose",{screen:[Vn]},Vn]}],h:[{h:[re,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Vn,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kc]}],"font-family":[{font:[di]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",Ro,Kc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vn,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vn,zn]}],"underline-offset":[{"underline-offset":["auto",vn,re]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),wA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},SA]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[vn,re]}],"outline-w":[{outline:[vn,zn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[vn,zn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Vn,CA]}],"shadow-color":[{shadow:[di]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",Vn,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:J()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:J()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ui,re]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[vn,zn,Kc]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},OA=cA(TA);function In(t,e=[]){let n=[];function r(i,s){const l=v.createContext(s),a=n.length;n=[...n,s];function c(d){const{scope:f,children:h,...p}=d,m=(f==null?void 0:f[t][a])||l,g=v.useMemo(()=>p,Object.values(p));return T.jsx(m.Provider,{value:g,children:h})}function u(d,f){const h=(f==null?void 0:f[t][a])||l,p=v.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>v.createContext(s));return function(l){const a=(l==null?void 0:l[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...l,[t]:a}}),[l,a])}};return o.scopeName=t,[r,AA(o,...e)]}function AA(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:a,scopeName:c})=>{const d=a(i)[`__scope${c}`];return{...l,...d}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function RA(t,e=globalThis==null?void 0:globalThis.document){const n=Pt(t);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var NA="DismissableLayer",ud="dismissableLayer.update",DA="dismissableLayer.pointerDownOutside",_A="dismissableLayer.focusOutside",sm,_0=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Za=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...a}=t,c=v.useContext(_0),[u,d]=v.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=v.useState({}),p=$e(e,k=>d(k)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),w=u?m.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,b=w>=y,C=LA(k=>{const A=k.target,E=[...c.branches].some(O=>O.contains(A));!b||E||(o==null||o(k),s==null||s(k),k.defaultPrevented||l==null||l())},f),x=$A(k=>{const A=k.target;[...c.branches].some(O=>O.contains(A))||(i==null||i(k),s==null||s(k),k.defaultPrevented||l==null||l())},f);return RA(k=>{w===c.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),v.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(sm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),lm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sm)}},[u,f,n,c]),v.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),lm())},[u,c]),v.useEffect(()=>{const k=()=>h({});return document.addEventListener(ud,k),()=>document.removeEventListener(ud,k)},[]),T.jsx(ge.div,{...a,ref:p,style:{pointerEvents:S?b?"auto":"none":void 0,...t.style},onFocusCapture:ee(t.onFocusCapture,x.onFocusCapture),onBlurCapture:ee(t.onBlurCapture,x.onBlurCapture),onPointerDownCapture:ee(t.onPointerDownCapture,C.onPointerDownCapture)})});Za.displayName=NA;var IA="DismissableLayerBranch",PA=v.forwardRef((t,e)=>{const n=v.useContext(_0),r=v.useRef(null),o=$e(e,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),T.jsx(ge.div,{...t,ref:o})});PA.displayName=IA;function LA(t,e=globalThis==null?void 0:globalThis.document){const n=Pt(t),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let a=function(){I0(DA,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=a,e.addEventListener("click",o.current,{once:!0})):a()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function $A(t,e=globalThis==null?void 0:globalThis.document){const n=Pt(t),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&I0(_A,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lm(){const t=new CustomEvent(ud);document.dispatchEvent(t)}function I0(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?E0(o,i):o.dispatchEvent(i)}var Jr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},BA=v.useId||(()=>{}),FA=0;function hr(t){const[e,n]=v.useState(BA());return Jr(()=>{n(r=>r??String(FA++))},[t]),e?`radix-${e}`:""}const jA=["top","right","bottom","left"],nn=Math.min,bt=Math.max,Fl=Math.round,Bs=Math.floor,pr=t=>({x:t,y:t}),HA={left:"right",right:"left",bottom:"top",top:"bottom"},zA={start:"end",end:"start"};function dd(t,e,n){return bt(t,nn(e,n))}function An(t,e){return typeof t=="function"?t(e):t}function Rn(t){return t.split("-")[0]}function ti(t){return t.split("-")[1]}function If(t){return t==="x"?"y":"x"}function Pf(t){return t==="y"?"height":"width"}function mr(t){return["top","bottom"].includes(Rn(t))?"y":"x"}function Lf(t){return If(mr(t))}function VA(t,e,n){n===void 0&&(n=!1);const r=ti(t),o=Lf(t),i=Pf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=jl(s)),[s,jl(s)]}function WA(t){const e=jl(t);return[fd(t),e,fd(e)]}function fd(t){return t.replace(/start|end/g,e=>zA[e])}function UA(t,e,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?i:s;default:return[]}}function KA(t,e,n,r){const o=ti(t);let i=UA(Rn(t),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(fd)))),i}function jl(t){return t.replace(/left|right|bottom|top/g,e=>HA[e])}function GA(t){return{top:0,right:0,bottom:0,left:0,...t}}function P0(t){return typeof t!="number"?GA(t):{top:t,right:t,bottom:t,left:t}}function Hl(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function am(t,e,n){let{reference:r,floating:o}=t;const i=mr(e),s=Lf(e),l=Pf(s),a=Rn(e),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let h;switch(a){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ti(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const qA=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:d}=am(c,r,a),f=r,h={},p=0;for(let m=0;m<l.length;m++){const{name:g,fn:y}=l[m],{x:w,y:S,data:b,reset:C}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});u=w??u,d=S??d,h={...h,[g]:{...h[g],...b}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):C.rects),{x:u,y:d}=am(c,f,a)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Vi(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=An(e,t),p=P0(h),g=l[f?d==="floating"?"reference":"floating":d],y=Hl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=Hl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:S,strategy:a}):w);return{top:(y.top-C.top+p.top)/b.y,bottom:(C.bottom-y.bottom+p.bottom)/b.y,left:(y.left-C.left+p.left)/b.x,right:(C.right-y.right+p.right)/b.x}}const JA=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:u=0}=An(t,e)||{};if(c==null)return{};const d=P0(u),f={x:n,y:r},h=Lf(o),p=Pf(h),m=await s.getDimensions(c),g=h==="y",y=g?"top":"left",w=g?"bottom":"right",S=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[h]-f[h]-i.floating[p],C=f[h]-i.reference[h],x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=x?x[S]:0;(!k||!await(s.isElement==null?void 0:s.isElement(x)))&&(k=l.floating[S]||i.floating[p]);const A=b/2-C/2,E=k/2-m[p]/2-1,O=nn(d[y],E),_=nn(d[w],E),L=O,H=k-m[p]-_,U=k/2-m[p]/2+A,K=dd(L,U,H),j=!a.arrow&&ti(o)!=null&&U!==K&&i.reference[p]/2-(U<L?O:_)-m[p]/2<0,M=j?U<L?U-L:U-H:0;return{[h]:f[h]+M,data:{[h]:K,centerOffset:U-K-M,...j&&{alignmentOffset:M}},reset:j}}}),YA=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=An(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Rn(o),w=mr(l),S=Rn(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=f||(S||!m?[jl(l)]:WA(l)),x=p!=="none";!f&&x&&C.push(...KA(l,m,p,b));const k=[l,...C],A=await Vi(e,g),E=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(A[y]),d){const U=VA(o,s,b);E.push(A[U[0]],A[U[1]])}if(O=[...O,{placement:o,overflows:E}],!E.every(U=>U<=0)){var _,L;const U=(((_=i.flip)==null?void 0:_.index)||0)+1,K=k[U];if(K)return{data:{index:U,overflows:O},reset:{placement:K}};let j=(L=O.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!j)switch(h){case"bestFit":{var H;const M=(H=O.filter(N=>{if(x){const D=mr(N.placement);return D===w||D==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(D=>D>0).reduce((D,z)=>D+z,0)]).sort((N,D)=>N[1]-D[1])[0])==null?void 0:H[0];M&&(j=M);break}case"initialPlacement":j=l;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function cm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function um(t){return jA.some(e=>t[e]>=0)}const XA=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=An(t,e);switch(r){case"referenceHidden":{const i=await Vi(e,{...o,elementContext:"reference"}),s=cm(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:um(s)}}}case"escaped":{const i=await Vi(e,{...o,altBoundary:!0}),s=cm(i,n.floating);return{data:{escapedOffsets:s,escaped:um(s)}}}default:return{}}}}};async function ZA(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Rn(n),l=ti(n),a=mr(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&a?-1:1,d=An(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return l&&typeof p=="number"&&(h=l==="end"?p*-1:p),a?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const QA=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=e,a=await ZA(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:s}}}}},eR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:y,y:w}=g;return{x:y,y:w}}},...a}=An(t,e),c={x:n,y:r},u=await Vi(e,a),d=mr(Rn(o)),f=If(d);let h=c[f],p=c[d];if(i){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=h+u[g],S=h-u[y];h=dd(w,h,S)}if(s){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=p+u[g],S=p-u[y];p=dd(w,p,S)}const m=l.fn({...e,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},tR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=An(t,e),u={x:n,y:r},d=mr(o),f=If(d);let h=u[f],p=u[d];const m=An(l,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const S=f==="y"?"height":"width",b=i.reference[f]-i.floating[S]+g.mainAxis,C=i.reference[f]+i.reference[S]-g.mainAxis;h<b?h=b:h>C&&(h=C)}if(c){var y,w;const S=f==="y"?"width":"height",b=["top","left"].includes(Rn(o)),C=i.reference[d]-i.floating[S]+(b&&((y=s.offset)==null?void 0:y[d])||0)+(b?0:g.crossAxis),x=i.reference[d]+i.reference[S]+(b?0:((w=s.offset)==null?void 0:w[d])||0)-(b?g.crossAxis:0);p<C?p=C:p>x&&(p=x)}return{[f]:h,[d]:p}}}},nR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:s=()=>{},...l}=An(t,e),a=await Vi(e,l),c=Rn(n),u=ti(n),d=mr(n)==="y",{width:f,height:h}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const g=h-a.top-a.bottom,y=f-a.left-a.right,w=nn(h-a[p],g),S=nn(f-a[m],y),b=!e.middlewareData.shift;let C=w,x=S;if(d?x=u||b?nn(S,y):y:C=u||b?nn(w,g):g,b&&!u){const A=bt(a.left,0),E=bt(a.right,0),O=bt(a.top,0),_=bt(a.bottom,0);d?x=f-2*(A!==0||E!==0?A+E:bt(a.left,a.right)):C=h-2*(O!==0||_!==0?O+_:bt(a.top,a.bottom))}await s({...e,availableWidth:x,availableHeight:C});const k=await o.getDimensions(i.floating);return f!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function ni(t){return L0(t)?(t.nodeName||"").toLowerCase():"#document"}function xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Pn(t){var e;return(e=(L0(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function L0(t){return t instanceof Node||t instanceof xt(t).Node}function Vt(t){return t instanceof Element||t instanceof xt(t).Element}function cn(t){return t instanceof HTMLElement||t instanceof xt(t).HTMLElement}function dm(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xt(t).ShadowRoot}function ws(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Wt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function rR(t){return["table","td","th"].includes(ni(t))}function Qa(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function $f(t){const e=Bf(),n=Vt(t)?Wt(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function oR(t){let e=gr(t);for(;cn(e)&&!Fo(e);){if($f(e))return e;if(Qa(e))return null;e=gr(e)}return null}function Bf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fo(t){return["html","body","#document"].includes(ni(t))}function Wt(t){return xt(t).getComputedStyle(t)}function ec(t){return Vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gr(t){if(ni(t)==="html")return t;const e=t.assignedSlot||t.parentNode||dm(t)&&t.host||Pn(t);return dm(e)?e.host:e}function $0(t){const e=gr(t);return Fo(e)?t.ownerDocument?t.ownerDocument.body:t.body:cn(e)&&ws(e)?e:$0(e)}function Wi(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=$0(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),s=xt(o);return i?e.concat(s,s.visualViewport||[],ws(o)?o:[],s.frameElement&&n?Wi(s.frameElement):[]):e.concat(o,Wi(o,[],n))}function B0(t){const e=Wt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=cn(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,l=Fl(n)!==i||Fl(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Ff(t){return Vt(t)?t:t.contextElement}function No(t){const e=Ff(t);if(!cn(e))return pr(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=B0(e);let s=(i?Fl(n.width):n.width)/r,l=(i?Fl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const iR=pr(0);function F0(t){const e=xt(t);return!Bf()||!e.visualViewport?iR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function sR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xt(t)?!1:e}function Yr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=Ff(t);let s=pr(1);e&&(r?Vt(r)&&(s=No(r)):s=No(t));const l=sR(i,n,r)?F0(i):pr(0);let a=(o.left+l.x)/s.x,c=(o.top+l.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=xt(i),h=r&&Vt(r)?xt(r):r;let p=f,m=p.frameElement;for(;m&&r&&h!==p;){const g=No(m),y=m.getBoundingClientRect(),w=Wt(m),S=y.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,b=y.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;a*=g.x,c*=g.y,u*=g.x,d*=g.y,a+=S,c+=b,p=xt(m),m=p.frameElement}}return Hl({width:u,height:d,x:a,y:c})}function lR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i=o==="fixed",s=Pn(r),l=e?Qa(e.floating):!1;if(r===s||l&&i)return n;let a={scrollLeft:0,scrollTop:0},c=pr(1);const u=pr(0),d=cn(r);if((d||!d&&!i)&&((ni(r)!=="body"||ws(s))&&(a=ec(r)),cn(r))){const f=Yr(r);c=No(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x,y:n.y*c.y-a.scrollTop*c.y+u.y}}function aR(t){return Array.from(t.getClientRects())}function j0(t){return Yr(Pn(t)).left+ec(t).scrollLeft}function cR(t){const e=Pn(t),n=ec(t),r=t.ownerDocument.body,o=bt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=bt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+j0(t);const l=-n.scrollTop;return Wt(r).direction==="rtl"&&(s+=bt(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function uR(t,e){const n=xt(t),r=Pn(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;const c=Bf();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:s,x:l,y:a}}function dR(t,e){const n=Yr(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=cn(t)?No(t):pr(1),s=t.clientWidth*i.x,l=t.clientHeight*i.y,a=o*i.x,c=r*i.y;return{width:s,height:l,x:a,y:c}}function fm(t,e,n){let r;if(e==="viewport")r=uR(t,n);else if(e==="document")r=cR(Pn(t));else if(Vt(e))r=dR(e,n);else{const o=F0(t);r={...e,x:e.x-o.x,y:e.y-o.y}}return Hl(r)}function H0(t,e){const n=gr(t);return n===e||!Vt(n)||Fo(n)?!1:Wt(n).position==="fixed"||H0(n,e)}function fR(t,e){const n=e.get(t);if(n)return n;let r=Wi(t,[],!1).filter(l=>Vt(l)&&ni(l)!=="body"),o=null;const i=Wt(t).position==="fixed";let s=i?gr(t):t;for(;Vt(s)&&!Fo(s);){const l=Wt(s),a=$f(s);!a&&l.position==="fixed"&&(o=null),(i?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ws(s)&&!a&&H0(t,s))?r=r.filter(u=>u!==s):o=l,s=gr(s)}return e.set(t,r),r}function hR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?Qa(e)?[]:fR(e,this._c):[].concat(n),r],l=s[0],a=s.reduce((c,u)=>{const d=fm(e,u,o);return c.top=bt(d.top,c.top),c.right=nn(d.right,c.right),c.bottom=nn(d.bottom,c.bottom),c.left=bt(d.left,c.left),c},fm(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function pR(t){const{width:e,height:n}=B0(t);return{width:e,height:n}}function mR(t,e,n){const r=cn(e),o=Pn(e),i=n==="fixed",s=Yr(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const a=pr(0);if(r||!r&&!i)if((ni(e)!=="body"||ws(o))&&(l=ec(e)),r){const d=Yr(e,!0,i,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else o&&(a.x=j0(o));const c=s.left+l.scrollLeft-a.x,u=s.top+l.scrollTop-a.y;return{x:c,y:u,width:s.width,height:s.height}}function Gc(t){return Wt(t).position==="static"}function hm(t,e){return!cn(t)||Wt(t).position==="fixed"?null:e?e(t):t.offsetParent}function z0(t,e){const n=xt(t);if(Qa(t))return n;if(!cn(t)){let o=gr(t);for(;o&&!Fo(o);){if(Vt(o)&&!Gc(o))return o;o=gr(o)}return n}let r=hm(t,e);for(;r&&rR(r)&&Gc(r);)r=hm(r,e);return r&&Fo(r)&&Gc(r)&&!$f(r)?n:r||oR(t)||n}const gR=async function(t){const e=this.getOffsetParent||z0,n=this.getDimensions,r=await n(t.floating);return{reference:mR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yR(t){return Wt(t).direction==="rtl"}const bR={convertOffsetParentRelativeRectToViewportRelativeRect:lR,getDocumentElement:Pn,getClippingRect:hR,getOffsetParent:z0,getElementRects:gR,getClientRects:aR,getDimensions:pR,getScale:No,isElement:Vt,isRTL:yR};function vR(t,e){let n=null,r;const o=Pn(t);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(l||e(),!d||!f)return;const h=Bs(u),p=Bs(o.clientWidth-(c+d)),m=Bs(o.clientHeight-(u+f)),g=Bs(c),w={rootMargin:-h+"px "+-p+"px "+-m+"px "+-g+"px",threshold:bt(0,nn(1,a))||1};let S=!0;function b(C){const x=C[0].intersectionRatio;if(x!==a){if(!S)return s();x?s(!1,x):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,w)}n.observe(t)}return s(!0),i}function wR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Ff(t),u=o||i?[...c?Wi(c):[],...Wi(e)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&l?vR(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(y=>{let[w]=y;w&&w.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),n()}),c&&!a&&h.observe(c),h.observe(e));let p,m=a?Yr(t):null;a&&g();function g(){const y=Yr(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,p=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,a&&cancelAnimationFrame(p)}}const xR=QA,SR=eR,CR=YA,ER=nR,kR=XA,pm=JA,MR=tR,TR=(t,e,n)=>{const r=new Map,o={platform:bR,...n},i={...o.platform,_c:r};return qA(t,e,{...o,platform:i})};var hl=typeof document<"u"?P.useLayoutEffect:P.useEffect;function zl(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!zl(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!zl(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function V0(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function mm(t,e){const n=V0(t);return Math.round(e*n)/n}function gm(t){const e=v.useRef(t);return hl(()=>{e.current=t}),e}function OR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:a,open:c}=t,[u,d]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=v.useState(r);zl(f,r)||h(r);const[p,m]=v.useState(null),[g,y]=v.useState(null),w=v.useCallback(M=>{M!==x.current&&(x.current=M,m(M))},[]),S=v.useCallback(M=>{M!==k.current&&(k.current=M,y(M))},[]),b=i||p,C=s||g,x=v.useRef(null),k=v.useRef(null),A=v.useRef(u),E=a!=null,O=gm(a),_=gm(o),L=v.useCallback(()=>{if(!x.current||!k.current)return;const M={placement:e,strategy:n,middleware:f};_.current&&(M.platform=_.current),TR(x.current,k.current,M).then(N=>{const D={...N,isPositioned:!0};H.current&&!zl(A.current,D)&&(A.current=D,df.flushSync(()=>{d(D)}))})},[f,e,n,_]);hl(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[c]);const H=v.useRef(!1);hl(()=>(H.current=!0,()=>{H.current=!1}),[]),hl(()=>{if(b&&(x.current=b),C&&(k.current=C),b&&C){if(O.current)return O.current(b,C,L);L()}},[b,C,L,O,E]);const U=v.useMemo(()=>({reference:x,floating:k,setReference:w,setFloating:S}),[w,S]),K=v.useMemo(()=>({reference:b,floating:C}),[b,C]),j=v.useMemo(()=>{const M={position:n,left:0,top:0};if(!K.floating)return M;const N=mm(K.floating,u.x),D=mm(K.floating,u.y);return l?{...M,transform:"translate("+N+"px, "+D+"px)",...V0(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:D}},[n,l,K.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:L,refs:U,elements:K,floatingStyles:j}),[u,L,U,K,j])}const AR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?pm({element:r.current,padding:o}).fn(n):{}:r?pm({element:r,padding:o}).fn(n):{}}}},RR=(t,e)=>({...xR(t),options:[t,e]}),NR=(t,e)=>({...SR(t),options:[t,e]}),DR=(t,e)=>({...MR(t),options:[t,e]}),_R=(t,e)=>({...CR(t),options:[t,e]}),IR=(t,e)=>({...ER(t),options:[t,e]}),PR=(t,e)=>({...kR(t),options:[t,e]}),LR=(t,e)=>({...AR(t),options:[t,e]});var $R="Arrow",W0=v.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...i}=t;return T.jsx(ge.svg,{...i,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});W0.displayName=$R;var BR=W0;function U0(t){const[e,n]=v.useState(void 0);return Jr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const a=i.borderBoxSize,c=Array.isArray(a)?a[0]:a;s=c.inlineSize,l=c.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var jf="Popper",[K0,ri]=In(jf),[FR,G0]=K0(jf),q0=t=>{const{__scopePopper:e,children:n}=t,[r,o]=v.useState(null);return T.jsx(FR,{scope:e,anchor:r,onAnchorChange:o,children:n})};q0.displayName=jf;var J0="PopperAnchor",Y0=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=G0(J0,n),s=v.useRef(null),l=$e(e,s);return v.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:T.jsx(ge.div,{...o,ref:l})});Y0.displayName=J0;var Hf="PopperContent",[jR,HR]=K0(Hf),X0=v.forwardRef((t,e)=>{var Pe,Be,Oe,Ze,Bt,mn;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:a=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...m}=t,g=G0(Hf,n),[y,w]=v.useState(null),S=$e(e,mt=>w(mt)),[b,C]=v.useState(null),x=U0(b),k=(x==null?void 0:x.width)??0,A=(x==null?void 0:x.height)??0,E=r+(i!=="center"?"-"+i:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(c)?c:[c],L=_.length>0,H={padding:O,boundary:_.filter(VR),altBoundary:L},{refs:U,floatingStyles:K,placement:j,isPositioned:M,middlewareData:N}=OR({strategy:"fixed",placement:E,whileElementsMounted:(...mt)=>wR(...mt,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[RR({mainAxis:o+A,alignmentAxis:s}),a&&NR({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?DR():void 0,...H}),a&&_R({...H}),IR({...H,apply:({elements:mt,rects:Ct,availableWidth:gn,availableHeight:Fe})=>{const{width:yn,height:Kt}=Ct.reference,X=mt.floating.style;X.setProperty("--radix-popper-available-width",`${gn}px`),X.setProperty("--radix-popper-available-height",`${Fe}px`),X.setProperty("--radix-popper-anchor-width",`${yn}px`),X.setProperty("--radix-popper-anchor-height",`${Kt}px`)}}),b&&LR({element:b,padding:l}),WR({arrowWidth:k,arrowHeight:A}),f&&PR({strategy:"referenceHidden",...H})]}),[D,z]=ev(j),J=Pt(p);Jr(()=>{M&&(J==null||J())},[M,J]);const se=(Pe=N.arrow)==null?void 0:Pe.x,Te=(Be=N.arrow)==null?void 0:Be.y,De=((Oe=N.arrow)==null?void 0:Oe.centerOffset)!==0,[de,he]=v.useState();return Jr(()=>{y&&he(window.getComputedStyle(y).zIndex)},[y]),T.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:M?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(Ze=N.transformOrigin)==null?void 0:Ze.x,(Bt=N.transformOrigin)==null?void 0:Bt.y].join(" "),...((mn=N.hide)==null?void 0:mn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T.jsx(jR,{scope:n,placedSide:D,onArrowChange:C,arrowX:se,arrowY:Te,shouldHideArrow:De,children:T.jsx(ge.div,{"data-side":D,"data-align":z,...m,ref:S,style:{...m.style,animation:M?void 0:"none"}})})})});X0.displayName=Hf;var Z0="PopperArrow",zR={top:"bottom",right:"left",bottom:"top",left:"right"},Q0=v.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=HR(Z0,r),s=zR[i.placedSide];return T.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:T.jsx(BR,{...o,ref:n,style:{...o.style,display:"block"}})})});Q0.displayName=Z0;function VR(t){return t!==null}var WR=t=>({name:"transformOrigin",options:t,fn(e){var g,y,w;const{placement:n,rects:r,middlewareData:o}=e,s=((g=o.arrow)==null?void 0:g.centerOffset)!==0,l=s?0:t.arrowWidth,a=s?0:t.arrowHeight,[c,u]=ev(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=o.arrow)==null?void 0:y.x)??0)+l/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+a/2;let p="",m="";return c==="bottom"?(p=s?d:`${f}px`,m=`${-a}px`):c==="top"?(p=s?d:`${f}px`,m=`${r.floating.height+a}px`):c==="right"?(p=`${-a}px`,m=s?d:`${h}px`):c==="left"&&(p=`${r.floating.width+a}px`,m=s?d:`${h}px`),{data:{x:p,y:m}}}});function ev(t){const[e,n="center"]=t.split("-");return[e,n]}var tc=q0,nc=Y0,zf=X0,Vf=Q0,UR="Portal",Wf=v.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,i]=v.useState(!1);Jr(()=>i(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?Ia.createPortal(T.jsx(ge.div,{...r,ref:e}),s):null});Wf.displayName=UR;function KR(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}var Ln=t=>{const{present:e,children:n}=t,r=GR(e),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=$e(r.ref,qR(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};Ln.displayName="Presence";function GR(t){const[e,n]=v.useState(),r=v.useRef({}),o=v.useRef(t),i=v.useRef("none"),s=t?"mounted":"unmounted",[l,a]=KR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const c=Fs(r.current);i.current=l==="mounted"?c:"none"},[l]),Jr(()=>{const c=r.current,u=o.current;if(u!==t){const f=i.current,h=Fs(c);t?a("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,a]),Jr(()=>{if(e){const c=d=>{const h=Fs(r.current).includes(d.animationName);d.target===e&&h&&df.flushSync(()=>a("ANIMATION_END"))},u=d=>{d.target===e&&(i.current=Fs(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:v.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Fs(t){return(t==null?void 0:t.animationName)||"none"}function qR(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var JR="VisuallyHidden",tv=v.forwardRef((t,e)=>T.jsx(ge.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));tv.displayName=JR;var YR=tv,[rc,T4]=In("Tooltip",[ri]),oc=ri(),nv="TooltipProvider",XR=700,hd="tooltip.open",[ZR,Uf]=rc(nv),rv=t=>{const{__scopeTooltip:e,delayDuration:n=XR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,[s,l]=v.useState(!0),a=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),T.jsx(ZR,{scope:e,isOpenDelayed:s,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(c.current),l(!1)},[]),onClose:v.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};rv.displayName=nv;var ic="Tooltip",[QR,sc]=rc(ic),ov=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=t,a=Uf(ic,t.__scopeTooltip),c=oc(e),[u,d]=v.useState(null),f=hr(),h=v.useRef(0),p=s??a.disableHoverableContent,m=l??a.delayDuration,g=v.useRef(!1),[y=!1,w]=Er({prop:r,defaultProp:o,onChange:k=>{k?(a.onOpen(),document.dispatchEvent(new CustomEvent(hd))):a.onClose(),i==null||i(k)}}),S=v.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),b=v.useCallback(()=>{window.clearTimeout(h.current),g.current=!1,w(!0)},[w]),C=v.useCallback(()=>{window.clearTimeout(h.current),w(!1)},[w]),x=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,w(!0)},m)},[m,w]);return v.useEffect(()=>()=>window.clearTimeout(h.current),[]),T.jsx(tc,{...c,children:T.jsx(QR,{scope:e,contentId:f,open:y,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{a.isOpenDelayed?x():b()},[a.isOpenDelayed,x,b]),onTriggerLeave:v.useCallback(()=>{p?C():window.clearTimeout(h.current)},[C,p]),onOpen:b,onClose:C,disableHoverableContent:p,children:n})})};ov.displayName=ic;var pd="TooltipTrigger",iv=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=sc(pd,n),i=Uf(pd,n),s=oc(n),l=v.useRef(null),a=$e(e,l,o.onTriggerChange),c=v.useRef(!1),u=v.useRef(!1),d=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),T.jsx(nc,{asChild:!0,...s,children:T.jsx(ge.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:a,onPointerMove:ee(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ee(t.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ee(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ee(t.onFocus,()=>{c.current||o.onOpen()}),onBlur:ee(t.onBlur,o.onClose),onClick:ee(t.onClick,o.onClose)})})});iv.displayName=pd;var eN="TooltipPortal",[O4,tN]=rc(eN,{forceMount:void 0}),jo="TooltipContent",sv=v.forwardRef((t,e)=>{const n=tN(jo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=sc(jo,t.__scopeTooltip);return T.jsx(Ln,{present:r||s.open,children:s.disableHoverableContent?T.jsx(lv,{side:o,...i,ref:e}):T.jsx(nN,{side:o,...i,ref:e})})}),nN=v.forwardRef((t,e)=>{const n=sc(jo,t.__scopeTooltip),r=Uf(jo,t.__scopeTooltip),o=v.useRef(null),i=$e(e,o),[s,l]=v.useState(null),{trigger:a,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{l(null),d(!1)},[d]),h=v.useCallback((p,m)=>{const g=p.currentTarget,y={x:p.clientX,y:p.clientY},w=sN(y,g.getBoundingClientRect()),S=lN(y,w),b=aN(m.getBoundingClientRect()),C=uN([...S,...b]);l(C),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(a&&u){const p=g=>h(g,u),m=g=>h(g,a);return a.addEventListener("pointerleave",p),u.addEventListener("pointerleave",m),()=>{a.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",m)}}},[a,u,h,f]),v.useEffect(()=>{if(s){const p=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},w=(a==null?void 0:a.contains(g))||(u==null?void 0:u.contains(g)),S=!cN(y,s);w?f():S&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[a,u,s,c,f]),T.jsx(lv,{...t,ref:i})}),[rN,oN]=rc(ic,{isInside:!1}),lv=v.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=t,a=sc(jo,n),c=oc(n),{onClose:u}=a;return v.useEffect(()=>(document.addEventListener(hd,u),()=>document.removeEventListener(hd,u)),[u]),v.useEffect(()=>{if(a.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(a.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[a.trigger,u]),T.jsx(Za,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:T.jsxs(zf,{"data-state":a.stateAttribute,...c,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[T.jsx(S0,{children:r}),T.jsx(rN,{scope:n,isInside:!0,children:T.jsx(YR,{id:a.contentId,role:"tooltip",children:o||r})})]})})});sv.displayName=jo;var av="TooltipArrow",iN=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=oc(n);return oN(av,n).isInside?null:T.jsx(Vf,{...o,...r,ref:e})});iN.displayName=av;function sN(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function lN(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function aN(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function cN(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const l=e[i].x,a=e[i].y,c=e[s].x,u=e[s].y;a>r!=u>r&&n<(c-l)*(r-a)/(u-a)+l&&(o=!o)}return o}function uN(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dN(e)}function dN(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var fN=rv,hN=ov,pN=iv,mN=sv;const gN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,yN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,vN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wN=nt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",le(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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Gr({find:gN,type:this.type}),Gr({find:bN,type:this.type})]},addPasteRules(){return[fr({find:yN,type:this.type}),fr({find:vN,type:this.type})]}}),xN=nt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),SN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,EN=nt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Gr({find:SN,type:this.type})]},addPasteRules(){return[fr({find:CN,type:this.type})]}}),kN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,MN=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,TN=nt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Gr({find:kN,type:this.type})]},addPasteRules(){return[fr({find:MN,type:this.type})]}}),ON=/^```([a-z]+)?[\s\n]$/,AN=/^~~~([a-z]+)?[\s\n]$/,RN=Ne.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",le(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
400
400
 
401
- `);return!i||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(Q.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[id({find:ON,type:this.type,getAttributes:t=>({language:t[1]})}),id({find:AN,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ke({key:new we("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
402
- `));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(X.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function NN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cv(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&cv(n)}),t}class ym{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function uv(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function sr(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const o in r)n[o]=r[o]}),n}const DN="</span>",bm=t=>!!t.scope,_N=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${e}${t}`};class IN{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=uv(e)}openNode(e){if(!bm(e))return;const n=_N(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){bm(e)&&(this.buffer+=DN)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const vm=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class Uf{constructor(){this.rootNode=vm(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=vm({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{Uf._collapse(n)}))}}class PN extends Uf{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new IN(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ui(t){return t?typeof t=="string"?t:t.source:null}function dv(t){return ro("(?=",t,")")}function LN(t){return ro("(?:",t,")*")}function $N(t){return ro("(?:",t,")?")}function ro(...t){return t.map(n=>Ui(n)).join("")}function BN(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Kf(...t){return"("+(BN(t).capture?"":"?:")+t.map(r=>Ui(r)).join("|")+")"}function fv(t){return new RegExp(t.toString()+"|").exec("").length-1}function FN(t,e){const n=t&&t.exec(e);return n&&n.index===0}const jN=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Gf(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const o=n;let i=Ui(r),s="";for(;i.length>0;){const l=jN.exec(i);if(!l){s+=i;break}s+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+o):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}const HN=/\b\B/,hv="[a-zA-Z]\\w*",qf="[a-zA-Z_]\\w*",pv="\\b\\d+(\\.\\d+)?",mv="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",gv="\\b(0b[01]+)",zN="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",VN=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=ro(e,/.*\b/,t.binary,/\b.*/)),sr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Ki={begin:"\\\\[\\s\\S]",relevance:0},WN={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ki]},UN={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ki]},KN={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ac=function(t,e,n={}){const r=sr({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Kf("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ro(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},GN=ac("//","$"),qN=ac("/\\*","\\*/"),JN=ac("#","$"),YN={scope:"number",begin:pv,relevance:0},XN={scope:"number",begin:mv,relevance:0},ZN={scope:"number",begin:gv,relevance:0},QN={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ki,{begin:/\[/,end:/\]/,relevance:0,contains:[Ki]}]},e2={scope:"title",begin:hv,relevance:0},t2={scope:"title",begin:qf,relevance:0},n2={begin:"\\.\\s*"+qf,relevance:0},r2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var Hs=Object.freeze({__proto__:null,APOS_STRING_MODE:WN,BACKSLASH_ESCAPE:Ki,BINARY_NUMBER_MODE:ZN,BINARY_NUMBER_RE:gv,COMMENT:ac,C_BLOCK_COMMENT_MODE:qN,C_LINE_COMMENT_MODE:GN,C_NUMBER_MODE:XN,C_NUMBER_RE:mv,END_SAME_AS_BEGIN:r2,HASH_COMMENT_MODE:JN,IDENT_RE:hv,MATCH_NOTHING_RE:HN,METHOD_GUARD:n2,NUMBER_MODE:YN,NUMBER_RE:pv,PHRASAL_WORDS_MODE:KN,QUOTE_STRING_MODE:UN,REGEXP_MODE:QN,RE_STARTERS_RE:zN,SHEBANG:VN,TITLE_MODE:e2,UNDERSCORE_IDENT_RE:qf,UNDERSCORE_TITLE_MODE:t2});function o2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function i2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function s2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=o2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function l2(t,e){Array.isArray(t.illegal)&&(t.illegal=Kf(...t.illegal))}function a2(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function c2(t,e){t.relevance===void 0&&(t.relevance=1)}const u2=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=ro(n.beforeMatch,dv(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},d2=["of","and","for","in","not","or","if","then","parent","list","value"],f2="keyword";function yv(t,e,n=f2){const r=Object.create(null);return typeof t=="string"?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach(function(i){Object.assign(r,yv(t[i],e,i))}),r;function o(i,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){const a=l.split("|");r[a[0]]=[i,h2(a[0],a[1])]})}}function h2(t,e){return e?Number(e):p2(t)?0:1}function p2(t){return d2.includes(t.toLowerCase())}const wm={},zr=t=>{console.error(t)},xm=(t,...e)=>{console.log(`WARN: ${t}`,...e)},po=(t,e)=>{wm[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),wm[`${t}/${e}`]=!0)},Wl=new Error;function bv(t,e,{key:n}){let r=0;const o=t[n],i={},s={};for(let l=1;l<=e.length;l++)s[l+r]=o[l],i[l+r]=!0,r+=fv(e[l-1]);t[n]=s,t[n]._emit=i,t[n]._multi=!0}function m2(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw zr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Wl;if(typeof t.beginScope!="object"||t.beginScope===null)throw zr("beginScope must be object"),Wl;bv(t,t.begin,{key:"beginScope"}),t.begin=Gf(t.begin,{joinWith:""})}}function g2(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw zr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Wl;if(typeof t.endScope!="object"||t.endScope===null)throw zr("endScope must be object"),Wl;bv(t,t.end,{key:"endScope"}),t.end=Gf(t.end,{joinWith:""})}}function y2(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function b2(t){y2(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),m2(t),g2(t)}function v2(t){function e(s,l){return new RegExp(Ui(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=fv(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=e(Gf(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const c=a.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return a.splice(0,c),Object.assign(a,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new n;return this.rules.slice(l).forEach(([c,u])=>a.addRule(c,u)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let c=a.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function o(s){const l=new r;return s.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function i(s,l){const a=s;if(s.isCompiled)return a;[i2,a2,b2,u2].forEach(u=>u(s,l)),t.compilerExtensions.forEach(u=>u(s,l)),s.__beforeBegin=null,[s2,l2,c2].forEach(u=>u(s,l)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=yv(s.keywords,t.case_insensitive)),a.keywordPatternRe=e(c,!0),l&&(s.begin||(s.begin=/\B|\b/),a.beginRe=e(a.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(a.endRe=e(a.end)),a.terminatorEnd=Ui(a.end)||"",s.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(a.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return w2(u==="self"?s:u)})),s.contains.forEach(function(u){i(u,a)}),s.starts&&i(s.starts,l),a.matcher=o(a),a}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=sr(t.classNameAliases||{}),i(t)}function vv(t){return t?t.endsWithParent||vv(t.starts):!1}function w2(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return sr(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:vv(t)?sr(t,{starts:t.starts?sr(t.starts):null}):Object.isFrozen(t)?sr(t):t}var x2="11.9.0";class S2 extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const Gc=uv,Sm=sr,Cm=Symbol("nomatch"),C2=7,wv=function(t){const e=Object.create(null),n=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:PN};function a(M){return l.noHighlightRe.test(M)}function c(M){let N=M.className+" ";N+=M.parentNode?M.parentNode.className:"";const D=l.languageDetectRe.exec(N);if(D){const z=E(D[1]);return z||(xm(i.replace("{}",D[1])),xm("Falling back to no-highlight mode for this block.",M)),z?D[1]:"no-highlight"}return N.split(/\s+/).find(z=>a(z)||E(z))}function u(M,N,D){let z="",Z="";typeof N=="object"?(z=M,D=N.ignoreIllegals,Z=N.language):(po("10.7.0","highlight(lang, code, ...args) has been deprecated."),po("10.7.0",`Please use highlight(code, options) instead.
403
- https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(D=!0);const ne={code:z,language:Z};K("before:highlight",ne);const Te=ne.result?ne.result:d(ne.language,ne.code,D);return Te.code=ne.code,K("after:highlight",Te),Te}function d(M,N,D,z){const Z=Object.create(null);function ne(F,W){return F.keywords[W]}function Te(){if(!Y.keywords){ve.addText(ce);return}let F=0;Y.keywordPatternRe.lastIndex=0;let W=Y.keywordPatternRe.exec(ce),re="";for(;W;){re+=ce.substring(F,W.index);const ue=Fe.case_insensitive?W[0].toLowerCase():W[0],je=ne(Y,ue);if(je){const[Ft,Mc]=je;if(ve.addText(re),re="",Z[ue]=(Z[ue]||0)+1,Z[ue]<=C2&&(kt+=Mc),Ft.startsWith("_"))re+=W[0];else{const A=Fe.classNameAliases[Ft]||Ft;he(W[0],A)}}else re+=W[0];F=Y.keywordPatternRe.lastIndex,W=Y.keywordPatternRe.exec(ce)}re+=ce.substring(F),ve.addText(re)}function De(){if(ce==="")return;let F=null;if(typeof Y.subLanguage=="string"){if(!e[Y.subLanguage]){ve.addText(ce);return}F=d(Y.subLanguage,ce,!0,Et[Y.subLanguage]),Et[Y.subLanguage]=F._top}else F=h(ce,Y.subLanguage.length?Y.subLanguage:null);Y.relevance>0&&(kt+=F.relevance),ve.__addSublanguage(F._emitter,F.language)}function de(){Y.subLanguage!=null?De():Te(),ce=""}function he(F,W){F!==""&&(ve.startScope(W),ve.addText(F),ve.endScope())}function Pe(F,W){let re=1;const ue=W.length-1;for(;re<=ue;){if(!F._emit[re]){re++;continue}const je=Fe.classNameAliases[F[re]]||F[re],Ft=W[re];je?he(Ft,je):(ce=Ft,Te(),ce=""),re++}}function Be(F,W){return F.scope&&typeof F.scope=="string"&&ve.openNode(Fe.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(he(ce,Fe.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),ce=""):F.beginScope._multi&&(Pe(F.beginScope,W),ce="")),Y=Object.create(F,{parent:{value:Y}}),Y}function Oe(F,W,re){let ue=FN(F.endRe,re);if(ue){if(F["on:end"]){const je=new ym(F);F["on:end"](W,je),je.isMatchIgnored&&(ue=!1)}if(ue){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return Oe(F.parent,W,re)}function Ze(F){return Y.matcher.regexIndex===0?(ce+=F[0],1):(Hn=!0,0)}function Bt(F){const W=F[0],re=F.rule,ue=new ym(re),je=[re.__beforeBegin,re["on:begin"]];for(const Ft of je)if(Ft&&(Ft(F,ue),ue.isMatchIgnored))return Ze(W);return re.skip?ce+=W:(re.excludeBegin&&(ce+=W),de(),!re.returnBegin&&!re.excludeBegin&&(ce=W)),Be(re,F),re.returnBegin?0:W.length}function mn(F){const W=F[0],re=N.substring(F.index),ue=Oe(Y,F,re);if(!ue)return Cm;const je=Y;Y.endScope&&Y.endScope._wrap?(de(),he(W,Y.endScope._wrap)):Y.endScope&&Y.endScope._multi?(de(),Pe(Y.endScope,F)):je.skip?ce+=W:(je.returnEnd||je.excludeEnd||(ce+=W),de(),je.excludeEnd&&(ce=W));do Y.scope&&ve.closeNode(),!Y.skip&&!Y.subLanguage&&(kt+=Y.relevance),Y=Y.parent;while(Y!==ue.parent);return ue.starts&&Be(ue.starts,F),je.returnEnd?0:W.length}function mt(){const F=[];for(let W=Y;W!==Fe;W=W.parent)W.scope&&F.unshift(W.scope);F.forEach(W=>ve.openNode(W))}let Ct={};function gn(F,W){const re=W&&W[0];if(ce+=F,re==null)return de(),0;if(Ct.type==="begin"&&W.type==="end"&&Ct.index===W.index&&re===""){if(ce+=N.slice(W.index,W.index+1),!o){const ue=new Error(`0 width match regex (${M})`);throw ue.languageName=M,ue.badRule=Ct.rule,ue}return 1}if(Ct=W,W.type==="begin")return Bt(W);if(W.type==="illegal"&&!D){const ue=new Error('Illegal lexeme "'+re+'" for mode "'+(Y.scope||"<unnamed>")+'"');throw ue.mode=Y,ue}else if(W.type==="end"){const ue=mn(W);if(ue!==Cm)return ue}if(W.type==="illegal"&&re==="")return 1;if(jn>1e5&&jn>W.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ce+=re,re.length}const Fe=E(M);if(!Fe)throw zr(i.replace("{}",M)),new Error('Unknown language: "'+M+'"');const yn=v2(Fe);let Kt="",Y=z||yn;const Et={},ve=new l.__emitter(l);mt();let ce="",kt=0,gt=0,jn=0,Hn=!1;try{if(Fe.__emitTokens)Fe.__emitTokens(N,ve);else{for(Y.matcher.considerAll();;){jn++,Hn?Hn=!1:Y.matcher.considerAll(),Y.matcher.lastIndex=gt;const F=Y.matcher.exec(N);if(!F)break;const W=N.substring(gt,F.index),re=gn(W,F);gt=F.index+re}gn(N.substring(gt))}return ve.finalize(),Kt=ve.toHTML(),{language:M,value:Kt,relevance:kt,illegal:!1,_emitter:ve,_top:Y}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:M,value:Gc(N),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:gt,context:N.slice(gt-100,gt+100),mode:F.mode,resultSoFar:Kt},_emitter:ve};if(o)return{language:M,value:Gc(N),illegal:!1,relevance:0,errorRaised:F,_emitter:ve,_top:Y};throw F}}function f(M){const N={value:Gc(M),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return N._emitter.addText(M),N}function h(M,N){N=N||l.languages||Object.keys(e);const D=f(M),z=N.filter(E).filter(I).map(de=>d(de,M,!1));z.unshift(D);const Z=z.sort((de,he)=>{if(de.relevance!==he.relevance)return he.relevance-de.relevance;if(de.language&&he.language){if(E(de.language).supersetOf===he.language)return 1;if(E(he.language).supersetOf===de.language)return-1}return 0}),[ne,Te]=Z,De=ne;return De.secondBest=Te,De}function p(M,N,D){const z=N&&n[N]||D;M.classList.add("hljs"),M.classList.add(`language-${z}`)}function m(M){let N=null;const D=c(M);if(a(D))return;if(K("before:highlightElement",{el:M,language:D}),M.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",M);return}if(M.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),l.throwUnescapedHTML))throw new S2("One of your code blocks includes unescaped HTML.",M.innerHTML);N=M;const z=N.textContent,Z=D?u(z,{language:D,ignoreIllegals:!0}):h(z);M.innerHTML=Z.value,M.dataset.highlighted="yes",p(M,D,Z.language),M.result={language:Z.language,re:Z.relevance,relevance:Z.relevance},Z.secondBest&&(M.secondBest={language:Z.secondBest.language,relevance:Z.secondBest.relevance}),K("after:highlightElement",{el:M,result:Z,text:z})}function g(M){l=Sm(l,M)}const y=()=>{b(),po("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){b(),po("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function b(){if(document.readyState==="loading"){S=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function C(){S&&b()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",C,!1);function w(M,N){let D=null;try{D=N(t)}catch(z){if(zr("Language definition for '{}' could not be registered.".replace("{}",M)),o)zr(z);else throw z;D=s}D.name||(D.name=M),e[M]=D,D.rawDefinition=N.bind(null,t),D.aliases&&O(D.aliases,{languageName:M})}function k(M){delete e[M];for(const N of Object.keys(n))n[N]===M&&delete n[N]}function R(){return Object.keys(e)}function E(M){return M=(M||"").toLowerCase(),e[M]||e[n[M]]}function O(M,{languageName:N}){typeof M=="string"&&(M=[M]),M.forEach(D=>{n[D.toLowerCase()]=N})}function I(M){const N=E(M);return N&&!N.disableAutodetect}function L(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=N=>{M["before:highlightBlock"](Object.assign({block:N.el},N))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=N=>{M["after:highlightBlock"](Object.assign({block:N.el},N))})}function H(M){L(M),r.push(M)}function U(M){const N=r.indexOf(M);N!==-1&&r.splice(N,1)}function K(M,N){const D=M;r.forEach(function(z){z[D]&&z[D](N)})}function j(M){return po("10.7.0","highlightBlock will be removed entirely in v12.0"),po("10.7.0","Please use highlightElement now."),m(M)}Object.assign(t,{highlight:u,highlightAuto:h,highlightAll:b,highlightElement:m,highlightBlock:j,configure:g,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:w,unregisterLanguage:k,listLanguages:R,getLanguage:E,registerAliases:O,autoDetection:I,inherit:Sm,addPlugin:H,removePlugin:U}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=x2,t.regex={concat:ro,lookahead:dv,either:Kf,optional:$N,anyNumberOfTimes:LN};for(const M in Hs)typeof Hs[M]=="object"&&cv(Hs[M]);return Object.assign(t,Hs),t},Ho=wv({});Ho.newInstance=()=>wv({});var E2=Ho;Ho.HighlightJS=Ho;Ho.default=Ho;var k2=NN(E2);function xv(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?xv(n.children,r):{text:n.value,classes:r}}).flat()}function Em(t){return t.value||t.children||[]}function M2(t){return!!k2.getLanguage(t)}function km({doc:t,name:e,lowlight:n,defaultLanguage:r}){const o=[];return nd(t,i=>i.type.name===e).forEach(i=>{let s=i.pos+1;const l=i.node.attrs.language||r,a=n.listLanguages(),c=l&&(a.includes(l)||M2(l))?Em(n.highlight(l,i.node.textContent)):Em(n.highlightAuto(i.node.textContent));xv(c).forEach(u=>{const d=s+u.text.length;if(u.classes.length){const f=Le.inline(s,d,{class:u.classes.join(" ")});o.push(f)}s=d})}),me.create(t,o)}function T2(t){return typeof t=="function"}function O2({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(o=>T2(e[o])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new ke({key:new we("lowlight"),state:{init:(o,{doc:i})=>km({doc:i,name:t,lowlight:e,defaultLanguage:n}),apply:(o,i,s,l)=>{const a=s.selection.$head.parent.type.name,c=l.selection.$head.parent.type.name,u=nd(s.doc,f=>f.type.name===t),d=nd(l.doc,f=>f.type.name===t);return o.docChanged&&([a,c].includes(t)||d.length!==u.length||o.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?km({doc:o.doc,name:t,lowlight:e,defaultLanguage:n}):i.map(o.mapping,o.doc)}},props:{decorations(o){return r.getState(o)}}});return r}const A2=RN.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],O2({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),R2=nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",le(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=vs(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),N2=Ie.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>{var e;return(e=t.style.fontFamily)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}});function Sv(t){const e=t+"CollectionProvider",[n,r]=In(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:p,children:m}=h,g=_.useRef(null),y=_.useRef(new Map).current;return T.jsx(o,{scope:p,itemMap:y,collectionRef:g,children:m})};s.displayName=e;const l=t+"CollectionSlot",a=_.forwardRef((h,p)=>{const{scope:m,children:g}=h,y=i(l,m),x=$e(p,y.collectionRef);return T.jsx(Jr,{ref:x,children:g})});a.displayName=l;const c=t+"CollectionItemSlot",u="data-radix-collection-item",d=_.forwardRef((h,p)=>{const{scope:m,children:g,...y}=h,x=_.useRef(null),S=$e(p,x),b=i(c,m);return _.useEffect(()=>(b.itemMap.set(x,{ref:x,...y}),()=>void b.itemMap.delete(x))),T.jsx(Jr,{[u]:"",ref:S,children:g})});d.displayName=c;function f(h){const p=i(t+"CollectionConsumer",h);return _.useCallback(()=>{const g=p.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((b,C)=>y.indexOf(b.ref.current)-y.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:a,ItemSlot:d},f,r]}var D2=v.createContext(void 0);function Jf(t){const e=v.useContext(D2);return t||e||"ltr"}var qc=0;function Cv(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Mm()),document.body.insertAdjacentElement("beforeend",t[1]??Mm()),qc++,()=>{qc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),qc--}},[])}function Mm(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var Jc="focusScope.autoFocusOnMount",Yc="focusScope.autoFocusOnUnmount",Tm={bubbles:!1,cancelable:!0},_2="FocusScope",Yf=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[l,a]=v.useState(null),c=Pt(o),u=Pt(i),d=v.useRef(null),f=$e(e,m=>a(m)),h=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(S){if(h.paused||!l)return;const b=S.target;l.contains(b)?d.current=b:Gn(d.current,{select:!0})},g=function(S){if(h.paused||!l)return;const b=S.relatedTarget;b!==null&&(l.contains(b)||Gn(d.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Gn(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(y);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),x.disconnect()}}},[r,l,h.paused]),v.useEffect(()=>{if(l){Am.add(h);const m=document.activeElement;if(!l.contains(m)){const y=new CustomEvent(Jc,Tm);l.addEventListener(Jc,c),l.dispatchEvent(y),y.defaultPrevented||(I2(F2(Ev(l)),{select:!0}),document.activeElement===m&&Gn(l))}return()=>{l.removeEventListener(Jc,c),setTimeout(()=>{const y=new CustomEvent(Yc,Tm);l.addEventListener(Yc,u),l.dispatchEvent(y),y.defaultPrevented||Gn(m??document.body,{select:!0}),l.removeEventListener(Yc,u),Am.remove(h)},0)}}},[l,c,u,h]);const p=v.useCallback(m=>{if(!n&&!r||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const x=m.currentTarget,[S,b]=P2(x);S&&b?!m.shiftKey&&y===b?(m.preventDefault(),n&&Gn(S,{select:!0})):m.shiftKey&&y===S&&(m.preventDefault(),n&&Gn(b,{select:!0})):y===x&&m.preventDefault()}},[n,r,h.paused]);return T.jsx(ge.div,{tabIndex:-1,...s,ref:f,onKeyDown:p})});Yf.displayName=_2;function I2(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Gn(r,{select:e}),document.activeElement!==n)return}function P2(t){const e=Ev(t),n=Om(e,t),r=Om(e.reverse(),t);return[n,r]}function Ev(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Om(t,e){for(const n of t)if(!L2(n,{upTo:e}))return n}function L2(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function $2(t){return t instanceof HTMLInputElement&&"select"in t}function Gn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&$2(t)&&e&&t.select()}}var Am=B2();function B2(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Rm(t,e),t.unshift(e)},remove(e){var n;t=Rm(t,e),(n=t[0])==null||n.resume()}}}function Rm(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function F2(t){return t.filter(e=>e.tagName!=="A")}var Xc="rovingFocusGroup.onEntryFocus",j2={bubbles:!1,cancelable:!0},cc="RovingFocusGroup",[pd,kv,H2]=Sv(cc),[z2,uc]=In(cc,[H2]),[V2,W2]=z2(cc),Mv=v.forwardRef((t,e)=>T.jsx(pd.Provider,{scope:t.__scopeRovingFocusGroup,children:T.jsx(pd.Slot,{scope:t.__scopeRovingFocusGroup,children:T.jsx(U2,{...t,ref:e})})}));Mv.displayName=cc;var U2=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=v.useRef(null),h=$e(e,f),p=Jf(i),[m=null,g]=Er({prop:s,defaultProp:l,onChange:a}),[y,x]=v.useState(!1),S=Pt(c),b=kv(n),C=v.useRef(!1),[w,k]=v.useState(0);return v.useEffect(()=>{const R=f.current;if(R)return R.addEventListener(Xc,S),()=>R.removeEventListener(Xc,S)},[S]),T.jsx(V2,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(R=>g(R),[g]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:v.useCallback(()=>k(R=>R-1),[]),children:T.jsx(ge.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ee(t.onMouseDown,()=>{C.current=!0}),onFocus:ee(t.onFocus,R=>{const E=!C.current;if(R.target===R.currentTarget&&E&&!y){const O=new CustomEvent(Xc,j2);if(R.currentTarget.dispatchEvent(O),!O.defaultPrevented){const I=b().filter(j=>j.focusable),L=I.find(j=>j.active),H=I.find(j=>j.id===m),K=[L,H,...I].filter(Boolean).map(j=>j.ref.current);Av(K,u)}}C.current=!1}),onBlur:ee(t.onBlur,()=>x(!1))})})}),Tv="RovingFocusGroupItem",Ov=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=t,l=hr(),a=i||l,c=W2(Tv,n),u=c.currentTabStopId===a,d=kv(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return v.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),T.jsx(pd.ItemSlot,{scope:n,id:a,focusable:r,active:o,children:T.jsx(ge.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:e,onMouseDown:ee(t.onMouseDown,p=>{r?c.onItemFocus(a):p.preventDefault()}),onFocus:ee(t.onFocus,()=>c.onItemFocus(a)),onKeyDown:ee(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=q2(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let y=d().filter(x=>x.focusable).map(x=>x.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const x=y.indexOf(p.currentTarget);y=c.loop?J2(y,x+1):y.slice(x+1)}setTimeout(()=>Av(y))}})})})});Ov.displayName=Tv;var K2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function G2(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function q2(t,e,n){const r=G2(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return K2[r]}function Av(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function J2(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Rv=Mv,Nv=Ov,Y2=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},mo=new WeakMap,zs=new WeakMap,Vs={},Zc=0,Dv=function(t){return t&&(t.host||Dv(t.parentNode))},X2=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Dv(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Z2=function(t,e,n,r){var o=X2(e,Array.isArray(t)?t:[t]);Vs[n]||(Vs[n]=new WeakMap);var i=Vs[n],s=[],l=new Set,a=new Set(o),c=function(d){!d||l.has(d)||(l.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(mo.get(f)||0)+1,g=(i.get(f)||0)+1;mo.set(f,m),i.set(f,g),s.push(f),m===1&&p&&zs.set(f,!0),g===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(e),l.clear(),Zc++,function(){s.forEach(function(d){var f=mo.get(d)-1,h=i.get(d)-1;mo.set(d,f),i.set(d,h),f||(zs.has(d)||d.removeAttribute(r),zs.delete(d)),h||d.removeAttribute(n)}),Zc--,Zc||(mo=new WeakMap,mo=new WeakMap,zs=new WeakMap,Vs={})}},_v=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=Y2(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Z2(r,o,n,"aria-hidden")):function(){return null}},en=function(){return en=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},en.apply(this,arguments)};function Iv(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function Q2(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var ml="right-scroll-bar-position",gl="width-before-scroll-bar",eD="with-scroll-bars-hidden",tD="--removed-body-scroll-bar-size";function Qc(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function nD(t,e){var n=_.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var rD=typeof window<"u"?v.useLayoutEffect:v.useEffect,Nm=new WeakMap;function oD(t,e){var n=nD(null,function(r){return t.forEach(function(o){return Qc(o,r)})});return rD(function(){var r=Nm.get(n);if(r){var o=new Set(r),i=new Set(t),s=n.current;o.forEach(function(l){i.has(l)||Qc(l,null)}),i.forEach(function(l){o.has(l)||Qc(l,s)})}Nm.set(n,t)},[t]),n}function iD(t){return t}function sD(t,e){e===void 0&&(e=iD);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var s=e(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var a=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function lD(t){t===void 0&&(t={});var e=sD(null);return e.options=en({async:!0,ssr:!1},t),e}var Pv=function(t){var e=t.sideCar,n=Iv(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,en({},n))};Pv.isSideCarExport=!0;function aD(t,e){return t.useMedium(e),Pv}var Lv=lD(),eu=function(){},dc=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:eu,onWheelCapture:eu,onTouchMoveCapture:eu}),o=r[0],i=r[1],s=t.forwardProps,l=t.children,a=t.className,c=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,h=t.noIsolation,p=t.inert,m=t.allowPinchZoom,g=t.as,y=g===void 0?"div":g,x=t.gapMode,S=Iv(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=f,C=oD([n,e]),w=en(en({},S),o);return v.createElement(v.Fragment,null,u&&v.createElement(b,{sideCar:Lv,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:x}),s?v.cloneElement(v.Children.only(l),en(en({},w),{ref:C})):v.createElement(y,en({},w,{className:a,ref:C}),l))});dc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};dc.classNames={fullWidth:gl,zeroRight:ml};var cD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=cD();return e&&t.setAttribute("nonce",e),t}function dD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function fD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var hD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=uD())&&(dD(e,n),fD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},pD=function(){var t=hD();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},$v=function(){var t=pD(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},mD={left:0,top:0,right:0,gap:0},tu=function(t){return parseInt(t||"",10)||0},gD=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[tu(n),tu(r),tu(o)]},yD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return mD;var e=gD(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},bD=$v(),Do="data-scroll-locked",vD=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,l=t.gap;return n===void 0&&(n="margin"),`
401
+ `);return!i||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(Q.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[sd({find:ON,type:this.type,getAttributes:t=>({language:t[1]})}),sd({find:AN,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ke({key:new we("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
402
+ `));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(Z.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function NN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cv(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&cv(n)}),t}class ym{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function uv(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function sr(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const o in r)n[o]=r[o]}),n}const DN="</span>",bm=t=>!!t.scope,_N=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${e}${t}`};class IN{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=uv(e)}openNode(e){if(!bm(e))return;const n=_N(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){bm(e)&&(this.buffer+=DN)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const vm=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class Kf{constructor(){this.rootNode=vm(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=vm({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{Kf._collapse(n)}))}}class PN extends Kf{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new IN(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ui(t){return t?typeof t=="string"?t:t.source:null}function dv(t){return no("(?=",t,")")}function LN(t){return no("(?:",t,")*")}function $N(t){return no("(?:",t,")?")}function no(...t){return t.map(n=>Ui(n)).join("")}function BN(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Gf(...t){return"("+(BN(t).capture?"":"?:")+t.map(r=>Ui(r)).join("|")+")"}function fv(t){return new RegExp(t.toString()+"|").exec("").length-1}function FN(t,e){const n=t&&t.exec(e);return n&&n.index===0}const jN=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function qf(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;const o=n;let i=Ui(r),s="";for(;i.length>0;){const l=jN.exec(i);if(!l){s+=i;break}s+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+o):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}const HN=/\b\B/,hv="[a-zA-Z]\\w*",Jf="[a-zA-Z_]\\w*",pv="\\b\\d+(\\.\\d+)?",mv="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",gv="\\b(0b[01]+)",zN="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",VN=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=no(e,/.*\b/,t.binary,/\b.*/)),sr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Ki={begin:"\\\\[\\s\\S]",relevance:0},WN={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ki]},UN={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ki]},KN={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},lc=function(t,e,n={}){const r=sr({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Gf("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:no(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},GN=lc("//","$"),qN=lc("/\\*","\\*/"),JN=lc("#","$"),YN={scope:"number",begin:pv,relevance:0},XN={scope:"number",begin:mv,relevance:0},ZN={scope:"number",begin:gv,relevance:0},QN={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ki,{begin:/\[/,end:/\]/,relevance:0,contains:[Ki]}]},e2={scope:"title",begin:hv,relevance:0},t2={scope:"title",begin:Jf,relevance:0},n2={begin:"\\.\\s*"+Jf,relevance:0},r2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})};var js=Object.freeze({__proto__:null,APOS_STRING_MODE:WN,BACKSLASH_ESCAPE:Ki,BINARY_NUMBER_MODE:ZN,BINARY_NUMBER_RE:gv,COMMENT:lc,C_BLOCK_COMMENT_MODE:qN,C_LINE_COMMENT_MODE:GN,C_NUMBER_MODE:XN,C_NUMBER_RE:mv,END_SAME_AS_BEGIN:r2,HASH_COMMENT_MODE:JN,IDENT_RE:hv,MATCH_NOTHING_RE:HN,METHOD_GUARD:n2,NUMBER_MODE:YN,NUMBER_RE:pv,PHRASAL_WORDS_MODE:KN,QUOTE_STRING_MODE:UN,REGEXP_MODE:QN,RE_STARTERS_RE:zN,SHEBANG:VN,TITLE_MODE:e2,UNDERSCORE_IDENT_RE:Jf,UNDERSCORE_TITLE_MODE:t2});function o2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function i2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function s2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=o2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function l2(t,e){Array.isArray(t.illegal)&&(t.illegal=Gf(...t.illegal))}function a2(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function c2(t,e){t.relevance===void 0&&(t.relevance=1)}const u2=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=no(n.beforeMatch,dv(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},d2=["of","and","for","in","not","or","if","then","parent","list","value"],f2="keyword";function yv(t,e,n=f2){const r=Object.create(null);return typeof t=="string"?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach(function(i){Object.assign(r,yv(t[i],e,i))}),r;function o(i,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){const a=l.split("|");r[a[0]]=[i,h2(a[0],a[1])]})}}function h2(t,e){return e?Number(e):p2(t)?0:1}function p2(t){return d2.includes(t.toLowerCase())}const wm={},Hr=t=>{console.error(t)},xm=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ho=(t,e)=>{wm[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),wm[`${t}/${e}`]=!0)},Vl=new Error;function bv(t,e,{key:n}){let r=0;const o=t[n],i={},s={};for(let l=1;l<=e.length;l++)s[l+r]=o[l],i[l+r]=!0,r+=fv(e[l-1]);t[n]=s,t[n]._emit=i,t[n]._multi=!0}function m2(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Hr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Vl;if(typeof t.beginScope!="object"||t.beginScope===null)throw Hr("beginScope must be object"),Vl;bv(t,t.begin,{key:"beginScope"}),t.begin=qf(t.begin,{joinWith:""})}}function g2(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Hr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Vl;if(typeof t.endScope!="object"||t.endScope===null)throw Hr("endScope must be object"),Vl;bv(t,t.end,{key:"endScope"}),t.end=qf(t.end,{joinWith:""})}}function y2(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function b2(t){y2(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),m2(t),g2(t)}function v2(t){function e(s,l){return new RegExp(Ui(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=fv(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=e(qf(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const c=a.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return a.splice(0,c),Object.assign(a,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new n;return this.rules.slice(l).forEach(([c,u])=>a.addRule(c,u)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let c=a.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function o(s){const l=new r;return s.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function i(s,l){const a=s;if(s.isCompiled)return a;[i2,a2,b2,u2].forEach(u=>u(s,l)),t.compilerExtensions.forEach(u=>u(s,l)),s.__beforeBegin=null,[s2,l2,c2].forEach(u=>u(s,l)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=yv(s.keywords,t.case_insensitive)),a.keywordPatternRe=e(c,!0),l&&(s.begin||(s.begin=/\B|\b/),a.beginRe=e(a.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(a.endRe=e(a.end)),a.terminatorEnd=Ui(a.end)||"",s.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(a.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return w2(u==="self"?s:u)})),s.contains.forEach(function(u){i(u,a)}),s.starts&&i(s.starts,l),a.matcher=o(a),a}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=sr(t.classNameAliases||{}),i(t)}function vv(t){return t?t.endsWithParent||vv(t.starts):!1}function w2(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return sr(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:vv(t)?sr(t,{starts:t.starts?sr(t.starts):null}):Object.isFrozen(t)?sr(t):t}var x2="11.10.0";class S2 extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const qc=uv,Sm=sr,Cm=Symbol("nomatch"),C2=7,wv=function(t){const e=Object.create(null),n=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:PN};function a(M){return l.noHighlightRe.test(M)}function c(M){let N=M.className+" ";N+=M.parentNode?M.parentNode.className:"";const D=l.languageDetectRe.exec(N);if(D){const z=E(D[1]);return z||(xm(i.replace("{}",D[1])),xm("Falling back to no-highlight mode for this block.",M)),z?D[1]:"no-highlight"}return N.split(/\s+/).find(z=>a(z)||E(z))}function u(M,N,D){let z="",J="";typeof N=="object"?(z=M,D=N.ignoreIllegals,J=N.language):(ho("10.7.0","highlight(lang, code, ...args) has been deprecated."),ho("10.7.0",`Please use highlight(code, options) instead.
403
+ https://github.com/highlightjs/highlight.js/issues/2277`),J=M,z=N),D===void 0&&(D=!0);const se={code:z,language:J};K("before:highlight",se);const Te=se.result?se.result:d(se.language,se.code,D);return Te.code=se.code,K("after:highlight",Te),Te}function d(M,N,D,z){const J=Object.create(null);function se(F,W){return F.keywords[W]}function Te(){if(!X.keywords){ve.addText(ce);return}let F=0;X.keywordPatternRe.lastIndex=0;let W=X.keywordPatternRe.exec(ce),ne="";for(;W;){ne+=ce.substring(F,W.index);const ue=Fe.case_insensitive?W[0].toLowerCase():W[0],je=se(X,ue);if(je){const[Ft,Mc]=je;if(ve.addText(ne),ne="",J[ue]=(J[ue]||0)+1,J[ue]<=C2&&(kt+=Mc),Ft.startsWith("_"))ne+=W[0];else{const R=Fe.classNameAliases[Ft]||Ft;he(W[0],R)}}else ne+=W[0];F=X.keywordPatternRe.lastIndex,W=X.keywordPatternRe.exec(ce)}ne+=ce.substring(F),ve.addText(ne)}function De(){if(ce==="")return;let F=null;if(typeof X.subLanguage=="string"){if(!e[X.subLanguage]){ve.addText(ce);return}F=d(X.subLanguage,ce,!0,Et[X.subLanguage]),Et[X.subLanguage]=F._top}else F=h(ce,X.subLanguage.length?X.subLanguage:null);X.relevance>0&&(kt+=F.relevance),ve.__addSublanguage(F._emitter,F.language)}function de(){X.subLanguage!=null?De():Te(),ce=""}function he(F,W){F!==""&&(ve.startScope(W),ve.addText(F),ve.endScope())}function Pe(F,W){let ne=1;const ue=W.length-1;for(;ne<=ue;){if(!F._emit[ne]){ne++;continue}const je=Fe.classNameAliases[F[ne]]||F[ne],Ft=W[ne];je?he(Ft,je):(ce=Ft,Te(),ce=""),ne++}}function Be(F,W){return F.scope&&typeof F.scope=="string"&&ve.openNode(Fe.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(he(ce,Fe.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),ce=""):F.beginScope._multi&&(Pe(F.beginScope,W),ce="")),X=Object.create(F,{parent:{value:X}}),X}function Oe(F,W,ne){let ue=FN(F.endRe,ne);if(ue){if(F["on:end"]){const je=new ym(F);F["on:end"](W,je),je.isMatchIgnored&&(ue=!1)}if(ue){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return Oe(F.parent,W,ne)}function Ze(F){return X.matcher.regexIndex===0?(ce+=F[0],1):(Hn=!0,0)}function Bt(F){const W=F[0],ne=F.rule,ue=new ym(ne),je=[ne.__beforeBegin,ne["on:begin"]];for(const Ft of je)if(Ft&&(Ft(F,ue),ue.isMatchIgnored))return Ze(W);return ne.skip?ce+=W:(ne.excludeBegin&&(ce+=W),de(),!ne.returnBegin&&!ne.excludeBegin&&(ce=W)),Be(ne,F),ne.returnBegin?0:W.length}function mn(F){const W=F[0],ne=N.substring(F.index),ue=Oe(X,F,ne);if(!ue)return Cm;const je=X;X.endScope&&X.endScope._wrap?(de(),he(W,X.endScope._wrap)):X.endScope&&X.endScope._multi?(de(),Pe(X.endScope,F)):je.skip?ce+=W:(je.returnEnd||je.excludeEnd||(ce+=W),de(),je.excludeEnd&&(ce=W));do X.scope&&ve.closeNode(),!X.skip&&!X.subLanguage&&(kt+=X.relevance),X=X.parent;while(X!==ue.parent);return ue.starts&&Be(ue.starts,F),je.returnEnd?0:W.length}function mt(){const F=[];for(let W=X;W!==Fe;W=W.parent)W.scope&&F.unshift(W.scope);F.forEach(W=>ve.openNode(W))}let Ct={};function gn(F,W){const ne=W&&W[0];if(ce+=F,ne==null)return de(),0;if(Ct.type==="begin"&&W.type==="end"&&Ct.index===W.index&&ne===""){if(ce+=N.slice(W.index,W.index+1),!o){const ue=new Error(`0 width match regex (${M})`);throw ue.languageName=M,ue.badRule=Ct.rule,ue}return 1}if(Ct=W,W.type==="begin")return Bt(W);if(W.type==="illegal"&&!D){const ue=new Error('Illegal lexeme "'+ne+'" for mode "'+(X.scope||"<unnamed>")+'"');throw ue.mode=X,ue}else if(W.type==="end"){const ue=mn(W);if(ue!==Cm)return ue}if(W.type==="illegal"&&ne==="")return 1;if(jn>1e5&&jn>W.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ce+=ne,ne.length}const Fe=E(M);if(!Fe)throw Hr(i.replace("{}",M)),new Error('Unknown language: "'+M+'"');const yn=v2(Fe);let Kt="",X=z||yn;const Et={},ve=new l.__emitter(l);mt();let ce="",kt=0,gt=0,jn=0,Hn=!1;try{if(Fe.__emitTokens)Fe.__emitTokens(N,ve);else{for(X.matcher.considerAll();;){jn++,Hn?Hn=!1:X.matcher.considerAll(),X.matcher.lastIndex=gt;const F=X.matcher.exec(N);if(!F)break;const W=N.substring(gt,F.index),ne=gn(W,F);gt=F.index+ne}gn(N.substring(gt))}return ve.finalize(),Kt=ve.toHTML(),{language:M,value:Kt,relevance:kt,illegal:!1,_emitter:ve,_top:X}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:M,value:qc(N),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:gt,context:N.slice(gt-100,gt+100),mode:F.mode,resultSoFar:Kt},_emitter:ve};if(o)return{language:M,value:qc(N),illegal:!1,relevance:0,errorRaised:F,_emitter:ve,_top:X};throw F}}function f(M){const N={value:qc(M),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return N._emitter.addText(M),N}function h(M,N){N=N||l.languages||Object.keys(e);const D=f(M),z=N.filter(E).filter(_).map(de=>d(de,M,!1));z.unshift(D);const J=z.sort((de,he)=>{if(de.relevance!==he.relevance)return he.relevance-de.relevance;if(de.language&&he.language){if(E(de.language).supersetOf===he.language)return 1;if(E(he.language).supersetOf===de.language)return-1}return 0}),[se,Te]=J,De=se;return De.secondBest=Te,De}function p(M,N,D){const z=N&&n[N]||D;M.classList.add("hljs"),M.classList.add(`language-${z}`)}function m(M){let N=null;const D=c(M);if(a(D))return;if(K("before:highlightElement",{el:M,language:D}),M.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",M);return}if(M.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),l.throwUnescapedHTML))throw new S2("One of your code blocks includes unescaped HTML.",M.innerHTML);N=M;const z=N.textContent,J=D?u(z,{language:D,ignoreIllegals:!0}):h(z);M.innerHTML=J.value,M.dataset.highlighted="yes",p(M,D,J.language),M.result={language:J.language,re:J.relevance,relevance:J.relevance},J.secondBest&&(M.secondBest={language:J.secondBest.language,relevance:J.secondBest.relevance}),K("after:highlightElement",{el:M,result:J,text:z})}function g(M){l=Sm(l,M)}const y=()=>{b(),ho("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){b(),ho("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function b(){if(document.readyState==="loading"){S=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function C(){S&&b()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",C,!1);function x(M,N){let D=null;try{D=N(t)}catch(z){if(Hr("Language definition for '{}' could not be registered.".replace("{}",M)),o)Hr(z);else throw z;D=s}D.name||(D.name=M),e[M]=D,D.rawDefinition=N.bind(null,t),D.aliases&&O(D.aliases,{languageName:M})}function k(M){delete e[M];for(const N of Object.keys(n))n[N]===M&&delete n[N]}function A(){return Object.keys(e)}function E(M){return M=(M||"").toLowerCase(),e[M]||e[n[M]]}function O(M,{languageName:N}){typeof M=="string"&&(M=[M]),M.forEach(D=>{n[D.toLowerCase()]=N})}function _(M){const N=E(M);return N&&!N.disableAutodetect}function L(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=N=>{M["before:highlightBlock"](Object.assign({block:N.el},N))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=N=>{M["after:highlightBlock"](Object.assign({block:N.el},N))})}function H(M){L(M),r.push(M)}function U(M){const N=r.indexOf(M);N!==-1&&r.splice(N,1)}function K(M,N){const D=M;r.forEach(function(z){z[D]&&z[D](N)})}function j(M){return ho("10.7.0","highlightBlock will be removed entirely in v12.0"),ho("10.7.0","Please use highlightElement now."),m(M)}Object.assign(t,{highlight:u,highlightAuto:h,highlightAll:b,highlightElement:m,highlightBlock:j,configure:g,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:x,unregisterLanguage:k,listLanguages:A,getLanguage:E,registerAliases:O,autoDetection:_,inherit:Sm,addPlugin:H,removePlugin:U}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=x2,t.regex={concat:no,lookahead:dv,either:Gf,optional:$N,anyNumberOfTimes:LN};for(const M in js)typeof js[M]=="object"&&cv(js[M]);return Object.assign(t,js),t},Ho=wv({});Ho.newInstance=()=>wv({});var E2=Ho;Ho.HighlightJS=Ho;Ho.default=Ho;var k2=NN(E2);function xv(t,e=[]){return t.map(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?xv(n.children,r):{text:n.value,classes:r}}).flat()}function Em(t){return t.value||t.children||[]}function M2(t){return!!k2.getLanguage(t)}function km({doc:t,name:e,lowlight:n,defaultLanguage:r}){const o=[];return rd(t,i=>i.type.name===e).forEach(i=>{let s=i.pos+1;const l=i.node.attrs.language||r,a=n.listLanguages(),c=l&&(a.includes(l)||M2(l))?Em(n.highlight(l,i.node.textContent)):Em(n.highlightAuto(i.node.textContent));xv(c).forEach(u=>{const d=s+u.text.length;if(u.classes.length){const f=Le.inline(s,d,{class:u.classes.join(" ")});o.push(f)}s=d})}),me.create(t,o)}function T2(t){return typeof t=="function"}function O2({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(o=>T2(e[o])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new ke({key:new we("lowlight"),state:{init:(o,{doc:i})=>km({doc:i,name:t,lowlight:e,defaultLanguage:n}),apply:(o,i,s,l)=>{const a=s.selection.$head.parent.type.name,c=l.selection.$head.parent.type.name,u=rd(s.doc,f=>f.type.name===t),d=rd(l.doc,f=>f.type.name===t);return o.docChanged&&([a,c].includes(t)||d.length!==u.length||o.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?km({doc:o.doc,name:t,lowlight:e,defaultLanguage:n}):i.map(o.mapping,o.doc)}},props:{decorations(o){return r.getState(o)}}});return r}const A2=RN.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],O2({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),R2=nt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",le(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=vs(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),N2=Ie.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>{var e;return(e=t.style.fontFamily)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}});function Sv(t){const e=t+"CollectionProvider",[n,r]=In(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:p,children:m}=h,g=P.useRef(null),y=P.useRef(new Map).current;return T.jsx(o,{scope:p,itemMap:y,collectionRef:g,children:m})};s.displayName=e;const l=t+"CollectionSlot",a=P.forwardRef((h,p)=>{const{scope:m,children:g}=h,y=i(l,m),w=$e(p,y.collectionRef);return T.jsx(qr,{ref:w,children:g})});a.displayName=l;const c=t+"CollectionItemSlot",u="data-radix-collection-item",d=P.forwardRef((h,p)=>{const{scope:m,children:g,...y}=h,w=P.useRef(null),S=$e(p,w),b=i(c,m);return P.useEffect(()=>(b.itemMap.set(w,{ref:w,...y}),()=>void b.itemMap.delete(w))),T.jsx(qr,{[u]:"",ref:S,children:g})});d.displayName=c;function f(h){const p=i(t+"CollectionConsumer",h);return P.useCallback(()=>{const g=p.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((b,C)=>y.indexOf(b.ref.current)-y.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:a,ItemSlot:d},f,r]}var D2=v.createContext(void 0);function Yf(t){const e=v.useContext(D2);return t||e||"ltr"}var Jc=0;function Cv(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Mm()),document.body.insertAdjacentElement("beforeend",t[1]??Mm()),Jc++,()=>{Jc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jc--}},[])}function Mm(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var Yc="focusScope.autoFocusOnMount",Xc="focusScope.autoFocusOnUnmount",Tm={bubbles:!1,cancelable:!0},_2="FocusScope",Xf=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[l,a]=v.useState(null),c=Pt(o),u=Pt(i),d=v.useRef(null),f=$e(e,m=>a(m)),h=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(S){if(h.paused||!l)return;const b=S.target;l.contains(b)?d.current=b:Gn(d.current,{select:!0})},g=function(S){if(h.paused||!l)return;const b=S.relatedTarget;b!==null&&(l.contains(b)||Gn(d.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Gn(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const w=new MutationObserver(y);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),w.disconnect()}}},[r,l,h.paused]),v.useEffect(()=>{if(l){Am.add(h);const m=document.activeElement;if(!l.contains(m)){const y=new CustomEvent(Yc,Tm);l.addEventListener(Yc,c),l.dispatchEvent(y),y.defaultPrevented||(I2(F2(Ev(l)),{select:!0}),document.activeElement===m&&Gn(l))}return()=>{l.removeEventListener(Yc,c),setTimeout(()=>{const y=new CustomEvent(Xc,Tm);l.addEventListener(Xc,u),l.dispatchEvent(y),y.defaultPrevented||Gn(m??document.body,{select:!0}),l.removeEventListener(Xc,u),Am.remove(h)},0)}}},[l,c,u,h]);const p=v.useCallback(m=>{if(!n&&!r||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const w=m.currentTarget,[S,b]=P2(w);S&&b?!m.shiftKey&&y===b?(m.preventDefault(),n&&Gn(S,{select:!0})):m.shiftKey&&y===S&&(m.preventDefault(),n&&Gn(b,{select:!0})):y===w&&m.preventDefault()}},[n,r,h.paused]);return T.jsx(ge.div,{tabIndex:-1,...s,ref:f,onKeyDown:p})});Xf.displayName=_2;function I2(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Gn(r,{select:e}),document.activeElement!==n)return}function P2(t){const e=Ev(t),n=Om(e,t),r=Om(e.reverse(),t);return[n,r]}function Ev(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Om(t,e){for(const n of t)if(!L2(n,{upTo:e}))return n}function L2(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function $2(t){return t instanceof HTMLInputElement&&"select"in t}function Gn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&$2(t)&&e&&t.select()}}var Am=B2();function B2(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Rm(t,e),t.unshift(e)},remove(e){var n;t=Rm(t,e),(n=t[0])==null||n.resume()}}}function Rm(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function F2(t){return t.filter(e=>e.tagName!=="A")}var Zc="rovingFocusGroup.onEntryFocus",j2={bubbles:!1,cancelable:!0},ac="RovingFocusGroup",[md,kv,H2]=Sv(ac),[z2,cc]=In(ac,[H2]),[V2,W2]=z2(ac),Mv=v.forwardRef((t,e)=>T.jsx(md.Provider,{scope:t.__scopeRovingFocusGroup,children:T.jsx(md.Slot,{scope:t.__scopeRovingFocusGroup,children:T.jsx(U2,{...t,ref:e})})}));Mv.displayName=ac;var U2=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=v.useRef(null),h=$e(e,f),p=Yf(i),[m=null,g]=Er({prop:s,defaultProp:l,onChange:a}),[y,w]=v.useState(!1),S=Pt(c),b=kv(n),C=v.useRef(!1),[x,k]=v.useState(0);return v.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Zc,S),()=>A.removeEventListener(Zc,S)},[S]),T.jsx(V2,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(A=>g(A),[g]),onItemShiftTab:v.useCallback(()=>w(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:v.useCallback(()=>k(A=>A-1),[]),children:T.jsx(ge.div,{tabIndex:y||x===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ee(t.onMouseDown,()=>{C.current=!0}),onFocus:ee(t.onFocus,A=>{const E=!C.current;if(A.target===A.currentTarget&&E&&!y){const O=new CustomEvent(Zc,j2);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const _=b().filter(j=>j.focusable),L=_.find(j=>j.active),H=_.find(j=>j.id===m),K=[L,H,..._].filter(Boolean).map(j=>j.ref.current);Av(K,u)}}C.current=!1}),onBlur:ee(t.onBlur,()=>w(!1))})})}),Tv="RovingFocusGroupItem",Ov=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=t,l=hr(),a=i||l,c=W2(Tv,n),u=c.currentTabStopId===a,d=kv(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return v.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),T.jsx(md.ItemSlot,{scope:n,id:a,focusable:r,active:o,children:T.jsx(ge.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:e,onMouseDown:ee(t.onMouseDown,p=>{r?c.onItemFocus(a):p.preventDefault()}),onFocus:ee(t.onFocus,()=>c.onItemFocus(a)),onKeyDown:ee(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=q2(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let y=d().filter(w=>w.focusable).map(w=>w.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const w=y.indexOf(p.currentTarget);y=c.loop?J2(y,w+1):y.slice(w+1)}setTimeout(()=>Av(y))}})})})});Ov.displayName=Tv;var K2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function G2(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function q2(t,e,n){const r=G2(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return K2[r]}function Av(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function J2(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Rv=Mv,Nv=Ov,Y2=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},po=new WeakMap,Hs=new WeakMap,zs={},Qc=0,Dv=function(t){return t&&(t.host||Dv(t.parentNode))},X2=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Dv(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Z2=function(t,e,n,r){var o=X2(e,Array.isArray(t)?t:[t]);zs[n]||(zs[n]=new WeakMap);var i=zs[n],s=[],l=new Set,a=new Set(o),c=function(d){!d||l.has(d)||(l.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",m=(po.get(f)||0)+1,g=(i.get(f)||0)+1;po.set(f,m),i.set(f,g),s.push(f),m===1&&p&&Hs.set(f,!0),g===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(e),l.clear(),Qc++,function(){s.forEach(function(d){var f=po.get(d)-1,h=i.get(d)-1;po.set(d,f),i.set(d,h),f||(Hs.has(d)||d.removeAttribute(r),Hs.delete(d)),h||d.removeAttribute(n)}),Qc--,Qc||(po=new WeakMap,po=new WeakMap,Hs=new WeakMap,zs={})}},_v=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=Y2(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Z2(r,o,n,"aria-hidden")):function(){return null}},en=function(){return en=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},en.apply(this,arguments)};function Iv(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function Q2(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var pl="right-scroll-bar-position",ml="width-before-scroll-bar",eD="with-scroll-bars-hidden",tD="--removed-body-scroll-bar-size";function eu(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function nD(t,e){var n=P.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var rD=typeof window<"u"?v.useLayoutEffect:v.useEffect,Nm=new WeakMap;function oD(t,e){var n=nD(null,function(r){return t.forEach(function(o){return eu(o,r)})});return rD(function(){var r=Nm.get(n);if(r){var o=new Set(r),i=new Set(t),s=n.current;o.forEach(function(l){i.has(l)||eu(l,null)}),i.forEach(function(l){o.has(l)||eu(l,s)})}Nm.set(n,t)},[t]),n}function iD(t){return t}function sD(t,e){e===void 0&&(e=iD);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var s=e(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var a=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(a)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function lD(t){t===void 0&&(t={});var e=sD(null);return e.options=en({async:!0,ssr:!1},t),e}var Pv=function(t){var e=t.sideCar,n=Iv(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,en({},n))};Pv.isSideCarExport=!0;function aD(t,e){return t.useMedium(e),Pv}var Lv=lD(),tu=function(){},uc=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:tu,onWheelCapture:tu,onTouchMoveCapture:tu}),o=r[0],i=r[1],s=t.forwardProps,l=t.children,a=t.className,c=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,h=t.noIsolation,p=t.inert,m=t.allowPinchZoom,g=t.as,y=g===void 0?"div":g,w=t.gapMode,S=Iv(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=f,C=oD([n,e]),x=en(en({},S),o);return v.createElement(v.Fragment,null,u&&v.createElement(b,{sideCar:Lv,removeScrollBar:c,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:w}),s?v.cloneElement(v.Children.only(l),en(en({},x),{ref:C})):v.createElement(y,en({},x,{className:a,ref:C}),l))});uc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};uc.classNames={fullWidth:ml,zeroRight:pl};var cD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=cD();return e&&t.setAttribute("nonce",e),t}function dD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function fD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var hD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=uD())&&(dD(e,n),fD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},pD=function(){var t=hD();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},$v=function(){var t=pD(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},mD={left:0,top:0,right:0,gap:0},nu=function(t){return parseInt(t||"",10)||0},gD=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[nu(n),nu(r),nu(o)]},yD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return mD;var e=gD(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},bD=$v(),Do="data-scroll-locked",vD=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,l=t.gap;return n===void 0&&(n="margin"),`
404
404
  .`.concat(eD,` {
405
405
  overflow: hidden `).concat(r,`;
406
406
  padding-right: `).concat(l,"px ").concat(r,`;
@@ -418,29 +418,29 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
418
418
  `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
419
419
  }
420
420
 
421
- .`).concat(ml,` {
421
+ .`).concat(pl,` {
422
422
  right: `).concat(l,"px ").concat(r,`;
423
423
  }
424
424
 
425
- .`).concat(gl,` {
425
+ .`).concat(ml,` {
426
426
  margin-right: `).concat(l,"px ").concat(r,`;
427
427
  }
428
428
 
429
- .`).concat(ml," .").concat(ml,` {
429
+ .`).concat(pl," .").concat(pl,` {
430
430
  right: 0 `).concat(r,`;
431
431
  }
432
432
 
433
- .`).concat(gl," .").concat(gl,` {
433
+ .`).concat(ml," .").concat(ml,` {
434
434
  margin-right: 0 `).concat(r,`;
435
435
  }
436
436
 
437
437
  body[`).concat(Do,`] {
438
438
  `).concat(tD,": ").concat(l,`px;
439
439
  }
440
- `)},Dm=function(){var t=parseInt(document.body.getAttribute(Do)||"0",10);return isFinite(t)?t:0},wD=function(){v.useEffect(function(){return document.body.setAttribute(Do,(Dm()+1).toString()),function(){var t=Dm()-1;t<=0?document.body.removeAttribute(Do):document.body.setAttribute(Do,t.toString())}},[])},xD=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;wD();var i=v.useMemo(function(){return yD(o)},[o]);return v.createElement(bD,{styles:vD(i,!e,o,n?"":"!important")})},md=!1;if(typeof window<"u")try{var Ws=Object.defineProperty({},"passive",{get:function(){return md=!0,!0}});window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{md=!1}var go=md?{passive:!1}:!1,SD=function(t){return t.tagName==="TEXTAREA"},Bv=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!SD(t)&&n[e]==="visible")},CD=function(t){return Bv(t,"overflowY")},ED=function(t){return Bv(t,"overflowX")},_m=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Fv(t,r);if(o){var i=jv(t,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},MD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Fv=function(t,e){return t==="v"?CD(e):ED(e)},jv=function(t,e){return t==="v"?kD(e):MD(e)},TD=function(t,e){return t==="h"&&e==="rtl"?-1:1},OD=function(t,e,n,r,o){var i=TD(t,window.getComputedStyle(e).direction),s=i*r,l=n.target,a=e.contains(l),c=!1,u=s>0,d=0,f=0;do{var h=jv(t,l),p=h[0],m=h[1],g=h[2],y=m-g-i*p;(p||y)&&Fv(t,l)&&(d+=y,f+=p),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(e.contains(l)||e===l));return(u&&(Math.abs(d)<1||!o)||!u&&(Math.abs(f)<1||!o))&&(c=!0),c},Us=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Im=function(t){return[t.deltaX,t.deltaY]},Pm=function(t){return t&&"current"in t?t.current:t},AD=function(t,e){return t[0]===e[0]&&t[1]===e[1]},RD=function(t){return`
440
+ `)},Dm=function(){var t=parseInt(document.body.getAttribute(Do)||"0",10);return isFinite(t)?t:0},wD=function(){v.useEffect(function(){return document.body.setAttribute(Do,(Dm()+1).toString()),function(){var t=Dm()-1;t<=0?document.body.removeAttribute(Do):document.body.setAttribute(Do,t.toString())}},[])},xD=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;wD();var i=v.useMemo(function(){return yD(o)},[o]);return v.createElement(bD,{styles:vD(i,!e,o,n?"":"!important")})},gd=!1;if(typeof window<"u")try{var Vs=Object.defineProperty({},"passive",{get:function(){return gd=!0,!0}});window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{gd=!1}var mo=gd?{passive:!1}:!1,SD=function(t){return t.tagName==="TEXTAREA"},Bv=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!SD(t)&&n[e]==="visible")},CD=function(t){return Bv(t,"overflowY")},ED=function(t){return Bv(t,"overflowX")},_m=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Fv(t,r);if(o){var i=jv(t,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},MD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Fv=function(t,e){return t==="v"?CD(e):ED(e)},jv=function(t,e){return t==="v"?kD(e):MD(e)},TD=function(t,e){return t==="h"&&e==="rtl"?-1:1},OD=function(t,e,n,r,o){var i=TD(t,window.getComputedStyle(e).direction),s=i*r,l=n.target,a=e.contains(l),c=!1,u=s>0,d=0,f=0;do{var h=jv(t,l),p=h[0],m=h[1],g=h[2],y=m-g-i*p;(p||y)&&Fv(t,l)&&(d+=y,f+=p),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(e.contains(l)||e===l));return(u&&(Math.abs(d)<1||!o)||!u&&(Math.abs(f)<1||!o))&&(c=!0),c},Ws=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Im=function(t){return[t.deltaX,t.deltaY]},Pm=function(t){return t&&"current"in t?t.current:t},AD=function(t,e){return t[0]===e[0]&&t[1]===e[1]},RD=function(t){return`
441
441
  .block-interactivity-`.concat(t,` {pointer-events: none;}
442
442
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
443
- `)},ND=0,yo=[];function DD(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(ND++)[0],i=v.useState($v)[0],s=v.useRef(t);v.useEffect(function(){s.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Q2([t.lockRef.current],(t.shards||[]).map(Pm),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var l=v.useCallback(function(m,g){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var y=Us(m),x=n.current,S="deltaX"in m?m.deltaX:x[0]-y[0],b="deltaY"in m?m.deltaY:x[1]-y[1],C,w=m.target,k=Math.abs(S)>Math.abs(b)?"h":"v";if("touches"in m&&k==="h"&&w.type==="range")return!1;var R=_m(k,w);if(!R)return!0;if(R?C=k:(C=k==="v"?"h":"v",R=_m(k,w)),!R)return!1;if(!r.current&&"changedTouches"in m&&(S||b)&&(r.current=C),!C)return!0;var E=r.current||C;return OD(E,g,m,E==="h"?S:b,!0)},[]),a=v.useCallback(function(m){var g=m;if(!(!yo.length||yo[yo.length-1]!==i)){var y="deltaY"in g?Im(g):Us(g),x=e.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&AD(C.delta,y)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var S=(s.current.shards||[]).map(Pm).filter(Boolean).filter(function(C){return C.contains(g.target)}),b=S.length>0?l(g,S[0]):!s.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),c=v.useCallback(function(m,g,y,x){var S={name:m,delta:g,target:y,should:x,shadowParent:_D(y)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(b){return b!==S})},1)},[]),u=v.useCallback(function(m){n.current=Us(m),r.current=void 0},[]),d=v.useCallback(function(m){c(m.type,Im(m),m.target,l(m,t.lockRef.current))},[]),f=v.useCallback(function(m){c(m.type,Us(m),m.target,l(m,t.lockRef.current))},[]);v.useEffect(function(){return yo.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",a,go),document.addEventListener("touchmove",a,go),document.addEventListener("touchstart",u,go),function(){yo=yo.filter(function(m){return m!==i}),document.removeEventListener("wheel",a,go),document.removeEventListener("touchmove",a,go),document.removeEventListener("touchstart",u,go)}},[]);var h=t.removeScrollBar,p=t.inert;return v.createElement(v.Fragment,null,p?v.createElement(i,{styles:RD(o)}):null,h?v.createElement(xD,{gapMode:t.gapMode}):null)}function _D(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ID=aD(Lv,DD);var Xf=v.forwardRef(function(t,e){return v.createElement(dc,en({},t,{ref:e,sideCar:ID}))});Xf.classNames=dc.classNames;var gd=["Enter"," "],PD=["ArrowDown","PageUp","Home"],Hv=["ArrowUp","PageDown","End"],LD=[...PD,...Hv],$D={ltr:[...gd,"ArrowRight"],rtl:[...gd,"ArrowLeft"]},BD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xs="Menu",[Gi,FD,jD]=Sv(xs),[oo,zv]=In(xs,[jD,ri,uc]),Ss=ri(),Vv=uc(),[Wv,kr]=oo(xs),[HD,Cs]=oo(xs),Uv=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,l=Ss(e),[a,c]=v.useState(null),u=v.useRef(!1),d=Pt(i),f=Jf(o);return v.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),T.jsx(nc,{...l,children:T.jsx(Wv,{scope:e,open:n,onOpenChange:d,content:a,onContentChange:c,children:T.jsx(HD,{scope:e,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};Uv.displayName=xs;var zD="MenuAnchor",Zf=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ss(n);return T.jsx(rc,{...o,...r,ref:e})});Zf.displayName=zD;var Qf="MenuPortal",[VD,Kv]=oo(Qf,{forceMount:void 0}),Gv=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=kr(Qf,e);return T.jsx(VD,{scope:e,forceMount:n,children:T.jsx(Ln,{present:n||i.open,children:T.jsx(Vf,{asChild:!0,container:o,children:r})})})};Gv.displayName=Qf;var _t="MenuContent",[WD,eh]=oo(_t),qv=v.forwardRef((t,e)=>{const n=Kv(_t,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=kr(_t,t.__scopeMenu),s=Cs(_t,t.__scopeMenu);return T.jsx(Gi.Provider,{scope:t.__scopeMenu,children:T.jsx(Ln,{present:r||i.open,children:T.jsx(Gi.Slot,{scope:t.__scopeMenu,children:s.modal?T.jsx(UD,{...o,ref:e}):T.jsx(KD,{...o,ref:e})})})})}),UD=v.forwardRef((t,e)=>{const n=kr(_t,t.__scopeMenu),r=v.useRef(null),o=$e(e,r);return v.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),T.jsx(th,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),KD=v.forwardRef((t,e)=>{const n=kr(_t,t.__scopeMenu);return T.jsx(th,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),th=v.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=t,g=kr(_t,n),y=Cs(_t,n),x=Ss(n),S=Vv(n),b=FD(n),[C,w]=v.useState(null),k=v.useRef(null),R=$e(e,k,g.onContentChange),E=v.useRef(0),O=v.useRef(""),I=v.useRef(0),L=v.useRef(null),H=v.useRef("right"),U=v.useRef(0),K=p?Xf:v.Fragment,j=p?{as:Jr,allowPinchZoom:!0}:void 0,M=D=>{var Pe,Be;const z=O.current+D,Z=b().filter(Oe=>!Oe.disabled),ne=document.activeElement,Te=(Pe=Z.find(Oe=>Oe.ref.current===ne))==null?void 0:Pe.textValue,De=Z.map(Oe=>Oe.textValue),de=o_(De,z,Te),he=(Be=Z.find(Oe=>Oe.textValue===de))==null?void 0:Be.ref.current;(function Oe(Ze){O.current=Ze,window.clearTimeout(E.current),Ze!==""&&(E.current=window.setTimeout(()=>Oe(""),1e3))})(z),he&&setTimeout(()=>he.focus())};v.useEffect(()=>()=>window.clearTimeout(E.current),[]),Cv();const N=v.useCallback(D=>{var Z,ne;return H.current===((Z=L.current)==null?void 0:Z.side)&&s_(D,(ne=L.current)==null?void 0:ne.area)},[]);return T.jsx(WD,{scope:n,searchRef:O,onItemEnter:v.useCallback(D=>{N(D)&&D.preventDefault()},[N]),onItemLeave:v.useCallback(D=>{var z;N(D)||((z=k.current)==null||z.focus(),w(null))},[N]),onTriggerLeave:v.useCallback(D=>{N(D)&&D.preventDefault()},[N]),pointerGraceTimerRef:I,onPointerGraceIntentChange:v.useCallback(D=>{L.current=D},[]),children:T.jsx(K,{...j,children:T.jsx(Yf,{asChild:!0,trapped:o,onMountAutoFocus:ee(i,D=>{var z;D.preventDefault(),(z=k.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:T.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:T.jsx(Rv,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:ee(a,D=>{y.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(Hf,{role:"menu","aria-orientation":"vertical","data-state":d1(g.open),"data-radix-menu-content":"",dir:y.dir,...x,...m,ref:R,style:{outline:"none",...m.style},onKeyDown:ee(m.onKeyDown,D=>{const Z=D.target.closest("[data-radix-menu-content]")===D.currentTarget,ne=D.ctrlKey||D.altKey||D.metaKey,Te=D.key.length===1;Z&&(D.key==="Tab"&&D.preventDefault(),!ne&&Te&&M(D.key));const De=k.current;if(D.target!==De||!LD.includes(D.key))return;D.preventDefault();const he=b().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);Hv.includes(D.key)&&he.reverse(),n_(he)}),onBlur:ee(t.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),O.current="")}),onPointerMove:ee(t.onPointerMove,qi(D=>{const z=D.target,Z=U.current!==D.clientX;if(D.currentTarget.contains(z)&&Z){const ne=D.clientX>U.current?"right":"left";H.current=ne,U.current=D.clientX}}))})})})})})})});qv.displayName=_t;var GD="MenuGroup",nh=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(ge.div,{role:"group",...r,ref:e})});nh.displayName=GD;var qD="MenuLabel",Jv=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(ge.div,{...r,ref:e})});Jv.displayName=qD;var Ul="MenuItem",Lm="menu.itemSelect",fc=v.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=v.useRef(null),s=Cs(Ul,t.__scopeMenu),l=eh(Ul,t.__scopeMenu),a=$e(e,i),c=v.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(Lm,{bubbles:!0,cancelable:!0});d.addEventListener(Lm,h=>r==null?void 0:r(h),{once:!0}),E0(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return T.jsx(Yv,{...o,ref:a,disabled:n,onClick:ee(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:ee(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ee(t.onKeyDown,d=>{const f=l.searchRef.current!=="";n||f&&d.key===" "||gd.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});fc.displayName=Ul;var Yv=v.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=eh(Ul,n),l=Vv(n),a=v.useRef(null),c=$e(e,a),[u,d]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const p=a.current;p&&h((p.textContent??"").trim())},[i.children]),T.jsx(Gi.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:T.jsx(Nv,{asChild:!0,...l,focusable:!r,children:T.jsx(ge.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:ee(t.onPointerMove,qi(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(t.onPointerLeave,qi(p=>s.onItemLeave(p))),onFocus:ee(t.onFocus,()=>d(!0)),onBlur:ee(t.onBlur,()=>d(!1))})})})}),JD="MenuCheckboxItem",Xv=v.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return T.jsx(n1,{scope:t.__scopeMenu,checked:n,children:T.jsx(fc,{role:"menuitemcheckbox","aria-checked":Kl(n)?"mixed":n,...o,ref:e,"data-state":ih(n),onSelect:ee(o.onSelect,()=>r==null?void 0:r(Kl(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xv.displayName=JD;var Zv="MenuRadioGroup",[YD,XD]=oo(Zv,{value:void 0,onValueChange:()=>{}}),Qv=v.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,i=Pt(r);return T.jsx(YD,{scope:t.__scopeMenu,value:n,onValueChange:i,children:T.jsx(nh,{...o,ref:e})})});Qv.displayName=Zv;var e1="MenuRadioItem",t1=v.forwardRef((t,e)=>{const{value:n,...r}=t,o=XD(e1,t.__scopeMenu),i=n===o.value;return T.jsx(n1,{scope:t.__scopeMenu,checked:i,children:T.jsx(fc,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":ih(i),onSelect:ee(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});t1.displayName=e1;var rh="MenuItemIndicator",[n1,ZD]=oo(rh,{checked:!1}),r1=v.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=ZD(rh,n);return T.jsx(Ln,{present:r||Kl(i.checked)||i.checked===!0,children:T.jsx(ge.span,{...o,ref:e,"data-state":ih(i.checked)})})});r1.displayName=rh;var QD="MenuSeparator",o1=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(ge.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});o1.displayName=QD;var e_="MenuArrow",i1=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ss(n);return T.jsx(zf,{...o,...r,ref:e})});i1.displayName=e_;var oh="MenuSub",[t_,s1]=oo(oh),l1=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,i=kr(oh,e),s=Ss(e),[l,a]=v.useState(null),[c,u]=v.useState(null),d=Pt(o);return v.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),T.jsx(nc,{...s,children:T.jsx(Wv,{scope:e,open:r,onOpenChange:d,content:c,onContentChange:u,children:T.jsx(t_,{scope:e,contentId:hr(),triggerId:hr(),trigger:l,onTriggerChange:a,children:n})})})};l1.displayName=oh;var bi="MenuSubTrigger",a1=v.forwardRef((t,e)=>{const n=kr(bi,t.__scopeMenu),r=Cs(bi,t.__scopeMenu),o=s1(bi,t.__scopeMenu),i=eh(bi,t.__scopeMenu),s=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:a}=i,c={__scopeMenu:t.__scopeMenu},u=v.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return v.useEffect(()=>u,[u]),v.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),a(null)}},[l,a]),T.jsx(Zf,{asChild:!0,...c,children:T.jsx(Yv,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":d1(n.open),...t,ref:Za(e,o.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(t.onPointerMove,qi(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ee(t.onPointerLeave,qi(d=>{var h,p;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(p=n.content)==null?void 0:p.dataset.side,g=m==="right",y=g?-5:5,x=f[g?"left":"right"],S=f[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x,y:f.top},{x:S,y:f.top},{x:S,y:f.bottom},{x,y:f.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ee(t.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||$D[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});a1.displayName=bi;var c1="MenuSubContent",u1=v.forwardRef((t,e)=>{const n=Kv(_t,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=kr(_t,t.__scopeMenu),s=Cs(_t,t.__scopeMenu),l=s1(c1,t.__scopeMenu),a=v.useRef(null),c=$e(e,a);return T.jsx(Gi.Provider,{scope:t.__scopeMenu,children:T.jsx(Ln,{present:r||i.open,children:T.jsx(Gi.Slot,{scope:t.__scopeMenu,children:T.jsx(th,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=a.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ee(t.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ee(t.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:ee(t.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=BD[s.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=l.trigger)==null||h.focus(),u.preventDefault())})})})})})});u1.displayName=c1;function d1(t){return t?"open":"closed"}function Kl(t){return t==="indeterminate"}function ih(t){return Kl(t)?"indeterminate":t?"checked":"unchecked"}function n_(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function r_(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function o_(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=r_(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const a=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function i_(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const l=e[i].x,a=e[i].y,c=e[s].x,u=e[s].y;a>r!=u>r&&n<(c-l)*(r-a)/(u-a)+l&&(o=!o)}return o}function s_(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return i_(n,e)}function qi(t){return e=>e.pointerType==="mouse"?t(e):void 0}var l_=Uv,a_=Zf,c_=Gv,u_=qv,d_=nh,f_=Jv,h_=fc,p_=Xv,m_=Qv,g_=t1,y_=r1,b_=o1,v_=i1,w_=l1,x_=a1,S_=u1,sh="DropdownMenu",[C_,R4]=In(sh,[zv]),it=zv(),[E_,f1]=C_(sh),h1=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,a=it(e),c=v.useRef(null),[u=!1,d]=Er({prop:o,defaultProp:i,onChange:s});return T.jsx(E_,{scope:e,triggerId:hr(),triggerRef:c,contentId:hr(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:l,children:T.jsx(l_,{...a,open:u,onOpenChange:d,dir:r,modal:l,children:n})})};h1.displayName=sh;var p1="DropdownMenuTrigger",m1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=f1(p1,n),s=it(n);return T.jsx(a_,{asChild:!0,...s,children:T.jsx(ge.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Za(e,i.triggerRef),onPointerDown:ee(t.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:ee(t.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});m1.displayName=p1;var k_="DropdownMenuPortal",g1=t=>{const{__scopeDropdownMenu:e,...n}=t,r=it(e);return T.jsx(c_,{...r,...n})};g1.displayName=k_;var y1="DropdownMenuContent",b1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=f1(y1,n),i=it(n),s=v.useRef(!1);return T.jsx(u_,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:e,onCloseAutoFocus:ee(t.onCloseAutoFocus,l=>{var a;s.current||(a=o.triggerRef.current)==null||a.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:ee(t.onInteractOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});b1.displayName=y1;var M_="DropdownMenuGroup",T_=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(d_,{...o,...r,ref:e})});T_.displayName=M_;var O_="DropdownMenuLabel",v1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(f_,{...o,...r,ref:e})});v1.displayName=O_;var A_="DropdownMenuItem",w1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(h_,{...o,...r,ref:e})});w1.displayName=A_;var R_="DropdownMenuCheckboxItem",x1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(p_,{...o,...r,ref:e})});x1.displayName=R_;var N_="DropdownMenuRadioGroup",D_=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(m_,{...o,...r,ref:e})});D_.displayName=N_;var __="DropdownMenuRadioItem",S1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(g_,{...o,...r,ref:e})});S1.displayName=__;var I_="DropdownMenuItemIndicator",C1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(y_,{...o,...r,ref:e})});C1.displayName=I_;var P_="DropdownMenuSeparator",E1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(b_,{...o,...r,ref:e})});E1.displayName=P_;var L_="DropdownMenuArrow",$_=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(v_,{...o,...r,ref:e})});$_.displayName=L_;var B_=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:i}=t,s=it(e),[l=!1,a]=Er({prop:r,defaultProp:i,onChange:o});return T.jsx(w_,{...s,open:l,onOpenChange:a,children:n})},F_="DropdownMenuSubTrigger",k1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(x_,{...o,...r,ref:e})});k1.displayName=F_;var j_="DropdownMenuSubContent",M1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(S_,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});M1.displayName=j_;var H_=h1,z_=m1,V_=g1,W_=b1,U_=v1,K_=w1,G_=x1,q_=S1,J_=C1,Y_=E1,X_=B_,Z_=k1,Q_=M1;const eI=Symbol(),lh=Symbol(),fi="a",Ei="w";let tI=(t,e)=>new Proxy(t,e);const yd=Object.getPrototypeOf,bd=new WeakMap,T1=t=>t&&(bd.has(t)?bd.get(t):yd(t)===Object.prototype||yd(t)===Array.prototype),Gl=t=>typeof t=="object"&&t!==null,nI=t=>{if(Array.isArray(t))return Array.from(t);const e=Object.getOwnPropertyDescriptors(t);return Object.values(e).forEach(n=>{n.configurable=!0}),Object.create(yd(t),e)},ah=t=>t[lh]||t,O1=(t,e,n,r)=>{if(!T1(t))return t;let o=r&&r.get(t);if(!o){const a=ah(t);o=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(u=>!u.configurable&&!u.writable))(a)?[a,nI(a)]:[a],r==null||r.set(t,o)}const[i,s]=o;let l=n&&n.get(i);return l&&l[1].f===!!s||(l=((a,c)=>{const u={f:c};let d=!1;const f=(p,m)=>{if(!d){let g=u[fi].get(a);if(g||(g={},u[fi].set(a,g)),p===Ei)g[Ei]=!0;else{let y=g[p];y||(y=new Set,g[p]=y),y.add(m)}}},h={get:(p,m)=>m===lh?a:(f("k",m),O1(Reflect.get(p,m),u[fi],u.c,u.t)),has:(p,m)=>m===eI?(d=!0,u[fi].delete(a),!0):(f("h",m),Reflect.has(p,m)),getOwnPropertyDescriptor:(p,m)=>(f("o",m),Reflect.getOwnPropertyDescriptor(p,m)),ownKeys:p=>(f(Ei),Reflect.ownKeys(p))};return c&&(h.set=h.deleteProperty=()=>!1),[h,u]})(i,!!s),l[1].p=tI(s||i,l[0]),n&&n.set(i,l)),l[1][fi]=e,l[1].c=n,l[1].t=r,l[1].p},A1=(t,e,n,r,o=Object.is)=>{if(o(t,e))return!1;if(!Gl(t)||!Gl(e))return!0;const i=n.get(ah(t));if(!i)return!0;if(r){const l=r.get(t);if(l&&l.n===e)return l.g;r.set(t,{n:e,g:!1})}let s=null;try{for(const l of i.h||[])if(s=Reflect.has(t,l)!==Reflect.has(e,l),s)return s;if(i[Ei]===!0){if(s=((l,a)=>{const c=Reflect.ownKeys(l),u=Reflect.ownKeys(a);return c.length!==u.length||c.some((d,f)=>d!==u[f])})(t,e),s)return s}else for(const l of i.o||[])if(s=!!Reflect.getOwnPropertyDescriptor(t,l)!=!!Reflect.getOwnPropertyDescriptor(e,l),s)return s;for(const l of i.k||[])if(s=A1(t[l],e[l],n,r,o),s)return s;return s===null&&(s=!0),s}finally{r&&r.set(t,{n:e,g:s})}},rI=t=>T1(t)&&t[lh]||null,$m=(t,e=!0)=>{bd.set(t,e)},oI=(t,e,n)=>{const r=[],o=new WeakSet,i=(s,l)=>{if(o.has(s))return;Gl(s)&&o.add(s);const a=Gl(s)&&e.get(ah(s));if(a){var c,u;if((c=a.h)==null||c.forEach(f=>{const h=`:has(${String(f)})`;r.push(l?[...l,h]:[h])}),a[Ei]===!0){const f=":ownKeys";r.push(l?[...l,f]:[f])}else{var d;(d=a.o)==null||d.forEach(f=>{const h=`:hasOwn(${String(f)})`;r.push(l?[...l,h]:[h])})}(u=a.k)==null||u.forEach(f=>{!("value"in(Object.getOwnPropertyDescriptor(s,f)||{}))||i(s[f],l?[...l,f]:[f])})}else l&&r.push(l)};return i(t),r},ql={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},nu=t=>typeof t=="object"&&t!==null,Jn=new WeakMap,Ks=new WeakSet,iI=(t=Object.is,e=(c,u)=>new Proxy(c,u),n=c=>nu(c)&&!Ks.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},o=new WeakMap,i=(c,u,d=r)=>{const f=o.get(c);if((f==null?void 0:f[0])===u)return f[1];const h=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return $m(h,!0),o.set(c,[u,h]),Reflect.ownKeys(c).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const m=Reflect.get(c,p),{enumerable:g}=Reflect.getOwnPropertyDescriptor(c,p),y={value:m,enumerable:g,configurable:!0};if(Ks.has(m))$m(m,!1);else if(m instanceof Promise)delete y.value,y.get=()=>d(m);else if(Jn.has(m)){const[x,S]=Jn.get(m);y.value=i(x,S(),d)}Object.defineProperty(h,p,y)}),Object.preventExtensions(h)},s=new WeakMap,l=[1,1],a=c=>{if(!nu(c))throw new Error("object required");const u=s.get(c);if(u)return u;let d=l[0];const f=new Set,h=(E,O=++l[0])=>{d!==O&&(d=O,f.forEach(I=>I(E,O)))};let p=l[1];const m=(E=++l[1])=>(p!==E&&!f.size&&(p=E,y.forEach(([O])=>{const I=O[1](E);I>d&&(d=I)})),d),g=E=>(O,I)=>{const L=[...O];L[1]=[E,...L[1]],h(L,I)},y=new Map,x=(E,O)=>{if((ql?"production":void 0)!=="production"&&y.has(E))throw new Error("prop listener already exists");if(f.size){const I=O[3](g(E));y.set(E,[O,I])}else y.set(E,[O])},S=E=>{var O;const I=y.get(E);I&&(y.delete(E),(O=I[1])==null||O.call(I))},b=E=>(f.add(E),f.size===1&&y.forEach(([I,L],H)=>{if((ql?"production":void 0)!=="production"&&L)throw new Error("remove already exists");const U=I[3](g(H));y.set(H,[I,U])}),()=>{f.delete(E),f.size===0&&y.forEach(([I,L],H)=>{L&&(L(),y.set(H,[I]))})}),C=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),k=e(C,{deleteProperty(E,O){const I=Reflect.get(E,O);S(O);const L=Reflect.deleteProperty(E,O);return L&&h(["delete",[O],I]),L},set(E,O,I,L){const H=Reflect.has(E,O),U=Reflect.get(E,O,L);if(H&&(t(U,I)||s.has(I)&&t(U,s.get(I))))return!0;S(O),nu(I)&&(I=rI(I)||I);let K=I;if(I instanceof Promise)I.then(j=>{I.status="fulfilled",I.value=j,h(["resolve",[O],j])}).catch(j=>{I.status="rejected",I.reason=j,h(["reject",[O],j])});else{!Jn.has(I)&&n(I)&&(K=a(I));const j=!Ks.has(K)&&Jn.get(K);j&&x(O,j)}return Reflect.set(E,O,K,L),h(["set",[O],I,U]),!0}});s.set(c,k);const R=[C,m,i,b];return Jn.set(k,R),Reflect.ownKeys(c).forEach(E=>{const O=Object.getOwnPropertyDescriptor(c,E);"value"in O&&(k[E]=c[E],delete O.value,delete O.writable),Object.defineProperty(C,E,O)}),k})=>[a,Jn,Ks,t,e,n,r,o,i,s,l],[sI]=iI();function lI(t={}){return sI(t)}function aI(t,e,n){const r=Jn.get(t);(ql?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let o;const i=[],s=r[3];let l=!1;const c=s(u=>{i.push(u),o||(o=Promise.resolve().then(()=>{o=void 0,l&&e(i.splice(0))}))});return l=!0,()=>{l=!1,c()}}function Bm(t,e){const n=Jn.get(t);(ql?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");const[r,o,i]=n;return i(r,o(),e)}function cI(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vd={exports:{}},ru={};/**
443
+ `)},ND=0,go=[];function DD(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(ND++)[0],i=v.useState($v)[0],s=v.useRef(t);v.useEffect(function(){s.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Q2([t.lockRef.current],(t.shards||[]).map(Pm),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var l=v.useCallback(function(m,g){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var y=Ws(m),w=n.current,S="deltaX"in m?m.deltaX:w[0]-y[0],b="deltaY"in m?m.deltaY:w[1]-y[1],C,x=m.target,k=Math.abs(S)>Math.abs(b)?"h":"v";if("touches"in m&&k==="h"&&x.type==="range")return!1;var A=_m(k,x);if(!A)return!0;if(A?C=k:(C=k==="v"?"h":"v",A=_m(k,x)),!A)return!1;if(!r.current&&"changedTouches"in m&&(S||b)&&(r.current=C),!C)return!0;var E=r.current||C;return OD(E,g,m,E==="h"?S:b,!0)},[]),a=v.useCallback(function(m){var g=m;if(!(!go.length||go[go.length-1]!==i)){var y="deltaY"in g?Im(g):Ws(g),w=e.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&AD(C.delta,y)})[0];if(w&&w.should){g.cancelable&&g.preventDefault();return}if(!w){var S=(s.current.shards||[]).map(Pm).filter(Boolean).filter(function(C){return C.contains(g.target)}),b=S.length>0?l(g,S[0]):!s.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),c=v.useCallback(function(m,g,y,w){var S={name:m,delta:g,target:y,should:w,shadowParent:_D(y)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(b){return b!==S})},1)},[]),u=v.useCallback(function(m){n.current=Ws(m),r.current=void 0},[]),d=v.useCallback(function(m){c(m.type,Im(m),m.target,l(m,t.lockRef.current))},[]),f=v.useCallback(function(m){c(m.type,Ws(m),m.target,l(m,t.lockRef.current))},[]);v.useEffect(function(){return go.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",a,mo),document.addEventListener("touchmove",a,mo),document.addEventListener("touchstart",u,mo),function(){go=go.filter(function(m){return m!==i}),document.removeEventListener("wheel",a,mo),document.removeEventListener("touchmove",a,mo),document.removeEventListener("touchstart",u,mo)}},[]);var h=t.removeScrollBar,p=t.inert;return v.createElement(v.Fragment,null,p?v.createElement(i,{styles:RD(o)}):null,h?v.createElement(xD,{gapMode:t.gapMode}):null)}function _D(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ID=aD(Lv,DD);var Zf=v.forwardRef(function(t,e){return v.createElement(uc,en({},t,{ref:e,sideCar:ID}))});Zf.classNames=uc.classNames;var yd=["Enter"," "],PD=["ArrowDown","PageUp","Home"],Hv=["ArrowUp","PageDown","End"],LD=[...PD,...Hv],$D={ltr:[...yd,"ArrowRight"],rtl:[...yd,"ArrowLeft"]},BD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xs="Menu",[Gi,FD,jD]=Sv(xs),[ro,zv]=In(xs,[jD,ri,cc]),Ss=ri(),Vv=cc(),[Wv,kr]=ro(xs),[HD,Cs]=ro(xs),Uv=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,l=Ss(e),[a,c]=v.useState(null),u=v.useRef(!1),d=Pt(i),f=Yf(o);return v.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),T.jsx(tc,{...l,children:T.jsx(Wv,{scope:e,open:n,onOpenChange:d,content:a,onContentChange:c,children:T.jsx(HD,{scope:e,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};Uv.displayName=xs;var zD="MenuAnchor",Qf=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ss(n);return T.jsx(nc,{...o,...r,ref:e})});Qf.displayName=zD;var eh="MenuPortal",[VD,Kv]=ro(eh,{forceMount:void 0}),Gv=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=kr(eh,e);return T.jsx(VD,{scope:e,forceMount:n,children:T.jsx(Ln,{present:n||i.open,children:T.jsx(Wf,{asChild:!0,container:o,children:r})})})};Gv.displayName=eh;var _t="MenuContent",[WD,th]=ro(_t),qv=v.forwardRef((t,e)=>{const n=Kv(_t,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=kr(_t,t.__scopeMenu),s=Cs(_t,t.__scopeMenu);return T.jsx(Gi.Provider,{scope:t.__scopeMenu,children:T.jsx(Ln,{present:r||i.open,children:T.jsx(Gi.Slot,{scope:t.__scopeMenu,children:s.modal?T.jsx(UD,{...o,ref:e}):T.jsx(KD,{...o,ref:e})})})})}),UD=v.forwardRef((t,e)=>{const n=kr(_t,t.__scopeMenu),r=v.useRef(null),o=$e(e,r);return v.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),T.jsx(nh,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),KD=v.forwardRef((t,e)=>{const n=kr(_t,t.__scopeMenu);return T.jsx(nh,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nh=v.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:p,...m}=t,g=kr(_t,n),y=Cs(_t,n),w=Ss(n),S=Vv(n),b=FD(n),[C,x]=v.useState(null),k=v.useRef(null),A=$e(e,k,g.onContentChange),E=v.useRef(0),O=v.useRef(""),_=v.useRef(0),L=v.useRef(null),H=v.useRef("right"),U=v.useRef(0),K=p?Zf:v.Fragment,j=p?{as:qr,allowPinchZoom:!0}:void 0,M=D=>{var Pe,Be;const z=O.current+D,J=b().filter(Oe=>!Oe.disabled),se=document.activeElement,Te=(Pe=J.find(Oe=>Oe.ref.current===se))==null?void 0:Pe.textValue,De=J.map(Oe=>Oe.textValue),de=o_(De,z,Te),he=(Be=J.find(Oe=>Oe.textValue===de))==null?void 0:Be.ref.current;(function Oe(Ze){O.current=Ze,window.clearTimeout(E.current),Ze!==""&&(E.current=window.setTimeout(()=>Oe(""),1e3))})(z),he&&setTimeout(()=>he.focus())};v.useEffect(()=>()=>window.clearTimeout(E.current),[]),Cv();const N=v.useCallback(D=>{var J,se;return H.current===((J=L.current)==null?void 0:J.side)&&s_(D,(se=L.current)==null?void 0:se.area)},[]);return T.jsx(WD,{scope:n,searchRef:O,onItemEnter:v.useCallback(D=>{N(D)&&D.preventDefault()},[N]),onItemLeave:v.useCallback(D=>{var z;N(D)||((z=k.current)==null||z.focus(),x(null))},[N]),onTriggerLeave:v.useCallback(D=>{N(D)&&D.preventDefault()},[N]),pointerGraceTimerRef:_,onPointerGraceIntentChange:v.useCallback(D=>{L.current=D},[]),children:T.jsx(K,{...j,children:T.jsx(Xf,{asChild:!0,trapped:o,onMountAutoFocus:ee(i,D=>{var z;D.preventDefault(),(z=k.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:T.jsx(Za,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:T.jsx(Rv,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:x,onEntryFocus:ee(a,D=>{y.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(zf,{role:"menu","aria-orientation":"vertical","data-state":d1(g.open),"data-radix-menu-content":"",dir:y.dir,...w,...m,ref:A,style:{outline:"none",...m.style},onKeyDown:ee(m.onKeyDown,D=>{const J=D.target.closest("[data-radix-menu-content]")===D.currentTarget,se=D.ctrlKey||D.altKey||D.metaKey,Te=D.key.length===1;J&&(D.key==="Tab"&&D.preventDefault(),!se&&Te&&M(D.key));const De=k.current;if(D.target!==De||!LD.includes(D.key))return;D.preventDefault();const he=b().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);Hv.includes(D.key)&&he.reverse(),n_(he)}),onBlur:ee(t.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),O.current="")}),onPointerMove:ee(t.onPointerMove,qi(D=>{const z=D.target,J=U.current!==D.clientX;if(D.currentTarget.contains(z)&&J){const se=D.clientX>U.current?"right":"left";H.current=se,U.current=D.clientX}}))})})})})})})});qv.displayName=_t;var GD="MenuGroup",rh=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(ge.div,{role:"group",...r,ref:e})});rh.displayName=GD;var qD="MenuLabel",Jv=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(ge.div,{...r,ref:e})});Jv.displayName=qD;var Wl="MenuItem",Lm="menu.itemSelect",dc=v.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=v.useRef(null),s=Cs(Wl,t.__scopeMenu),l=th(Wl,t.__scopeMenu),a=$e(e,i),c=v.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(Lm,{bubbles:!0,cancelable:!0});d.addEventListener(Lm,h=>r==null?void 0:r(h),{once:!0}),E0(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return T.jsx(Yv,{...o,ref:a,disabled:n,onClick:ee(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:ee(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ee(t.onKeyDown,d=>{const f=l.searchRef.current!=="";n||f&&d.key===" "||yd.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});dc.displayName=Wl;var Yv=v.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=th(Wl,n),l=Vv(n),a=v.useRef(null),c=$e(e,a),[u,d]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const p=a.current;p&&h((p.textContent??"").trim())},[i.children]),T.jsx(Gi.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:T.jsx(Nv,{asChild:!0,...l,focusable:!r,children:T.jsx(ge.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:ee(t.onPointerMove,qi(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(t.onPointerLeave,qi(p=>s.onItemLeave(p))),onFocus:ee(t.onFocus,()=>d(!0)),onBlur:ee(t.onBlur,()=>d(!1))})})})}),JD="MenuCheckboxItem",Xv=v.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return T.jsx(n1,{scope:t.__scopeMenu,checked:n,children:T.jsx(dc,{role:"menuitemcheckbox","aria-checked":Ul(n)?"mixed":n,...o,ref:e,"data-state":sh(n),onSelect:ee(o.onSelect,()=>r==null?void 0:r(Ul(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xv.displayName=JD;var Zv="MenuRadioGroup",[YD,XD]=ro(Zv,{value:void 0,onValueChange:()=>{}}),Qv=v.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,i=Pt(r);return T.jsx(YD,{scope:t.__scopeMenu,value:n,onValueChange:i,children:T.jsx(rh,{...o,ref:e})})});Qv.displayName=Zv;var e1="MenuRadioItem",t1=v.forwardRef((t,e)=>{const{value:n,...r}=t,o=XD(e1,t.__scopeMenu),i=n===o.value;return T.jsx(n1,{scope:t.__scopeMenu,checked:i,children:T.jsx(dc,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":sh(i),onSelect:ee(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});t1.displayName=e1;var oh="MenuItemIndicator",[n1,ZD]=ro(oh,{checked:!1}),r1=v.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=ZD(oh,n);return T.jsx(Ln,{present:r||Ul(i.checked)||i.checked===!0,children:T.jsx(ge.span,{...o,ref:e,"data-state":sh(i.checked)})})});r1.displayName=oh;var QD="MenuSeparator",o1=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(ge.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});o1.displayName=QD;var e_="MenuArrow",i1=v.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ss(n);return T.jsx(Vf,{...o,...r,ref:e})});i1.displayName=e_;var ih="MenuSub",[t_,s1]=ro(ih),l1=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,i=kr(ih,e),s=Ss(e),[l,a]=v.useState(null),[c,u]=v.useState(null),d=Pt(o);return v.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),T.jsx(tc,{...s,children:T.jsx(Wv,{scope:e,open:r,onOpenChange:d,content:c,onContentChange:u,children:T.jsx(t_,{scope:e,contentId:hr(),triggerId:hr(),trigger:l,onTriggerChange:a,children:n})})})};l1.displayName=ih;var bi="MenuSubTrigger",a1=v.forwardRef((t,e)=>{const n=kr(bi,t.__scopeMenu),r=Cs(bi,t.__scopeMenu),o=s1(bi,t.__scopeMenu),i=th(bi,t.__scopeMenu),s=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:a}=i,c={__scopeMenu:t.__scopeMenu},u=v.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return v.useEffect(()=>u,[u]),v.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),a(null)}},[l,a]),T.jsx(Qf,{asChild:!0,...c,children:T.jsx(Yv,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":d1(n.open),...t,ref:Ya(e,o.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(t.onPointerMove,qi(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ee(t.onPointerLeave,qi(d=>{var h,p;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(p=n.content)==null?void 0:p.dataset.side,g=m==="right",y=g?-5:5,w=f[g?"left":"right"],S=f[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:w,y:f.top},{x:S,y:f.top},{x:S,y:f.bottom},{x:w,y:f.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ee(t.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||$D[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});a1.displayName=bi;var c1="MenuSubContent",u1=v.forwardRef((t,e)=>{const n=Kv(_t,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=kr(_t,t.__scopeMenu),s=Cs(_t,t.__scopeMenu),l=s1(c1,t.__scopeMenu),a=v.useRef(null),c=$e(e,a);return T.jsx(Gi.Provider,{scope:t.__scopeMenu,children:T.jsx(Ln,{present:r||i.open,children:T.jsx(Gi.Slot,{scope:t.__scopeMenu,children:T.jsx(nh,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=a.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ee(t.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ee(t.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:ee(t.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=BD[s.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=l.trigger)==null||h.focus(),u.preventDefault())})})})})})});u1.displayName=c1;function d1(t){return t?"open":"closed"}function Ul(t){return t==="indeterminate"}function sh(t){return Ul(t)?"indeterminate":t?"checked":"unchecked"}function n_(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function r_(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function o_(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=r_(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const a=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function i_(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const l=e[i].x,a=e[i].y,c=e[s].x,u=e[s].y;a>r!=u>r&&n<(c-l)*(r-a)/(u-a)+l&&(o=!o)}return o}function s_(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return i_(n,e)}function qi(t){return e=>e.pointerType==="mouse"?t(e):void 0}var l_=Uv,a_=Qf,c_=Gv,u_=qv,d_=rh,f_=Jv,h_=dc,p_=Xv,m_=Qv,g_=t1,y_=r1,b_=o1,v_=i1,w_=l1,x_=a1,S_=u1,lh="DropdownMenu",[C_,A4]=In(lh,[zv]),it=zv(),[E_,f1]=C_(lh),h1=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=t,a=it(e),c=v.useRef(null),[u=!1,d]=Er({prop:o,defaultProp:i,onChange:s});return T.jsx(E_,{scope:e,triggerId:hr(),triggerRef:c,contentId:hr(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(f=>!f),[d]),modal:l,children:T.jsx(l_,{...a,open:u,onOpenChange:d,dir:r,modal:l,children:n})})};h1.displayName=lh;var p1="DropdownMenuTrigger",m1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=f1(p1,n),s=it(n);return T.jsx(a_,{asChild:!0,...s,children:T.jsx(ge.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ya(e,i.triggerRef),onPointerDown:ee(t.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:ee(t.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});m1.displayName=p1;var k_="DropdownMenuPortal",g1=t=>{const{__scopeDropdownMenu:e,...n}=t,r=it(e);return T.jsx(c_,{...r,...n})};g1.displayName=k_;var y1="DropdownMenuContent",b1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=f1(y1,n),i=it(n),s=v.useRef(!1);return T.jsx(u_,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:e,onCloseAutoFocus:ee(t.onCloseAutoFocus,l=>{var a;s.current||(a=o.triggerRef.current)==null||a.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:ee(t.onInteractOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});b1.displayName=y1;var M_="DropdownMenuGroup",T_=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(d_,{...o,...r,ref:e})});T_.displayName=M_;var O_="DropdownMenuLabel",v1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(f_,{...o,...r,ref:e})});v1.displayName=O_;var A_="DropdownMenuItem",w1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(h_,{...o,...r,ref:e})});w1.displayName=A_;var R_="DropdownMenuCheckboxItem",x1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(p_,{...o,...r,ref:e})});x1.displayName=R_;var N_="DropdownMenuRadioGroup",D_=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(m_,{...o,...r,ref:e})});D_.displayName=N_;var __="DropdownMenuRadioItem",S1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(g_,{...o,...r,ref:e})});S1.displayName=__;var I_="DropdownMenuItemIndicator",C1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(y_,{...o,...r,ref:e})});C1.displayName=I_;var P_="DropdownMenuSeparator",E1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(b_,{...o,...r,ref:e})});E1.displayName=P_;var L_="DropdownMenuArrow",$_=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(v_,{...o,...r,ref:e})});$_.displayName=L_;var B_=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:i}=t,s=it(e),[l=!1,a]=Er({prop:r,defaultProp:i,onChange:o});return T.jsx(w_,{...s,open:l,onOpenChange:a,children:n})},F_="DropdownMenuSubTrigger",k1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(x_,{...o,...r,ref:e})});k1.displayName=F_;var j_="DropdownMenuSubContent",M1=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=it(n);return T.jsx(S_,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});M1.displayName=j_;var H_=h1,z_=m1,V_=g1,W_=b1,U_=v1,K_=w1,G_=x1,q_=S1,J_=C1,Y_=E1,X_=B_,Z_=k1,Q_=M1;const eI=Symbol(),ah=Symbol(),fi="a",Ei="w";let tI=(t,e)=>new Proxy(t,e);const bd=Object.getPrototypeOf,vd=new WeakMap,T1=t=>t&&(vd.has(t)?vd.get(t):bd(t)===Object.prototype||bd(t)===Array.prototype),Kl=t=>typeof t=="object"&&t!==null,nI=t=>{if(Array.isArray(t))return Array.from(t);const e=Object.getOwnPropertyDescriptors(t);return Object.values(e).forEach(n=>{n.configurable=!0}),Object.create(bd(t),e)},ch=t=>t[ah]||t,O1=(t,e,n,r)=>{if(!T1(t))return t;let o=r&&r.get(t);if(!o){const a=ch(t);o=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(u=>!u.configurable&&!u.writable))(a)?[a,nI(a)]:[a],r==null||r.set(t,o)}const[i,s]=o;let l=n&&n.get(i);return l&&l[1].f===!!s||(l=((a,c)=>{const u={f:c};let d=!1;const f=(p,m)=>{if(!d){let g=u[fi].get(a);if(g||(g={},u[fi].set(a,g)),p===Ei)g[Ei]=!0;else{let y=g[p];y||(y=new Set,g[p]=y),y.add(m)}}},h={get:(p,m)=>m===ah?a:(f("k",m),O1(Reflect.get(p,m),u[fi],u.c,u.t)),has:(p,m)=>m===eI?(d=!0,u[fi].delete(a),!0):(f("h",m),Reflect.has(p,m)),getOwnPropertyDescriptor:(p,m)=>(f("o",m),Reflect.getOwnPropertyDescriptor(p,m)),ownKeys:p=>(f(Ei),Reflect.ownKeys(p))};return c&&(h.set=h.deleteProperty=()=>!1),[h,u]})(i,!!s),l[1].p=tI(s||i,l[0]),n&&n.set(i,l)),l[1][fi]=e,l[1].c=n,l[1].t=r,l[1].p},A1=(t,e,n,r,o=Object.is)=>{if(o(t,e))return!1;if(!Kl(t)||!Kl(e))return!0;const i=n.get(ch(t));if(!i)return!0;if(r){const l=r.get(t);if(l&&l.n===e)return l.g;r.set(t,{n:e,g:!1})}let s=null;try{for(const l of i.h||[])if(s=Reflect.has(t,l)!==Reflect.has(e,l),s)return s;if(i[Ei]===!0){if(s=((l,a)=>{const c=Reflect.ownKeys(l),u=Reflect.ownKeys(a);return c.length!==u.length||c.some((d,f)=>d!==u[f])})(t,e),s)return s}else for(const l of i.o||[])if(s=!!Reflect.getOwnPropertyDescriptor(t,l)!=!!Reflect.getOwnPropertyDescriptor(e,l),s)return s;for(const l of i.k||[])if(s=A1(t[l],e[l],n,r,o),s)return s;return s===null&&(s=!0),s}finally{r&&r.set(t,{n:e,g:s})}},rI=t=>T1(t)&&t[ah]||null,$m=(t,e=!0)=>{vd.set(t,e)},oI=(t,e,n)=>{const r=[],o=new WeakSet,i=(s,l)=>{if(o.has(s))return;Kl(s)&&o.add(s);const a=Kl(s)&&e.get(ch(s));if(a){var c,u;if((c=a.h)==null||c.forEach(f=>{const h=`:has(${String(f)})`;r.push(l?[...l,h]:[h])}),a[Ei]===!0){const f=":ownKeys";r.push(l?[...l,f]:[f])}else{var d;(d=a.o)==null||d.forEach(f=>{const h=`:hasOwn(${String(f)})`;r.push(l?[...l,h]:[h])})}(u=a.k)==null||u.forEach(f=>{!("value"in(Object.getOwnPropertyDescriptor(s,f)||{}))||i(s[f],l?[...l,f]:[f])})}else l&&r.push(l)};return i(t),r},Gl={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},ru=t=>typeof t=="object"&&t!==null,Jn=new WeakMap,Us=new WeakSet,iI=(t=Object.is,e=(c,u)=>new Proxy(c,u),n=c=>ru(c)&&!Us.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},o=new WeakMap,i=(c,u,d=r)=>{const f=o.get(c);if((f==null?void 0:f[0])===u)return f[1];const h=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return $m(h,!0),o.set(c,[u,h]),Reflect.ownKeys(c).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const m=Reflect.get(c,p),{enumerable:g}=Reflect.getOwnPropertyDescriptor(c,p),y={value:m,enumerable:g,configurable:!0};if(Us.has(m))$m(m,!1);else if(m instanceof Promise)delete y.value,y.get=()=>d(m);else if(Jn.has(m)){const[w,S]=Jn.get(m);y.value=i(w,S(),d)}Object.defineProperty(h,p,y)}),Object.preventExtensions(h)},s=new WeakMap,l=[1,1],a=c=>{if(!ru(c))throw new Error("object required");const u=s.get(c);if(u)return u;let d=l[0];const f=new Set,h=(E,O=++l[0])=>{d!==O&&(d=O,f.forEach(_=>_(E,O)))};let p=l[1];const m=(E=++l[1])=>(p!==E&&!f.size&&(p=E,y.forEach(([O])=>{const _=O[1](E);_>d&&(d=_)})),d),g=E=>(O,_)=>{const L=[...O];L[1]=[E,...L[1]],h(L,_)},y=new Map,w=(E,O)=>{if((Gl?"production":void 0)!=="production"&&y.has(E))throw new Error("prop listener already exists");if(f.size){const _=O[3](g(E));y.set(E,[O,_])}else y.set(E,[O])},S=E=>{var O;const _=y.get(E);_&&(y.delete(E),(O=_[1])==null||O.call(_))},b=E=>(f.add(E),f.size===1&&y.forEach(([_,L],H)=>{if((Gl?"production":void 0)!=="production"&&L)throw new Error("remove already exists");const U=_[3](g(H));y.set(H,[_,U])}),()=>{f.delete(E),f.size===0&&y.forEach(([_,L],H)=>{L&&(L(),y.set(H,[_]))})}),C=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),k=e(C,{deleteProperty(E,O){const _=Reflect.get(E,O);S(O);const L=Reflect.deleteProperty(E,O);return L&&h(["delete",[O],_]),L},set(E,O,_,L){const H=Reflect.has(E,O),U=Reflect.get(E,O,L);if(H&&(t(U,_)||s.has(_)&&t(U,s.get(_))))return!0;S(O),ru(_)&&(_=rI(_)||_);let K=_;if(_ instanceof Promise)_.then(j=>{_.status="fulfilled",_.value=j,h(["resolve",[O],j])}).catch(j=>{_.status="rejected",_.reason=j,h(["reject",[O],j])});else{!Jn.has(_)&&n(_)&&(K=a(_));const j=!Us.has(K)&&Jn.get(K);j&&w(O,j)}return Reflect.set(E,O,K,L),h(["set",[O],_,U]),!0}});s.set(c,k);const A=[C,m,i,b];return Jn.set(k,A),Reflect.ownKeys(c).forEach(E=>{const O=Object.getOwnPropertyDescriptor(c,E);"value"in O&&(k[E]=c[E],delete O.value,delete O.writable),Object.defineProperty(C,E,O)}),k})=>[a,Jn,Us,t,e,n,r,o,i,s,l],[sI]=iI();function lI(t={}){return sI(t)}function aI(t,e,n){const r=Jn.get(t);(Gl?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let o;const i=[],s=r[3];let l=!1;const c=s(u=>{i.push(u),o||(o=Promise.resolve().then(()=>{o=void 0,l&&e(i.splice(0))}))});return l=!0,()=>{l=!1,c()}}function Bm(t,e){const n=Jn.get(t);(Gl?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");const[r,o,i]=n;return i(r,o(),e)}function cI(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wd={exports:{}},ou={};/**
444
444
  * @license React
445
445
  * use-sync-external-store-shim.production.min.js
446
446
  *
@@ -448,7 +448,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
448
448
  *
449
449
  * This source code is licensed under the MIT license found in the
450
450
  * LICENSE file in the root directory of this source tree.
451
- */var Fm;function uI(){if(Fm)return ru;Fm=1;var t=_;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,g=p[1];return i(function(){m.value=h,m.getSnapshot=f,a(m)&&g({inst:m})},[d,h,f]),o(function(){return a(m)&&g({inst:m}),d(function(){a(m)&&g({inst:m})})},[d]),s(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return ru.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,ru}var ou={};/**
451
+ */var Fm;function uI(){if(Fm)return ou;Fm=1;var t=P;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,g=p[1];return i(function(){m.value=h,m.getSnapshot=f,a(m)&&g({inst:m})},[d,h,f]),o(function(){return a(m)&&g({inst:m}),d(function(){a(m)&&g({inst:m})})},[d]),s(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return ou.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,ou}var iu={};/**
452
452
  * @license React
453
453
  * use-sync-external-store-shim.development.js
454
454
  *
@@ -456,32 +456,32 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
456
456
  *
457
457
  * This source code is licensed under the MIT license found in the
458
458
  * LICENSE file in the root directory of this source tree.
459
- */var jm;function dI(){return jm||(jm=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=_,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var b=arguments.length,C=new Array(b>1?b-1:0),w=1;w<b;w++)C[w-1]=arguments[w];r("error",S,C)}}function r(S,b,C){{var w=e.ReactDebugCurrentFrame,k=w.getStackAddendum();k!==""&&(b+="%s",C=C.concat([k]));var R=C.map(function(E){return String(E)});R.unshift("Warning: "+b),Function.prototype.apply.call(console[S],console,R)}}function o(S,b){return S===b&&(S!==0||1/S===1/b)||S!==S&&b!==b}var i=typeof Object.is=="function"?Object.is:o,s=t.useState,l=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function f(S,b,C){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=b();if(!d){var k=b();i(w,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var R=s({inst:{value:w,getSnapshot:b}}),E=R[0].inst,O=R[1];return a(function(){E.value=w,E.getSnapshot=b,h(E)&&O({inst:E})},[S,w,b]),l(function(){h(E)&&O({inst:E});var I=function(){h(E)&&O({inst:E})};return S(I)},[S]),c(w),w}function h(S){var b=S.getSnapshot,C=S.value;try{var w=b();return!i(C,w)}catch{return!0}}function p(S,b,C){return b()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!m,y=g?p:f,x=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;ou.useSyncExternalStore=x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ou}process.env.NODE_ENV==="production"?vd.exports=uI():vd.exports=dI();var fI=vd.exports;const hI=cI(fI),pI={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{use:Hm}=_,{useSyncExternalStore:mI}=hI,gI=(t,e)=>{const n=_.useRef();_.useEffect(()=>{n.current=oI(t,e)}),_.useDebugValue(n.current)},yI=new WeakMap;function bI(t,e){const r=_.useRef(),o=_.useRef();let i=!0;const s=mI(_.useCallback(c=>{const u=aI(t,c);return c(),u},[t,void 0]),()=>{const c=Bm(t,Hm);try{if(!i&&r.current&&o.current&&!A1(r.current,c,o.current,new WeakMap))return r.current}catch{}return c},()=>Bm(t,Hm));i=!1;const l=new WeakMap;_.useEffect(()=>{r.current=s,o.current=l}),(pI?"production":void 0)!=="production"&&gI(s,l);const a=_.useMemo(()=>new WeakMap,[]);return O1(s,l,a,yI)}const vI=Ne.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,le(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>id({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),wI=Ie.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var ch="Popover",[R1,N4]=In(ch,[ri]),Es=ri(),[xI,Mr]=R1(ch),N1=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=t,l=Es(e),a=v.useRef(null),[c,u]=v.useState(!1),[d=!1,f]=Er({prop:r,defaultProp:o,onChange:i});return T.jsx(nc,{...l,children:T.jsx(xI,{scope:e,contentId:hr(),triggerRef:a,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:s,children:n})})};N1.displayName=ch;var D1="PopoverAnchor",SI=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Mr(D1,n),i=Es(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return v.useEffect(()=>(s(),()=>l()),[s,l]),T.jsx(rc,{...i,...r,ref:e})});SI.displayName=D1;var _1="PopoverTrigger",I1=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Mr(_1,n),i=Es(n),s=$e(e,o.triggerRef),l=T.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":F1(o.open),...r,ref:s,onClick:ee(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:T.jsx(rc,{asChild:!0,...i,children:l})});I1.displayName=_1;var uh="PopoverPortal",[CI,EI]=R1(uh,{forceMount:void 0}),P1=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=Mr(uh,e);return T.jsx(CI,{scope:e,forceMount:n,children:T.jsx(Ln,{present:n||i.open,children:T.jsx(Vf,{asChild:!0,container:o,children:r})})})};P1.displayName=uh;var zo="PopoverContent",L1=v.forwardRef((t,e)=>{const n=EI(zo,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=Mr(zo,t.__scopePopover);return T.jsx(Ln,{present:r||i.open,children:i.modal?T.jsx(kI,{...o,ref:e}):T.jsx(MI,{...o,ref:e})})});L1.displayName=zo;var kI=v.forwardRef((t,e)=>{const n=Mr(zo,t.__scopePopover),r=v.useRef(null),o=$e(e,r),i=v.useRef(!1);return v.useEffect(()=>{const s=r.current;if(s)return _v(s)},[]),T.jsx(Xf,{as:Jr,allowPinchZoom:!0,children:T.jsx($1,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,s=>{var l;s.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,s=>{const l=s.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0,c=l.button===2||a;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ee(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),MI=v.forwardRef((t,e)=>{const n=Mr(zo,t.__scopePopover),r=v.useRef(!1),o=v.useRef(!1);return T.jsx($1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,l;(s=t.onCloseAutoFocus)==null||s.call(t,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var a,c;(a=t.onInteractOutside)==null||a.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),$1=v.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Mr(zo,n),h=Es(n);return Cv(),T.jsx(Yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:T.jsx(Qa,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:T.jsx(Hf,{"data-state":F1(f.open),role:"dialog",id:f.contentId,...h,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),B1="PopoverClose",TI=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Mr(B1,n);return T.jsx(ge.button,{type:"button",...r,ref:e,onClick:ee(t.onClick,()=>o.onOpenChange(!1))})});TI.displayName=B1;var OI="PopoverArrow",AI=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Es(n);return T.jsx(zf,{...o,...r,ref:e})});AI.displayName=OI;function F1(t){return t?"open":"closed"}var RI=N1,NI=I1,DI=P1,_I=L1;const II=Ie.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var j1=typeof global=="object"&&global&&global.Object===Object&&global,PI=typeof self=="object"&&self&&self.Object===Object&&self,hn=j1||PI||Function("return this")(),un=hn.Symbol,H1=Object.prototype,LI=H1.hasOwnProperty,$I=H1.toString,hi=un?un.toStringTag:void 0;function BI(t){var e=LI.call(t,hi),n=t[hi];try{t[hi]=void 0;var r=!0}catch{}var o=$I.call(t);return r&&(e?t[hi]=n:delete t[hi]),o}var FI=Object.prototype,jI=FI.toString;function HI(t){return jI.call(t)}var zI="[object Null]",VI="[object Undefined]",zm=un?un.toStringTag:void 0;function io(t){return t==null?t===void 0?VI:zI:zm&&zm in Object(t)?BI(t):HI(t)}function yr(t){return t!=null&&typeof t=="object"}var WI="[object Symbol]";function hc(t){return typeof t=="symbol"||yr(t)&&io(t)==WI}function z1(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var dn=Array.isArray,UI=1/0,Vm=un?un.prototype:void 0,Wm=Vm?Vm.toString:void 0;function Jl(t){if(typeof t=="string")return t;if(dn(t))return z1(t,Jl)+"";if(hc(t))return Wm?Wm.call(t):"";var e=t+"";return e=="0"&&1/t==-UI?"-0":e}var KI=/\s/;function GI(t){for(var e=t.length;e--&&KI.test(t.charAt(e)););return e}var qI=/^\s+/;function JI(t){return t&&t.slice(0,GI(t)+1).replace(qI,"")}function br(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Um=NaN,YI=/^[-+]0x[0-9a-f]+$/i,XI=/^0b[01]+$/i,ZI=/^0o[0-7]+$/i,QI=parseInt;function wd(t){if(typeof t=="number")return t;if(hc(t))return Um;if(br(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=br(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=JI(t);var n=XI.test(t);return n||ZI.test(t)?QI(t.slice(2),n?2:8):YI.test(t)?Um:+t}var Km=1/0,eP=17976931348623157e292;function tP(t){if(!t)return t===0?t:0;if(t=wd(t),t===Km||t===-Km){var e=t<0?-1:1;return e*eP}return t===t?t:0}function nP(t){var e=tP(t),n=e%1;return e===e?n?e-n:e:0}function dh(t){return t}var rP="[object AsyncFunction]",oP="[object Function]",iP="[object GeneratorFunction]",sP="[object Proxy]";function V1(t){if(!br(t))return!1;var e=io(t);return e==oP||e==iP||e==rP||e==sP}var iu=hn["__core-js_shared__"],Gm=function(){var t=/[^.]+$/.exec(iu&&iu.keys&&iu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function lP(t){return!!Gm&&Gm in t}var aP=Function.prototype,cP=aP.toString;function so(t){if(t!=null){try{return cP.call(t)}catch{}try{return t+""}catch{}}return""}var uP=/[\\^$.*+?()[\]{}|]/g,dP=/^\[object .+?Constructor\]$/,fP=Function.prototype,hP=Object.prototype,pP=fP.toString,mP=hP.hasOwnProperty,gP=RegExp("^"+pP.call(mP).replace(uP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yP(t){if(!br(t)||lP(t))return!1;var e=V1(t)?gP:dP;return e.test(so(t))}function bP(t,e){return t==null?void 0:t[e]}function lo(t,e){var n=bP(t,e);return yP(n)?n:void 0}var xd=lo(hn,"WeakMap");function vP(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var wP=800,xP=16,SP=Date.now;function CP(t){var e=0,n=0;return function(){var r=SP(),o=xP-(r-n);if(n=r,o>0){if(++e>=wP)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function EP(t){return function(){return t}}var qm=function(){try{var t=lo(Object,"defineProperty");return t({},"",{}),t}catch{}}(),kP=qm?function(t,e){return qm(t,"toString",{configurable:!0,enumerable:!1,value:EP(e),writable:!0})}:dh,MP=CP(kP);function TP(t,e,n,r){for(var o=t.length,i=n+-1;++i<o;)if(e(t[i],i,t))return i;return-1}function OP(t){return t!==t}function AP(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}function RP(t,e,n){return e===e?AP(t,e,n):TP(t,OP,n)}function NP(t,e){var n=t==null?0:t.length;return!!n&&RP(t,e,0)>-1}var DP=9007199254740991,_P=/^(?:0|[1-9]\d*)$/;function W1(t,e){var n=typeof t;return e=e??DP,!!e&&(n=="number"||n!="symbol"&&_P.test(t))&&t>-1&&t%1==0&&t<e}function U1(t,e){return t===e||t!==t&&e!==e}var Jm=Math.max;function IP(t,e,n){return e=Jm(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Jm(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var l=Array(e+1);++o<e;)l[o]=r[o];return l[e]=n(s),vP(t,this,l)}}function PP(t,e){return MP(IP(t,e,dh),t+"")}var LP=9007199254740991;function fh(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=LP}function K1(t){return t!=null&&fh(t.length)&&!V1(t)}var $P=Object.prototype;function BP(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$P;return t===n}function FP(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var jP="[object Arguments]";function Ym(t){return yr(t)&&io(t)==jP}var G1=Object.prototype,HP=G1.hasOwnProperty,zP=G1.propertyIsEnumerable,hh=Ym(function(){return arguments}())?Ym:function(t){return yr(t)&&HP.call(t,"callee")&&!zP.call(t,"callee")};function VP(){return!1}var q1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xm=q1&&typeof module=="object"&&module&&!module.nodeType&&module,WP=Xm&&Xm.exports===q1,Zm=WP?hn.Buffer:void 0,UP=Zm?Zm.isBuffer:void 0,Sd=UP||VP,KP="[object Arguments]",GP="[object Array]",qP="[object Boolean]",JP="[object Date]",YP="[object Error]",XP="[object Function]",ZP="[object Map]",QP="[object Number]",eL="[object Object]",tL="[object RegExp]",nL="[object Set]",rL="[object String]",oL="[object WeakMap]",iL="[object ArrayBuffer]",sL="[object DataView]",lL="[object Float32Array]",aL="[object Float64Array]",cL="[object Int8Array]",uL="[object Int16Array]",dL="[object Int32Array]",fL="[object Uint8Array]",hL="[object Uint8ClampedArray]",pL="[object Uint16Array]",mL="[object Uint32Array]",Se={};Se[lL]=Se[aL]=Se[cL]=Se[uL]=Se[dL]=Se[fL]=Se[hL]=Se[pL]=Se[mL]=!0;Se[KP]=Se[GP]=Se[iL]=Se[qP]=Se[sL]=Se[JP]=Se[YP]=Se[XP]=Se[ZP]=Se[QP]=Se[eL]=Se[tL]=Se[nL]=Se[rL]=Se[oL]=!1;function gL(t){return yr(t)&&fh(t.length)&&!!Se[io(t)]}function ph(t){return function(e){return t(e)}}var J1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ki=J1&&typeof module=="object"&&module&&!module.nodeType&&module,yL=ki&&ki.exports===J1,su=yL&&j1.process,Yl=function(){try{var t=ki&&ki.require&&ki.require("util").types;return t||su&&su.binding&&su.binding("util")}catch{}}(),Qm=Yl&&Yl.isTypedArray,Y1=Qm?ph(Qm):gL,bL=Object.prototype,vL=bL.hasOwnProperty;function wL(t,e){var n=dn(t),r=!n&&hh(t),o=!n&&!r&&Sd(t),i=!n&&!r&&!o&&Y1(t),s=n||r||o||i,l=s?FP(t.length,String):[],a=l.length;for(var c in t)vL.call(t,c)&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||W1(c,a)))&&l.push(c);return l}function xL(t,e){return function(n){return t(e(n))}}var SL=xL(Object.keys,Object),CL=Object.prototype,EL=CL.hasOwnProperty;function kL(t){if(!BP(t))return SL(t);var e=[];for(var n in Object(t))EL.call(t,n)&&n!="constructor"&&e.push(n);return e}function X1(t){return K1(t)?wL(t):kL(t)}var ML=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TL=/^\w*$/;function mh(t,e){if(dn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||hc(t)?!0:TL.test(t)||!ML.test(t)||e!=null&&t in Object(e)}var Ji=lo(Object,"create");function OL(){this.__data__=Ji?Ji(null):{},this.size=0}function AL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var RL="__lodash_hash_undefined__",NL=Object.prototype,DL=NL.hasOwnProperty;function _L(t){var e=this.__data__;if(Ji){var n=e[t];return n===RL?void 0:n}return DL.call(e,t)?e[t]:void 0}var IL=Object.prototype,PL=IL.hasOwnProperty;function LL(t){var e=this.__data__;return Ji?e[t]!==void 0:PL.call(e,t)}var $L="__lodash_hash_undefined__";function BL(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ji&&e===void 0?$L:e,this}function Zr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Zr.prototype.clear=OL;Zr.prototype.delete=AL;Zr.prototype.get=_L;Zr.prototype.has=LL;Zr.prototype.set=BL;function FL(){this.__data__=[],this.size=0}function pc(t,e){for(var n=t.length;n--;)if(U1(t[n][0],e))return n;return-1}var jL=Array.prototype,HL=jL.splice;function zL(t){var e=this.__data__,n=pc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():HL.call(e,n,1),--this.size,!0}function VL(t){var e=this.__data__,n=pc(e,t);return n<0?void 0:e[n][1]}function WL(t){return pc(this.__data__,t)>-1}function UL(t,e){var n=this.__data__,r=pc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function $n(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}$n.prototype.clear=FL;$n.prototype.delete=zL;$n.prototype.get=VL;$n.prototype.has=WL;$n.prototype.set=UL;var Yi=lo(hn,"Map");function KL(){this.size=0,this.__data__={hash:new Zr,map:new(Yi||$n),string:new Zr}}function GL(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function mc(t,e){var n=t.__data__;return GL(e)?n[typeof e=="string"?"string":"hash"]:n.map}function qL(t){var e=mc(this,t).delete(t);return this.size-=e?1:0,e}function JL(t){return mc(this,t).get(t)}function YL(t){return mc(this,t).has(t)}function XL(t,e){var n=mc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Bn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Bn.prototype.clear=KL;Bn.prototype.delete=qL;Bn.prototype.get=JL;Bn.prototype.has=YL;Bn.prototype.set=XL;var ZL="Expected a function";function gh(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ZL);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(gh.Cache||Bn),n}gh.Cache=Bn;var QL=500;function e$(t){var e=gh(t,function(r){return n.size===QL&&n.clear(),r}),n=e.cache;return e}var t$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n$=/\\(\\)?/g,r$=e$(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(t$,function(n,r,o,i){e.push(o?i.replace(n$,"$1"):r||n)}),e});function Cd(t){return t==null?"":Jl(t)}function Z1(t,e){return dn(t)?t:mh(t,e)?[t]:r$(Cd(t))}var o$=1/0;function gc(t){if(typeof t=="string"||hc(t))return t;var e=t+"";return e=="0"&&1/t==-o$?"-0":e}function Q1(t,e){e=Z1(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[gc(e[n++])];return n&&n==r?t:void 0}function i$(t,e,n){var r=t==null?void 0:Q1(t,e);return r===void 0?n:r}function ew(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var eg=un?un.isConcatSpreadable:void 0;function s$(t){return dn(t)||hh(t)||!!(eg&&t&&t[eg])}function l$(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=s$),o||(o=[]);++i<s;){var l=t[i];n(l)&&ew(o,l)}return o}function a$(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),n=n>o?o:n,n<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function c$(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:a$(t,e,n)}var u$="\\ud800-\\udfff",d$="\\u0300-\\u036f",f$="\\ufe20-\\ufe2f",h$="\\u20d0-\\u20ff",p$=d$+f$+h$,m$="\\ufe0e\\ufe0f",g$="\\u200d",y$=RegExp("["+g$+u$+p$+m$+"]");function yh(t){return y$.test(t)}function b$(t){return t.split("")}var tw="\\ud800-\\udfff",v$="\\u0300-\\u036f",w$="\\ufe20-\\ufe2f",x$="\\u20d0-\\u20ff",S$=v$+w$+x$,C$="\\ufe0e\\ufe0f",E$="["+tw+"]",Ed="["+S$+"]",kd="\\ud83c[\\udffb-\\udfff]",k$="(?:"+Ed+"|"+kd+")",nw="[^"+tw+"]",rw="(?:\\ud83c[\\udde6-\\uddff]){2}",ow="[\\ud800-\\udbff][\\udc00-\\udfff]",M$="\\u200d",iw=k$+"?",sw="["+C$+"]?",T$="(?:"+M$+"(?:"+[nw,rw,ow].join("|")+")"+sw+iw+")*",O$=sw+iw+T$,A$="(?:"+[nw+Ed+"?",Ed,rw,ow,E$].join("|")+")",R$=RegExp(kd+"(?="+kd+")|"+A$+O$,"g");function N$(t){return t.match(R$)||[]}function D$(t){return yh(t)?N$(t):b$(t)}function _$(){this.__data__=new $n,this.size=0}function I$(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function P$(t){return this.__data__.get(t)}function L$(t){return this.__data__.has(t)}var $$=200;function B$(t,e){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!Yi||r.length<$$-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Bn(r)}return n.set(t,e),this.size=n.size,this}function On(t){var e=this.__data__=new $n(t);this.size=e.size}On.prototype.clear=_$;On.prototype.delete=I$;On.prototype.get=P$;On.prototype.has=L$;On.prototype.set=B$;function F$(t,e){for(var n=-1,r=t==null?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function j$(){return[]}var H$=Object.prototype,z$=H$.propertyIsEnumerable,tg=Object.getOwnPropertySymbols,V$=tg?function(t){return t==null?[]:(t=Object(t),F$(tg(t),function(e){return z$.call(t,e)}))}:j$;function W$(t,e,n){var r=e(t);return dn(t)?r:ew(r,n(t))}function ng(t){return W$(t,X1,V$)}var Md=lo(hn,"DataView"),Td=lo(hn,"Promise"),Od=lo(hn,"Set"),rg="[object Map]",U$="[object Object]",og="[object Promise]",ig="[object Set]",sg="[object WeakMap]",lg="[object DataView]",K$=so(Md),G$=so(Yi),q$=so(Td),J$=so(Od),Y$=so(xd),Yn=io;(Md&&Yn(new Md(new ArrayBuffer(1)))!=lg||Yi&&Yn(new Yi)!=rg||Td&&Yn(Td.resolve())!=og||Od&&Yn(new Od)!=ig||xd&&Yn(new xd)!=sg)&&(Yn=function(t){var e=io(t),n=e==U$?t.constructor:void 0,r=n?so(n):"";if(r)switch(r){case K$:return lg;case G$:return rg;case q$:return og;case J$:return ig;case Y$:return sg}return e});var ag=hn.Uint8Array,X$="__lodash_hash_undefined__";function Z$(t){return this.__data__.set(t,X$),this}function Q$(t){return this.__data__.has(t)}function Xi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Bn;++e<n;)this.add(t[e])}Xi.prototype.add=Xi.prototype.push=Z$;Xi.prototype.has=Q$;function eB(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function lw(t,e){return t.has(e)}var tB=1,nB=2;function aw(t,e,n,r,o,i){var s=n&tB,l=t.length,a=e.length;if(l!=a&&!(s&&a>l))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,h=n&nB?new Xi:void 0;for(i.set(t,e),i.set(e,t);++d<l;){var p=t[d],m=e[d];if(r)var g=s?r(m,p,d,e,t,i):r(p,m,d,t,e,i);if(g!==void 0){if(g)continue;f=!1;break}if(h){if(!eB(e,function(y,x){if(!lw(h,x)&&(p===y||o(p,y,n,r,i)))return h.push(x)})){f=!1;break}}else if(!(p===m||o(p,m,n,r,i))){f=!1;break}}return i.delete(t),i.delete(e),f}function rB(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}function oB(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var iB=1,sB=2,lB="[object Boolean]",aB="[object Date]",cB="[object Error]",uB="[object Map]",dB="[object Number]",fB="[object RegExp]",hB="[object Set]",pB="[object String]",mB="[object Symbol]",gB="[object ArrayBuffer]",yB="[object DataView]",cg=un?un.prototype:void 0,lu=cg?cg.valueOf:void 0;function bB(t,e,n,r,o,i,s){switch(n){case yB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case gB:return!(t.byteLength!=e.byteLength||!i(new ag(t),new ag(e)));case lB:case aB:case dB:return U1(+t,+e);case cB:return t.name==e.name&&t.message==e.message;case fB:case pB:return t==e+"";case uB:var l=rB;case hB:var a=r&iB;if(l||(l=oB),t.size!=e.size&&!a)return!1;var c=s.get(t);if(c)return c==e;r|=sB,s.set(t,e);var u=aw(l(t),l(e),r,o,i,s);return s.delete(t),u;case mB:if(lu)return lu.call(t)==lu.call(e)}return!1}var vB=1,wB=Object.prototype,xB=wB.hasOwnProperty;function SB(t,e,n,r,o,i){var s=n&vB,l=ng(t),a=l.length,c=ng(e),u=c.length;if(a!=u&&!s)return!1;for(var d=a;d--;){var f=l[d];if(!(s?f in e:xB.call(e,f)))return!1}var h=i.get(t),p=i.get(e);if(h&&p)return h==e&&p==t;var m=!0;i.set(t,e),i.set(e,t);for(var g=s;++d<a;){f=l[d];var y=t[f],x=e[f];if(r)var S=s?r(x,y,f,e,t,i):r(y,x,f,t,e,i);if(!(S===void 0?y===x||o(y,x,n,r,i):S)){m=!1;break}g||(g=f=="constructor")}if(m&&!g){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(m=!1)}return i.delete(t),i.delete(e),m}var CB=1,ug="[object Arguments]",dg="[object Array]",Gs="[object Object]",EB=Object.prototype,fg=EB.hasOwnProperty;function kB(t,e,n,r,o,i){var s=dn(t),l=dn(e),a=s?dg:Yn(t),c=l?dg:Yn(e);a=a==ug?Gs:a,c=c==ug?Gs:c;var u=a==Gs,d=c==Gs,f=a==c;if(f&&Sd(t)){if(!Sd(e))return!1;s=!0,u=!1}if(f&&!u)return i||(i=new On),s||Y1(t)?aw(t,e,n,r,o,i):bB(t,e,a,n,r,o,i);if(!(n&CB)){var h=u&&fg.call(t,"__wrapped__"),p=d&&fg.call(e,"__wrapped__");if(h||p){var m=h?t.value():t,g=p?e.value():e;return i||(i=new On),o(m,g,n,r,i)}}return f?(i||(i=new On),SB(t,e,n,r,o,i)):!1}function bh(t,e,n,r,o){return t===e?!0:t==null||e==null||!yr(t)&&!yr(e)?t!==t&&e!==e:kB(t,e,n,r,bh,o)}var MB=1,TB=2;function OB(t,e,n,r){var o=n.length,i=o;if(t==null)return!i;for(t=Object(t);o--;){var s=n[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){s=n[o];var l=s[0],a=t[l],c=s[1];if(s[2]){if(a===void 0&&!(l in t))return!1}else{var u=new On,d;if(!(d===void 0?bh(c,a,MB|TB,r,u):d))return!1}}return!0}function cw(t){return t===t&&!br(t)}function AB(t){for(var e=X1(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,cw(o)]}return e}function uw(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function RB(t){var e=AB(t);return e.length==1&&e[0][2]?uw(e[0][0],e[0][1]):function(n){return n===t||OB(n,t,e)}}function NB(t,e){return t!=null&&e in Object(t)}function DB(t,e,n){e=Z1(e,t);for(var r=-1,o=e.length,i=!1;++r<o;){var s=gc(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=o?i:(o=t==null?0:t.length,!!o&&fh(o)&&W1(s,o)&&(dn(t)||hh(t)))}function _B(t,e){return t!=null&&DB(t,e,NB)}var IB=1,PB=2;function LB(t,e){return mh(t)&&cw(e)?uw(gc(t),e):function(n){var r=i$(n,t);return r===void 0&&r===e?_B(n,t):bh(e,r,IB|PB)}}function dw(t){return function(e){return e==null?void 0:e[t]}}function $B(t){return function(e){return Q1(e,t)}}function BB(t){return mh(t)?dw(gc(t)):$B(t)}function FB(t){return typeof t=="function"?t:t==null?dh:typeof t=="object"?dn(t)?LB(t[0],t[1]):RB(t):BB(t)}var au=function(){return hn.Date.now()},jB="Expected a function",HB=Math.max,zB=Math.min;function fw(t,e,n){var r,o,i,s,l,a,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(jB);e=wd(e)||0,br(n)&&(u=!!n.leading,d="maxWait"in n,i=d?HB(wd(n.maxWait)||0,e):i,f="trailing"in n?!!n.trailing:f);function h(w){var k=r,R=o;return r=o=void 0,c=w,s=t.apply(R,k),s}function p(w){return c=w,l=setTimeout(y,e),u?h(w):s}function m(w){var k=w-a,R=w-c,E=e-k;return d?zB(E,i-R):E}function g(w){var k=w-a,R=w-c;return a===void 0||k>=e||k<0||d&&R>=i}function y(){var w=au();if(g(w))return x(w);l=setTimeout(y,m(w))}function x(w){return l=void 0,f&&r?h(w):(r=o=void 0,s)}function S(){l!==void 0&&clearTimeout(l),c=0,r=a=o=l=void 0}function b(){return l===void 0?s:x(au())}function C(){var w=au(),k=g(w);if(r=arguments,o=this,a=w,k){if(l===void 0)return p(a);if(d)return clearTimeout(l),l=setTimeout(y,e),h(a)}return l===void 0&&(l=setTimeout(y,e)),s}return C.cancel=S,C.flush=b,C}function cu(t){return yr(t)&&K1(t)}var VB=200;function WB(t,e,n,r){var o=-1,i=NP,s=!0,l=t.length,a=[],c=e.length;if(!l)return a;n&&(e=z1(e,ph(n))),e.length>=VB&&(i=lw,s=!1,e=new Xi(e));e:for(;++o<l;){var u=t[o],d=n==null?u:n(u);if(u=u!==0?u:0,s&&d===d){for(var f=c;f--;)if(e[f]===d)continue e;a.push(u)}else i(e,d,r)||a.push(u)}return a}function UB(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var KB=PP(function(t,e){var n=UB(e);return cu(n)&&(n=void 0),cu(t)?WB(t,l$(e,1,cu),FB(n)):[]}),GB="[object RegExp]";function qB(t){return yr(t)&&io(t)==GB}var hg=Yl&&Yl.isRegExp,JB=hg?ph(hg):qB,YB=dw("length"),hw="\\ud800-\\udfff",XB="\\u0300-\\u036f",ZB="\\ufe20-\\ufe2f",QB="\\u20d0-\\u20ff",e3=XB+ZB+QB,t3="\\ufe0e\\ufe0f",n3="["+hw+"]",Ad="["+e3+"]",Rd="\\ud83c[\\udffb-\\udfff]",r3="(?:"+Ad+"|"+Rd+")",pw="[^"+hw+"]",mw="(?:\\ud83c[\\udde6-\\uddff]){2}",gw="[\\ud800-\\udbff][\\udc00-\\udfff]",o3="\\u200d",yw=r3+"?",bw="["+t3+"]?",i3="(?:"+o3+"(?:"+[pw,mw,gw].join("|")+")"+bw+yw+")*",s3=bw+yw+i3,l3="(?:"+[pw+Ad+"?",Ad,mw,gw,n3].join("|")+")",pg=RegExp(Rd+"(?="+Rd+")|"+l3+s3,"g");function a3(t){for(var e=pg.lastIndex=0;pg.test(t);)++e;return e}function c3(t){return yh(t)?a3(t):YB(t)}var u3="Expected a function";function d3(t,e,n){var r=!0,o=!0;if(typeof t!="function")throw new TypeError(u3);return br(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),fw(t,e,{leading:r,maxWait:e,trailing:o})}var f3=30,h3="...",p3=/\w*$/;function m3(t,e){var n=f3,r=h3;if(br(e)){var o="separator"in e?e.separator:o;n="length"in e?nP(e.length):n,r="omission"in e?Jl(e.omission):r}t=Cd(t);var i=t.length;if(yh(t)){var s=D$(t);i=s.length}if(n>=i)return t;var l=n-c3(r);if(l<1)return r;var a=s?c$(s,0,l).join(""):t.slice(0,l);if(o===void 0)return a+r;if(s&&(l+=a.length-l),JB(o)){if(t.slice(l).search(o)){var c,u=a;for(o.global||(o=RegExp(o.source,Cd(p3.exec(o))+"g")),o.lastIndex=0;c=o.exec(u);)var d=c.index;a=a.slice(0,d===void 0?l:d)}}else if(t.indexOf(Jl(o),l)!=l){var f=a.lastIndexOf(o);f>-1&&(a=a.slice(0,f))}return a+r}function yc(){return(yc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function vw(t,e){if(t==null)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}function Nd(t){var e=_.useRef(t),n=_.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Zi=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Mi=function(t){return"touches"in t},Dd=function(t){return t&&t.ownerDocument.defaultView||self},mg=function(t,e,n){var r=t.getBoundingClientRect(),o=Mi(e)?function(i,s){for(var l=0;l<i.length;l++)if(i[l].identifier===s)return i[l];return i[0]}(e.touches,n):e;return{left:Zi((o.pageX-(r.left+Dd(t).pageXOffset))/r.width),top:Zi((o.pageY-(r.top+Dd(t).pageYOffset))/r.height)}},gg=function(t){!Mi(t)&&t.preventDefault()},ww=_.memo(function(t){var e=t.onMove,n=t.onKey,r=vw(t,["onMove","onKey"]),o=_.useRef(null),i=Nd(e),s=Nd(n),l=_.useRef(null),a=_.useRef(!1),c=_.useMemo(function(){var h=function(g){gg(g),(Mi(g)?g.touches.length>0:g.buttons>0)&&o.current?i(mg(o.current,g,l.current)):m(!1)},p=function(){return m(!1)};function m(g){var y=a.current,x=Dd(o.current),S=g?x.addEventListener:x.removeEventListener;S(y?"touchmove":"mousemove",h),S(y?"touchend":"mouseup",p)}return[function(g){var y=g.nativeEvent,x=o.current;if(x&&(gg(y),!function(b,C){return C&&!Mi(b)}(y,a.current)&&x)){if(Mi(y)){a.current=!0;var S=y.changedTouches||[];S.length&&(l.current=S[0].identifier)}x.focus(),i(mg(x,y,l.current)),m(!0)}},function(g){var y=g.which||g.keyCode;y<37||y>40||(g.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},m]},[s,i]),u=c[0],d=c[1],f=c[2];return _.useEffect(function(){return f},[f]),_.createElement("div",yc({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))}),vh=function(t){return t.filter(Boolean).join(" ")},xw=function(t){var e=t.color,n=t.left,r=t.top,o=r===void 0?.5:r,i=vh(["react-colorful__pointer",t.className]);return _.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},_.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Ye=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},g3=function(t){return x3(_d(t))},_d=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Ye(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Ye(parseInt(t.substring(6,8),16)/255,2):1}},y3=function(t){return w3(v3(t))},b3=function(t){var e=t.s,n=t.v,r=t.a,o=(200-e)*n/100;return{h:Ye(t.h),s:Ye(o>0&&o<200?e*n/100/(o<=100?o:200-o)*100:0),l:Ye(o/2),a:Ye(r,2)}},Id=function(t){var e=b3(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},v3=function(t){var e=t.h,n=t.s,r=t.v,o=t.a;e=e/360*6,n/=100,r/=100;var i=Math.floor(e),s=r*(1-n),l=r*(1-(e-i)*n),a=r*(1-(1-e+i)*n),c=i%6;return{r:Ye(255*[r,l,s,s,a,r][c]),g:Ye(255*[a,r,r,l,s,s][c]),b:Ye(255*[s,s,a,r,r,l][c]),a:Ye(o,2)}},qs=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},w3=function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=o<1?qs(Ye(255*o)):"";return"#"+qs(e)+qs(n)+qs(r)+i},x3=function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=Math.max(e,n,r),s=i-Math.min(e,n,r),l=s?i===e?(n-r)/s:i===n?2+(r-e)/s:4+(e-n)/s:0;return{h:Ye(60*(l<0?l+6:l)),s:Ye(i?s/i*100:0),v:Ye(i/255*100),a:o}},S3=_.memo(function(t){var e=t.hue,n=t.onChange,r=vh(["react-colorful__hue",t.className]);return _.createElement("div",{className:r},_.createElement(ww,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Zi(e+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":Ye(e),"aria-valuemax":"360","aria-valuemin":"0"},_.createElement(xw,{className:"react-colorful__hue-pointer",left:e/360,color:Id({h:e,s:100,v:100,a:1})})))}),C3=_.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:Id({h:e.h,s:100,v:100,a:1})};return _.createElement("div",{className:"react-colorful__saturation",style:r},_.createElement(ww,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Zi(e.s+100*o.left,0,100),v:Zi(e.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Ye(e.s)+"%, Brightness "+Ye(e.v)+"%"},_.createElement(xw,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Id(e)})))}),Sw=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},E3=function(t,e){return t.toLowerCase()===e.toLowerCase()||Sw(_d(t),_d(e))};function k3(t,e,n){var r=Nd(n),o=_.useState(function(){return t.toHsva(e)}),i=o[0],s=o[1],l=_.useRef({color:e,hsva:i});_.useEffect(function(){if(!t.equal(e,l.current.color)){var c=t.toHsva(e);l.current={hsva:c,color:e},s(c)}},[e,t]),_.useEffect(function(){var c;Sw(i,l.current.hsva)||t.equal(c=t.fromHsva(i),l.current.color)||(l.current={hsva:i,color:c},r(c))},[i,t,r]);var a=_.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[i,a]}var M3=typeof window<"u"?_.useLayoutEffect:_.useEffect,T3=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},yg=new Map,O3=function(t){M3(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!yg.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,yg.set(e,n);var r=T3();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},A3=function(t){var e=t.className,n=t.colorModel,r=t.color,o=r===void 0?n.defaultColor:r,i=t.onChange,s=vw(t,["className","colorModel","color","onChange"]),l=_.useRef(null);O3(l);var a=k3(n,o,i),c=a[0],u=a[1],d=vh(["react-colorful",e]);return _.createElement("div",yc({},s,{ref:l,className:d}),_.createElement(C3,{hsva:c,onChange:u}),_.createElement(S3,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},R3={defaultColor:"000",toHsva:g3,fromHsva:function(t){return y3({h:t.h,s:t.s,v:t.v,a:1})},equal:E3},N3=function(t){return _.createElement(A3,yc({},t,{colorModel:R3}))},D3="Separator",bg="horizontal",_3=["horizontal","vertical"],Cw=v.forwardRef((t,e)=>{const{decorative:n,orientation:r=bg,...o}=t,i=I3(r)?r:bg,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return T.jsx(ge.div,{"data-orientation":i,...l,...o,ref:e})});Cw.displayName=D3;function I3(t){return _3.includes(t)}var P3=Cw;const L3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,$3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,B3=nt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[qr({find:L3,type:this.type})]},addPasteRules(){return[fr({find:$3,type:this.type})]}}),F3=Ne.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",le(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),vg=nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",le(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=vs(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),wg=/^\s*([-+*])\s$/,j3=Ne.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",le(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(F3.name,this.editor.getAttributes(vg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Bo({find:wg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bo({find:wg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(vg.name),editor:this.editor})),[t]}}),H3=Ne.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",le(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),xg=nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",le(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=vs(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),Sg=/^(\d+)\.\s$/,z3=Ne.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",le(this.options.HTMLAttributes,n),0]:["ol",le(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(H3.name,this.editor.getAttributes(xg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Bo({find:Sg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bo({find:Sg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xg.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),V3=/^\s*(\[([( |x])?\])\s$/,W3=Ne.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",le(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");return i.contentEditable="false",l.type="checkbox",l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:u}=c.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:d})=>{const f=n(),h=d.doc.nodeAt(f);return d.setNodeMarkup(f,void 0,{...h==null?void 0:h.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,u)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{o.setAttribute(c,u)}),o.dataset.checked=t.attrs.checked,t.attrs.checked&&l.setAttribute("checked","checked"),i.append(l,s),o.append(i,a),Object.entries(e).forEach(([c,u])=>{o.setAttribute(c,u)}),{dom:o,contentDOM:a,update:c=>c.type!==this.type?!1:(o.dataset.checked=c.attrs.checked,c.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[Bo({find:V3,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),U3=Ne.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",le(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),K3=/^\s*>\s$/,G3=Ne.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Bo({find:K3,type:this.type})]}}),q3="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",J3="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vo=(t,e)=>{for(const n in e)t[n]=e[n];return t},Pd="numeric",Ld="ascii",$d="alpha",yl="asciinumeric",Js="alphanumeric",Bd="domain",Ew="emoji",Y3="scheme",X3="slashscheme",Cg="whitespace";function Z3(t,e){return t in e||(e[t]=[]),e[t]}function Lr(t,e,n){e[Pd]&&(e[yl]=!0,e[Js]=!0),e[Ld]&&(e[yl]=!0,e[$d]=!0),e[yl]&&(e[Js]=!0),e[$d]&&(e[Js]=!0),e[Js]&&(e[Bd]=!0),e[Ew]&&(e[Bd]=!0);for(const r in e){const o=Z3(r,n);o.indexOf(t)<0&&o.push(t)}}function Q3(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ut(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}ut.groups={};ut.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||ut.groups;let o;return e&&e.j?o=e:(o=new ut(e),n&&r&&Lr(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||ut.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,l=o.go(t);if(l?(s=new ut,Vo(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new ut,i){if(r)if(s.t&&typeof s.t=="string"){const a=Vo(Q3(s.t,r),n);Lr(i,a,r)}else n&&Lr(i,n,r);s.t=i}return o.j[t]=s,s}};const ie=(t,e,n,r,o)=>t.ta(e,n,r,o),Tt=(t,e,n,r,o)=>t.tr(e,n,r,o),Eg=(t,e,n,r,o)=>t.ts(e,n,r,o),$=(t,e,n,r,o)=>t.tt(e,n,r,o),xn="WORD",Fd="UWORD",Qi="LOCALHOST",jd="TLD",Hd="UTLD",bl="SCHEME",So="SLASH_SCHEME",wh="NUM",kw="WS",xh="NL",Ti="OPENBRACE",Oi="CLOSEBRACE",Xl="OPENBRACKET",Zl="CLOSEBRACKET",Ql="OPENPAREN",ea="CLOSEPAREN",ta="OPENANGLEBRACKET",na="CLOSEANGLEBRACKET",ra="FULLWIDTHLEFTPAREN",oa="FULLWIDTHRIGHTPAREN",ia="LEFTCORNERBRACKET",sa="RIGHTCORNERBRACKET",la="LEFTWHITECORNERBRACKET",aa="RIGHTWHITECORNERBRACKET",ca="FULLWIDTHLESSTHAN",ua="FULLWIDTHGREATERTHAN",da="AMPERSAND",fa="APOSTROPHE",ha="ASTERISK",Xn="AT",pa="BACKSLASH",ma="BACKTICK",ga="CARET",er="COLON",Sh="COMMA",ya="DOLLAR",qt="DOT",ba="EQUALS",Ch="EXCLAMATION",Jt="HYPHEN",va="PERCENT",wa="PIPE",xa="PLUS",Sa="POUND",Ca="QUERY",Eh="QUOTE",kh="SEMI",Yt="SLASH",Ai="TILDE",Ea="UNDERSCORE",Mw="EMOJI",ka="SYM";var Tw=Object.freeze({__proto__:null,WORD:xn,UWORD:Fd,LOCALHOST:Qi,TLD:jd,UTLD:Hd,SCHEME:bl,SLASH_SCHEME:So,NUM:wh,WS:kw,NL:xh,OPENBRACE:Ti,CLOSEBRACE:Oi,OPENBRACKET:Xl,CLOSEBRACKET:Zl,OPENPAREN:Ql,CLOSEPAREN:ea,OPENANGLEBRACKET:ta,CLOSEANGLEBRACKET:na,FULLWIDTHLEFTPAREN:ra,FULLWIDTHRIGHTPAREN:oa,LEFTCORNERBRACKET:ia,RIGHTCORNERBRACKET:sa,LEFTWHITECORNERBRACKET:la,RIGHTWHITECORNERBRACKET:aa,FULLWIDTHLESSTHAN:ca,FULLWIDTHGREATERTHAN:ua,AMPERSAND:da,APOSTROPHE:fa,ASTERISK:ha,AT:Xn,BACKSLASH:pa,BACKTICK:ma,CARET:ga,COLON:er,COMMA:Sh,DOLLAR:ya,DOT:qt,EQUALS:ba,EXCLAMATION:Ch,HYPHEN:Jt,PERCENT:va,PIPE:wa,PLUS:xa,POUND:Sa,QUERY:Ca,QUOTE:Eh,SEMI:kh,SLASH:Yt,TILDE:Ai,UNDERSCORE:Ea,EMOJI:Mw,SYM:ka});const bo=/[a-z]/,uu=new RegExp("\\p{L}","u"),du=new RegExp("\\p{Emoji}","u"),fu=/\d/,kg=/\s/,Mg=`
460
- `,eF="️",tF="‍";let Ys=null,Xs=null;function nF(t){t===void 0&&(t=[]);const e={};ut.groups=e;const n=new ut;Ys==null&&(Ys=Tg(q3)),Xs==null&&(Xs=Tg(J3)),$(n,"'",fa),$(n,"{",Ti),$(n,"}",Oi),$(n,"[",Xl),$(n,"]",Zl),$(n,"(",Ql),$(n,")",ea),$(n,"<",ta),$(n,">",na),$(n,"(",ra),$(n,")",oa),$(n,"「",ia),$(n,"」",sa),$(n,"『",la),$(n,"』",aa),$(n,"<",ca),$(n,">",ua),$(n,"&",da),$(n,"*",ha),$(n,"@",Xn),$(n,"`",ma),$(n,"^",ga),$(n,":",er),$(n,",",Sh),$(n,"$",ya),$(n,".",qt),$(n,"=",ba),$(n,"!",Ch),$(n,"-",Jt),$(n,"%",va),$(n,"|",wa),$(n,"+",xa),$(n,"#",Sa),$(n,"?",Ca),$(n,'"',Eh),$(n,"/",Yt),$(n,";",kh),$(n,"~",Ai),$(n,"_",Ea),$(n,"\\",pa);const r=Tt(n,fu,wh,{[Pd]:!0});Tt(r,fu,r);const o=Tt(n,bo,xn,{[Ld]:!0});Tt(o,bo,o);const i=Tt(n,uu,Fd,{[$d]:!0});Tt(i,bo),Tt(i,uu,i);const s=Tt(n,kg,kw,{[Cg]:!0});$(n,Mg,xh,{[Cg]:!0}),$(s,Mg),Tt(s,kg,s);const l=Tt(n,du,Mw,{[Ew]:!0});Tt(l,du,l),$(l,eF,l);const a=$(l,tF);Tt(a,du,l);const c=[[bo,o]],u=[[bo,null],[uu,i]];for(let d=0;d<Ys.length;d++)Wn(n,Ys[d],jd,xn,c);for(let d=0;d<Xs.length;d++)Wn(n,Xs[d],Hd,Fd,u);Lr(jd,{tld:!0,ascii:!0},e),Lr(Hd,{utld:!0,alpha:!0},e),Wn(n,"file",bl,xn,c),Wn(n,"mailto",bl,xn,c),Wn(n,"http",So,xn,c),Wn(n,"https",So,xn,c),Wn(n,"ftp",So,xn,c),Wn(n,"ftps",So,xn,c),Lr(bl,{scheme:!0,ascii:!0},e),Lr(So,{slashscheme:!0,ascii:!0},e),t=t.sort((d,f)=>d[0]>f[0]?1:-1);for(let d=0;d<t.length;d++){const f=t[d][0],p=t[d][1]?{[Y3]:!0}:{[X3]:!0};f.indexOf("-")>=0?p[Bd]=!0:bo.test(f)?fu.test(f)?p[yl]=!0:p[Ld]=!0:p[Pd]=!0,Eg(n,f,f,p)}return Eg(n,"localhost",Qi,{ascii:!0}),n.jd=new ut(ka),{start:n,tokens:Vo({groups:e},Tw)}}function rF(t,e){const n=oF(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let l=t,a=null,c=0,u=null,d=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=d,s-=f,c-=d,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function oF(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Wn(t,e,n,r,o){let i;const s=e.length;for(let l=0;l<s-1;l++){const a=e[l];t.j[a]?i=t.j[a]:(i=new ut(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new ut(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Tg(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const es={defaultProtocol:"http",events:null,format:Og,formatHref:Og,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Mh(t,e){e===void 0&&(e=null);let n=Vo({},es);t&&(n=Vo(n,t instanceof Mh?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Mh.prototype={o:es,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:es[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Og(t){return t}function Ow(t,e){this.t="token",this.v=t,this.tk=e}Ow.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=es.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Vo(s,u),{tagName:o,attributes:s,content:i,eventListeners:d}}};function bc(t,e){class n extends Ow{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Ag=bc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Rg=bc("text"),iF=bc("nl"),Zs=bc("url",{isLink:!0,toHref(t){return t===void 0&&(t=es.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Qi&&t[1].t===er}}),Ot=t=>new ut(t);function sF(t){let{groups:e}=t;const n=e.domain.concat([da,ha,Xn,pa,ma,ga,ya,ba,Jt,wh,va,wa,xa,Sa,Yt,ka,Ai,Ea]),r=[fa,er,Sh,qt,Ch,Ca,Eh,kh,ta,na,Ti,Oi,Zl,Xl,Ql,ea,ra,oa,ia,sa,la,aa,ca,ua],o=[da,fa,ha,pa,ma,ga,ya,ba,Jt,Ti,Oi,va,wa,xa,Sa,Ca,Yt,ka,Ai,Ea],i=Ot(),s=$(i,Ai);ie(s,o,s),ie(s,e.domain,s);const l=Ot(),a=Ot(),c=Ot();ie(i,e.domain,l),ie(i,e.scheme,a),ie(i,e.slashscheme,c),ie(l,o,s),ie(l,e.domain,l);const u=$(l,Xn);$(s,Xn,u),$(a,Xn,u),$(c,Xn,u);const d=$(s,qt);ie(d,o,s),ie(d,e.domain,s);const f=Ot();ie(u,e.domain,f),ie(f,e.domain,f);const h=$(f,qt);ie(h,e.domain,f);const p=Ot(Ag);ie(h,e.tld,p),ie(h,e.utld,p),$(u,Qi,p);const m=$(f,Jt);ie(m,e.domain,f),ie(p,e.domain,f),$(p,qt,h),$(p,Jt,m);const g=$(p,er);ie(g,e.numeric,Ag);const y=$(l,Jt),x=$(l,qt);ie(y,e.domain,l),ie(x,o,s),ie(x,e.domain,l);const S=Ot(Zs);ie(x,e.tld,S),ie(x,e.utld,S),ie(S,e.domain,l),ie(S,o,s),$(S,qt,x),$(S,Jt,y),$(S,Xn,u);const b=$(S,er),C=Ot(Zs);ie(b,e.numeric,C);const w=Ot(Zs),k=Ot();ie(w,n,w),ie(w,r,k),ie(k,n,w),ie(k,r,k),$(S,Yt,w),$(C,Yt,w);const R=$(a,er),E=$(c,er),O=$(E,Yt),I=$(O,Yt);ie(a,e.domain,l),$(a,qt,x),$(a,Jt,y),ie(c,e.domain,l),$(c,qt,x),$(c,Jt,y),ie(R,e.domain,w),$(R,Yt,w),ie(I,e.domain,w),ie(I,n,w),$(I,Yt,w);const L=[[Ti,Oi],[Xl,Zl],[Ql,ea],[ta,na],[ra,oa],[ia,sa],[la,aa],[ca,ua]];for(let H=0;H<L.length;H++){const[U,K]=L[H],j=$(w,U);$(k,U,j),$(j,K,w);const M=Ot(Zs);ie(j,n,M);const N=Ot();ie(j,r),ie(M,n,M),ie(M,r,N),ie(N,n,M),ie(N,r,N),$(M,K,w),$(N,K,w)}return $(i,Qi,S),$(i,xh,iF),{start:i,tokens:Tw}}function lF(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let l=t,a=null,c=null,u=0,d=null,f=-1;for(;o<r&&!(a=l.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(hu(Rg,e,s)),s=[]),o-=f,u-=f;const h=d.t,p=n.slice(o-u,o);i.push(hu(h,e,p))}}return s.length>0&&i.push(hu(Rg,e,s)),i}function hu(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const aF=typeof console<"u"&&console&&console.warn||(()=>{}),cF="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Me={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function uF(){ut.groups={},Me.scanner=null,Me.parser=null,Me.tokenQueue=[],Me.pluginQueue=[],Me.customSchemes=[],Me.initialized=!1}function Ng(t,e){if(e===void 0&&(e=!1),Me.initialized&&aF(`linkifyjs: already initialized - will not register custom scheme "${t}" ${cF}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
459
+ */var jm;function dI(){return jm||(jm=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=P,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var b=arguments.length,C=new Array(b>1?b-1:0),x=1;x<b;x++)C[x-1]=arguments[x];r("error",S,C)}}function r(S,b,C){{var x=e.ReactDebugCurrentFrame,k=x.getStackAddendum();k!==""&&(b+="%s",C=C.concat([k]));var A=C.map(function(E){return String(E)});A.unshift("Warning: "+b),Function.prototype.apply.call(console[S],console,A)}}function o(S,b){return S===b&&(S!==0||1/S===1/b)||S!==S&&b!==b}var i=typeof Object.is=="function"?Object.is:o,s=t.useState,l=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function f(S,b,C){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=b();if(!d){var k=b();i(x,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var A=s({inst:{value:x,getSnapshot:b}}),E=A[0].inst,O=A[1];return a(function(){E.value=x,E.getSnapshot=b,h(E)&&O({inst:E})},[S,x,b]),l(function(){h(E)&&O({inst:E});var _=function(){h(E)&&O({inst:E})};return S(_)},[S]),c(x),x}function h(S){var b=S.getSnapshot,C=S.value;try{var x=b();return!i(C,x)}catch{return!0}}function p(S,b,C){return b()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!m,y=g?p:f,w=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;iu.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),iu}process.env.NODE_ENV==="production"?wd.exports=uI():wd.exports=dI();var fI=wd.exports;const hI=cI(fI),pI={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{use:Hm}=P,{useSyncExternalStore:mI}=hI,gI=(t,e)=>{const n=P.useRef();P.useEffect(()=>{n.current=oI(t,e)}),P.useDebugValue(n.current)},yI=new WeakMap;function bI(t,e){const r=P.useRef(),o=P.useRef();let i=!0;const s=mI(P.useCallback(c=>{const u=aI(t,c);return c(),u},[t,void 0]),()=>{const c=Bm(t,Hm);try{if(!i&&r.current&&o.current&&!A1(r.current,c,o.current,new WeakMap))return r.current}catch{}return c},()=>Bm(t,Hm));i=!1;const l=new WeakMap;P.useEffect(()=>{r.current=s,o.current=l}),(pI?"production":void 0)!=="production"&&gI(s,l);const a=P.useMemo(()=>new WeakMap,[]);return O1(s,l,a,yI)}const vI=Ne.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,le(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sd({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),wI=Ie.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var uh="Popover",[R1,R4]=In(uh,[ri]),Es=ri(),[xI,Mr]=R1(uh),N1=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=t,l=Es(e),a=v.useRef(null),[c,u]=v.useState(!1),[d=!1,f]=Er({prop:r,defaultProp:o,onChange:i});return T.jsx(tc,{...l,children:T.jsx(xI,{scope:e,contentId:hr(),triggerRef:a,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:s,children:n})})};N1.displayName=uh;var D1="PopoverAnchor",SI=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Mr(D1,n),i=Es(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return v.useEffect(()=>(s(),()=>l()),[s,l]),T.jsx(nc,{...i,...r,ref:e})});SI.displayName=D1;var _1="PopoverTrigger",I1=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Mr(_1,n),i=Es(n),s=$e(e,o.triggerRef),l=T.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":F1(o.open),...r,ref:s,onClick:ee(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:T.jsx(nc,{asChild:!0,...i,children:l})});I1.displayName=_1;var dh="PopoverPortal",[CI,EI]=R1(dh,{forceMount:void 0}),P1=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=Mr(dh,e);return T.jsx(CI,{scope:e,forceMount:n,children:T.jsx(Ln,{present:n||i.open,children:T.jsx(Wf,{asChild:!0,container:o,children:r})})})};P1.displayName=dh;var zo="PopoverContent",L1=v.forwardRef((t,e)=>{const n=EI(zo,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=Mr(zo,t.__scopePopover);return T.jsx(Ln,{present:r||i.open,children:i.modal?T.jsx(kI,{...o,ref:e}):T.jsx(MI,{...o,ref:e})})});L1.displayName=zo;var kI=v.forwardRef((t,e)=>{const n=Mr(zo,t.__scopePopover),r=v.useRef(null),o=$e(e,r),i=v.useRef(!1);return v.useEffect(()=>{const s=r.current;if(s)return _v(s)},[]),T.jsx(Zf,{as:qr,allowPinchZoom:!0,children:T.jsx($1,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(t.onCloseAutoFocus,s=>{var l;s.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(t.onPointerDownOutside,s=>{const l=s.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0,c=l.button===2||a;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ee(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),MI=v.forwardRef((t,e)=>{const n=Mr(zo,t.__scopePopover),r=v.useRef(!1),o=v.useRef(!1);return T.jsx($1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,l;(s=t.onCloseAutoFocus)==null||s.call(t,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var a,c;(a=t.onInteractOutside)==null||a.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),$1=v.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Mr(zo,n),h=Es(n);return Cv(),T.jsx(Xf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:T.jsx(Za,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:T.jsx(zf,{"data-state":F1(f.open),role:"dialog",id:f.contentId,...h,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),B1="PopoverClose",TI=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Mr(B1,n);return T.jsx(ge.button,{type:"button",...r,ref:e,onClick:ee(t.onClick,()=>o.onOpenChange(!1))})});TI.displayName=B1;var OI="PopoverArrow",AI=v.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Es(n);return T.jsx(Vf,{...o,...r,ref:e})});AI.displayName=OI;function F1(t){return t?"open":"closed"}var RI=N1,NI=I1,DI=P1,_I=L1;const II=Ie.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var j1=typeof global=="object"&&global&&global.Object===Object&&global,PI=typeof self=="object"&&self&&self.Object===Object&&self,hn=j1||PI||Function("return this")(),un=hn.Symbol,H1=Object.prototype,LI=H1.hasOwnProperty,$I=H1.toString,hi=un?un.toStringTag:void 0;function BI(t){var e=LI.call(t,hi),n=t[hi];try{t[hi]=void 0;var r=!0}catch{}var o=$I.call(t);return r&&(e?t[hi]=n:delete t[hi]),o}var FI=Object.prototype,jI=FI.toString;function HI(t){return jI.call(t)}var zI="[object Null]",VI="[object Undefined]",zm=un?un.toStringTag:void 0;function oo(t){return t==null?t===void 0?VI:zI:zm&&zm in Object(t)?BI(t):HI(t)}function yr(t){return t!=null&&typeof t=="object"}var WI="[object Symbol]";function fc(t){return typeof t=="symbol"||yr(t)&&oo(t)==WI}function z1(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var dn=Array.isArray,UI=1/0,Vm=un?un.prototype:void 0,Wm=Vm?Vm.toString:void 0;function ql(t){if(typeof t=="string")return t;if(dn(t))return z1(t,ql)+"";if(fc(t))return Wm?Wm.call(t):"";var e=t+"";return e=="0"&&1/t==-UI?"-0":e}var KI=/\s/;function GI(t){for(var e=t.length;e--&&KI.test(t.charAt(e)););return e}var qI=/^\s+/;function JI(t){return t&&t.slice(0,GI(t)+1).replace(qI,"")}function br(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Um=NaN,YI=/^[-+]0x[0-9a-f]+$/i,XI=/^0b[01]+$/i,ZI=/^0o[0-7]+$/i,QI=parseInt;function xd(t){if(typeof t=="number")return t;if(fc(t))return Um;if(br(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=br(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=JI(t);var n=XI.test(t);return n||ZI.test(t)?QI(t.slice(2),n?2:8):YI.test(t)?Um:+t}var Km=1/0,eP=17976931348623157e292;function tP(t){if(!t)return t===0?t:0;if(t=xd(t),t===Km||t===-Km){var e=t<0?-1:1;return e*eP}return t===t?t:0}function nP(t){var e=tP(t),n=e%1;return e===e?n?e-n:e:0}function fh(t){return t}var rP="[object AsyncFunction]",oP="[object Function]",iP="[object GeneratorFunction]",sP="[object Proxy]";function V1(t){if(!br(t))return!1;var e=oo(t);return e==oP||e==iP||e==rP||e==sP}var su=hn["__core-js_shared__"],Gm=function(){var t=/[^.]+$/.exec(su&&su.keys&&su.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function lP(t){return!!Gm&&Gm in t}var aP=Function.prototype,cP=aP.toString;function io(t){if(t!=null){try{return cP.call(t)}catch{}try{return t+""}catch{}}return""}var uP=/[\\^$.*+?()[\]{}|]/g,dP=/^\[object .+?Constructor\]$/,fP=Function.prototype,hP=Object.prototype,pP=fP.toString,mP=hP.hasOwnProperty,gP=RegExp("^"+pP.call(mP).replace(uP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yP(t){if(!br(t)||lP(t))return!1;var e=V1(t)?gP:dP;return e.test(io(t))}function bP(t,e){return t==null?void 0:t[e]}function so(t,e){var n=bP(t,e);return yP(n)?n:void 0}var Sd=so(hn,"WeakMap");function vP(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var wP=800,xP=16,SP=Date.now;function CP(t){var e=0,n=0;return function(){var r=SP(),o=xP-(r-n);if(n=r,o>0){if(++e>=wP)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function EP(t){return function(){return t}}var qm=function(){try{var t=so(Object,"defineProperty");return t({},"",{}),t}catch{}}(),kP=qm?function(t,e){return qm(t,"toString",{configurable:!0,enumerable:!1,value:EP(e),writable:!0})}:fh,MP=CP(kP);function TP(t,e,n,r){for(var o=t.length,i=n+-1;++i<o;)if(e(t[i],i,t))return i;return-1}function OP(t){return t!==t}function AP(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}function RP(t,e,n){return e===e?AP(t,e,n):TP(t,OP,n)}function NP(t,e){var n=t==null?0:t.length;return!!n&&RP(t,e,0)>-1}var DP=9007199254740991,_P=/^(?:0|[1-9]\d*)$/;function W1(t,e){var n=typeof t;return e=e??DP,!!e&&(n=="number"||n!="symbol"&&_P.test(t))&&t>-1&&t%1==0&&t<e}function U1(t,e){return t===e||t!==t&&e!==e}var Jm=Math.max;function IP(t,e,n){return e=Jm(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Jm(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var l=Array(e+1);++o<e;)l[o]=r[o];return l[e]=n(s),vP(t,this,l)}}function PP(t,e){return MP(IP(t,e,fh),t+"")}var LP=9007199254740991;function hh(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=LP}function K1(t){return t!=null&&hh(t.length)&&!V1(t)}var $P=Object.prototype;function BP(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$P;return t===n}function FP(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var jP="[object Arguments]";function Ym(t){return yr(t)&&oo(t)==jP}var G1=Object.prototype,HP=G1.hasOwnProperty,zP=G1.propertyIsEnumerable,ph=Ym(function(){return arguments}())?Ym:function(t){return yr(t)&&HP.call(t,"callee")&&!zP.call(t,"callee")};function VP(){return!1}var q1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xm=q1&&typeof module=="object"&&module&&!module.nodeType&&module,WP=Xm&&Xm.exports===q1,Zm=WP?hn.Buffer:void 0,UP=Zm?Zm.isBuffer:void 0,Cd=UP||VP,KP="[object Arguments]",GP="[object Array]",qP="[object Boolean]",JP="[object Date]",YP="[object Error]",XP="[object Function]",ZP="[object Map]",QP="[object Number]",eL="[object Object]",tL="[object RegExp]",nL="[object Set]",rL="[object String]",oL="[object WeakMap]",iL="[object ArrayBuffer]",sL="[object DataView]",lL="[object Float32Array]",aL="[object Float64Array]",cL="[object Int8Array]",uL="[object Int16Array]",dL="[object Int32Array]",fL="[object Uint8Array]",hL="[object Uint8ClampedArray]",pL="[object Uint16Array]",mL="[object Uint32Array]",Se={};Se[lL]=Se[aL]=Se[cL]=Se[uL]=Se[dL]=Se[fL]=Se[hL]=Se[pL]=Se[mL]=!0;Se[KP]=Se[GP]=Se[iL]=Se[qP]=Se[sL]=Se[JP]=Se[YP]=Se[XP]=Se[ZP]=Se[QP]=Se[eL]=Se[tL]=Se[nL]=Se[rL]=Se[oL]=!1;function gL(t){return yr(t)&&hh(t.length)&&!!Se[oo(t)]}function mh(t){return function(e){return t(e)}}var J1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ki=J1&&typeof module=="object"&&module&&!module.nodeType&&module,yL=ki&&ki.exports===J1,lu=yL&&j1.process,Jl=function(){try{var t=ki&&ki.require&&ki.require("util").types;return t||lu&&lu.binding&&lu.binding("util")}catch{}}(),Qm=Jl&&Jl.isTypedArray,Y1=Qm?mh(Qm):gL,bL=Object.prototype,vL=bL.hasOwnProperty;function wL(t,e){var n=dn(t),r=!n&&ph(t),o=!n&&!r&&Cd(t),i=!n&&!r&&!o&&Y1(t),s=n||r||o||i,l=s?FP(t.length,String):[],a=l.length;for(var c in t)vL.call(t,c)&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||W1(c,a)))&&l.push(c);return l}function xL(t,e){return function(n){return t(e(n))}}var SL=xL(Object.keys,Object),CL=Object.prototype,EL=CL.hasOwnProperty;function kL(t){if(!BP(t))return SL(t);var e=[];for(var n in Object(t))EL.call(t,n)&&n!="constructor"&&e.push(n);return e}function X1(t){return K1(t)?wL(t):kL(t)}var ML=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TL=/^\w*$/;function gh(t,e){if(dn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||fc(t)?!0:TL.test(t)||!ML.test(t)||e!=null&&t in Object(e)}var Ji=so(Object,"create");function OL(){this.__data__=Ji?Ji(null):{},this.size=0}function AL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var RL="__lodash_hash_undefined__",NL=Object.prototype,DL=NL.hasOwnProperty;function _L(t){var e=this.__data__;if(Ji){var n=e[t];return n===RL?void 0:n}return DL.call(e,t)?e[t]:void 0}var IL=Object.prototype,PL=IL.hasOwnProperty;function LL(t){var e=this.__data__;return Ji?e[t]!==void 0:PL.call(e,t)}var $L="__lodash_hash_undefined__";function BL(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ji&&e===void 0?$L:e,this}function Xr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Xr.prototype.clear=OL;Xr.prototype.delete=AL;Xr.prototype.get=_L;Xr.prototype.has=LL;Xr.prototype.set=BL;function FL(){this.__data__=[],this.size=0}function hc(t,e){for(var n=t.length;n--;)if(U1(t[n][0],e))return n;return-1}var jL=Array.prototype,HL=jL.splice;function zL(t){var e=this.__data__,n=hc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():HL.call(e,n,1),--this.size,!0}function VL(t){var e=this.__data__,n=hc(e,t);return n<0?void 0:e[n][1]}function WL(t){return hc(this.__data__,t)>-1}function UL(t,e){var n=this.__data__,r=hc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function $n(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}$n.prototype.clear=FL;$n.prototype.delete=zL;$n.prototype.get=VL;$n.prototype.has=WL;$n.prototype.set=UL;var Yi=so(hn,"Map");function KL(){this.size=0,this.__data__={hash:new Xr,map:new(Yi||$n),string:new Xr}}function GL(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pc(t,e){var n=t.__data__;return GL(e)?n[typeof e=="string"?"string":"hash"]:n.map}function qL(t){var e=pc(this,t).delete(t);return this.size-=e?1:0,e}function JL(t){return pc(this,t).get(t)}function YL(t){return pc(this,t).has(t)}function XL(t,e){var n=pc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Bn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Bn.prototype.clear=KL;Bn.prototype.delete=qL;Bn.prototype.get=JL;Bn.prototype.has=YL;Bn.prototype.set=XL;var ZL="Expected a function";function yh(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ZL);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(yh.Cache||Bn),n}yh.Cache=Bn;var QL=500;function e$(t){var e=yh(t,function(r){return n.size===QL&&n.clear(),r}),n=e.cache;return e}var t$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n$=/\\(\\)?/g,r$=e$(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(t$,function(n,r,o,i){e.push(o?i.replace(n$,"$1"):r||n)}),e});function Ed(t){return t==null?"":ql(t)}function Z1(t,e){return dn(t)?t:gh(t,e)?[t]:r$(Ed(t))}var o$=1/0;function mc(t){if(typeof t=="string"||fc(t))return t;var e=t+"";return e=="0"&&1/t==-o$?"-0":e}function Q1(t,e){e=Z1(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[mc(e[n++])];return n&&n==r?t:void 0}function i$(t,e,n){var r=t==null?void 0:Q1(t,e);return r===void 0?n:r}function ew(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var eg=un?un.isConcatSpreadable:void 0;function s$(t){return dn(t)||ph(t)||!!(eg&&t&&t[eg])}function l$(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=s$),o||(o=[]);++i<s;){var l=t[i];n(l)&&ew(o,l)}return o}function a$(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),n=n>o?o:n,n<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function c$(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:a$(t,e,n)}var u$="\\ud800-\\udfff",d$="\\u0300-\\u036f",f$="\\ufe20-\\ufe2f",h$="\\u20d0-\\u20ff",p$=d$+f$+h$,m$="\\ufe0e\\ufe0f",g$="\\u200d",y$=RegExp("["+g$+u$+p$+m$+"]");function bh(t){return y$.test(t)}function b$(t){return t.split("")}var tw="\\ud800-\\udfff",v$="\\u0300-\\u036f",w$="\\ufe20-\\ufe2f",x$="\\u20d0-\\u20ff",S$=v$+w$+x$,C$="\\ufe0e\\ufe0f",E$="["+tw+"]",kd="["+S$+"]",Md="\\ud83c[\\udffb-\\udfff]",k$="(?:"+kd+"|"+Md+")",nw="[^"+tw+"]",rw="(?:\\ud83c[\\udde6-\\uddff]){2}",ow="[\\ud800-\\udbff][\\udc00-\\udfff]",M$="\\u200d",iw=k$+"?",sw="["+C$+"]?",T$="(?:"+M$+"(?:"+[nw,rw,ow].join("|")+")"+sw+iw+")*",O$=sw+iw+T$,A$="(?:"+[nw+kd+"?",kd,rw,ow,E$].join("|")+")",R$=RegExp(Md+"(?="+Md+")|"+A$+O$,"g");function N$(t){return t.match(R$)||[]}function D$(t){return bh(t)?N$(t):b$(t)}function _$(){this.__data__=new $n,this.size=0}function I$(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function P$(t){return this.__data__.get(t)}function L$(t){return this.__data__.has(t)}var $$=200;function B$(t,e){var n=this.__data__;if(n instanceof $n){var r=n.__data__;if(!Yi||r.length<$$-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Bn(r)}return n.set(t,e),this.size=n.size,this}function On(t){var e=this.__data__=new $n(t);this.size=e.size}On.prototype.clear=_$;On.prototype.delete=I$;On.prototype.get=P$;On.prototype.has=L$;On.prototype.set=B$;function F$(t,e){for(var n=-1,r=t==null?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function j$(){return[]}var H$=Object.prototype,z$=H$.propertyIsEnumerable,tg=Object.getOwnPropertySymbols,V$=tg?function(t){return t==null?[]:(t=Object(t),F$(tg(t),function(e){return z$.call(t,e)}))}:j$;function W$(t,e,n){var r=e(t);return dn(t)?r:ew(r,n(t))}function ng(t){return W$(t,X1,V$)}var Td=so(hn,"DataView"),Od=so(hn,"Promise"),Ad=so(hn,"Set"),rg="[object Map]",U$="[object Object]",og="[object Promise]",ig="[object Set]",sg="[object WeakMap]",lg="[object DataView]",K$=io(Td),G$=io(Yi),q$=io(Od),J$=io(Ad),Y$=io(Sd),Yn=oo;(Td&&Yn(new Td(new ArrayBuffer(1)))!=lg||Yi&&Yn(new Yi)!=rg||Od&&Yn(Od.resolve())!=og||Ad&&Yn(new Ad)!=ig||Sd&&Yn(new Sd)!=sg)&&(Yn=function(t){var e=oo(t),n=e==U$?t.constructor:void 0,r=n?io(n):"";if(r)switch(r){case K$:return lg;case G$:return rg;case q$:return og;case J$:return ig;case Y$:return sg}return e});var ag=hn.Uint8Array,X$="__lodash_hash_undefined__";function Z$(t){return this.__data__.set(t,X$),this}function Q$(t){return this.__data__.has(t)}function Xi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Bn;++e<n;)this.add(t[e])}Xi.prototype.add=Xi.prototype.push=Z$;Xi.prototype.has=Q$;function eB(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function lw(t,e){return t.has(e)}var tB=1,nB=2;function aw(t,e,n,r,o,i){var s=n&tB,l=t.length,a=e.length;if(l!=a&&!(s&&a>l))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,h=n&nB?new Xi:void 0;for(i.set(t,e),i.set(e,t);++d<l;){var p=t[d],m=e[d];if(r)var g=s?r(m,p,d,e,t,i):r(p,m,d,t,e,i);if(g!==void 0){if(g)continue;f=!1;break}if(h){if(!eB(e,function(y,w){if(!lw(h,w)&&(p===y||o(p,y,n,r,i)))return h.push(w)})){f=!1;break}}else if(!(p===m||o(p,m,n,r,i))){f=!1;break}}return i.delete(t),i.delete(e),f}function rB(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}function oB(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var iB=1,sB=2,lB="[object Boolean]",aB="[object Date]",cB="[object Error]",uB="[object Map]",dB="[object Number]",fB="[object RegExp]",hB="[object Set]",pB="[object String]",mB="[object Symbol]",gB="[object ArrayBuffer]",yB="[object DataView]",cg=un?un.prototype:void 0,au=cg?cg.valueOf:void 0;function bB(t,e,n,r,o,i,s){switch(n){case yB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case gB:return!(t.byteLength!=e.byteLength||!i(new ag(t),new ag(e)));case lB:case aB:case dB:return U1(+t,+e);case cB:return t.name==e.name&&t.message==e.message;case fB:case pB:return t==e+"";case uB:var l=rB;case hB:var a=r&iB;if(l||(l=oB),t.size!=e.size&&!a)return!1;var c=s.get(t);if(c)return c==e;r|=sB,s.set(t,e);var u=aw(l(t),l(e),r,o,i,s);return s.delete(t),u;case mB:if(au)return au.call(t)==au.call(e)}return!1}var vB=1,wB=Object.prototype,xB=wB.hasOwnProperty;function SB(t,e,n,r,o,i){var s=n&vB,l=ng(t),a=l.length,c=ng(e),u=c.length;if(a!=u&&!s)return!1;for(var d=a;d--;){var f=l[d];if(!(s?f in e:xB.call(e,f)))return!1}var h=i.get(t),p=i.get(e);if(h&&p)return h==e&&p==t;var m=!0;i.set(t,e),i.set(e,t);for(var g=s;++d<a;){f=l[d];var y=t[f],w=e[f];if(r)var S=s?r(w,y,f,e,t,i):r(y,w,f,t,e,i);if(!(S===void 0?y===w||o(y,w,n,r,i):S)){m=!1;break}g||(g=f=="constructor")}if(m&&!g){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(m=!1)}return i.delete(t),i.delete(e),m}var CB=1,ug="[object Arguments]",dg="[object Array]",Ks="[object Object]",EB=Object.prototype,fg=EB.hasOwnProperty;function kB(t,e,n,r,o,i){var s=dn(t),l=dn(e),a=s?dg:Yn(t),c=l?dg:Yn(e);a=a==ug?Ks:a,c=c==ug?Ks:c;var u=a==Ks,d=c==Ks,f=a==c;if(f&&Cd(t)){if(!Cd(e))return!1;s=!0,u=!1}if(f&&!u)return i||(i=new On),s||Y1(t)?aw(t,e,n,r,o,i):bB(t,e,a,n,r,o,i);if(!(n&CB)){var h=u&&fg.call(t,"__wrapped__"),p=d&&fg.call(e,"__wrapped__");if(h||p){var m=h?t.value():t,g=p?e.value():e;return i||(i=new On),o(m,g,n,r,i)}}return f?(i||(i=new On),SB(t,e,n,r,o,i)):!1}function vh(t,e,n,r,o){return t===e?!0:t==null||e==null||!yr(t)&&!yr(e)?t!==t&&e!==e:kB(t,e,n,r,vh,o)}var MB=1,TB=2;function OB(t,e,n,r){var o=n.length,i=o;if(t==null)return!i;for(t=Object(t);o--;){var s=n[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){s=n[o];var l=s[0],a=t[l],c=s[1];if(s[2]){if(a===void 0&&!(l in t))return!1}else{var u=new On,d;if(!(d===void 0?vh(c,a,MB|TB,r,u):d))return!1}}return!0}function cw(t){return t===t&&!br(t)}function AB(t){for(var e=X1(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,cw(o)]}return e}function uw(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function RB(t){var e=AB(t);return e.length==1&&e[0][2]?uw(e[0][0],e[0][1]):function(n){return n===t||OB(n,t,e)}}function NB(t,e){return t!=null&&e in Object(t)}function DB(t,e,n){e=Z1(e,t);for(var r=-1,o=e.length,i=!1;++r<o;){var s=mc(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=o?i:(o=t==null?0:t.length,!!o&&hh(o)&&W1(s,o)&&(dn(t)||ph(t)))}function _B(t,e){return t!=null&&DB(t,e,NB)}var IB=1,PB=2;function LB(t,e){return gh(t)&&cw(e)?uw(mc(t),e):function(n){var r=i$(n,t);return r===void 0&&r===e?_B(n,t):vh(e,r,IB|PB)}}function dw(t){return function(e){return e==null?void 0:e[t]}}function $B(t){return function(e){return Q1(e,t)}}function BB(t){return gh(t)?dw(mc(t)):$B(t)}function FB(t){return typeof t=="function"?t:t==null?fh:typeof t=="object"?dn(t)?LB(t[0],t[1]):RB(t):BB(t)}var cu=function(){return hn.Date.now()},jB="Expected a function",HB=Math.max,zB=Math.min;function fw(t,e,n){var r,o,i,s,l,a,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(jB);e=xd(e)||0,br(n)&&(u=!!n.leading,d="maxWait"in n,i=d?HB(xd(n.maxWait)||0,e):i,f="trailing"in n?!!n.trailing:f);function h(x){var k=r,A=o;return r=o=void 0,c=x,s=t.apply(A,k),s}function p(x){return c=x,l=setTimeout(y,e),u?h(x):s}function m(x){var k=x-a,A=x-c,E=e-k;return d?zB(E,i-A):E}function g(x){var k=x-a,A=x-c;return a===void 0||k>=e||k<0||d&&A>=i}function y(){var x=cu();if(g(x))return w(x);l=setTimeout(y,m(x))}function w(x){return l=void 0,f&&r?h(x):(r=o=void 0,s)}function S(){l!==void 0&&clearTimeout(l),c=0,r=a=o=l=void 0}function b(){return l===void 0?s:w(cu())}function C(){var x=cu(),k=g(x);if(r=arguments,o=this,a=x,k){if(l===void 0)return p(a);if(d)return clearTimeout(l),l=setTimeout(y,e),h(a)}return l===void 0&&(l=setTimeout(y,e)),s}return C.cancel=S,C.flush=b,C}function uu(t){return yr(t)&&K1(t)}var VB=200;function WB(t,e,n,r){var o=-1,i=NP,s=!0,l=t.length,a=[],c=e.length;if(!l)return a;n&&(e=z1(e,mh(n))),e.length>=VB&&(i=lw,s=!1,e=new Xi(e));e:for(;++o<l;){var u=t[o],d=n==null?u:n(u);if(u=u!==0?u:0,s&&d===d){for(var f=c;f--;)if(e[f]===d)continue e;a.push(u)}else i(e,d,r)||a.push(u)}return a}function UB(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var KB=PP(function(t,e){var n=UB(e);return uu(n)&&(n=void 0),uu(t)?WB(t,l$(e,1,uu),FB(n)):[]}),GB="[object RegExp]";function qB(t){return yr(t)&&oo(t)==GB}var hg=Jl&&Jl.isRegExp,JB=hg?mh(hg):qB,YB=dw("length"),hw="\\ud800-\\udfff",XB="\\u0300-\\u036f",ZB="\\ufe20-\\ufe2f",QB="\\u20d0-\\u20ff",e3=XB+ZB+QB,t3="\\ufe0e\\ufe0f",n3="["+hw+"]",Rd="["+e3+"]",Nd="\\ud83c[\\udffb-\\udfff]",r3="(?:"+Rd+"|"+Nd+")",pw="[^"+hw+"]",mw="(?:\\ud83c[\\udde6-\\uddff]){2}",gw="[\\ud800-\\udbff][\\udc00-\\udfff]",o3="\\u200d",yw=r3+"?",bw="["+t3+"]?",i3="(?:"+o3+"(?:"+[pw,mw,gw].join("|")+")"+bw+yw+")*",s3=bw+yw+i3,l3="(?:"+[pw+Rd+"?",Rd,mw,gw,n3].join("|")+")",pg=RegExp(Nd+"(?="+Nd+")|"+l3+s3,"g");function a3(t){for(var e=pg.lastIndex=0;pg.test(t);)++e;return e}function c3(t){return bh(t)?a3(t):YB(t)}var u3="Expected a function";function d3(t,e,n){var r=!0,o=!0;if(typeof t!="function")throw new TypeError(u3);return br(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),fw(t,e,{leading:r,maxWait:e,trailing:o})}var f3=30,h3="...",p3=/\w*$/;function m3(t,e){var n=f3,r=h3;if(br(e)){var o="separator"in e?e.separator:o;n="length"in e?nP(e.length):n,r="omission"in e?ql(e.omission):r}t=Ed(t);var i=t.length;if(bh(t)){var s=D$(t);i=s.length}if(n>=i)return t;var l=n-c3(r);if(l<1)return r;var a=s?c$(s,0,l).join(""):t.slice(0,l);if(o===void 0)return a+r;if(s&&(l+=a.length-l),JB(o)){if(t.slice(l).search(o)){var c,u=a;for(o.global||(o=RegExp(o.source,Ed(p3.exec(o))+"g")),o.lastIndex=0;c=o.exec(u);)var d=c.index;a=a.slice(0,d===void 0?l:d)}}else if(t.indexOf(ql(o),l)!=l){var f=a.lastIndexOf(o);f>-1&&(a=a.slice(0,f))}return a+r}function gc(){return(gc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function vw(t,e){if(t==null)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}function Dd(t){var e=P.useRef(t),n=P.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Zi=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Mi=function(t){return"touches"in t},_d=function(t){return t&&t.ownerDocument.defaultView||self},mg=function(t,e,n){var r=t.getBoundingClientRect(),o=Mi(e)?function(i,s){for(var l=0;l<i.length;l++)if(i[l].identifier===s)return i[l];return i[0]}(e.touches,n):e;return{left:Zi((o.pageX-(r.left+_d(t).pageXOffset))/r.width),top:Zi((o.pageY-(r.top+_d(t).pageYOffset))/r.height)}},gg=function(t){!Mi(t)&&t.preventDefault()},ww=P.memo(function(t){var e=t.onMove,n=t.onKey,r=vw(t,["onMove","onKey"]),o=P.useRef(null),i=Dd(e),s=Dd(n),l=P.useRef(null),a=P.useRef(!1),c=P.useMemo(function(){var h=function(g){gg(g),(Mi(g)?g.touches.length>0:g.buttons>0)&&o.current?i(mg(o.current,g,l.current)):m(!1)},p=function(){return m(!1)};function m(g){var y=a.current,w=_d(o.current),S=g?w.addEventListener:w.removeEventListener;S(y?"touchmove":"mousemove",h),S(y?"touchend":"mouseup",p)}return[function(g){var y=g.nativeEvent,w=o.current;if(w&&(gg(y),!function(b,C){return C&&!Mi(b)}(y,a.current)&&w)){if(Mi(y)){a.current=!0;var S=y.changedTouches||[];S.length&&(l.current=S[0].identifier)}w.focus(),i(mg(w,y,l.current)),m(!0)}},function(g){var y=g.which||g.keyCode;y<37||y>40||(g.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},m]},[s,i]),u=c[0],d=c[1],f=c[2];return P.useEffect(function(){return f},[f]),P.createElement("div",gc({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))}),wh=function(t){return t.filter(Boolean).join(" ")},xw=function(t){var e=t.color,n=t.left,r=t.top,o=r===void 0?.5:r,i=wh(["react-colorful__pointer",t.className]);return P.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},P.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Ye=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},g3=function(t){return x3(Id(t))},Id=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Ye(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Ye(parseInt(t.substring(6,8),16)/255,2):1}},y3=function(t){return w3(v3(t))},b3=function(t){var e=t.s,n=t.v,r=t.a,o=(200-e)*n/100;return{h:Ye(t.h),s:Ye(o>0&&o<200?e*n/100/(o<=100?o:200-o)*100:0),l:Ye(o/2),a:Ye(r,2)}},Pd=function(t){var e=b3(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},v3=function(t){var e=t.h,n=t.s,r=t.v,o=t.a;e=e/360*6,n/=100,r/=100;var i=Math.floor(e),s=r*(1-n),l=r*(1-(e-i)*n),a=r*(1-(1-e+i)*n),c=i%6;return{r:Ye(255*[r,l,s,s,a,r][c]),g:Ye(255*[a,r,r,l,s,s][c]),b:Ye(255*[s,s,a,r,r,l][c]),a:Ye(o,2)}},Gs=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},w3=function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=o<1?Gs(Ye(255*o)):"";return"#"+Gs(e)+Gs(n)+Gs(r)+i},x3=function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=Math.max(e,n,r),s=i-Math.min(e,n,r),l=s?i===e?(n-r)/s:i===n?2+(r-e)/s:4+(e-n)/s:0;return{h:Ye(60*(l<0?l+6:l)),s:Ye(i?s/i*100:0),v:Ye(i/255*100),a:o}},S3=P.memo(function(t){var e=t.hue,n=t.onChange,r=wh(["react-colorful__hue",t.className]);return P.createElement("div",{className:r},P.createElement(ww,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Zi(e+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":Ye(e),"aria-valuemax":"360","aria-valuemin":"0"},P.createElement(xw,{className:"react-colorful__hue-pointer",left:e/360,color:Pd({h:e,s:100,v:100,a:1})})))}),C3=P.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:Pd({h:e.h,s:100,v:100,a:1})};return P.createElement("div",{className:"react-colorful__saturation",style:r},P.createElement(ww,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Zi(e.s+100*o.left,0,100),v:Zi(e.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Ye(e.s)+"%, Brightness "+Ye(e.v)+"%"},P.createElement(xw,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Pd(e)})))}),Sw=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},E3=function(t,e){return t.toLowerCase()===e.toLowerCase()||Sw(Id(t),Id(e))};function k3(t,e,n){var r=Dd(n),o=P.useState(function(){return t.toHsva(e)}),i=o[0],s=o[1],l=P.useRef({color:e,hsva:i});P.useEffect(function(){if(!t.equal(e,l.current.color)){var c=t.toHsva(e);l.current={hsva:c,color:e},s(c)}},[e,t]),P.useEffect(function(){var c;Sw(i,l.current.hsva)||t.equal(c=t.fromHsva(i),l.current.color)||(l.current={hsva:i,color:c},r(c))},[i,t,r]);var a=P.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[i,a]}var M3=typeof window<"u"?P.useLayoutEffect:P.useEffect,T3=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},yg=new Map,O3=function(t){M3(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!yg.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,yg.set(e,n);var r=T3();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},A3=function(t){var e=t.className,n=t.colorModel,r=t.color,o=r===void 0?n.defaultColor:r,i=t.onChange,s=vw(t,["className","colorModel","color","onChange"]),l=P.useRef(null);O3(l);var a=k3(n,o,i),c=a[0],u=a[1],d=wh(["react-colorful",e]);return P.createElement("div",gc({},s,{ref:l,className:d}),P.createElement(C3,{hsva:c,onChange:u}),P.createElement(S3,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},R3={defaultColor:"000",toHsva:g3,fromHsva:function(t){return y3({h:t.h,s:t.s,v:t.v,a:1})},equal:E3},N3=function(t){return P.createElement(A3,gc({},t,{colorModel:R3}))},D3="Separator",bg="horizontal",_3=["horizontal","vertical"],Cw=v.forwardRef((t,e)=>{const{decorative:n,orientation:r=bg,...o}=t,i=I3(r)?r:bg,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return T.jsx(ge.div,{"data-orientation":i,...l,...o,ref:e})});Cw.displayName=D3;function I3(t){return _3.includes(t)}var P3=Cw;const L3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,$3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,B3=nt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Gr({find:L3,type:this.type})]},addPasteRules(){return[fr({find:$3,type:this.type})]}}),F3=Ne.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",le(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),vg=nt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",le(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=vs(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),wg=/^\s*([-+*])\s$/,j3=Ne.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",le(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(F3.name,this.editor.getAttributes(vg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Bo({find:wg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bo({find:wg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(vg.name),editor:this.editor})),[t]}}),H3=Ne.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",le(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),xg=nt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",le(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=vs(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),Sg=/^(\d+)\.\s$/,z3=Ne.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",le(this.options.HTMLAttributes,n),0]:["ol",le(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(H3.name,this.editor.getAttributes(xg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Bo({find:Sg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bo({find:Sg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xg.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),V3=/^\s*(\[([( |x])?\])\s$/,W3=Ne.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",le(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");return i.contentEditable="false",l.type="checkbox",l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:u}=c.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:d})=>{const f=n(),h=d.doc.nodeAt(f);return d.setNodeMarkup(f,void 0,{...h==null?void 0:h.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,u)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{o.setAttribute(c,u)}),o.dataset.checked=t.attrs.checked,t.attrs.checked&&l.setAttribute("checked","checked"),i.append(l,s),o.append(i,a),Object.entries(e).forEach(([c,u])=>{o.setAttribute(c,u)}),{dom:o,contentDOM:a,update:c=>c.type!==this.type?!1:(o.dataset.checked=c.attrs.checked,c.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[Bo({find:V3,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),U3=Ne.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",le(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),K3=/^\s*>\s$/,G3=Ne.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Bo({find:K3,type:this.type})]}}),q3="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",J3="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vo=(t,e)=>{for(const n in e)t[n]=e[n];return t},Ld="numeric",$d="ascii",Bd="alpha",gl="asciinumeric",qs="alphanumeric",Fd="domain",Ew="emoji",Y3="scheme",X3="slashscheme",Cg="whitespace";function Z3(t,e){return t in e||(e[t]=[]),e[t]}function Pr(t,e,n){e[Ld]&&(e[gl]=!0,e[qs]=!0),e[$d]&&(e[gl]=!0,e[Bd]=!0),e[gl]&&(e[qs]=!0),e[Bd]&&(e[qs]=!0),e[qs]&&(e[Fd]=!0),e[Ew]&&(e[Fd]=!0);for(const r in e){const o=Z3(r,n);o.indexOf(t)<0&&o.push(t)}}function Q3(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ut(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}ut.groups={};ut.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||ut.groups;let o;return e&&e.j?o=e:(o=new ut(e),n&&r&&Pr(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||ut.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,l=o.go(t);if(l?(s=new ut,Vo(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new ut,i){if(r)if(s.t&&typeof s.t=="string"){const a=Vo(Q3(s.t,r),n);Pr(i,a,r)}else n&&Pr(i,n,r);s.t=i}return o.j[t]=s,s}};const oe=(t,e,n,r,o)=>t.ta(e,n,r,o),Tt=(t,e,n,r,o)=>t.tr(e,n,r,o),Eg=(t,e,n,r,o)=>t.ts(e,n,r,o),$=(t,e,n,r,o)=>t.tt(e,n,r,o),xn="WORD",jd="UWORD",Qi="LOCALHOST",Hd="TLD",zd="UTLD",yl="SCHEME",xo="SLASH_SCHEME",xh="NUM",kw="WS",Sh="NL",Ti="OPENBRACE",Oi="CLOSEBRACE",Yl="OPENBRACKET",Xl="CLOSEBRACKET",Zl="OPENPAREN",Ql="CLOSEPAREN",ea="OPENANGLEBRACKET",ta="CLOSEANGLEBRACKET",na="FULLWIDTHLEFTPAREN",ra="FULLWIDTHRIGHTPAREN",oa="LEFTCORNERBRACKET",ia="RIGHTCORNERBRACKET",sa="LEFTWHITECORNERBRACKET",la="RIGHTWHITECORNERBRACKET",aa="FULLWIDTHLESSTHAN",ca="FULLWIDTHGREATERTHAN",ua="AMPERSAND",da="APOSTROPHE",fa="ASTERISK",Xn="AT",ha="BACKSLASH",pa="BACKTICK",ma="CARET",er="COLON",Ch="COMMA",ga="DOLLAR",qt="DOT",ya="EQUALS",Eh="EXCLAMATION",Jt="HYPHEN",ba="PERCENT",va="PIPE",wa="PLUS",xa="POUND",Sa="QUERY",kh="QUOTE",Mh="SEMI",Yt="SLASH",Ai="TILDE",Ca="UNDERSCORE",Mw="EMOJI",Ea="SYM";var Tw=Object.freeze({__proto__:null,WORD:xn,UWORD:jd,LOCALHOST:Qi,TLD:Hd,UTLD:zd,SCHEME:yl,SLASH_SCHEME:xo,NUM:xh,WS:kw,NL:Sh,OPENBRACE:Ti,CLOSEBRACE:Oi,OPENBRACKET:Yl,CLOSEBRACKET:Xl,OPENPAREN:Zl,CLOSEPAREN:Ql,OPENANGLEBRACKET:ea,CLOSEANGLEBRACKET:ta,FULLWIDTHLEFTPAREN:na,FULLWIDTHRIGHTPAREN:ra,LEFTCORNERBRACKET:oa,RIGHTCORNERBRACKET:ia,LEFTWHITECORNERBRACKET:sa,RIGHTWHITECORNERBRACKET:la,FULLWIDTHLESSTHAN:aa,FULLWIDTHGREATERTHAN:ca,AMPERSAND:ua,APOSTROPHE:da,ASTERISK:fa,AT:Xn,BACKSLASH:ha,BACKTICK:pa,CARET:ma,COLON:er,COMMA:Ch,DOLLAR:ga,DOT:qt,EQUALS:ya,EXCLAMATION:Eh,HYPHEN:Jt,PERCENT:ba,PIPE:va,PLUS:wa,POUND:xa,QUERY:Sa,QUOTE:kh,SEMI:Mh,SLASH:Yt,TILDE:Ai,UNDERSCORE:Ca,EMOJI:Mw,SYM:Ea});const yo=/[a-z]/,du=new RegExp("\\p{L}","u"),fu=new RegExp("\\p{Emoji}","u"),hu=/\d/,kg=/\s/,Mg=`
460
+ `,eF="️",tF="‍";let Js=null,Ys=null;function nF(t){t===void 0&&(t=[]);const e={};ut.groups=e;const n=new ut;Js==null&&(Js=Tg(q3)),Ys==null&&(Ys=Tg(J3)),$(n,"'",da),$(n,"{",Ti),$(n,"}",Oi),$(n,"[",Yl),$(n,"]",Xl),$(n,"(",Zl),$(n,")",Ql),$(n,"<",ea),$(n,">",ta),$(n,"(",na),$(n,")",ra),$(n,"「",oa),$(n,"」",ia),$(n,"『",sa),$(n,"』",la),$(n,"<",aa),$(n,">",ca),$(n,"&",ua),$(n,"*",fa),$(n,"@",Xn),$(n,"`",pa),$(n,"^",ma),$(n,":",er),$(n,",",Ch),$(n,"$",ga),$(n,".",qt),$(n,"=",ya),$(n,"!",Eh),$(n,"-",Jt),$(n,"%",ba),$(n,"|",va),$(n,"+",wa),$(n,"#",xa),$(n,"?",Sa),$(n,'"',kh),$(n,"/",Yt),$(n,";",Mh),$(n,"~",Ai),$(n,"_",Ca),$(n,"\\",ha);const r=Tt(n,hu,xh,{[Ld]:!0});Tt(r,hu,r);const o=Tt(n,yo,xn,{[$d]:!0});Tt(o,yo,o);const i=Tt(n,du,jd,{[Bd]:!0});Tt(i,yo),Tt(i,du,i);const s=Tt(n,kg,kw,{[Cg]:!0});$(n,Mg,Sh,{[Cg]:!0}),$(s,Mg),Tt(s,kg,s);const l=Tt(n,fu,Mw,{[Ew]:!0});Tt(l,fu,l),$(l,eF,l);const a=$(l,tF);Tt(a,fu,l);const c=[[yo,o]],u=[[yo,null],[du,i]];for(let d=0;d<Js.length;d++)Wn(n,Js[d],Hd,xn,c);for(let d=0;d<Ys.length;d++)Wn(n,Ys[d],zd,jd,u);Pr(Hd,{tld:!0,ascii:!0},e),Pr(zd,{utld:!0,alpha:!0},e),Wn(n,"file",yl,xn,c),Wn(n,"mailto",yl,xn,c),Wn(n,"http",xo,xn,c),Wn(n,"https",xo,xn,c),Wn(n,"ftp",xo,xn,c),Wn(n,"ftps",xo,xn,c),Pr(yl,{scheme:!0,ascii:!0},e),Pr(xo,{slashscheme:!0,ascii:!0},e),t=t.sort((d,f)=>d[0]>f[0]?1:-1);for(let d=0;d<t.length;d++){const f=t[d][0],p=t[d][1]?{[Y3]:!0}:{[X3]:!0};f.indexOf("-")>=0?p[Fd]=!0:yo.test(f)?hu.test(f)?p[gl]=!0:p[$d]=!0:p[Ld]=!0,Eg(n,f,f,p)}return Eg(n,"localhost",Qi,{ascii:!0}),n.jd=new ut(Ea),{start:n,tokens:Vo({groups:e},Tw)}}function rF(t,e){const n=oF(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let l=t,a=null,c=0,u=null,d=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=d,s-=f,c-=d,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function oF(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Wn(t,e,n,r,o){let i;const s=e.length;for(let l=0;l<s-1;l++){const a=e[l];t.j[a]?i=t.j[a]:(i=new ut(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new ut(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Tg(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const es={defaultProtocol:"http",events:null,format:Og,formatHref:Og,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Th(t,e){e===void 0&&(e=null);let n=Vo({},es);t&&(n=Vo(n,t instanceof Th?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Th.prototype={o:es,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:es[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Og(t){return t}function Ow(t,e){this.t="token",this.v=t,this.tk=e}Ow.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=es.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Vo(s,u),{tagName:o,attributes:s,content:i,eventListeners:d}}};function yc(t,e){class n extends Ow{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Ag=yc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Rg=yc("text"),iF=yc("nl"),Xs=yc("url",{isLink:!0,toHref(t){return t===void 0&&(t=es.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Qi&&t[1].t===er}}),Ot=t=>new ut(t);function sF(t){let{groups:e}=t;const n=e.domain.concat([ua,fa,Xn,ha,pa,ma,ga,ya,Jt,xh,ba,va,wa,xa,Yt,Ea,Ai,Ca]),r=[da,er,Ch,qt,Eh,Sa,kh,Mh,ea,ta,Ti,Oi,Xl,Yl,Zl,Ql,na,ra,oa,ia,sa,la,aa,ca],o=[ua,da,fa,ha,pa,ma,ga,ya,Jt,Ti,Oi,ba,va,wa,xa,Sa,Yt,Ea,Ai,Ca],i=Ot(),s=$(i,Ai);oe(s,o,s),oe(s,e.domain,s);const l=Ot(),a=Ot(),c=Ot();oe(i,e.domain,l),oe(i,e.scheme,a),oe(i,e.slashscheme,c),oe(l,o,s),oe(l,e.domain,l);const u=$(l,Xn);$(s,Xn,u),$(a,Xn,u),$(c,Xn,u);const d=$(s,qt);oe(d,o,s),oe(d,e.domain,s);const f=Ot();oe(u,e.domain,f),oe(f,e.domain,f);const h=$(f,qt);oe(h,e.domain,f);const p=Ot(Ag);oe(h,e.tld,p),oe(h,e.utld,p),$(u,Qi,p);const m=$(f,Jt);oe(m,e.domain,f),oe(p,e.domain,f),$(p,qt,h),$(p,Jt,m);const g=$(p,er);oe(g,e.numeric,Ag);const y=$(l,Jt),w=$(l,qt);oe(y,e.domain,l),oe(w,o,s),oe(w,e.domain,l);const S=Ot(Xs);oe(w,e.tld,S),oe(w,e.utld,S),oe(S,e.domain,l),oe(S,o,s),$(S,qt,w),$(S,Jt,y),$(S,Xn,u);const b=$(S,er),C=Ot(Xs);oe(b,e.numeric,C);const x=Ot(Xs),k=Ot();oe(x,n,x),oe(x,r,k),oe(k,n,x),oe(k,r,k),$(S,Yt,x),$(C,Yt,x);const A=$(a,er),E=$(c,er),O=$(E,Yt),_=$(O,Yt);oe(a,e.domain,l),$(a,qt,w),$(a,Jt,y),oe(c,e.domain,l),$(c,qt,w),$(c,Jt,y),oe(A,e.domain,x),$(A,Yt,x),oe(_,e.domain,x),oe(_,n,x),$(_,Yt,x);const L=[[Ti,Oi],[Yl,Xl],[Zl,Ql],[ea,ta],[na,ra],[oa,ia],[sa,la],[aa,ca]];for(let H=0;H<L.length;H++){const[U,K]=L[H],j=$(x,U);$(k,U,j),$(j,K,x);const M=Ot(Xs);oe(j,n,M);const N=Ot();oe(j,r),oe(M,n,M),oe(M,r,N),oe(N,n,M),oe(N,r,N),$(M,K,x),$(N,K,x)}return $(i,Qi,S),$(i,Sh,iF),{start:i,tokens:Tw}}function lF(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let l=t,a=null,c=null,u=0,d=null,f=-1;for(;o<r&&!(a=l.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(pu(Rg,e,s)),s=[]),o-=f,u-=f;const h=d.t,p=n.slice(o-u,o);i.push(pu(h,e,p))}}return s.length>0&&i.push(pu(Rg,e,s)),i}function pu(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const aF=typeof console<"u"&&console&&console.warn||(()=>{}),cF="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Me={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function uF(){ut.groups={},Me.scanner=null,Me.parser=null,Me.tokenQueue=[],Me.pluginQueue=[],Me.customSchemes=[],Me.initialized=!1}function Ng(t,e){if(e===void 0&&(e=!1),Me.initialized&&aF(`linkifyjs: already initialized - will not register custom scheme "${t}" ${cF}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
461
461
  1. Must only contain digits, lowercase ASCII letters or "-"
462
462
  2. Cannot start or end with "-"
463
- 3. "-" cannot repeat`);Me.customSchemes.push([t,e])}function dF(){Me.scanner=nF(Me.customSchemes);for(let t=0;t<Me.tokenQueue.length;t++)Me.tokenQueue[t][1]({scanner:Me.scanner});Me.parser=sF(Me.scanner.tokens);for(let t=0;t<Me.pluginQueue.length;t++)Me.pluginQueue[t][1]({scanner:Me.scanner,parser:Me.parser});Me.initialized=!0}function Aw(t){return Me.initialized||dF(),lF(Me.parser.start,t,rF(Me.scanner.start,t))}function Rw(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Mh(n),o=Aw(t),i=[];for(let s=0;s<o.length;s++){const l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}function fF(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function hF(t){return new ke({key:new we("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,l=_M(n.doc,[...e]);if(HM(l).forEach(({newRange:c})=>{const u=PM(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const h=f.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=d.pos+f.lastIndexOf(p);if(!p)return!1;const g=Aw(p).map(y=>y.toObject(t.defaultProtocol));if(!fF(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).forEach(y=>{Rf(y.from,y.to,r.doc).some(x=>x.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function pF(t){return new ke({key:new we("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=b0(e.state,t.type.name),c=r.target,u=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:a.href,d=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:a.target;return c&&u?(window.open(u,d),!0):!1}}})}function mF(t){return new ke({key:new we("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=Rw(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(t.editor.commands.setMark(t.type,{href:a.href}),!0)}}})}const gF=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,yF=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Dg(t){return!t||t.replace(gF,"").match(yF)}const bF=nt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Ng(t);return}Ng(t.scheme,t.optionalSlashes)})},onDestroy(){uF()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!Dg(e)?!1:{href:e}}}]},renderHTML({HTMLAttributes:t}){return Dg(t.href)?["a",le(this.options.HTMLAttributes,t),0]:["a",le(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[fr({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=Rw(t).filter(o=>o.isLink&&n(o.value));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(hF({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(pF({type:this.type})),this.options.linkOnPaste&&t.push(mF({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var vF="Label",Nw=v.forwardRef((t,e)=>T.jsx(ge.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Nw.displayName=vF;var wF=Nw;function xF(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Th="Switch",[SF,D4]=In(Th),[CF,EF]=SF(Th),Dw=v.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:l,value:a="on",onCheckedChange:c,...u}=t,[d,f]=v.useState(null),h=$e(e,x=>f(x)),p=v.useRef(!1),m=d?!!d.closest("form"):!0,[g=!1,y]=Er({prop:o,defaultProp:i,onChange:c});return T.jsxs(CF,{scope:n,checked:g,disabled:l,children:[T.jsx(ge.button,{type:"button",role:"switch","aria-checked":g,"aria-required":s,"data-state":Pw(g),"data-disabled":l?"":void 0,disabled:l,value:a,...u,ref:h,onClick:ee(t.onClick,x=>{y(S=>!S),m&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})}),m&&T.jsx(kF,{control:d,bubbles:!p.current,name:r,value:a,checked:g,required:s,disabled:l,style:{transform:"translateX(-100%)"}})]})});Dw.displayName=Th;var _w="SwitchThumb",Iw=v.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=EF(_w,n);return T.jsx(ge.span,{"data-state":Pw(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:e})});Iw.displayName=_w;var kF=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=v.useRef(null),s=xF(n),l=U0(e);return v.useEffect(()=>{const a=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(a,n),a.dispatchEvent(f)}},[s,n,r]),T.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Pw(t){return t?"checked":"unchecked"}var MF=Dw,TF=Iw;const OF=Ne.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",le(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):w0(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:l})=>{var a;if(l){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(X.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(J.create(s.doc,c.pos)):s.setSelection(X.create(s.doc,c.pos));else{const d=(a=c.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(s.insert(u,d),s.setSelection(X.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[x0({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Ma=200,We=function(){};We.prototype.append=function(e){return e.length?(e=We.from(e),!this.length&&e||e.length<Ma&&this.leafAppend(e)||this.length<Ma&&e.leafPrepend(this)||this.appendInner(e)):this};We.prototype.prepend=function(e){return e.length?We.from(e).append(this):this};We.prototype.appendInner=function(e){return new AF(this,e)};We.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?We.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};We.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};We.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};We.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o};We.from=function(e){return e instanceof We?e:e&&e.length?new Lw(e):We.empty};var Lw=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,l){for(var a=i;a<s;a++)if(o(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,l){for(var a=i-1;a>=s;a--)if(o(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Ma)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Ma)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(We);We.empty=new Lw([]);var AF=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(i,l),s)===!1||i>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,i)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(i,l)-l,s+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(o,l),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(We);const RF=500;class Ht{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Un(d.map));let h=d.step.map(o.slice(i)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Un(p,void 0,void 0,c.length+u.length))),i--,p&&o.appendMap(p,i)}else s.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(i)):d.selection,a=new Ht(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,o){let i=[],s=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Un(e.mapping.maps[u],d,n),h;(h=a&&a.merge(f))&&(f=h,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),n&&(s++,n=void 0),o||(a=f)}let c=s-r.depth;return c>DF&&(l=NF(l,c),s-=c),new Ht(l.append(i),s)}remapping(e,n){let r=new To;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ht(this.items.append(e.map(n=>new Un(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=i.getMirror(--a);if(h==null)return;s=Math.min(s,h);let p=i.maps[h];if(f.step){let m=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(i.slice(a+1,h));g&&l++,r.push(new Un(p,m,g))}else r.push(new Un(p))},o);let c=[];for(let f=n;f<s;f++)c.push(new Un(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Ht(u,l);return d.emptyItemCount()>RF&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,l)=>{if(l>=e)o.push(s),s.selection&&i++;else if(s.step){let a=s.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Un(c.invert(),a,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new Ht(We.from(o.reverse()),i)}}Ht.empty=new Ht(We.empty,0);function NF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let Un=class $w{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new $w(n.getMap().invert(),n,this.selection)}}};class Zn{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const DF=20;function _F(t,e,n,r){let o=n.getMeta(Vr),i;if(o)return o.historyState;n.getMeta(LF)&&(t=new Zn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Vr))return s.getMeta(Vr).redo?new Zn(t.done.addTransform(n,void 0,r,vl(e)),t.undone,_g(n.mapping.maps),t.prevTime,t.prevComposition):new Zn(t.done,t.undone.addTransform(n,void 0,r,vl(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!IF(n,t.prevRanges)),c=s?pu(t.prevRanges,n.mapping):_g(n.mapping.maps);return new Zn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,vl(e)),Ht.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Zn(t.done.rebased(n,i),t.undone.rebased(n,i),pu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Zn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),pu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function IF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function _g(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function pu(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function PF(t,e,n){let r=vl(e),o=Vr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),a=new Zn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(Vr,{redo:n,historyState:a})}let mu=!1,Ig=null;function vl(t){let e=t.plugins;if(Ig!=e){mu=!1,Ig=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){mu=!0;break}}return mu}const Vr=new we("history"),LF=new we("closeHistory");function $F(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ke({key:Vr,state:{init(){return new Zn(Ht.empty,Ht.empty,null,0,-1)},apply(e,n,r){return _F(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?Fw:r=="historyRedo"?jw:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function Bw(t,e){return(n,r)=>{let o=Vr.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=PF(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const Fw=Bw(!1,!0),jw=Bw(!0,!0),BF=Ie.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Fw(t,e),redo:()=>({state:t,dispatch:e})=>jw(t,e)}},addProseMirrorPlugins(){return[$F(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),FF=Ie.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize"}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return((t==null?void 0:t.mode)||this.options.mode)==="textSize"?e.textBetween(0,e.content.size,void 0," ").length:e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return e.textBetween(0,e.content.size," "," ").split(" ").filter(o=>o!=="").length}},addProseMirrorPlugins(){return[new ke({key:new we("characterCount"),filterTransaction:(t,e)=>{const n=this.options.limit;if(!t.docChanged||n===0||n===null||n===void 0)return!0;const r=this.storage.characters({node:e.doc}),o=this.storage.characters({node:t.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r||!t.getMeta("paste"))return!1;const s=t.selection.$head.pos,l=o-n,a=s-l,c=s;return t.deleteRange(a,c),!(this.storage.characters({node:t.doc})>n)}})]}}),jF=Ne.create({name:"doc",topNode:!0,content:"block+"});function HF(t={}){return new ke({view(e){return new zF(e,t)}})}class zF{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let l=o.getBoundingClientRect();i=l.left-o.scrollLeft,s=l.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=gb(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const VF=Ie.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[HF(this.options)]}}),WF=Ie.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ke({key:new we("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,i=[];if(!n||!r)return me.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(a.isText)return;if(!(o>=c&&o<=c+a.nodeSize-1))return!1;s+=1});let l=0;return t.descendants((a,c)=>{if(a.isText||!(o>=c&&o<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(Le.node(c,c+a.nodeSize,{class:this.options.className}))}),me.create(t,i)}}})]}});class Ae extends Q{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ae.valid(r)?new Ae(r):Q.near(r)}content(){return B.empty}eq(e){return e instanceof Ae&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ae(e.resolve(n.pos))}getBookmark(){return new Oh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!UF(e)||!KF(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ae.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)<l.childCount:e.index(s)>0){i=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let a=e.doc.resolve(o);if(Ae.valid(a))return a}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let l=e.doc.resolve(o);if(Ae.valid(l))return l}return null}}}Ae.prototype.visible=!1;Ae.findFrom=Ae.findGapCursorFrom;Q.jsonID("gapcursor",Ae);class Oh{constructor(e){this.pos=e}map(e){return new Oh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ae.valid(n)?new Ae(n):Q.near(n)}}function UF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function KF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function GF(){return new ke({props:{decorations:XF,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ae.valid(n)?new Ae(n):null},handleClick:JF,handleKeyDown:qF,handleDOMEvents:{beforeinput:YF}}})}const qF=Ef({ArrowLeft:Qs("horiz",-1),ArrowRight:Qs("horiz",1),ArrowUp:Qs("vert",-1),ArrowDown:Qs("vert",1)});function Qs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof X){if(!i.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ae.findGapCursorFrom(l,e,a);return c?(o&&o(r.tr.setSelection(new Ae(c))),!0):!1}}function JF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ae.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&J.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ae(r))),!0)}function YF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ae))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=P.empty;for(let s=r.length-1;s>=0;s--)o=P.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new B(o,0,0));return i.setSelection(X.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function XF(t){if(!(t.selection instanceof Ae))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",me.create(t.doc,[Le.widget(t.selection.head,e,{key:"gapcursor"})])}const ZF=Ie.create({name:"gapCursor",addProseMirrorPlugins(){return[GF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=se(V(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),QF=Ne.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",le(this.options.HTMLAttributes,t)]},renderText(){return`
464
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ej=Ne.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",le(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),tj=Ne.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nj=Ie.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ke({key:new we("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((s,l)=>{const a=r>=l&&r<=l+s.nodeSize,c=!s.isLeaf&&Nf(s);if((a||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];i&&u.push(this.options.emptyEditorClass);const d=Le.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:a}):this.options.placeholder});o.push(d)}return this.options.includeChildren}),me.create(t,o)}}})]}}),rj=Ne.create({name:"text",group:"inline"}),oj=nt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),ij=nt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var ht="top",Lt="bottom",$t="right",pt="left",Ah="auto",ks=[ht,Lt,$t,pt],Wo="start",ts="end",sj="clippingParents",Hw="viewport",pi="popper",lj="reference",Pg=ks.reduce(function(t,e){return t.concat([e+"-"+Wo,e+"-"+ts])},[]),zw=[].concat(ks,[Ah]).reduce(function(t,e){return t.concat([e,e+"-"+Wo,e+"-"+ts])},[]),aj="beforeRead",cj="read",uj="afterRead",dj="beforeMain",fj="main",hj="afterMain",pj="beforeWrite",mj="write",gj="afterWrite",yj=[aj,cj,uj,dj,fj,hj,pj,mj,gj];function fn(t){return t?(t.nodeName||"").toLowerCase():null}function St(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Qr(t){var e=St(t).Element;return t instanceof e||t instanceof Element}function It(t){var e=St(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Rh(t){if(typeof ShadowRoot>"u")return!1;var e=St(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function bj(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!It(i)||!fn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var l=o[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function vj(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!It(o)||!fn(o)||(Object.assign(o.style,l),Object.keys(i).forEach(function(a){o.removeAttribute(a)}))})}}const Vw={name:"applyStyles",enabled:!0,phase:"write",fn:bj,effect:vj,requires:["computeStyles"]};function rn(t){return t.split("-")[0]}var Wr=Math.max,Ta=Math.min,Uo=Math.round;function zd(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ww(){return!/^((?!chrome|android).)*safari/i.test(zd())}function Ko(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&It(t)&&(o=t.offsetWidth>0&&Uo(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Uo(r.height)/t.offsetHeight||1);var s=Qr(t)?St(t):window,l=s.visualViewport,a=!Ww()&&n,c=(r.left+(a&&l?l.offsetLeft:0))/o,u=(r.top+(a&&l?l.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Nh(t){var e=Ko(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Uw(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Rh(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Nn(t){return St(t).getComputedStyle(t)}function wj(t){return["table","td","th"].indexOf(fn(t))>=0}function Tr(t){return((Qr(t)?t.ownerDocument:t.document)||window.document).documentElement}function vc(t){return fn(t)==="html"?t:t.assignedSlot||t.parentNode||(Rh(t)?t.host:null)||Tr(t)}function Lg(t){return!It(t)||Nn(t).position==="fixed"?null:t.offsetParent}function xj(t){var e=/firefox/i.test(zd()),n=/Trident/i.test(zd());if(n&&It(t)){var r=Nn(t);if(r.position==="fixed")return null}var o=vc(t);for(Rh(o)&&(o=o.host);It(o)&&["html","body"].indexOf(fn(o))<0;){var i=Nn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Ms(t){for(var e=St(t),n=Lg(t);n&&wj(n)&&Nn(n).position==="static";)n=Lg(n);return n&&(fn(n)==="html"||fn(n)==="body"&&Nn(n).position==="static")?e:n||xj(t)||e}function Dh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ri(t,e,n){return Wr(t,Ta(e,n))}function Sj(t,e,n){var r=Ri(t,e,n);return r>n?n:r}function Kw(){return{top:0,right:0,bottom:0,left:0}}function Gw(t){return Object.assign({},Kw(),t)}function qw(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Cj=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Gw(typeof e!="number"?e:qw(e,ks))};function Ej(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=rn(n.placement),a=Dh(l),c=[pt,$t].indexOf(l)>=0,u=c?"height":"width";if(!(!i||!s)){var d=Cj(o.padding,n),f=Nh(i),h=a==="y"?ht:pt,p=a==="y"?Lt:$t,m=n.rects.reference[u]+n.rects.reference[a]-s[a]-n.rects.popper[u],g=s[a]-n.rects.reference[a],y=Ms(i),x=y?a==="y"?y.clientHeight||0:y.clientWidth||0:0,S=m/2-g/2,b=d[h],C=x-f[u]-d[p],w=x/2-f[u]/2+S,k=Ri(b,w,C),R=a;n.modifiersData[r]=(e={},e[R]=k,e.centerOffset=k-w,e)}}function kj(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||Uw(e.elements.popper,o)&&(e.elements.arrow=o))}const Mj={name:"arrow",enabled:!0,phase:"main",fn:Ej,effect:kj,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Go(t){return t.split("-")[1]}var Tj={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Oj(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Uo(n*o)/o||0,y:Uo(r*o)/o||0}}function $g(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,l=t.position,a=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,h=f===void 0?0:f,p=s.y,m=p===void 0?0:p,g=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),S=pt,b=ht,C=window;if(c){var w=Ms(n),k="clientHeight",R="clientWidth";if(w===St(n)&&(w=Tr(n),Nn(w).position!=="static"&&l==="absolute"&&(k="scrollHeight",R="scrollWidth")),w=w,o===ht||(o===pt||o===$t)&&i===ts){b=Lt;var E=d&&w===C&&C.visualViewport?C.visualViewport.height:w[k];m-=E-r.height,m*=a?1:-1}if(o===pt||(o===ht||o===Lt)&&i===ts){S=$t;var O=d&&w===C&&C.visualViewport?C.visualViewport.width:w[R];h-=O-r.width,h*=a?1:-1}}var I=Object.assign({position:l},c&&Tj),L=u===!0?Oj({x:h,y:m},St(n)):{x:h,y:m};if(h=L.x,m=L.y,a){var H;return Object.assign({},I,(H={},H[b]=x?"0":"",H[S]=y?"0":"",H.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",H))}return Object.assign({},I,(e={},e[b]=x?m+"px":"",e[S]=y?h+"px":"",e.transform="",e))}function Aj(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,a=l===void 0?!0:l,c={placement:rn(e.placement),variation:Go(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$g(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$g(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Rj={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Aj,data:{}};var el={passive:!0};function Nj(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,l=s===void 0?!0:s,a=St(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,el)}),l&&a.addEventListener("resize",n.update,el),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,el)}),l&&a.removeEventListener("resize",n.update,el)}}const Dj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Nj,data:{}};var _j={left:"right",right:"left",bottom:"top",top:"bottom"};function wl(t){return t.replace(/left|right|bottom|top/g,function(e){return _j[e]})}var Ij={start:"end",end:"start"};function Bg(t){return t.replace(/start|end/g,function(e){return Ij[e]})}function _h(t){var e=St(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ih(t){return Ko(Tr(t)).left+_h(t).scrollLeft}function Pj(t,e){var n=St(t),r=Tr(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;var c=Ww();(c||!c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:s,x:l+Ih(t),y:a}}function Lj(t){var e,n=Tr(t),r=_h(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=Wr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Wr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+Ih(t),a=-r.scrollTop;return Nn(o||n).direction==="rtl"&&(l+=Wr(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:l,y:a}}function Ph(t){var e=Nn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Jw(t){return["html","body","#document"].indexOf(fn(t))>=0?t.ownerDocument.body:It(t)&&Ph(t)?t:Jw(vc(t))}function Ni(t,e){var n;e===void 0&&(e=[]);var r=Jw(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=St(r),s=o?[i].concat(i.visualViewport||[],Ph(r)?r:[]):r,l=e.concat(s);return o?l:l.concat(Ni(vc(s)))}function Vd(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $j(t,e){var n=Ko(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Fg(t,e,n){return e===Hw?Vd(Pj(t,n)):Qr(e)?$j(e,n):Vd(Lj(Tr(t)))}function Bj(t){var e=Ni(vc(t)),n=["absolute","fixed"].indexOf(Nn(t).position)>=0,r=n&&It(t)?Ms(t):t;return Qr(r)?e.filter(function(o){return Qr(o)&&Uw(o,r)&&fn(o)!=="body"}):[]}function Fj(t,e,n,r){var o=e==="clippingParents"?Bj(t):[].concat(e),i=[].concat(o,[n]),s=i[0],l=i.reduce(function(a,c){var u=Fg(t,c,r);return a.top=Wr(u.top,a.top),a.right=Ta(u.right,a.right),a.bottom=Ta(u.bottom,a.bottom),a.left=Wr(u.left,a.left),a},Fg(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Yw(t){var e=t.reference,n=t.element,r=t.placement,o=r?rn(r):null,i=r?Go(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(o){case ht:a={x:s,y:e.y-n.height};break;case Lt:a={x:s,y:e.y+e.height};break;case $t:a={x:e.x+e.width,y:l};break;case pt:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var c=o?Dh(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Wo:a[c]=a[c]-(e[u]/2-n[u]/2);break;case ts:a[c]=a[c]+(e[u]/2-n[u]/2);break}}return a}function ns(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,l=n.boundary,a=l===void 0?sj:l,c=n.rootBoundary,u=c===void 0?Hw:c,d=n.elementContext,f=d===void 0?pi:d,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,y=Gw(typeof g!="number"?g:qw(g,ks)),x=f===pi?lj:pi,S=t.rects.popper,b=t.elements[p?x:f],C=Fj(Qr(b)?b:b.contextElement||Tr(t.elements.popper),a,u,s),w=Ko(t.elements.reference),k=Yw({reference:w,element:S,strategy:"absolute",placement:o}),R=Vd(Object.assign({},S,k)),E=f===pi?R:w,O={top:C.top-E.top+y.top,bottom:E.bottom-C.bottom+y.bottom,left:C.left-E.left+y.left,right:E.right-C.right+y.right},I=t.modifiersData.offset;if(f===pi&&I){var L=I[o];Object.keys(O).forEach(function(H){var U=[$t,Lt].indexOf(H)>=0?1:-1,K=[ht,Lt].indexOf(H)>=0?"y":"x";O[H]+=L[K]*U})}return O}function jj(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,c=a===void 0?zw:a,u=Go(r),d=u?l?Pg:Pg.filter(function(p){return Go(p)===u}):ks,f=d.filter(function(p){return c.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,m){return p[m]=ns(t,{placement:m,boundary:o,rootBoundary:i,padding:s})[rn(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function Hj(t){if(rn(t)===Ah)return[];var e=wl(t);return[Bg(t),e,Bg(e)]}function zj(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!0:s,a=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,g=e.options.placement,y=rn(g),x=y===g,S=a||(x||!p?[wl(g)]:Hj(g)),b=[g].concat(S).reduce(function(De,de){return De.concat(rn(de)===Ah?jj(e,{placement:de,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):de)},[]),C=e.rects.reference,w=e.rects.popper,k=new Map,R=!0,E=b[0],O=0;O<b.length;O++){var I=b[O],L=rn(I),H=Go(I)===Wo,U=[ht,Lt].indexOf(L)>=0,K=U?"width":"height",j=ns(e,{placement:I,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),M=U?H?$t:pt:H?Lt:ht;C[K]>w[K]&&(M=wl(M));var N=wl(M),D=[];if(i&&D.push(j[L]<=0),l&&D.push(j[M]<=0,j[N]<=0),D.every(function(De){return De})){E=I,R=!1;break}k.set(I,D)}if(R)for(var z=p?3:1,Z=function(de){var he=b.find(function(Pe){var Be=k.get(Pe);if(Be)return Be.slice(0,de).every(function(Oe){return Oe})});if(he)return E=he,"break"},ne=z;ne>0;ne--){var Te=Z(ne);if(Te==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const Vj={name:"flip",enabled:!0,phase:"main",fn:zj,requiresIfExists:["offset"],data:{_skip:!1}};function jg(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Hg(t){return[ht,$t,Lt,pt].some(function(e){return t[e]>=0})}function Wj(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=ns(e,{elementContext:"reference"}),l=ns(e,{altBoundary:!0}),a=jg(s,r),c=jg(l,o,i),u=Hg(a),d=Hg(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Uj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Wj};function Kj(t,e,n){var r=rn(t),o=[pt,ht].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*o,[pt,$t].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function Gj(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=zw.reduce(function(u,d){return u[d]=Kj(d,e.rects,i),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const qj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gj};function Jj(t){var e=t.state,n=t.name;e.modifiersData[n]=Yw({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Yj={name:"popperOffsets",enabled:!0,phase:"read",fn:Jj,data:{}};function Xj(t){return t==="x"?"y":"x"}function Zj(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!1:s,a=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,m=p===void 0?0:p,g=ns(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),y=rn(e.placement),x=Go(e.placement),S=!x,b=Dh(y),C=Xj(b),w=e.modifiersData.popperOffsets,k=e.rects.reference,R=e.rects.popper,E=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,O=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),I=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(w){if(i){var H,U=b==="y"?ht:pt,K=b==="y"?Lt:$t,j=b==="y"?"height":"width",M=w[b],N=M+g[U],D=M-g[K],z=h?-R[j]/2:0,Z=x===Wo?k[j]:R[j],ne=x===Wo?-R[j]:-k[j],Te=e.elements.arrow,De=h&&Te?Nh(Te):{width:0,height:0},de=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Kw(),he=de[U],Pe=de[K],Be=Ri(0,k[j],De[j]),Oe=S?k[j]/2-z-Be-he-O.mainAxis:Z-Be-he-O.mainAxis,Ze=S?-k[j]/2+z+Be+Pe+O.mainAxis:ne+Be+Pe+O.mainAxis,Bt=e.elements.arrow&&Ms(e.elements.arrow),mn=Bt?b==="y"?Bt.clientTop||0:Bt.clientLeft||0:0,mt=(H=I==null?void 0:I[b])!=null?H:0,Ct=M+Oe-mt-mn,gn=M+Ze-mt,Fe=Ri(h?Ta(N,Ct):N,M,h?Wr(D,gn):D);w[b]=Fe,L[b]=Fe-M}if(l){var yn,Kt=b==="x"?ht:pt,Y=b==="x"?Lt:$t,Et=w[C],ve=C==="y"?"height":"width",ce=Et+g[Kt],kt=Et-g[Y],gt=[ht,pt].indexOf(y)!==-1,jn=(yn=I==null?void 0:I[C])!=null?yn:0,Hn=gt?ce:Et-k[ve]-R[ve]-jn+O.altAxis,F=gt?Et+k[ve]+R[ve]-jn-O.altAxis:kt,W=h&&gt?Sj(Hn,Et,F):Ri(h?Hn:ce,Et,h?F:kt);w[C]=W,L[C]=W-Et}e.modifiersData[r]=L}}const Qj={name:"preventOverflow",enabled:!0,phase:"main",fn:Zj,requiresIfExists:["offset"]};function eH(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function tH(t){return t===St(t)||!It(t)?_h(t):eH(t)}function nH(t){var e=t.getBoundingClientRect(),n=Uo(e.width)/t.offsetWidth||1,r=Uo(e.height)/t.offsetHeight||1;return n!==1||r!==1}function rH(t,e,n){n===void 0&&(n=!1);var r=It(e),o=It(e)&&nH(e),i=Tr(e),s=Ko(t,o,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((fn(e)!=="body"||Ph(i))&&(l=tH(e)),It(e)?(a=Ko(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):i&&(a.x=Ih(i))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function oH(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&o(a)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function iH(t){var e=oH(t);return yj.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function sH(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function lH(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var zg={placement:"bottom",modifiers:[],strategy:"absolute"};function Vg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function aH(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?zg:o;return function(l,a,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},zg,i),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(y){var x=typeof y=="function"?y(u.options):y;m(),u.options=Object.assign({},i,u.options,x),u.scrollParents={reference:Qr(l)?Ni(l):l.contextElement?Ni(l.contextElement):[],popper:Ni(a)};var S=iH(lH([].concat(r,u.options.modifiers)));return u.orderedModifiers=S.filter(function(b){return b.enabled}),p(),h.update()},forceUpdate:function(){if(!f){var y=u.elements,x=y.reference,S=y.popper;if(Vg(x,S)){u.rects={reference:rH(x,Ms(S),u.options.strategy==="fixed"),popper:Nh(S)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var C=u.orderedModifiers[b],w=C.fn,k=C.options,R=k===void 0?{}:k,E=C.name;typeof w=="function"&&(u=w({state:u,options:R,name:E,instance:h})||u)}}}},update:sH(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){m(),f=!0}};if(!Vg(l,a))return h;h.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function p(){u.orderedModifiers.forEach(function(g){var y=g.name,x=g.options,S=x===void 0?{}:x,b=g.effect;if(typeof b=="function"){var C=b({state:u,name:y,instance:h,options:S}),w=function(){};d.push(C||w)}})}function m(){d.forEach(function(g){return g()}),d=[]}return h}}var cH=[Dj,Yj,Rj,Vw,qj,Vj,Qj,Mj,Uj],uH=aH({defaultModifiers:cH}),dH="tippy-box",Xw="tippy-content",fH="tippy-backdrop",Zw="tippy-arrow",Qw="tippy-svg-arrow",Rr={passive:!0,capture:!0},ex=function(){return document.body};function hH(t,e){return{}.hasOwnProperty.call(t,e)}function gu(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Lh(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function tx(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Wg(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function pH(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function mH(t){return t.split(/\s+/).filter(Boolean)}function Co(t){return[].concat(t)}function Ug(t,e){t.indexOf(e)===-1&&t.push(e)}function gH(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function yH(t){return t.split("-")[0]}function Oa(t){return[].slice.call(t)}function Kg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Di(){return document.createElement("div")}function rs(t){return["Element","Fragment"].some(function(e){return Lh(t,e)})}function bH(t){return Lh(t,"NodeList")}function vH(t){return Lh(t,"MouseEvent")}function wH(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function xH(t){return rs(t)?[t]:bH(t)?Oa(t):Array.isArray(t)?t:Oa(document.querySelectorAll(t))}function yu(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Gg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function SH(t){var e,n=Co(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function CH(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,l=o.props,a=l.interactiveBorder,c=yH(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,m=i.top-r+d>a,g=r-i.bottom-f>a,y=i.left-n+h>a,x=n-i.right-p>a;return m||g||y||x})}function bu(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function qg(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Zt={isTouch:!1},Jg=0;function EH(){Zt.isTouch||(Zt.isTouch=!0,window.performance&&document.addEventListener("mousemove",nx))}function nx(){var t=performance.now();t-Jg<20&&(Zt.isTouch=!1,document.removeEventListener("mousemove",nx)),Jg=t}function kH(){var t=document.activeElement;if(wH(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function MH(){document.addEventListener("touchstart",EH,Rr),window.addEventListener("blur",kH)}var TH=typeof window<"u"&&typeof document<"u",OH=TH?!!window.msCrypto:!1;function vo(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Yg(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function AH(t){return Yg(`
463
+ 3. "-" cannot repeat`);Me.customSchemes.push([t,e])}function dF(){Me.scanner=nF(Me.customSchemes);for(let t=0;t<Me.tokenQueue.length;t++)Me.tokenQueue[t][1]({scanner:Me.scanner});Me.parser=sF(Me.scanner.tokens);for(let t=0;t<Me.pluginQueue.length;t++)Me.pluginQueue[t][1]({scanner:Me.scanner,parser:Me.parser});Me.initialized=!0}function Aw(t){return Me.initialized||dF(),lF(Me.parser.start,t,rF(Me.scanner.start,t))}function Rw(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Th(n),o=Aw(t),i=[];for(let s=0;s<o.length;s++){const l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}function fF(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function hF(t){return new ke({key:new we("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,l=_M(n.doc,[...e]);if(HM(l).forEach(({newRange:c})=>{const u=PM(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const h=f.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=d.pos+f.lastIndexOf(p);if(!p)return!1;const g=Aw(p).map(y=>y.toObject(t.defaultProtocol));if(!fF(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).forEach(y=>{Nf(y.from,y.to,r.doc).some(w=>w.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function pF(t){return new ke({key:new we("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=b0(e.state,t.type.name),c=r.target,u=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:a.href,d=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:a.target;return c&&u?(window.open(u,d),!0):!1}}})}function mF(t){return new ke({key:new we("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=Rw(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(t.editor.commands.setMark(t.type,{href:a.href}),!0)}}})}const gF=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,yF=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Dg(t){return!t||t.replace(gF,"").match(yF)}const bF=nt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Ng(t);return}Ng(t.scheme,t.optionalSlashes)})},onDestroy(){uF()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!Dg(e)?!1:null}}]},renderHTML({HTMLAttributes:t}){return Dg(t.href)?["a",le(this.options.HTMLAttributes,t),0]:["a",le(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[fr({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=Rw(t).filter(o=>o.isLink&&n(o.value));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(hF({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(pF({type:this.type})),this.options.linkOnPaste&&t.push(mF({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var vF="Label",Nw=v.forwardRef((t,e)=>T.jsx(ge.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Nw.displayName=vF;var wF=Nw;function xF(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Oh="Switch",[SF,N4]=In(Oh),[CF,EF]=SF(Oh),Dw=v.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:l,value:a="on",onCheckedChange:c,...u}=t,[d,f]=v.useState(null),h=$e(e,w=>f(w)),p=v.useRef(!1),m=d?!!d.closest("form"):!0,[g=!1,y]=Er({prop:o,defaultProp:i,onChange:c});return T.jsxs(CF,{scope:n,checked:g,disabled:l,children:[T.jsx(ge.button,{type:"button",role:"switch","aria-checked":g,"aria-required":s,"data-state":Pw(g),"data-disabled":l?"":void 0,disabled:l,value:a,...u,ref:h,onClick:ee(t.onClick,w=>{y(S=>!S),m&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),m&&T.jsx(kF,{control:d,bubbles:!p.current,name:r,value:a,checked:g,required:s,disabled:l,style:{transform:"translateX(-100%)"}})]})});Dw.displayName=Oh;var _w="SwitchThumb",Iw=v.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=EF(_w,n);return T.jsx(ge.span,{"data-state":Pw(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:e})});Iw.displayName=_w;var kF=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=v.useRef(null),s=xF(n),l=U0(e);return v.useEffect(()=>{const a=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(a,n),a.dispatchEvent(f)}},[s,n,r]),T.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Pw(t){return t?"checked":"unchecked"}var MF=Dw,TF=Iw;const OF=Ne.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",le(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):w0(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:l})=>{var a;if(l){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(Z.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(Y.create(s.doc,c.pos)):s.setSelection(Z.create(s.doc,c.pos));else{const d=(a=c.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(s.insert(u,d),s.setSelection(Z.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[x0({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var ka=200,We=function(){};We.prototype.append=function(e){return e.length?(e=We.from(e),!this.length&&e||e.length<ka&&this.leafAppend(e)||this.length<ka&&e.leafPrepend(this)||this.appendInner(e)):this};We.prototype.prepend=function(e){return e.length?We.from(e).append(this):this};We.prototype.appendInner=function(e){return new AF(this,e)};We.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?We.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};We.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};We.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};We.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o};We.from=function(e){return e instanceof We?e:e&&e.length?new Lw(e):We.empty};var Lw=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,l){for(var a=i;a<s;a++)if(o(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,l){for(var a=i-1;a>=s;a--)if(o(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=ka)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=ka)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(We);We.empty=new Lw([]);var AF=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(i,l),s)===!1||i>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,i)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(i,l)-l,s+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(o,l),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(We);const RF=500;class Ht{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Un(d.map));let h=d.step.map(o.slice(i)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Un(p,void 0,void 0,c.length+u.length))),i--,p&&o.appendMap(p,i)}else s.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(i)):d.selection,a=new Ht(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,o){let i=[],s=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Un(e.mapping.maps[u],d,n),h;(h=a&&a.merge(f))&&(f=h,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),n&&(s++,n=void 0),o||(a=f)}let c=s-r.depth;return c>DF&&(l=NF(l,c),s-=c),new Ht(l.append(i),s)}remapping(e,n){let r=new Mo;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ht(this.items.append(e.map(n=>new Un(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=i.getMirror(--a);if(h==null)return;s=Math.min(s,h);let p=i.maps[h];if(f.step){let m=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(i.slice(a+1,h));g&&l++,r.push(new Un(p,m,g))}else r.push(new Un(p))},o);let c=[];for(let f=n;f<s;f++)c.push(new Un(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Ht(u,l);return d.emptyItemCount()>RF&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,l)=>{if(l>=e)o.push(s),s.selection&&i++;else if(s.step){let a=s.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Un(c.invert(),a,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new Ht(We.from(o.reverse()),i)}}Ht.empty=new Ht(We.empty,0);function NF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let Un=class $w{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new $w(n.getMap().invert(),n,this.selection)}}};class Zn{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const DF=20;function _F(t,e,n,r){let o=n.getMeta(zr),i;if(o)return o.historyState;n.getMeta(LF)&&(t=new Zn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(zr))return s.getMeta(zr).redo?new Zn(t.done.addTransform(n,void 0,r,bl(e)),t.undone,_g(n.mapping.maps),t.prevTime,t.prevComposition):new Zn(t.done,t.undone.addTransform(n,void 0,r,bl(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!IF(n,t.prevRanges)),c=s?mu(t.prevRanges,n.mapping):_g(n.mapping.maps);return new Zn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,bl(e)),Ht.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Zn(t.done.rebased(n,i),t.undone.rebased(n,i),mu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Zn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),mu(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function IF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function _g(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function mu(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function PF(t,e,n){let r=bl(e),o=zr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),a=new Zn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(zr,{redo:n,historyState:a})}let gu=!1,Ig=null;function bl(t){let e=t.plugins;if(Ig!=e){gu=!1,Ig=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){gu=!0;break}}return gu}const zr=new we("history"),LF=new we("closeHistory");function $F(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ke({key:zr,state:{init(){return new Zn(Ht.empty,Ht.empty,null,0,-1)},apply(e,n,r){return _F(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?Fw:r=="historyRedo"?jw:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function Bw(t,e){return(n,r)=>{let o=zr.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=PF(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const Fw=Bw(!1,!0),jw=Bw(!0,!0),BF=Ie.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Fw(t,e),redo:()=>({state:t,dispatch:e})=>jw(t,e)}},addProseMirrorPlugins(){return[$F(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),FF=Ie.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize"}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return((t==null?void 0:t.mode)||this.options.mode)==="textSize"?e.textBetween(0,e.content.size,void 0," ").length:e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return e.textBetween(0,e.content.size," "," ").split(" ").filter(o=>o!=="").length}},addProseMirrorPlugins(){return[new ke({key:new we("characterCount"),filterTransaction:(t,e)=>{const n=this.options.limit;if(!t.docChanged||n===0||n===null||n===void 0)return!0;const r=this.storage.characters({node:e.doc}),o=this.storage.characters({node:t.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r||!t.getMeta("paste"))return!1;const s=t.selection.$head.pos,l=o-n,a=s-l,c=s;return t.deleteRange(a,c),!(this.storage.characters({node:t.doc})>n)}})]}}),jF=Ne.create({name:"doc",topNode:!0,content:"block+"});function HF(t={}){return new ke({view(e){return new zF(e,t)}})}class zF{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let l=o.getBoundingClientRect();i=l.left-o.scrollLeft,s=l.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=gb(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const VF=Ie.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[HF(this.options)]}}),WF=Ie.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ke({key:new we("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,i=[];if(!n||!r)return me.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(a.isText)return;if(!(o>=c&&o<=c+a.nodeSize-1))return!1;s+=1});let l=0;return t.descendants((a,c)=>{if(a.isText||!(o>=c&&o<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(Le.node(c,c+a.nodeSize,{class:this.options.className}))}),me.create(t,i)}}})]}});class Ae extends Q{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ae.valid(r)?new Ae(r):Q.near(r)}content(){return B.empty}eq(e){return e instanceof Ae&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ae(e.resolve(n.pos))}getBookmark(){return new Ah(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!UF(e)||!KF(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ae.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)<l.childCount:e.index(s)>0){i=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let a=e.doc.resolve(o);if(Ae.valid(a))return a}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Y.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let l=e.doc.resolve(o);if(Ae.valid(l))return l}return null}}}Ae.prototype.visible=!1;Ae.findFrom=Ae.findGapCursorFrom;Q.jsonID("gapcursor",Ae);class Ah{constructor(e){this.pos=e}map(e){return new Ah(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ae.valid(n)?new Ae(n):Q.near(n)}}function UF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function KF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function GF(){return new ke({props:{decorations:XF,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ae.valid(n)?new Ae(n):null},handleClick:JF,handleKeyDown:qF,handleDOMEvents:{beforeinput:YF}}})}const qF=kf({ArrowLeft:Zs("horiz",-1),ArrowRight:Zs("horiz",1),ArrowUp:Zs("vert",-1),ArrowDown:Zs("vert",1)});function Zs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof Z){if(!i.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ae.findGapCursorFrom(l,e,a);return c?(o&&o(r.tr.setSelection(new Ae(c))),!0):!1}}function JF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ae.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Y.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ae(r))),!0)}function YF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ae))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=I.empty;for(let s=r.length-1;s>=0;s--)o=I.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new B(o,0,0));return i.setSelection(Z.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function XF(t){if(!(t.selection instanceof Ae))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",me.create(t.doc,[Le.widget(t.selection.head,e,{key:"gapcursor"})])}const ZF=Ie.create({name:"gapCursor",addProseMirrorPlugins(){return[GF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ie(V(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),QF=Ne.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",le(this.options.HTMLAttributes,t)]},renderText(){return`
464
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ej=Ne.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",le(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),tj=Ne.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nj=Ie.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ke({key:new we("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((s,l)=>{const a=r>=l&&r<=l+s.nodeSize,c=!s.isLeaf&&Df(s);if((a||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];i&&u.push(this.options.emptyEditorClass);const d=Le.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:a}):this.options.placeholder});o.push(d)}return this.options.includeChildren}),me.create(t,o)}}})]}}),rj=Ne.create({name:"text",group:"inline"}),oj=nt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),ij=nt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",le(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var ht="top",Lt="bottom",$t="right",pt="left",Rh="auto",ks=[ht,Lt,$t,pt],Wo="start",ts="end",sj="clippingParents",Hw="viewport",pi="popper",lj="reference",Pg=ks.reduce(function(t,e){return t.concat([e+"-"+Wo,e+"-"+ts])},[]),zw=[].concat(ks,[Rh]).reduce(function(t,e){return t.concat([e,e+"-"+Wo,e+"-"+ts])},[]),aj="beforeRead",cj="read",uj="afterRead",dj="beforeMain",fj="main",hj="afterMain",pj="beforeWrite",mj="write",gj="afterWrite",yj=[aj,cj,uj,dj,fj,hj,pj,mj,gj];function fn(t){return t?(t.nodeName||"").toLowerCase():null}function St(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Zr(t){var e=St(t).Element;return t instanceof e||t instanceof Element}function It(t){var e=St(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Nh(t){if(typeof ShadowRoot>"u")return!1;var e=St(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function bj(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!It(i)||!fn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var l=o[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function vj(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!It(o)||!fn(o)||(Object.assign(o.style,l),Object.keys(i).forEach(function(a){o.removeAttribute(a)}))})}}const Vw={name:"applyStyles",enabled:!0,phase:"write",fn:bj,effect:vj,requires:["computeStyles"]};function rn(t){return t.split("-")[0]}var Vr=Math.max,Ma=Math.min,Uo=Math.round;function Vd(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ww(){return!/^((?!chrome|android).)*safari/i.test(Vd())}function Ko(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&It(t)&&(o=t.offsetWidth>0&&Uo(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Uo(r.height)/t.offsetHeight||1);var s=Zr(t)?St(t):window,l=s.visualViewport,a=!Ww()&&n,c=(r.left+(a&&l?l.offsetLeft:0))/o,u=(r.top+(a&&l?l.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Dh(t){var e=Ko(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Uw(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Nh(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Nn(t){return St(t).getComputedStyle(t)}function wj(t){return["table","td","th"].indexOf(fn(t))>=0}function Tr(t){return((Zr(t)?t.ownerDocument:t.document)||window.document).documentElement}function bc(t){return fn(t)==="html"?t:t.assignedSlot||t.parentNode||(Nh(t)?t.host:null)||Tr(t)}function Lg(t){return!It(t)||Nn(t).position==="fixed"?null:t.offsetParent}function xj(t){var e=/firefox/i.test(Vd()),n=/Trident/i.test(Vd());if(n&&It(t)){var r=Nn(t);if(r.position==="fixed")return null}var o=bc(t);for(Nh(o)&&(o=o.host);It(o)&&["html","body"].indexOf(fn(o))<0;){var i=Nn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Ms(t){for(var e=St(t),n=Lg(t);n&&wj(n)&&Nn(n).position==="static";)n=Lg(n);return n&&(fn(n)==="html"||fn(n)==="body"&&Nn(n).position==="static")?e:n||xj(t)||e}function _h(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ri(t,e,n){return Vr(t,Ma(e,n))}function Sj(t,e,n){var r=Ri(t,e,n);return r>n?n:r}function Kw(){return{top:0,right:0,bottom:0,left:0}}function Gw(t){return Object.assign({},Kw(),t)}function qw(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Cj=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Gw(typeof e!="number"?e:qw(e,ks))};function Ej(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=rn(n.placement),a=_h(l),c=[pt,$t].indexOf(l)>=0,u=c?"height":"width";if(!(!i||!s)){var d=Cj(o.padding,n),f=Dh(i),h=a==="y"?ht:pt,p=a==="y"?Lt:$t,m=n.rects.reference[u]+n.rects.reference[a]-s[a]-n.rects.popper[u],g=s[a]-n.rects.reference[a],y=Ms(i),w=y?a==="y"?y.clientHeight||0:y.clientWidth||0:0,S=m/2-g/2,b=d[h],C=w-f[u]-d[p],x=w/2-f[u]/2+S,k=Ri(b,x,C),A=a;n.modifiersData[r]=(e={},e[A]=k,e.centerOffset=k-x,e)}}function kj(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||Uw(e.elements.popper,o)&&(e.elements.arrow=o))}const Mj={name:"arrow",enabled:!0,phase:"main",fn:Ej,effect:kj,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Go(t){return t.split("-")[1]}var Tj={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Oj(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Uo(n*o)/o||0,y:Uo(r*o)/o||0}}function $g(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,l=t.position,a=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,h=f===void 0?0:f,p=s.y,m=p===void 0?0:p,g=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),S=pt,b=ht,C=window;if(c){var x=Ms(n),k="clientHeight",A="clientWidth";if(x===St(n)&&(x=Tr(n),Nn(x).position!=="static"&&l==="absolute"&&(k="scrollHeight",A="scrollWidth")),x=x,o===ht||(o===pt||o===$t)&&i===ts){b=Lt;var E=d&&x===C&&C.visualViewport?C.visualViewport.height:x[k];m-=E-r.height,m*=a?1:-1}if(o===pt||(o===ht||o===Lt)&&i===ts){S=$t;var O=d&&x===C&&C.visualViewport?C.visualViewport.width:x[A];h-=O-r.width,h*=a?1:-1}}var _=Object.assign({position:l},c&&Tj),L=u===!0?Oj({x:h,y:m},St(n)):{x:h,y:m};if(h=L.x,m=L.y,a){var H;return Object.assign({},_,(H={},H[b]=w?"0":"",H[S]=y?"0":"",H.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",H))}return Object.assign({},_,(e={},e[b]=w?m+"px":"",e[S]=y?h+"px":"",e.transform="",e))}function Aj(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,a=l===void 0?!0:l,c={placement:rn(e.placement),variation:Go(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$g(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$g(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Rj={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Aj,data:{}};var Qs={passive:!0};function Nj(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,l=s===void 0?!0:s,a=St(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Qs)}),l&&a.addEventListener("resize",n.update,Qs),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Qs)}),l&&a.removeEventListener("resize",n.update,Qs)}}const Dj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Nj,data:{}};var _j={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(t){return t.replace(/left|right|bottom|top/g,function(e){return _j[e]})}var Ij={start:"end",end:"start"};function Bg(t){return t.replace(/start|end/g,function(e){return Ij[e]})}function Ih(t){var e=St(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ph(t){return Ko(Tr(t)).left+Ih(t).scrollLeft}function Pj(t,e){var n=St(t),r=Tr(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;var c=Ww();(c||!c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:s,x:l+Ph(t),y:a}}function Lj(t){var e,n=Tr(t),r=Ih(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=Vr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Vr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+Ph(t),a=-r.scrollTop;return Nn(o||n).direction==="rtl"&&(l+=Vr(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:l,y:a}}function Lh(t){var e=Nn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Jw(t){return["html","body","#document"].indexOf(fn(t))>=0?t.ownerDocument.body:It(t)&&Lh(t)?t:Jw(bc(t))}function Ni(t,e){var n;e===void 0&&(e=[]);var r=Jw(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=St(r),s=o?[i].concat(i.visualViewport||[],Lh(r)?r:[]):r,l=e.concat(s);return o?l:l.concat(Ni(bc(s)))}function Wd(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $j(t,e){var n=Ko(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Fg(t,e,n){return e===Hw?Wd(Pj(t,n)):Zr(e)?$j(e,n):Wd(Lj(Tr(t)))}function Bj(t){var e=Ni(bc(t)),n=["absolute","fixed"].indexOf(Nn(t).position)>=0,r=n&&It(t)?Ms(t):t;return Zr(r)?e.filter(function(o){return Zr(o)&&Uw(o,r)&&fn(o)!=="body"}):[]}function Fj(t,e,n,r){var o=e==="clippingParents"?Bj(t):[].concat(e),i=[].concat(o,[n]),s=i[0],l=i.reduce(function(a,c){var u=Fg(t,c,r);return a.top=Vr(u.top,a.top),a.right=Ma(u.right,a.right),a.bottom=Ma(u.bottom,a.bottom),a.left=Vr(u.left,a.left),a},Fg(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Yw(t){var e=t.reference,n=t.element,r=t.placement,o=r?rn(r):null,i=r?Go(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(o){case ht:a={x:s,y:e.y-n.height};break;case Lt:a={x:s,y:e.y+e.height};break;case $t:a={x:e.x+e.width,y:l};break;case pt:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var c=o?_h(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Wo:a[c]=a[c]-(e[u]/2-n[u]/2);break;case ts:a[c]=a[c]+(e[u]/2-n[u]/2);break}}return a}function ns(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,l=n.boundary,a=l===void 0?sj:l,c=n.rootBoundary,u=c===void 0?Hw:c,d=n.elementContext,f=d===void 0?pi:d,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,y=Gw(typeof g!="number"?g:qw(g,ks)),w=f===pi?lj:pi,S=t.rects.popper,b=t.elements[p?w:f],C=Fj(Zr(b)?b:b.contextElement||Tr(t.elements.popper),a,u,s),x=Ko(t.elements.reference),k=Yw({reference:x,element:S,strategy:"absolute",placement:o}),A=Wd(Object.assign({},S,k)),E=f===pi?A:x,O={top:C.top-E.top+y.top,bottom:E.bottom-C.bottom+y.bottom,left:C.left-E.left+y.left,right:E.right-C.right+y.right},_=t.modifiersData.offset;if(f===pi&&_){var L=_[o];Object.keys(O).forEach(function(H){var U=[$t,Lt].indexOf(H)>=0?1:-1,K=[ht,Lt].indexOf(H)>=0?"y":"x";O[H]+=L[K]*U})}return O}function jj(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,c=a===void 0?zw:a,u=Go(r),d=u?l?Pg:Pg.filter(function(p){return Go(p)===u}):ks,f=d.filter(function(p){return c.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,m){return p[m]=ns(t,{placement:m,boundary:o,rootBoundary:i,padding:s})[rn(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function Hj(t){if(rn(t)===Rh)return[];var e=vl(t);return[Bg(t),e,Bg(e)]}function zj(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!0:s,a=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,g=e.options.placement,y=rn(g),w=y===g,S=a||(w||!p?[vl(g)]:Hj(g)),b=[g].concat(S).reduce(function(De,de){return De.concat(rn(de)===Rh?jj(e,{placement:de,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):de)},[]),C=e.rects.reference,x=e.rects.popper,k=new Map,A=!0,E=b[0],O=0;O<b.length;O++){var _=b[O],L=rn(_),H=Go(_)===Wo,U=[ht,Lt].indexOf(L)>=0,K=U?"width":"height",j=ns(e,{placement:_,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),M=U?H?$t:pt:H?Lt:ht;C[K]>x[K]&&(M=vl(M));var N=vl(M),D=[];if(i&&D.push(j[L]<=0),l&&D.push(j[M]<=0,j[N]<=0),D.every(function(De){return De})){E=_,A=!1;break}k.set(_,D)}if(A)for(var z=p?3:1,J=function(de){var he=b.find(function(Pe){var Be=k.get(Pe);if(Be)return Be.slice(0,de).every(function(Oe){return Oe})});if(he)return E=he,"break"},se=z;se>0;se--){var Te=J(se);if(Te==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const Vj={name:"flip",enabled:!0,phase:"main",fn:zj,requiresIfExists:["offset"],data:{_skip:!1}};function jg(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Hg(t){return[ht,$t,Lt,pt].some(function(e){return t[e]>=0})}function Wj(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=ns(e,{elementContext:"reference"}),l=ns(e,{altBoundary:!0}),a=jg(s,r),c=jg(l,o,i),u=Hg(a),d=Hg(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Uj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Wj};function Kj(t,e,n){var r=rn(t),o=[pt,ht].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*o,[pt,$t].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function Gj(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=zw.reduce(function(u,d){return u[d]=Kj(d,e.rects,i),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const qj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gj};function Jj(t){var e=t.state,n=t.name;e.modifiersData[n]=Yw({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Yj={name:"popperOffsets",enabled:!0,phase:"read",fn:Jj,data:{}};function Xj(t){return t==="x"?"y":"x"}function Zj(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!1:s,a=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,m=p===void 0?0:p,g=ns(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),y=rn(e.placement),w=Go(e.placement),S=!w,b=_h(y),C=Xj(b),x=e.modifiersData.popperOffsets,k=e.rects.reference,A=e.rects.popper,E=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,O=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(x){if(i){var H,U=b==="y"?ht:pt,K=b==="y"?Lt:$t,j=b==="y"?"height":"width",M=x[b],N=M+g[U],D=M-g[K],z=h?-A[j]/2:0,J=w===Wo?k[j]:A[j],se=w===Wo?-A[j]:-k[j],Te=e.elements.arrow,De=h&&Te?Dh(Te):{width:0,height:0},de=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Kw(),he=de[U],Pe=de[K],Be=Ri(0,k[j],De[j]),Oe=S?k[j]/2-z-Be-he-O.mainAxis:J-Be-he-O.mainAxis,Ze=S?-k[j]/2+z+Be+Pe+O.mainAxis:se+Be+Pe+O.mainAxis,Bt=e.elements.arrow&&Ms(e.elements.arrow),mn=Bt?b==="y"?Bt.clientTop||0:Bt.clientLeft||0:0,mt=(H=_==null?void 0:_[b])!=null?H:0,Ct=M+Oe-mt-mn,gn=M+Ze-mt,Fe=Ri(h?Ma(N,Ct):N,M,h?Vr(D,gn):D);x[b]=Fe,L[b]=Fe-M}if(l){var yn,Kt=b==="x"?ht:pt,X=b==="x"?Lt:$t,Et=x[C],ve=C==="y"?"height":"width",ce=Et+g[Kt],kt=Et-g[X],gt=[ht,pt].indexOf(y)!==-1,jn=(yn=_==null?void 0:_[C])!=null?yn:0,Hn=gt?ce:Et-k[ve]-A[ve]-jn+O.altAxis,F=gt?Et+k[ve]+A[ve]-jn-O.altAxis:kt,W=h&&gt?Sj(Hn,Et,F):Ri(h?Hn:ce,Et,h?F:kt);x[C]=W,L[C]=W-Et}e.modifiersData[r]=L}}const Qj={name:"preventOverflow",enabled:!0,phase:"main",fn:Zj,requiresIfExists:["offset"]};function eH(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function tH(t){return t===St(t)||!It(t)?Ih(t):eH(t)}function nH(t){var e=t.getBoundingClientRect(),n=Uo(e.width)/t.offsetWidth||1,r=Uo(e.height)/t.offsetHeight||1;return n!==1||r!==1}function rH(t,e,n){n===void 0&&(n=!1);var r=It(e),o=It(e)&&nH(e),i=Tr(e),s=Ko(t,o,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((fn(e)!=="body"||Lh(i))&&(l=tH(e)),It(e)?(a=Ko(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):i&&(a.x=Ph(i))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function oH(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&o(a)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function iH(t){var e=oH(t);return yj.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function sH(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function lH(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var zg={placement:"bottom",modifiers:[],strategy:"absolute"};function Vg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function aH(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?zg:o;return function(l,a,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},zg,i),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(y){var w=typeof y=="function"?y(u.options):y;m(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:Zr(l)?Ni(l):l.contextElement?Ni(l.contextElement):[],popper:Ni(a)};var S=iH(lH([].concat(r,u.options.modifiers)));return u.orderedModifiers=S.filter(function(b){return b.enabled}),p(),h.update()},forceUpdate:function(){if(!f){var y=u.elements,w=y.reference,S=y.popper;if(Vg(w,S)){u.rects={reference:rH(w,Ms(S),u.options.strategy==="fixed"),popper:Dh(S)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var C=u.orderedModifiers[b],x=C.fn,k=C.options,A=k===void 0?{}:k,E=C.name;typeof x=="function"&&(u=x({state:u,options:A,name:E,instance:h})||u)}}}},update:sH(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){m(),f=!0}};if(!Vg(l,a))return h;h.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function p(){u.orderedModifiers.forEach(function(g){var y=g.name,w=g.options,S=w===void 0?{}:w,b=g.effect;if(typeof b=="function"){var C=b({state:u,name:y,instance:h,options:S}),x=function(){};d.push(C||x)}})}function m(){d.forEach(function(g){return g()}),d=[]}return h}}var cH=[Dj,Yj,Rj,Vw,qj,Vj,Qj,Mj,Uj],uH=aH({defaultModifiers:cH}),dH="tippy-box",Xw="tippy-content",fH="tippy-backdrop",Zw="tippy-arrow",Qw="tippy-svg-arrow",Rr={passive:!0,capture:!0},ex=function(){return document.body};function hH(t,e){return{}.hasOwnProperty.call(t,e)}function yu(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function $h(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function tx(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Wg(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function pH(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function mH(t){return t.split(/\s+/).filter(Boolean)}function So(t){return[].concat(t)}function Ug(t,e){t.indexOf(e)===-1&&t.push(e)}function gH(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function yH(t){return t.split("-")[0]}function Ta(t){return[].slice.call(t)}function Kg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Di(){return document.createElement("div")}function rs(t){return["Element","Fragment"].some(function(e){return $h(t,e)})}function bH(t){return $h(t,"NodeList")}function vH(t){return $h(t,"MouseEvent")}function wH(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function xH(t){return rs(t)?[t]:bH(t)?Ta(t):Array.isArray(t)?t:Ta(document.querySelectorAll(t))}function bu(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Gg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function SH(t){var e,n=So(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function CH(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,l=o.props,a=l.interactiveBorder,c=yH(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,m=i.top-r+d>a,g=r-i.bottom-f>a,y=i.left-n+h>a,w=n-i.right-p>a;return m||g||y||w})}function vu(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function qg(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Zt={isTouch:!1},Jg=0;function EH(){Zt.isTouch||(Zt.isTouch=!0,window.performance&&document.addEventListener("mousemove",nx))}function nx(){var t=performance.now();t-Jg<20&&(Zt.isTouch=!1,document.removeEventListener("mousemove",nx)),Jg=t}function kH(){var t=document.activeElement;if(wH(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function MH(){document.addEventListener("touchstart",EH,Rr),window.addEventListener("blur",kH)}var TH=typeof window<"u"&&typeof document<"u",OH=TH?!!window.msCrypto:!1;function bo(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Yg(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function AH(t){return Yg(`
465
465
  %ctippy.js
466
466
 
467
467
  %c`+Yg(t)+`
468
468
 
469
469
  %c👷‍ This is a development-only message. It will be removed in production.
470
- `)}function rx(t){return[AH(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var is;process.env.NODE_ENV!=="production"&&RH();function RH(){is=new Set}function En(t,e){if(t&&!is.has(e)){var n;is.add(e),(n=console).warn.apply(n,rx(e))}}function Wd(t,e){if(t&&!is.has(e)){var n;is.add(e),(n=console).error.apply(n,rx(e))}}function NH(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Wd(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Wd(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var ox={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},DH={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},wt=Object.assign({appendTo:ex,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},ox,DH),_H=Object.keys(wt),IH=function(e){process.env.NODE_ENV!=="production"&&sx(e,[]);var n=Object.keys(e);n.forEach(function(r){wt[r]=e[r]})};function ix(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var l;r[i]=t[i]!==void 0?t[i]:(l=wt[i])!=null?l:s}return r},{});return Object.assign({},t,n)}function PH(t,e){var n=e?Object.keys(ix(Object.assign({},wt,{plugins:e}))):_H,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function Xg(t,e){var n=Object.assign({},e,{content:tx(e.content,[t])},e.ignoreAttributes?{}:PH(t,e.plugins));return n.aria=Object.assign({},wt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function sx(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=pH(wt,Object.keys(ox)),i=!hH(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),En(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
470
+ `)}function rx(t){return[AH(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var is;process.env.NODE_ENV!=="production"&&RH();function RH(){is=new Set}function En(t,e){if(t&&!is.has(e)){var n;is.add(e),(n=console).warn.apply(n,rx(e))}}function Ud(t,e){if(t&&!is.has(e)){var n;is.add(e),(n=console).error.apply(n,rx(e))}}function NH(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Ud(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ud(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var ox={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},DH={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},wt=Object.assign({appendTo:ex,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},ox,DH),_H=Object.keys(wt),IH=function(e){process.env.NODE_ENV!=="production"&&sx(e,[]);var n=Object.keys(e);n.forEach(function(r){wt[r]=e[r]})};function ix(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var l;r[i]=t[i]!==void 0?t[i]:(l=wt[i])!=null?l:s}return r},{});return Object.assign({},t,n)}function PH(t,e){var n=e?Object.keys(ix(Object.assign({},wt,{plugins:e}))):_H,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function Xg(t,e){var n=Object.assign({},e,{content:tx(e.content,[t])},e.ignoreAttributes?{}:PH(t,e.plugins));return n.aria=Object.assign({},wt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function sx(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=pH(wt,Object.keys(ox)),i=!hH(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),En(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
471
471
 
472
472
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
473
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var LH=function(){return"innerHTML"};function Ud(t,e){t[LH()]=e}function Zg(t){var e=Di();return t===!0?e.className=Zw:(e.className=Qw,rs(t)?e.appendChild(t):Ud(e,t)),e}function Qg(t,e){rs(e.content)?(Ud(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ud(t,e.content):t.textContent=e.content)}function Kd(t){var e=t.firstElementChild,n=Oa(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Xw)}),arrow:n.find(function(r){return r.classList.contains(Zw)||r.classList.contains(Qw)}),backdrop:n.find(function(r){return r.classList.contains(fH)})}}function lx(t){var e=Di(),n=Di();n.className=dH,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Di();r.className=Xw,r.setAttribute("data-state","hidden"),Qg(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var l=Kd(e),a=l.box,c=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Qg(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(a.removeChild(u),a.appendChild(Zg(s.arrow))):a.appendChild(Zg(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:o}}lx.$$tippy=!0;var $H=1,tl=[],vu=[];function BH(t,e){var n=Xg(t,Object.assign({},wt,ix(Kg(e)))),r,o,i,s=!1,l=!1,a=!1,c=!1,u,d,f,h=[],p=Wg(Ct,n.interactiveDebounce),m,g=$H++,y=null,x=gH(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:t,popper:Di(),popperInstance:y,props:n,state:S,plugins:x,clearDelayTimeouts:Hn,setProps:F,setContent:W,show:re,hide:ue,hideWithInteractivity:je,enable:gt,disable:jn,unmount:Ft,destroy:Mc};if(!n.render)return process.env.NODE_ENV!=="production"&&Wd(!0,"render() function has not been supplied."),b;var C=n.render(b),w=C.popper,k=C.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,t._tippy=b,w._tippy=b;var R=x.map(function(A){return A.fn(b)}),E=t.hasAttribute("aria-expanded");return Bt(),z(),M(),N("onCreate",[b]),n.showOnCreate&&ce(),w.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",p)}),b;function O(){var A=b.props.touch;return Array.isArray(A)?A:[A,0]}function I(){return O()[0]==="hold"}function L(){var A;return!!((A=b.props.render)!=null&&A.$$tippy)}function H(){return m||t}function U(){var A=H().parentNode;return A?SH(A):document}function K(){return Kd(w)}function j(A){return b.state.isMounted&&!b.state.isVisible||Zt.isTouch||u&&u.type==="focus"?0:gu(b.props.delay,A?0:1,wt.delay)}function M(A){A===void 0&&(A=!1),w.style.pointerEvents=b.props.interactive&&!A?"":"none",w.style.zIndex=""+b.props.zIndex}function N(A,G,te){if(te===void 0&&(te=!0),R.forEach(function(ae){ae[A]&&ae[A].apply(ae,G)}),te){var fe;(fe=b.props)[A].apply(fe,G)}}function D(){var A=b.props.aria;if(A.content){var G="aria-"+A.content,te=w.id,fe=Co(b.props.triggerTarget||t);fe.forEach(function(ae){var st=ae.getAttribute(G);if(b.state.isVisible)ae.setAttribute(G,st?st+" "+te:te);else{var Mt=st&&st.replace(te,"").trim();Mt?ae.setAttribute(G,Mt):ae.removeAttribute(G)}})}}function z(){if(!(E||!b.props.aria.expanded)){var A=Co(b.props.triggerTarget||t);A.forEach(function(G){b.props.interactive?G.setAttribute("aria-expanded",b.state.isVisible&&G===H()?"true":"false"):G.removeAttribute("aria-expanded")})}}function Z(){U().removeEventListener("mousemove",p),tl=tl.filter(function(A){return A!==p})}function ne(A){if(!(Zt.isTouch&&(a||A.type==="mousedown"))){var G=A.composedPath&&A.composedPath()[0]||A.target;if(!(b.props.interactive&&qg(w,G))){if(Co(b.props.triggerTarget||t).some(function(te){return qg(te,G)})){if(Zt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[b,A]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||he())}}}function Te(){a=!0}function De(){a=!1}function de(){var A=U();A.addEventListener("mousedown",ne,!0),A.addEventListener("touchend",ne,Rr),A.addEventListener("touchstart",De,Rr),A.addEventListener("touchmove",Te,Rr)}function he(){var A=U();A.removeEventListener("mousedown",ne,!0),A.removeEventListener("touchend",ne,Rr),A.removeEventListener("touchstart",De,Rr),A.removeEventListener("touchmove",Te,Rr)}function Pe(A,G){Oe(A,function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&G()})}function Be(A,G){Oe(A,G)}function Oe(A,G){var te=K().box;function fe(ae){ae.target===te&&(bu(te,"remove",fe),G())}if(A===0)return G();bu(te,"remove",d),bu(te,"add",fe),d=fe}function Ze(A,G,te){te===void 0&&(te=!1);var fe=Co(b.props.triggerTarget||t);fe.forEach(function(ae){ae.addEventListener(A,G,te),h.push({node:ae,eventType:A,handler:G,options:te})})}function Bt(){I()&&(Ze("touchstart",mt,{passive:!0}),Ze("touchend",gn,{passive:!0})),mH(b.props.trigger).forEach(function(A){if(A!=="manual")switch(Ze(A,mt),A){case"mouseenter":Ze("mouseleave",gn);break;case"focus":Ze(OH?"focusout":"blur",Fe);break;case"focusin":Ze("focusout",Fe);break}})}function mn(){h.forEach(function(A){var G=A.node,te=A.eventType,fe=A.handler,ae=A.options;G.removeEventListener(te,fe,ae)}),h=[]}function mt(A){var G,te=!1;if(!(!b.state.isEnabled||yn(A)||l)){var fe=((G=u)==null?void 0:G.type)==="focus";u=A,m=A.currentTarget,z(),!b.state.isVisible&&vH(A)&&tl.forEach(function(ae){return ae(A)}),A.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?te=!0:ce(A),A.type==="click"&&(s=!te),te&&!fe&&kt(A)}}function Ct(A){var G=A.target,te=H().contains(G)||w.contains(G);if(!(A.type==="mousemove"&&te)){var fe=ve().concat(w).map(function(ae){var st,Mt=ae._tippy,co=(st=Mt.popperInstance)==null?void 0:st.state;return co?{popperRect:ae.getBoundingClientRect(),popperState:co,props:n}:null}).filter(Boolean);CH(fe,A)&&(Z(),kt(A))}}function gn(A){var G=yn(A)||b.props.trigger.indexOf("click")>=0&&s;if(!G){if(b.props.interactive){b.hideWithInteractivity(A);return}kt(A)}}function Fe(A){b.props.trigger.indexOf("focusin")<0&&A.target!==H()||b.props.interactive&&A.relatedTarget&&w.contains(A.relatedTarget)||kt(A)}function yn(A){return Zt.isTouch?I()!==A.type.indexOf("touch")>=0:!1}function Kt(){Y();var A=b.props,G=A.popperOptions,te=A.placement,fe=A.offset,ae=A.getReferenceClientRect,st=A.moveTransition,Mt=L()?Kd(w).arrow:null,co=ae?{getBoundingClientRect:ae,contextElement:ae.contextElement||H()}:t,Zh={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(As){var uo=As.state;if(L()){var yS=K(),Oc=yS.box;["placement","reference-hidden","escaped"].forEach(function(Rs){Rs==="placement"?Oc.setAttribute("data-placement",uo.placement):uo.attributes.popper["data-popper-"+Rs]?Oc.setAttribute("data-"+Rs,""):Oc.removeAttribute("data-"+Rs)}),uo.attributes.popper={}}}},Ar=[{name:"offset",options:{offset:fe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!st}},Zh];L()&&Mt&&Ar.push({name:"arrow",options:{element:Mt,padding:3}}),Ar.push.apply(Ar,(G==null?void 0:G.modifiers)||[]),b.popperInstance=uH(co,w,Object.assign({},G,{placement:te,onFirstUpdate:f,modifiers:Ar}))}function Y(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Et(){var A=b.props.appendTo,G,te=H();b.props.interactive&&A===ex||A==="parent"?G=te.parentNode:G=tx(A,[te]),G.contains(w)||G.appendChild(w),b.state.isMounted=!0,Kt(),process.env.NODE_ENV!=="production"&&En(b.props.interactive&&A===wt.appendTo&&te.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
473
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var LH=function(){return"innerHTML"};function Kd(t,e){t[LH()]=e}function Zg(t){var e=Di();return t===!0?e.className=Zw:(e.className=Qw,rs(t)?e.appendChild(t):Kd(e,t)),e}function Qg(t,e){rs(e.content)?(Kd(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Kd(t,e.content):t.textContent=e.content)}function Gd(t){var e=t.firstElementChild,n=Ta(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Xw)}),arrow:n.find(function(r){return r.classList.contains(Zw)||r.classList.contains(Qw)}),backdrop:n.find(function(r){return r.classList.contains(fH)})}}function lx(t){var e=Di(),n=Di();n.className=dH,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Di();r.className=Xw,r.setAttribute("data-state","hidden"),Qg(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var l=Gd(e),a=l.box,c=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Qg(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(a.removeChild(u),a.appendChild(Zg(s.arrow))):a.appendChild(Zg(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:o}}lx.$$tippy=!0;var $H=1,el=[],wu=[];function BH(t,e){var n=Xg(t,Object.assign({},wt,ix(Kg(e)))),r,o,i,s=!1,l=!1,a=!1,c=!1,u,d,f,h=[],p=Wg(Ct,n.interactiveDebounce),m,g=$H++,y=null,w=gH(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:t,popper:Di(),popperInstance:y,props:n,state:S,plugins:w,clearDelayTimeouts:Hn,setProps:F,setContent:W,show:ne,hide:ue,hideWithInteractivity:je,enable:gt,disable:jn,unmount:Ft,destroy:Mc};if(!n.render)return process.env.NODE_ENV!=="production"&&Ud(!0,"render() function has not been supplied."),b;var C=n.render(b),x=C.popper,k=C.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,t._tippy=b,x._tippy=b;var A=w.map(function(R){return R.fn(b)}),E=t.hasAttribute("aria-expanded");return Bt(),z(),M(),N("onCreate",[b]),n.showOnCreate&&ce(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",p)}),b;function O(){var R=b.props.touch;return Array.isArray(R)?R:[R,0]}function _(){return O()[0]==="hold"}function L(){var R;return!!((R=b.props.render)!=null&&R.$$tippy)}function H(){return m||t}function U(){var R=H().parentNode;return R?SH(R):document}function K(){return Gd(x)}function j(R){return b.state.isMounted&&!b.state.isVisible||Zt.isTouch||u&&u.type==="focus"?0:yu(b.props.delay,R?0:1,wt.delay)}function M(R){R===void 0&&(R=!1),x.style.pointerEvents=b.props.interactive&&!R?"":"none",x.style.zIndex=""+b.props.zIndex}function N(R,G,te){if(te===void 0&&(te=!0),A.forEach(function(ae){ae[R]&&ae[R].apply(ae,G)}),te){var fe;(fe=b.props)[R].apply(fe,G)}}function D(){var R=b.props.aria;if(R.content){var G="aria-"+R.content,te=x.id,fe=So(b.props.triggerTarget||t);fe.forEach(function(ae){var st=ae.getAttribute(G);if(b.state.isVisible)ae.setAttribute(G,st?st+" "+te:te);else{var Mt=st&&st.replace(te,"").trim();Mt?ae.setAttribute(G,Mt):ae.removeAttribute(G)}})}}function z(){if(!(E||!b.props.aria.expanded)){var R=So(b.props.triggerTarget||t);R.forEach(function(G){b.props.interactive?G.setAttribute("aria-expanded",b.state.isVisible&&G===H()?"true":"false"):G.removeAttribute("aria-expanded")})}}function J(){U().removeEventListener("mousemove",p),el=el.filter(function(R){return R!==p})}function se(R){if(!(Zt.isTouch&&(a||R.type==="mousedown"))){var G=R.composedPath&&R.composedPath()[0]||R.target;if(!(b.props.interactive&&qg(x,G))){if(So(b.props.triggerTarget||t).some(function(te){return qg(te,G)})){if(Zt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[b,R]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||he())}}}function Te(){a=!0}function De(){a=!1}function de(){var R=U();R.addEventListener("mousedown",se,!0),R.addEventListener("touchend",se,Rr),R.addEventListener("touchstart",De,Rr),R.addEventListener("touchmove",Te,Rr)}function he(){var R=U();R.removeEventListener("mousedown",se,!0),R.removeEventListener("touchend",se,Rr),R.removeEventListener("touchstart",De,Rr),R.removeEventListener("touchmove",Te,Rr)}function Pe(R,G){Oe(R,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&G()})}function Be(R,G){Oe(R,G)}function Oe(R,G){var te=K().box;function fe(ae){ae.target===te&&(vu(te,"remove",fe),G())}if(R===0)return G();vu(te,"remove",d),vu(te,"add",fe),d=fe}function Ze(R,G,te){te===void 0&&(te=!1);var fe=So(b.props.triggerTarget||t);fe.forEach(function(ae){ae.addEventListener(R,G,te),h.push({node:ae,eventType:R,handler:G,options:te})})}function Bt(){_()&&(Ze("touchstart",mt,{passive:!0}),Ze("touchend",gn,{passive:!0})),mH(b.props.trigger).forEach(function(R){if(R!=="manual")switch(Ze(R,mt),R){case"mouseenter":Ze("mouseleave",gn);break;case"focus":Ze(OH?"focusout":"blur",Fe);break;case"focusin":Ze("focusout",Fe);break}})}function mn(){h.forEach(function(R){var G=R.node,te=R.eventType,fe=R.handler,ae=R.options;G.removeEventListener(te,fe,ae)}),h=[]}function mt(R){var G,te=!1;if(!(!b.state.isEnabled||yn(R)||l)){var fe=((G=u)==null?void 0:G.type)==="focus";u=R,m=R.currentTarget,z(),!b.state.isVisible&&vH(R)&&el.forEach(function(ae){return ae(R)}),R.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?te=!0:ce(R),R.type==="click"&&(s=!te),te&&!fe&&kt(R)}}function Ct(R){var G=R.target,te=H().contains(G)||x.contains(G);if(!(R.type==="mousemove"&&te)){var fe=ve().concat(x).map(function(ae){var st,Mt=ae._tippy,ao=(st=Mt.popperInstance)==null?void 0:st.state;return ao?{popperRect:ae.getBoundingClientRect(),popperState:ao,props:n}:null}).filter(Boolean);CH(fe,R)&&(J(),kt(R))}}function gn(R){var G=yn(R)||b.props.trigger.indexOf("click")>=0&&s;if(!G){if(b.props.interactive){b.hideWithInteractivity(R);return}kt(R)}}function Fe(R){b.props.trigger.indexOf("focusin")<0&&R.target!==H()||b.props.interactive&&R.relatedTarget&&x.contains(R.relatedTarget)||kt(R)}function yn(R){return Zt.isTouch?_()!==R.type.indexOf("touch")>=0:!1}function Kt(){X();var R=b.props,G=R.popperOptions,te=R.placement,fe=R.offset,ae=R.getReferenceClientRect,st=R.moveTransition,Mt=L()?Gd(x).arrow:null,ao=ae?{getBoundingClientRect:ae,contextElement:ae.contextElement||H()}:t,Zh={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(As){var co=As.state;if(L()){var yS=K(),Oc=yS.box;["placement","reference-hidden","escaped"].forEach(function(Rs){Rs==="placement"?Oc.setAttribute("data-placement",co.placement):co.attributes.popper["data-popper-"+Rs]?Oc.setAttribute("data-"+Rs,""):Oc.removeAttribute("data-"+Rs)}),co.attributes.popper={}}}},Ar=[{name:"offset",options:{offset:fe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!st}},Zh];L()&&Mt&&Ar.push({name:"arrow",options:{element:Mt,padding:3}}),Ar.push.apply(Ar,(G==null?void 0:G.modifiers)||[]),b.popperInstance=uH(ao,x,Object.assign({},G,{placement:te,onFirstUpdate:f,modifiers:Ar}))}function X(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Et(){var R=b.props.appendTo,G,te=H();b.props.interactive&&R===ex||R==="parent"?G=te.parentNode:G=tx(R,[te]),G.contains(x)||G.appendChild(x),b.state.isMounted=!0,Kt(),process.env.NODE_ENV!=="production"&&En(b.props.interactive&&R===wt.appendTo&&te.nextElementSibling!==x,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
474
474
 
475
475
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
476
476
 
477
477
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
478
478
 
479
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ve(){return Oa(w.querySelectorAll("[data-tippy-root]"))}function ce(A){b.clearDelayTimeouts(),A&&N("onTrigger",[b,A]),de();var G=j(!0),te=O(),fe=te[0],ae=te[1];Zt.isTouch&&fe==="hold"&&ae&&(G=ae),G?r=setTimeout(function(){b.show()},G):b.show()}function kt(A){if(b.clearDelayTimeouts(),N("onUntrigger",[b,A]),!b.state.isVisible){he();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(A.type)>=0&&s)){var G=j(!1);G?o=setTimeout(function(){b.state.isVisible&&b.hide()},G):i=requestAnimationFrame(function(){b.hide()})}}function gt(){b.state.isEnabled=!0}function jn(){b.hide(),b.state.isEnabled=!1}function Hn(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function F(A){if(process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,vo("setProps")),!b.state.isDestroyed){N("onBeforeUpdate",[b,A]),mn();var G=b.props,te=Xg(t,Object.assign({},G,Kg(A),{ignoreAttributes:!0}));b.props=te,Bt(),G.interactiveDebounce!==te.interactiveDebounce&&(Z(),p=Wg(Ct,te.interactiveDebounce)),G.triggerTarget&&!te.triggerTarget?Co(G.triggerTarget).forEach(function(fe){fe.removeAttribute("aria-expanded")}):te.triggerTarget&&t.removeAttribute("aria-expanded"),z(),M(),k&&k(G,te),b.popperInstance&&(Kt(),ve().forEach(function(fe){requestAnimationFrame(fe._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[b,A])}}function W(A){b.setProps({content:A})}function re(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,vo("show"));var A=b.state.isVisible,G=b.state.isDestroyed,te=!b.state.isEnabled,fe=Zt.isTouch&&!b.props.touch,ae=gu(b.props.duration,0,wt.duration);if(!(A||G||te||fe)&&!H().hasAttribute("disabled")&&(N("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,L()&&(w.style.visibility="visible"),M(),de(),b.state.isMounted||(w.style.transition="none"),L()){var st=K(),Mt=st.box,co=st.content;yu([Mt,co],0)}f=function(){var Ar;if(!(!b.state.isVisible||c)){if(c=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,L()&&b.props.animation){var Tc=K(),As=Tc.box,uo=Tc.content;yu([As,uo],ae),Gg([As,uo],"visible")}D(),z(),Ug(vu,b),(Ar=b.popperInstance)==null||Ar.forceUpdate(),N("onMount",[b]),b.props.animation&&L()&&Be(ae,function(){b.state.isShown=!0,N("onShown",[b])})}},Et()}}function ue(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,vo("hide"));var A=!b.state.isVisible,G=b.state.isDestroyed,te=!b.state.isEnabled,fe=gu(b.props.duration,1,wt.duration);if(!(A||G||te)&&(N("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,L()&&(w.style.visibility="hidden"),Z(),he(),M(!0),L()){var ae=K(),st=ae.box,Mt=ae.content;b.props.animation&&(yu([st,Mt],fe),Gg([st,Mt],"hidden"))}D(),z(),b.props.animation?L()&&Pe(fe,b.unmount):b.unmount()}}function je(A){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,vo("hideWithInteractivity")),U().addEventListener("mousemove",p),Ug(tl,p),p(A)}function Ft(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,vo("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(Y(),ve().forEach(function(A){A._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),vu=vu.filter(function(A){return A!==b}),b.state.isMounted=!1,N("onHidden",[b]))}function Mc(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,vo("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),mn(),delete t._tippy,b.state.isDestroyed=!0,N("onDestroy",[b]))}}function ao(t,e){e===void 0&&(e={});var n=wt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(NH(t),sx(e,n)),MH();var r=Object.assign({},e,{plugins:n}),o=xH(t);if(process.env.NODE_ENV!=="production"){var i=rs(r.content),s=o.length>1;En(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
479
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ve(){return Ta(x.querySelectorAll("[data-tippy-root]"))}function ce(R){b.clearDelayTimeouts(),R&&N("onTrigger",[b,R]),de();var G=j(!0),te=O(),fe=te[0],ae=te[1];Zt.isTouch&&fe==="hold"&&ae&&(G=ae),G?r=setTimeout(function(){b.show()},G):b.show()}function kt(R){if(b.clearDelayTimeouts(),N("onUntrigger",[b,R]),!b.state.isVisible){he();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(R.type)>=0&&s)){var G=j(!1);G?o=setTimeout(function(){b.state.isVisible&&b.hide()},G):i=requestAnimationFrame(function(){b.hide()})}}function gt(){b.state.isEnabled=!0}function jn(){b.hide(),b.state.isEnabled=!1}function Hn(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function F(R){if(process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,bo("setProps")),!b.state.isDestroyed){N("onBeforeUpdate",[b,R]),mn();var G=b.props,te=Xg(t,Object.assign({},G,Kg(R),{ignoreAttributes:!0}));b.props=te,Bt(),G.interactiveDebounce!==te.interactiveDebounce&&(J(),p=Wg(Ct,te.interactiveDebounce)),G.triggerTarget&&!te.triggerTarget?So(G.triggerTarget).forEach(function(fe){fe.removeAttribute("aria-expanded")}):te.triggerTarget&&t.removeAttribute("aria-expanded"),z(),M(),k&&k(G,te),b.popperInstance&&(Kt(),ve().forEach(function(fe){requestAnimationFrame(fe._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[b,R])}}function W(R){b.setProps({content:R})}function ne(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,bo("show"));var R=b.state.isVisible,G=b.state.isDestroyed,te=!b.state.isEnabled,fe=Zt.isTouch&&!b.props.touch,ae=yu(b.props.duration,0,wt.duration);if(!(R||G||te||fe)&&!H().hasAttribute("disabled")&&(N("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,L()&&(x.style.visibility="visible"),M(),de(),b.state.isMounted||(x.style.transition="none"),L()){var st=K(),Mt=st.box,ao=st.content;bu([Mt,ao],0)}f=function(){var Ar;if(!(!b.state.isVisible||c)){if(c=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,L()&&b.props.animation){var Tc=K(),As=Tc.box,co=Tc.content;bu([As,co],ae),Gg([As,co],"visible")}D(),z(),Ug(wu,b),(Ar=b.popperInstance)==null||Ar.forceUpdate(),N("onMount",[b]),b.props.animation&&L()&&Be(ae,function(){b.state.isShown=!0,N("onShown",[b])})}},Et()}}function ue(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,bo("hide"));var R=!b.state.isVisible,G=b.state.isDestroyed,te=!b.state.isEnabled,fe=yu(b.props.duration,1,wt.duration);if(!(R||G||te)&&(N("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,L()&&(x.style.visibility="hidden"),J(),he(),M(!0),L()){var ae=K(),st=ae.box,Mt=ae.content;b.props.animation&&(bu([st,Mt],fe),Gg([st,Mt],"hidden"))}D(),z(),b.props.animation?L()&&Pe(fe,b.unmount):b.unmount()}}function je(R){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,bo("hideWithInteractivity")),U().addEventListener("mousemove",p),Ug(el,p),p(R)}function Ft(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,bo("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(X(),ve().forEach(function(R){R._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),wu=wu.filter(function(R){return R!==b}),b.state.isMounted=!1,N("onHidden",[b]))}function Mc(){process.env.NODE_ENV!=="production"&&En(b.state.isDestroyed,bo("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),mn(),delete t._tippy,b.state.isDestroyed=!0,N("onDestroy",[b]))}}function lo(t,e){e===void 0&&(e={});var n=wt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(NH(t),sx(e,n)),MH();var r=Object.assign({},e,{plugins:n}),o=xH(t);if(process.env.NODE_ENV!=="production"){var i=rs(r.content),s=o.length>1;En(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
480
480
 
481
481
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
482
482
 
483
483
  `,`1) content: element.innerHTML
484
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=o.reduce(function(a,c){var u=c&&BH(c,r);return u&&a.push(u),a},[]);return rs(t)?l[0]:l}ao.defaultProps=wt;ao.setDefaultProps=IH;ao.currentInput=Zt;Object.assign({},Vw,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var FH={name:"sticky",defaultValue:!1,fn:function(e){var n=e.reference,r=e.popper;function o(){return e.popperInstance?e.popperInstance.state.elements.reference:n}function i(c){return e.props.sticky===!0||e.props.sticky===c}var s=null,l=null;function a(){var c=i("reference")?o().getBoundingClientRect():null,u=i("popper")?r.getBoundingClientRect():null;(c&&ey(s,c)||u&&ey(l,u))&&e.popperInstance&&e.popperInstance.update(),s=c,l=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function ey(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}ao.setDefaultProps({render:lx});class jH{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:h}=f,p=!d.textBetween(c,u).length&&Of(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,h;const{state:p,composing:m}=l,{selection:g}=p;if(m||!a&&!c)return;this.createTooltip();const{ranges:x}=g,S=Math.min(...x.map(w=>w.$from.pos)),b=Math.max(...x.map(w=>w.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:l,state:p,oldState:u,from:S,to:b}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(w0(p.selection)){let w=l.nodeDOM(S);const k=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(k&&(w=k.firstChild),w)return w.getBoundingClientRect()}return zM(l,S,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=i,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ao(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const i=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,i,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ax=t=>new ke({key:typeof t.pluginKey=="string"?new we(t.pluginKey):t.pluginKey,view:e=>new jH({view:e,...t})});Ie.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ax({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const HH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},zH=({renderers:t})=>_.createElement(_.Fragment,null,Object.entries(t).map(([e,n])=>Pa.createPortal(n.reactElement,n.element,e)));class VH extends _.Component{constructor(e){super(e),this.editorContentRef=_.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?Pa.flushSync(e):e()}setRenderer(e,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[e]:n}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[e],{renderers:r}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return _.createElement(_.Fragment,null,_.createElement("div",{ref:HH(n,this.editorContentRef),...r}),_.createElement(zH,{renderers:this.state.renderers}))}}const WH=_.forwardRef((t,e)=>{const n=_.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return _.createElement(VH,{key:n,innerRef:e,...t})}),UH=_.memo(WH);var Gd={exports:{}},wu={};/**
484
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=o.reduce(function(a,c){var u=c&&BH(c,r);return u&&a.push(u),a},[]);return rs(t)?l[0]:l}lo.defaultProps=wt;lo.setDefaultProps=IH;lo.currentInput=Zt;Object.assign({},Vw,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var FH={name:"sticky",defaultValue:!1,fn:function(e){var n=e.reference,r=e.popper;function o(){return e.popperInstance?e.popperInstance.state.elements.reference:n}function i(c){return e.props.sticky===!0||e.props.sticky===c}var s=null,l=null;function a(){var c=i("reference")?o().getBoundingClientRect():null,u=i("popper")?r.getBoundingClientRect():null;(c&&ey(s,c)||u&&ey(l,u))&&e.popperInstance&&e.popperInstance.update(),s=c,l=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function ey(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}lo.setDefaultProps({render:lx});class jH{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:h}=f,p=!d.textBetween(c,u).length&&Af(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,h;const{state:p,composing:m}=l,{selection:g}=p;if(m||!a&&!c)return;this.createTooltip();const{ranges:w}=g,S=Math.min(...w.map(x=>x.$from.pos)),b=Math.max(...w.map(x=>x.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:l,state:p,oldState:u,from:S,to:b}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(w0(p.selection)){let x=l.nodeDOM(S);const k=x.dataset.nodeViewWrapper?x:x.querySelector("[data-node-view-wrapper]");if(k&&(x=k.firstChild),x)return x.getBoundingClientRect()}return zM(l,S,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=i,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=lo(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const i=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,i,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ax=t=>new ke({key:typeof t.pluginKey=="string"?new we(t.pluginKey):t.pluginKey,view:e=>new jH({view:e,...t})});Ie.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ax({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var qd={exports:{}},xu={};/**
485
485
  * @license React
486
486
  * use-sync-external-store-shim.production.min.js
487
487
  *
@@ -489,7 +489,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
489
489
  *
490
490
  * This source code is licensed under the MIT license found in the
491
491
  * LICENSE file in the root directory of this source tree.
492
- */var ty;function KH(){if(ty)return wu;ty=1;var t=_;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,g=p[1];return i(function(){m.value=h,m.getSnapshot=f,a(m)&&g({inst:m})},[d,h,f]),o(function(){return a(m)&&g({inst:m}),d(function(){a(m)&&g({inst:m})})},[d]),s(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return wu.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,wu}var xu={};/**
492
+ */var ty;function HH(){if(ty)return xu;ty=1;var t=P;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(d,f){var h=f(),p=r({inst:{value:h,getSnapshot:f}}),m=p[0].inst,g=p[1];return i(function(){m.value=h,m.getSnapshot=f,a(m)&&g({inst:m})},[d,h,f]),o(function(){return a(m)&&g({inst:m}),d(function(){a(m)&&g({inst:m})})},[d]),s(h),h}function a(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return xu.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,xu}var Su={};/**
493
493
  * @license React
494
494
  * use-sync-external-store-shim.development.js
495
495
  *
@@ -497,7 +497,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
497
497
  *
498
498
  * This source code is licensed under the MIT license found in the
499
499
  * LICENSE file in the root directory of this source tree.
500
- */var ny;function GH(){return ny||(ny=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=_,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var b=arguments.length,C=new Array(b>1?b-1:0),w=1;w<b;w++)C[w-1]=arguments[w];r("error",S,C)}}function r(S,b,C){{var w=e.ReactDebugCurrentFrame,k=w.getStackAddendum();k!==""&&(b+="%s",C=C.concat([k]));var R=C.map(function(E){return String(E)});R.unshift("Warning: "+b),Function.prototype.apply.call(console[S],console,R)}}function o(S,b){return S===b&&(S!==0||1/S===1/b)||S!==S&&b!==b}var i=typeof Object.is=="function"?Object.is:o,s=t.useState,l=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function f(S,b,C){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=b();if(!d){var k=b();i(w,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var R=s({inst:{value:w,getSnapshot:b}}),E=R[0].inst,O=R[1];return a(function(){E.value=w,E.getSnapshot=b,h(E)&&O({inst:E})},[S,w,b]),l(function(){h(E)&&O({inst:E});var I=function(){h(E)&&O({inst:E})};return S(I)},[S]),c(w),w}function h(S){var b=S.getSnapshot,C=S.value;try{var w=b();return!i(C,w)}catch{return!0}}function p(S,b,C){return b()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!m,y=g?p:f,x=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;xu.useSyncExternalStore=x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),xu}process.env.NODE_ENV==="production"?Gd.exports=KH():Gd.exports=GH();var $h=Gd.exports;class qH extends gT{constructor(){super(...arguments),this.contentComponent=null}}var qd={exports:{}},Su={};/**
500
+ */var ny;function zH(){return ny||(ny=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=P,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var b=arguments.length,C=new Array(b>1?b-1:0),x=1;x<b;x++)C[x-1]=arguments[x];r("error",S,C)}}function r(S,b,C){{var x=e.ReactDebugCurrentFrame,k=x.getStackAddendum();k!==""&&(b+="%s",C=C.concat([k]));var A=C.map(function(E){return String(E)});A.unshift("Warning: "+b),Function.prototype.apply.call(console[S],console,A)}}function o(S,b){return S===b&&(S!==0||1/S===1/b)||S!==S&&b!==b}var i=typeof Object.is=="function"?Object.is:o,s=t.useState,l=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function f(S,b,C){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=b();if(!d){var k=b();i(x,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var A=s({inst:{value:x,getSnapshot:b}}),E=A[0].inst,O=A[1];return a(function(){E.value=x,E.getSnapshot=b,h(E)&&O({inst:E})},[S,x,b]),l(function(){h(E)&&O({inst:E});var _=function(){h(E)&&O({inst:E})};return S(_)},[S]),c(x),x}function h(S){var b=S.getSnapshot,C=S.value;try{var x=b();return!i(C,x)}catch{return!0}}function p(S,b,C){return b()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!m,y=g?p:f,w=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;Su.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Su}process.env.NODE_ENV==="production"?qd.exports=HH():qd.exports=zH();var vc=qd.exports;const VH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},WH=({contentComponent:t})=>{const e=vc.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return P.createElement(P.Fragment,null,Object.values(e))};function UH(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Ia.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}class KH extends P.Component{constructor(e){var n;super(e),this.editorContentRef=P.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=UH(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return P.createElement(P.Fragment,null,P.createElement("div",{ref:VH(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&P.createElement(WH,{contentComponent:e.contentComponent}))}}const GH=P.forwardRef((t,e)=>{const n=P.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return P.createElement(KH,{key:n,innerRef:e,...t})}),qH=P.memo(GH);var Jd={exports:{}},Cu={};/**
501
501
  * @license React
502
502
  * use-sync-external-store-shim/with-selector.production.min.js
503
503
  *
@@ -505,7 +505,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
505
505
  *
506
506
  * This source code is licensed under the MIT license found in the
507
507
  * LICENSE file in the root directory of this source tree.
508
- */var ry;function JH(){if(ry)return Su;ry=1;var t=_,e=$h;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,l=t.useMemo,a=t.useDebugValue;return Su.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var p=i(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=l(function(){function y(w){if(!x){if(x=!0,S=w,w=f(w),h!==void 0&&m.hasValue){var k=m.value;if(h(k,w))return b=k}return b=w}if(k=b,r(S,w))return k;var R=f(w);return h!==void 0&&h(k,R)?k:(S=w,b=R)}var x=!1,S,b,C=d===void 0?null:d;return[function(){return y(u())},C===null?void 0:function(){return y(C())}]},[u,d,f,h]);var g=o(c,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),a(g),g},Su}var Cu={};/**
508
+ */var ry;function JH(){if(ry)return Cu;ry=1;var t=P,e=vc;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,l=t.useMemo,a=t.useDebugValue;return Cu.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var p=i(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=l(function(){function y(x){if(!w){if(w=!0,S=x,x=f(x),h!==void 0&&m.hasValue){var k=m.value;if(h(k,x))return b=k}return b=x}if(k=b,r(S,x))return k;var A=f(x);return h!==void 0&&h(k,A)?k:(S=x,b=A)}var w=!1,S,b,C=d===void 0?null:d;return[function(){return y(u())},C===null?void 0:function(){return y(C())}]},[u,d,f,h]);var g=o(c,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),a(g),g},Cu}var Eu={};/**
509
509
  * @license React
510
510
  * use-sync-external-store-shim/with-selector.development.js
511
511
  *
@@ -513,6 +513,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Z=M,z=N),D===void 0&&(
513
513
  *
514
514
  * This source code is licensed under the MIT license found in the
515
515
  * LICENSE file in the root directory of this source tree.
516
- */var oy;function YH(){return oy||(oy=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=_,e=$h;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,l=t.useMemo,a=t.useDebugValue;function c(u,d,f,h,p){var m=i(null),g;m.current===null?(g={hasValue:!1,value:null},m.current=g):g=m.current;var y=l(function(){var C=!1,w,k,R=function(L){if(!C){C=!0,w=L;var H=h(L);if(p!==void 0&&g.hasValue){var U=g.value;if(p(U,H))return k=U,U}return k=H,H}var K=w,j=k;if(r(K,L))return j;var M=h(L);return p!==void 0&&p(j,M)?j:(w=L,k=M,M)},E=f===void 0?null:f,O=function(){return R(d())},I=E===null?void 0:function(){return R(E())};return[O,I]},[d,f,h,p]),x=y[0],S=y[1],b=o(u,x,S);return s(function(){g.hasValue=!0,g.value=b},[b]),a(b),b}Cu.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Cu}process.env.NODE_ENV==="production"?qd.exports=JH():qd.exports=YH();var XH=qd.exports;class ZH{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function QH(t){const[e]=_.useState(()=>new ZH(t.editor)),n=XH.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);return _.useEffect(()=>e.watch(t.editor),[t.editor,e]),_.useDebugValue(n),n}const iy=process.env.NODE_ENV!=="production",Jd=typeof window>"u",ez=Jd||!!(typeof window<"u"&&window.next);class tz{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Jd||ez?(iy&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Jd&&iy)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e=new qH(this.options.current);return e.on("beforeCreate",(...n)=>{var r,o;return(o=(r=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(r,...n)}),e.on("blur",(...n)=>{var r,o;return(o=(r=this.options.current).onBlur)===null||o===void 0?void 0:o.call(r,...n)}),e.on("create",(...n)=>{var r,o;return(o=(r=this.options.current).onCreate)===null||o===void 0?void 0:o.call(r,...n)}),e.on("destroy",(...n)=>{var r,o;return(o=(r=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(r,...n)}),e.on("focus",(...n)=>{var r,o;return(o=(r=this.options.current).onFocus)===null||o===void 0?void 0:o.call(r,...n)}),e.on("selectionUpdate",(...n)=>{var r,o;return(o=(r=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(r,...n)}),e.on("transaction",(...n)=>{var r,o;return(o=(r=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(r,...n)}),e.on("update",(...n)=>{var r,o;return(o=(r=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(r,...n)}),e.on("contentError",(...n)=>{var r,o;return(o=(r=this.options.current).onContentError)===null||o===void 0?void 0:o.call(r,...n)}),e}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},0)}}function nz(t={},e=[]){const n=_.useRef(t);n.current=t;const[r]=_.useState(()=>new tz(n)),o=$h.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return _.useDebugValue(o),_.useEffect(r.onRender(e)),QH({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const cx=_.createContext({editor:null});cx.Consumer;const rz=()=>_.useContext(cx),oz=t=>{const[e,n]=_.useState(null),{editor:r}=rz();return _.useEffect(()=>{var o;if(!e||!((o=t.editor)===null||o===void 0)&&o.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:i="bubbleMenu",editor:s,tippyOptions:l={},updateDelay:a,shouldShow:c=null}=t,u=s||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=ax({updateDelay:a,editor:u,element:e,pluginKey:i,shouldShow:c,tippyOptions:l});return u.registerPlugin(d),()=>u.unregisterPlugin(i)},[t.editor,r,e]),_.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},ux=_.createContext({onDragStart:void 0}),iz=()=>_.useContext(ux),sz=_.forwardRef((t,e)=>{const{onDragStart:n}=iz(),r=t.as||"div";return _.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function lz(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function az(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class dx{constructor(e,{editor:n,props:r={},as:o="div",className:i="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),s&&Object.keys(s).forEach(l=>{this.element.setAttribute(l,s[l])}),this.render()}render(){var e,n;const r=this.component,o=this.props;(lz(r)||az(r))&&(o.ref=i=>{this.ref=i}),this.reactElement=_.createElement(r,{...o}),(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e,n;(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}class cz extends bT{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const i=s=>s.charAt(0).toUpperCase()+s.substring(1);this.component.displayName=i(this.extension.name)}const n=i=>{const s=this.component,l=this.onDragStart.bind(this),a=c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)};return _.createElement(_.Fragment,null,_.createElement(ux.Provider,{value:{onDragStart:l,nodeViewContentRef:a}},_.createElement(s,{...i})))};n.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:o=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new dx(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${o}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection;if(e<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n){const r=o=>{this.renderer.updateProps(o)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,i=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:o,oldDecorations:i,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function uz(t,e){return n=>n.editor.contentComponent?new cz(t,n,e):{}}function dz(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:s}=t,l=vT(n),a=new RegExp(`\\s${l}$`),c=i?"^":"",u=r?new RegExp(`${c}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${c}(?:^)?${l}[^\\s${l}]*`,"gm"),d=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!d)return null;const f=s.pos-d.length,h=Array.from(d.matchAll(u)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(p);if(o!==null&&!m)return null;const g=f+h.index;let y=g+h[0].length;return r&&a.test(d.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}const fz=new we("suggestion");function hz({pluginKey:t=fz,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:o=[" "],startOfLine:i=!1,decorationTag:s="span",decorationClass:l="suggestion",command:a=()=>null,items:c=()=>[],render:u=()=>({}),allow:d=()=>!0,findSuggestionMatch:f=dz}){let h;const p=u==null?void 0:u(),m=new ke({key:t,view(){return{update:async(g,y)=>{var x,S,b,C,w,k,R;const E=(x=this.key)===null||x===void 0?void 0:x.getState(y),O=(S=this.key)===null||S===void 0?void 0:S.getState(g.state),I=E.active&&O.active&&E.range.from!==O.range.from,L=!E.active&&O.active,H=E.active&&!O.active,U=!L&&!H&&E.query!==O.query,K=L,j=U||I,M=H;if(!K&&!j&&!M)return;const N=M&&!K?E:O,D=g.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`);h={editor:e,range:N.range,query:N.query,text:N.text,items:[],command:z=>a({editor:e,range:N.range,props:z}),decorationNode:D,clientRect:D?()=>{var z;const{decorationId:Z}=(z=this.key)===null||z===void 0?void 0:z.getState(e.state),ne=g.dom.querySelector(`[data-decoration-id="${Z}"]`);return(ne==null?void 0:ne.getBoundingClientRect())||null}:null},K&&((b=p==null?void 0:p.onBeforeStart)===null||b===void 0||b.call(p,h)),j&&((C=p==null?void 0:p.onBeforeUpdate)===null||C===void 0||C.call(p,h)),(j||K)&&(h.items=await c({editor:e,query:N.query})),M&&((w=p==null?void 0:p.onExit)===null||w===void 0||w.call(p,h)),j&&((k=p==null?void 0:p.onUpdate)===null||k===void 0||k.call(p,h)),K&&((R=p==null?void 0:p.onStart)===null||R===void 0||R.call(p,h))},destroy:()=>{var g;h&&((g=p==null?void 0:p.onExit)===null||g===void 0||g.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,x,S){const{isEditable:b}=e,{composing:C}=e.view,{selection:w}=g,{empty:k,from:R}=w,E={...y};if(E.composing=C,b&&(k||e.view.composing)){(R<y.range.from||R>y.range.to)&&!C&&!y.composing&&(E.active=!1);const O=f({char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:w.$from}),I=`id_${Math.floor(Math.random()*4294967295)}`;O&&d({editor:e,state:S,range:O.range,isActive:y.active})?(E.active=!0,E.decorationId=y.decorationId?y.decorationId:I,E.range=O.range,E.query=O.query,E.text=O.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(g,y){var x;const{active:S,range:b}=m.getState(g.state);return S&&((x=p==null?void 0:p.onKeyDown)===null||x===void 0?void 0:x.call(p,{view:g,event:y,range:b}))||!1},decorations(g){const{active:y,range:x,decorationId:S}=m.getState(g);return y?me.create(g.doc,[Le.inline(x.from,x.to,{nodeName:s,class:l,"data-decoration-id":S})]):null}}});return m}const pz=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,mz=Ne.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",le(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[x0({find:pz,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Bh="Tabs",[gz,_4]=In(Bh,[uc]),fx=uc(),[yz,Fh]=gz(Bh),hx=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:a="automatic",...c}=t,u=Jf(l),[d,f]=Er({prop:r,onChange:o,defaultProp:i});return T.jsx(yz,{scope:n,baseId:hr(),value:d,onValueChange:f,orientation:s,dir:u,activationMode:a,children:T.jsx(ge.div,{dir:u,"data-orientation":s,...c,ref:e})})});hx.displayName=Bh;var px="TabsList",mx=v.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,i=Fh(px,n),s=fx(n);return T.jsx(Rv,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:T.jsx(ge.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:e})})});mx.displayName=px;var gx="TabsTrigger",yx=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=t,s=Fh(gx,n),l=fx(n),a=wx(s.baseId,r),c=xx(s.baseId,r),u=r===s.value;return T.jsx(Nv,{asChild:!0,...l,focusable:!o,active:u,children:T.jsx(ge.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:e,onMouseDown:ee(t.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ee(t.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ee(t.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});yx.displayName=gx;var bx="TabsContent",vx=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=t,l=Fh(bx,n),a=wx(l.baseId,r),c=xx(l.baseId,r),u=r===l.value,d=v.useRef(u);return v.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),T.jsx(Ln,{present:o||u,children:({present:f})=>T.jsx(ge.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":a,hidden:!f,id:c,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});vx.displayName=bx;function wx(t,e){return`${t}-trigger-${e}`}function xx(t,e){return`${t}-content-${e}`}var bz=hx,vz=mx,wz=yx,xz=vx;const Sz=Ne.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",le(this.options.HTMLAttributes,t),0]}});var Yd,Xd;if(typeof WeakMap<"u"){let t=new WeakMap;Yd=e=>t.get(e),Xd=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Yd=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},Xd=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var Re=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;s<this.height&&this.map[e+this.width*l]==n;l++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?i==0:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,a),right:Math.max(r,l),bottom:Math.max(i,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,!(o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const l=(t+1)*this.width;for(;s<l&&this.map[s]<o;)s++;return s==l?i-1:this.map[s]}o=i}}static get(t){return Yd(t)||Xd(t,Cz(t))}};function Cz(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Ez(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let p=0;;p++){for(;o<r.length&&r[o]!=0;)o++;if(p==d.childCount)break;const m=d.child(p),{colspan:g,rowspan:y,colwidth:x}=m.attrs;for(let S=0;S<y;S++){if(S+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-S});break}const b=o+S*e;for(let C=0;C<g;C++){r[b+C]==0?r[b+C]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:g-C});const w=x&&x[C];if(w){const k=(b+C)%e*2,R=s[k];R==null||R!=w&&s[k+1]==1?(s[k]=w,s[k+1]=1):R==w&&s[k+1]++}}}o+=g,u+=m.nodeSize}const f=(c+1)*e;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:c,n:h}),u++}const l=new Re(e,n,r,i);let a=!1;for(let c=0;!a&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(a=!0);return a&&kz(l,s,t),l}function Ez(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const l=t.child(s);for(let a=0;a<l.childCount;a++){const c=l.child(a);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const l=o.child(s);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function kz(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=s.attrs;for(let c=0;c<a.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!a.colwidth||a.colwidth[c]!=d)&&((l||(l=Mz(a)))[c]=d)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function Mz(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function rt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var tr=new we("selectingCells");function oi(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Tz(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Ut(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function wc(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=oi(e.$head)||Oz(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Oz(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Zd(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Az(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function jh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Sx(t,e,n){const r=t.node(-1),o=Re.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function eo(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Cx(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function Rz(t,e,n){const r=rt(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var be=class Sn extends Q{constructor(e,n=e){const r=e.node(-1),o=Re.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=o.cellsInRect(s).filter(u=>u!=n.pos-i);a.unshift(n.pos-i);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new pf(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Zd(r)&&Zd(o)&&jh(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Sn.rowSelection(r,o):i&&this.isColSelection()?Sn.colSelection(r,o):new Sn(r,o)}return X.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=Re.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let a=o.top;a<o.bottom;a++){const c=[];for(let u=a*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(i[f])continue;i[f]=!0;const h=n.findCell(f);let p=e.nodeAt(f);if(!p)throw RangeError(`No cell with offset ${f} found`);const m=o.left-h.left,g=h.right-o.right;if(m>0||g>0){let y=p.attrs;if(m>0&&(y=eo(y,0,m)),g>0&&(y=eo(y,y.colspan-g,g)),h.left<o.left){if(p=p.type.createAndFill(y),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(h.top<o.top||h.bottom>o.bottom){const y={...p.attrs,rowspan:Math.min(h.bottom,o.bottom)-Math.max(h.top,o.top)};h.top<o.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}c.push(p)}s.push(e.child(a).copy(P.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new B(P.from(l),1,1)}replace(e,n=B.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:l,$to:a}=o[s],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),s?B.empty:n)}const i=Q.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new B(P.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Re.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=Re.get(r),i=e.start(-1),s=o.findCell(e.pos-i),l=o.findCell(n.pos-i),a=e.node(0);return s.top<=l.top?(s.top>0&&(e=a.resolve(i+o.map[s.left])),l.bottom<o.height&&(n=a.resolve(i+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+o.map[l.left])),s.bottom<o.height&&(e=a.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Sn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Re.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Sn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=Re.get(r),i=e.start(-1),s=o.findCell(e.pos-i),l=o.findCell(n.pos-i),a=e.node(0);return s.left<=l.left?(s.left>0&&(e=a.resolve(i+o.map[s.top*o.width])),l.right<o.width&&(n=a.resolve(i+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+o.map[l.top*o.width])),s.right<o.width&&(e=a.resolve(i+o.map[o.width*(s.top+1)-1]))),new Sn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Sn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Sn(e.resolve(n),e.resolve(r))}getBookmark(){return new Nz(this.$anchorCell.pos,this.$headCell.pos)}};be.prototype.visible=!1;Q.jsonID("cell",be);var Nz=class Ex{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ex(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&jh(n,r)?new be(n,r):Q.near(r,1)}};function Dz(t){if(!(t.selection instanceof be))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Le.node(r,r+n.nodeSize,{class:"selectedCell"}))}),me.create(t.doc,e)}function _z({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function Iz({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function Pz(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof J&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=be.create(o,r.from);else if(s=="row"){const l=o.resolve(r.from+1);i=be.rowSelection(l,l)}else if(!n){const l=Re.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];i=be.create(o,a+1,c)}}else r instanceof X&&_z(r)?i=X.create(o,r.from):r instanceof X&&Iz(r)&&(i=X.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var Lz=new we("fix-tables");function kx(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,l=0;s<i;s++){const a=e.child(s);for(let c=l,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==a){l=c+1,n+=a.nodeSize;continue e}r(a,n),l<o&&t.child(l).sameMarkup(a)?kx(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Mx(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=$z(t,o,i,n))};return e?e.doc!=t.doc&&kx(e.doc,t.doc,0,r):t.doc.descendants(r),n}function $z(t,e,n,r){const o=Re.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let a=0;a<o.height;a++)i.push(0);for(let a=0;a<o.problems.length;a++){const c=o.problems[a];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)i[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,eo(d,d.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let s,l;for(let a=0;a<i.length;a++)i[a]&&(s==null&&(s=a),l=a);for(let a=0,c=n+1;a<o.height;a++){const u=e.child(a),d=c+u.nodeSize,f=i[a];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<f;g++){const y=rt(t.schema)[h].createAndFill();y&&p.push(y)}const m=(a==0||s==a-1)&&l==a?c+1:d-1;r.insert(r.mapping.map(m),p)}c=d}return r.setMeta(Lz,{fixTables:!0})}function Bz(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,l=[];if(i=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const u=a?0:Math.max(0,n-1),d=a<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=Qd(rt(s).row,new B(c,u,d)).content),l.push(c)}else if(i=="cell"||i=="header_cell")l.push(n||r?Qd(rt(s).row,new B(e,n,r)).content:e);else return null;return Fz(s,l)}function Fz(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:l,colspan:a}=i.child(s).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+a}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(P.empty),n[o]<r){const i=rt(t).cell.createAndFill(),s=[];for(let l=n[o];l<r;l++)s.push(i);e[o]=e[o].append(P.from(s))}return{height:e.length,width:r,rows:e}}function Qd(t,e){const n=t.createAndFill();return new hf(n).replace(0,n.content.size,e).doc}function jz({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let l=0;l<n.length;l++){const a=n[l],c=[];for(let u=i[l]||0,d=0;u<r;d++){let f=a.child(d%a.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(eo(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)i[l+h]=(i[l+h]||0)+f.attrs.colspan}s.push(P.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,l=0;s<o;s++,l++){const a=[],c=n[l%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);s+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),a.push(d)}i.push(P.from(a))}n=i,e=o}return{width:t,height:e,rows:n}}function Hz(t,e,n,r,o,i,s){const l=t.doc.type.schema,a=rt(l);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const h=n.child(d);f+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==a.cell?m=c||(c=a.cell.createAndFill()):m=u||(u=a.header_cell.createAndFill());for(let g=e.width;g<o;g++)p.push(m);t.insert(t.mapping.slice(s).map(f-1+r),p)}if(i>e.height){const d=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,o);p++){const g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==a.header_cell;d.push(g?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,P.from(d)),h=[];for(let p=e.height;p<i;p++)h.push(f);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!!(c||u)}function sy(t,e,n,r,o,i,s,l){if(s==0||s==e.height)return!1;let a=!1;for(let c=o;c<i;c++){const u=s*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){a=!0;const f=n.nodeAt(d),{top:h,left:p}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:s-h}),t.insert(t.mapping.slice(l).map(e.positionAt(s,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),c+=f.attrs.colspan-1}}return a}function ly(t,e,n,r,o,i,s,l){if(s==0||s==e.width)return!1;let a=!1;for(let c=o;c<i;c++){const u=c*e.width+s,d=e.map[u];if(e.map[u-1]==d){a=!0;const f=n.nodeAt(d),h=e.colCount(d),p=t.mapping.slice(l).map(d+r);t.setNodeMarkup(p,null,eo(f.attrs,s-h,f.attrs.colspan-(s-h))),t.insert(p+f.nodeSize,f.type.createAndFill(eo(f.attrs,0,s-h))),c+=f.attrs.rowspan-1}}return a}function ay(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=Re.get(i);const{top:l,left:a}=r,c=a+o.width,u=l+o.height,d=t.tr;let f=0;function h(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");s=Re.get(i),f=d.mapping.maps.length}Hz(d,s,i,n,c,u,f)&&h(),sy(d,s,i,n,a,c,l,f)&&h(),sy(d,s,i,n,a,c,u,f)&&h(),ly(d,s,i,n,l,u,a,f)&&h(),ly(d,s,i,n,l,u,c,f)&&h();for(let p=l;p<u;p++){const m=s.positionAt(p,a,i),g=s.positionAt(p,c,i);d.replace(d.mapping.slice(f).map(m+n),d.mapping.slice(f).map(g+n),new B(o.rows[p-l],0,0))}h(),d.setSelection(new be(d.doc.resolve(n+s.positionAt(l,a,i)),d.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(d)}var zz=Ef({ArrowLeft:nl("horiz",-1),ArrowRight:nl("horiz",1),ArrowUp:nl("vert",-1),ArrowDown:nl("vert",1),"Shift-ArrowLeft":rl("horiz",-1),"Shift-ArrowRight":rl("horiz",1),"Shift-ArrowUp":rl("vert",-1),"Shift-ArrowDown":rl("vert",1),Backspace:ol,"Mod-Backspace":ol,Delete:ol,"Mod-Delete":ol});function xl(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function nl(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof be)return xl(n,r,Q.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=Tx(o,t,e);if(s==null)return!1;if(t=="horiz")return xl(n,r,Q.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(s),a=Sx(l,t,e);let c;return a?c=Q.near(a,1):e<0?c=Q.near(n.doc.resolve(l.before(-1)),-1):c=Q.near(n.doc.resolve(l.after(-1)),1),xl(n,r,c)}}}function rl(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof be)s=i;else{const a=Tx(o,t,e);if(a==null)return!1;s=new be(n.doc.resolve(a))}const l=Sx(s.$headCell,t,e);return l?xl(n,r,new be(s.$anchorCell,l)):!1}}function ol(t,e){const n=t.selection;if(!(n instanceof be))return!1;if(e){const r=t.tr,o=rt(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new B(o,0,0))}),r.docChanged&&e(r)}return!0}function Vz(t,e){const n=t.state.doc,r=oi(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new be(r))),!0):!1}function Wz(t,e,n){if(!Ut(t.state))return!1;let r=Bz(n);const o=t.state.selection;if(o instanceof be){r||(r={width:1,height:1,rows:[P.from(Qd(rt(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),l=Re.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=jz(r,l.right-l.left,l.bottom-l.top),ay(t.state,t.dispatch,s,l,r),!0}else if(r){const i=wc(t.state),s=i.start(-1);return ay(t.state,t.dispatch,s,Re.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function Uz(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=cy(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof be)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=oi(t.state.selection.$anchor))!=null&&((n=Eu(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(a,c){let u=Eu(t,c);const d=tr.getState(t.state)==null;if(!u||!jh(a,u))if(d)u=a;else return;const f=new be(a,u);if(d||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);d&&h.setMeta(tr,a.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),tr.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(tr,-1))}function l(a){const c=a,u=tr.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(cy(t,c.target)!=r&&(d=Eu(t,e),!d))return s();d&&i(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function Tx(t,e,n){if(!(t.state.selection instanceof X))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const l=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?l:null}}return null}function cy(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Eu(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?oi(t.state.doc.resolve(n.pos)):null}var Kz=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ef(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ef(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ef(t,e,n,r,o,i){var s;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:h,colwidth:p}=u.child(d).attrs;for(let m=0;m<h;m++,f++){const g=o==f?i:p&&p[m],y=g?g+"px":"";l+=g||r,g||(a=!1),c?(c.style.width!=y&&(c.style.width=y),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=y}}for(;c;){const d=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=d}a?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var Rt=new we("tableColumnResizing");function Gz({handleWidth:t=5,cellMinWidth:e=25,View:n=Kz,lastColumnResizable:r=!0}={}){const o=new ke({key:Rt,state:{init(i,s){var l,a;const c=(a=(l=o.spec)==null?void 0:l.props)==null?void 0:a.nodeViews,u=rt(s.schema).table.name;return n&&c&&(c[u]=(d,f)=>new n(d,e,f)),new qz(-1,!1)},apply(i,s){return s.apply(i)}},props:{attributes:i=>{const s=Rt.getState(i);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(i,s)=>{Jz(i,s,t,e,r)},mouseleave:i=>{Yz(i)},mousedown:(i,s)=>{Xz(i,s,e)}},decorations:i=>{const s=Rt.getState(i);if(s&&s.activeHandle>-1)return r5(i,s.activeHandle)},nodeViews:{}}});return o}var qz=class Sl{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Rt);if(r&&r.setHandle!=null)return new Sl(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Sl(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Zd(e.doc.resolve(o))||(o=-1),new Sl(o,n.dragging)}return n}};function Jz(t,e,n,r,o){const i=Rt.getState(t.state);if(i&&!i.dragging){const s=Qz(e.target);let l=-1;if(s){const{left:a,right:c}=s.getBoundingClientRect();e.clientX-a<=n?l=uy(t,e,"left",n):c-e.clientX<=n&&(l=uy(t,e,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const a=t.state.doc.resolve(l),c=a.node(-1),u=Re.get(c),d=a.start(-1);if(u.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==u.width-1)return}Ox(t,l)}}}function Yz(t){const e=Rt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Ox(t,-1)}function Xz(t,e,n){var r;const o=(r=t.dom.ownerDocument.defaultView)!=null?r:window,i=Rt.getState(t.state);if(!i||i.activeHandle==-1||i.dragging)return!1;const s=t.state.doc.nodeAt(i.activeHandle),l=Zz(t,i.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Rt,{setDragging:{startX:e.clientX,startWidth:l}}));function a(u){o.removeEventListener("mouseup",a),o.removeEventListener("mousemove",c);const d=Rt.getState(t.state);d!=null&&d.dragging&&(e5(t,d.activeHandle,dy(d.dragging,u,n)),t.dispatch(t.state.tr.setMeta(Rt,{setDragging:null})))}function c(u){if(!u.which)return a(u);const d=Rt.getState(t.state);if(d&&d.dragging){const f=dy(d.dragging,u,n);t5(t,d.activeHandle,f,n)}}return o.addEventListener("mouseup",a),o.addEventListener("mousemove",c),e.preventDefault(),!0}function Zz(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let l=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],a--);return l/a}function Qz(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function uy(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,l=oi(t.state.doc.resolve(s));if(!l)return-1;if(n=="right")return l.pos;const a=Re.get(l.node(-1)),c=l.start(-1),u=a.map.indexOf(l.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function dy(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Ox(t,e){t.dispatch(t.state.tr.setMeta(Rt,{setHandle:e}))}function e5(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=Re.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+l;if(c&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],f=o.nodeAt(d).attrs,h=f.colspan==1?0:l-i.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():n5(f.colspan);p[h]=n,a.setNodeMarkup(s+d,null,{...f,colwidth:p})}a.docChanged&&t.dispatch(a)}function t5(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),l=Re.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let a=t.domAtPos(o.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ef(i,a.firstChild,a,r,l,n)}function n5(t){return Array(t).fill(0)}function r5(t,e){const n=[],r=t.doc.resolve(e),o=r.node(-1);if(!o)return me.empty;const i=Re.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let a=0;a<i.height;a++){const c=l+a*i.width;if((l==i.width-1||i.map[c]!=i.map[c+1])&&(a==0||i.map[c]!=i.map[c-i.width])){const u=i.map[c],d=s+u+o.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",n.push(Le.widget(d,f))}}return me.create(t.doc,n)}function pn(t){const e=t.selection,n=wc(t),r=n.node(-1),o=n.start(-1),i=Re.get(r);return{...e instanceof be?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function Ax(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;Rz(e,r,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){const l=s*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],c=r.nodeAt(a);t.setNodeMarkup(t.mapping.map(n+a),null,Cx(c.attrs,o-e.colCount(a))),s+=c.attrs.rowspan-1}else{const a=i==null?rt(r.type.schema).cell:r.nodeAt(e.map[l+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),a.createAndFill())}}return t}function o5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Ax(t.tr,n,n.left))}return!0}function i5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Ax(t.tr,n,n.right))}return!0}function s5(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const l=s*e.width+o,a=e.map[l],c=n.nodeAt(a),u=c.attrs;if(o>0&&e.map[l-1]==a||o<e.width-1&&e.map[l+1]==a)t.setNodeMarkup(t.mapping.slice(i).map(r+a),null,eo(u,o-e.colCount(a)));else{const d=t.mapping.slice(i).map(r+a);t.delete(d,d+c.nodeSize)}s+=u.rowspan}}function l5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;s5(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Re.get(i)}e(r)}return!0}function a5(t,e,n){var r;const o=rt(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((r=e.nodeAt(t.map[i+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Rx(t,{map:e,tableStart:n,table:r},o){var i;let s=n;for(let c=0;c<o;c++)s+=r.child(c).nodeSize;const l=[];let a=o>0?-1:0;a5(e,r,o+a)&&(a=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=a==null?rt(r.type.schema).cell:(i=r.nodeAt(e.map[u+a*e.width]))==null?void 0:i.type,f=d==null?void 0:d.createAndFill();f&&l.push(f)}return t.insert(s,rt(r.type.schema).row.create(null,l)),t}function c5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Rx(t.tr,n,n.top))}return!0}function u5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Rx(t.tr,n,n.bottom))}return!0}function d5(t,{map:e,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const s=i+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(i+r,s+r);const a=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const d=e.map[u];if(!a.has(d)){if(a.add(d),o>0&&d==e.map[u-e.width]){const f=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(o<e.height&&d==e.map[u+e.width]){const f=n.nodeAt(d),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+m),p),c+=h.colspan-1}}}}function f5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;d5(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Re.get(n.table)}e(r)}return!0}function fy(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function h5({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[l]==n[l+1])return!0;i+=t,l+=t}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}function hy(t,e){const n=t.selection;if(!(n instanceof be)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=pn(t),{map:o}=r;if(h5(o,r))return!1;if(e){const i=t.tr,s={};let l=P.empty,a,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],h=r.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,a==null)a=f,c=h;else{fy(h)||(l=l.append(h.content));const p=i.mapping.map(f+r.tableStart);i.delete(p,p+h.nodeSize)}}if(a==null||c==null)return!0;if(i.setNodeMarkup(a+r.tableStart,null,{...Cx(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const u=a+1+c.content.size,d=fy(c)?a+1:u;i.replaceWith(d+r.tableStart,u+r.tableStart,l)}i.setSelection(new be(i.doc.resolve(a+r.tableStart))),e(i)}return!0}function py(t,e){const n=rt(t.schema);return p5(({node:r})=>n[r.type.spec.tableRole])(t,e)}function p5(t){return(e,n)=>{var r;const o=e.selection;let i,s;if(o instanceof be){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=Tz(o.$from),!i)return!1;s=(r=oi(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let l=i.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const u=pn(e),d=e.tr;for(let h=0;h<u.right-u.left;h++)a.push(c?{...l,colwidth:c&&c[h]?[c[h]]:null}:l);let f;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=i.nodeSize);for(let m=u.left,g=0;m<u.right;m++,g++)m==u.left&&h==u.top||d.insert(f=d.mapping.map(p+u.tableStart,1),t({node:i,row:h,col:m}).createAndFill(a[g]))}d.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),a[0]),o instanceof be&&d.setSelection(new be(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function m5(t,e){return function(n,r){if(!Ut(n))return!1;const o=wc(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof be?n.selection.forEachCell((s,l)=>{s.attrs[t]!==e&&i.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}function g5(t){return function(e,n){if(!Ut(e))return!1;if(n){const r=rt(e.schema),o=pn(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=s.map(a=>o.table.nodeAt(a));for(let a=0;a<s.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[a],r.cell,l[a].attrs);if(i.steps.length==0)for(let a=0;a<s.length;a++)i.setNodeMarkup(o.tableStart+s[a],r.header_cell,l[a].attrs);n(i)}return!0}}function my(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function ss(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?g5(t):function(n,r){if(!Ut(n))return!1;if(r){const o=rt(n.schema),i=pn(n),s=n.tr,l=my("row",i,o),a=my("column",i,o),u=(t==="column"?l:t==="row"?a:!1)?1:0,d=t=="column"?{left:0,top:u,right:1,bottom:i.map.height}:t=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,f=t=="column"?a?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;i.map.cellsInRect(d).forEach(h=>{const p=h+i.tableStart,m=s.doc.nodeAt(p);m&&s.setNodeMarkup(p,f,m.attrs)}),r(s)}return!0}}ss("row",{useDeprecatedLogic:!0});ss("column",{useDeprecatedLogic:!0});var y5=ss("cell",{useDeprecatedLogic:!0});function b5(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function gy(t){return function(e,n){if(!Ut(e))return!1;const r=b5(wc(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(X.between(o,Az(o))).scrollIntoView())}return!0}}function v5(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function w5({allowTableNodeSelection:t=!1}={}){return new ke({key:tr,state:{init(){return null},apply(e,n){const r=e.getMeta(tr);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:Dz,handleDOMEvents:{mousedown:Uz},createSelectionBetween(e){return tr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Vz,handleKeyDown:zz,handlePaste:Wz},appendTransaction(e,n,r){return Pz(r,Mx(r,n),t)}})}function yy(t,e,n,r,o,i){let s=0,l=!0,a=e.firstChild;const c=t.firstChild;for(let u=0,d=0;u<c.childCount;u+=1){const{colspan:f,colwidth:h}=c.child(u).attrs;for(let p=0;p<f;p+=1,d+=1){const m=o===d?i:h&&h[p],g=m?`${m}px`:"";s+=m||r,m||(l=!1),a?(a.style.width!==g&&(a.style.width=g),a=a.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;a;){const u=a.nextSibling;a.parentNode.removeChild(a),a=u}l?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}class x5{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),yy(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,yy(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function S5(t,e,n,r){let o=0,i=!0;const s=[],l=t.firstChild;if(!l)return{};for(let d=0,f=0;d<l.childCount;d+=1){const{colspan:h,colwidth:p}=l.child(d).attrs;for(let m=0;m<h;m+=1,f+=1){const g=n===f?r:p&&p[m],y=g?`${g}px`:"";o+=g||e,g||(i=!1),s.push(["col",y?{style:`width: ${y}`}:{}])}}const a=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:a,tableMinWidth:c}}function by(t,e){return t.createAndFill()}function C5(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function E5(t,e,n,r,o){const i=C5(t),s=[],l=[];for(let c=0;c<n;c+=1){const u=by(i.cell);if(u&&l.push(u),r){const d=by(i.header_cell);d&&s.push(d)}}const a=[];for(let c=0;c<e;c+=1)a.push(i.row.createChecked(null,r&&c===0?s:l));return i.table.createChecked(null,a)}function k5(t){return t instanceof be}const il=({editor:t})=>{const{selection:e}=t.state;if(!k5(e))return!1;let n=0;const r=y0(e.ranges[0].$from,i=>i.type.name==="table");return r==null||r.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},M5=Ne.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:x5,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=S5(t,this.options.cellMinWidth);return["table",le(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=E5(i.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(X.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>o5(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>i5(t,e),deleteColumn:()=>({state:t,dispatch:e})=>l5(t,e),addRowBefore:()=>({state:t,dispatch:e})=>c5(t,e),addRowAfter:()=>({state:t,dispatch:e})=>u5(t,e),deleteRow:()=>({state:t,dispatch:e})=>f5(t,e),deleteTable:()=>({state:t,dispatch:e})=>v5(t,e),mergeCells:()=>({state:t,dispatch:e})=>hy(t,e),splitCell:()=>({state:t,dispatch:e})=>py(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ss("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ss("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>y5(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>hy(t,e)?!0:py(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>m5(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>gy(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>gy(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Mx(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=be.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:il,"Mod-Backspace":il,Delete:il,"Mod-Delete":il}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Gz({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],w5({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:se(V(t,"tableRole",e))}}}),T5=Ne.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",le(this.options.HTMLAttributes,t),0]}}),O5=Ne.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",le(this.options.HTMLAttributes,t),0]}}),on=()=>new Map,tf=t=>{const e=on();return t.forEach((n,r)=>{e.set(r,n)}),e},ii=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},A5=(t,e)=>{const n=[];for(const[r,o]of t)n.push(e(o,r));return n},R5=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},qo=()=>new Set,ku=t=>t[t.length-1],Jo=Array.from,N5=Array.isArray;class D5{constructor(){this._observers=on()}on(e,n){return ii(this._observers,e,qo).add(n),n}once(e,n){const r=(...o)=>{this.off(e,r),n(...o)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Jo((this._observers.get(e)||on()).values()).forEach(r=>r(...n))}destroy(){this._observers=on()}}const to=Math.floor,Cl=Math.abs,Nx=(t,e)=>t<e?t:e,si=(t,e)=>t>e?t:e,_5=t=>t!==0?t<0:1/t<0,vy=1,wy=2,Mu=4,Tu=8,I5=32,Dx=64,Aa=128,P5=31,xy=63,_i=127,L5=2147483647,$5=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&to(t)===t),B5=t=>t.toLowerCase(),F5=/^\s*/g,j5=t=>t.replace(F5,""),H5=/([A-Z])/g,Sy=(t,e)=>j5(t.replace(H5,n=>`${e}${B5(n)}`)),z5=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=e.codePointAt(o);return r},ls=typeof TextEncoder<"u"?new TextEncoder:null,V5=t=>ls.encode(t),W5=ls?V5:z5;let Ou=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ou&&Ou.decode(new Uint8Array).length===1&&(Ou=null);class Ts{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Hh=()=>new Ts,U5=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Mn=t=>{const e=new Uint8Array(U5(t));let n=0;for(let r=0;r<t.bufs.length;r++){const o=t.bufs[r];e.set(o,n),n+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},K5=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(si(n,e)*2),t.cpos=0)},He=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},nf=He,ye=(t,e)=>{for(;e>_i;)He(t,Aa|_i&e),e=to(e/128);He(t,_i&e)},zh=(t,e)=>{const n=_5(e);for(n&&(e=-e),He(t,(e>xy?Aa:0)|(n?Dx:0)|xy&e),e=to(e/64);e>0;)He(t,(e>_i?Aa:0)|_i&e),e=to(e/128)},rf=new Uint8Array(3e4),G5=rf.length/3,q5=(t,e)=>{if(e.length<G5){const n=ls.encodeInto(e,rf).written||0;ye(t,n);for(let r=0;r<n;r++)He(t,rf[r])}else yt(t,W5(e))},J5=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;ye(t,r);for(let o=0;o<r;o++)He(t,n.codePointAt(o))},_o=ls&&ls.encodeInto?q5:J5,Vh=(t,e)=>{const n=t.cbuf.length,r=t.cpos,o=Nx(n-r,e.length),i=e.length-o;t.cbuf.set(e.subarray(0,o),r),t.cpos+=o,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(si(n*2,i)),t.cbuf.set(e.subarray(o)),t.cpos=i)},yt=(t,e)=>{ye(t,e.byteLength),Vh(t,e)},Wh=(t,e)=>{K5(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Y5=(t,e)=>Wh(t,4).setFloat32(0,e,!1),X5=(t,e)=>Wh(t,8).setFloat64(0,e,!1),Z5=(t,e)=>Wh(t,8).setBigInt64(0,e,!1),Cy=new DataView(new ArrayBuffer(4)),Q5=t=>(Cy.setFloat32(0,t),Cy.getFloat32(0)===t),as=(t,e)=>{switch(typeof e){case"string":He(t,119),_o(t,e);break;case"number":$5(e)&&Cl(e)<=L5?(He(t,125),zh(t,e)):Q5(e)?(He(t,124),Y5(t,e)):(He(t,123),X5(t,e));break;case"bigint":He(t,122),Z5(t,e);break;case"object":if(e===null)He(t,126);else if(N5(e)){He(t,117),ye(t,e.length);for(let n=0;n<e.length;n++)as(t,e[n])}else if(e instanceof Uint8Array)He(t,116),yt(t,e);else{He(t,118);const n=Object.keys(e);ye(t,n.length);for(let r=0;r<n.length;r++){const o=n[r];_o(t,o),as(t,e[o])}}break;case"boolean":He(t,e?120:121);break;default:He(t,127)}};class Ey extends Ts{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ye(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const ky=t=>{t.count>0&&(zh(t.encoder,t.count===1?t.s:-t.s),t.count>1&&ye(t.encoder,t.count-2))};class El{constructor(){this.encoder=new Ts,this.s=0,this.count=0}write(e){this.s===e?this.count++:(ky(this),this.count=1,this.s=e)}toUint8Array(){return ky(this),Mn(this.encoder)}}const My=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);zh(t.encoder,e),t.count>1&&ye(t.encoder,t.count-2)}};class Au{constructor(){this.encoder=new Ts,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(My(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return My(this),Mn(this.encoder)}}class eV{constructor(){this.sarr=[],this.s="",this.lensE=new El}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Ts;return this.sarr.push(this.s),this.s="",_o(e,this.sarr.join("")),Vh(e,this.lensE.toUint8Array()),Mn(e)}}const Yo=t=>new Error(t),sn=()=>{throw Yo("Method unimplemented")},vr=()=>{throw Yo("Unexpected case")},tV=crypto.getRandomValues.bind(crypto),_x=()=>tV(new Uint32Array(1))[0],nV="10000000-1000-4000-8000"+-1e11,rV=()=>nV.replace(/[018]/g,t=>(t^_x()&15>>t/4).toString(16)),Ty=t=>new Promise(t);Promise.all.bind(Promise);const Oy=t=>t===void 0?null:t;class oV{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let Ix=new oV,iV=!0;try{typeof localStorage<"u"&&localStorage&&(Ix=localStorage,iV=!1)}catch{}const sV=Ix,lV=Object.assign,aV=Object.keys,cV=(t,e)=>{for(const n in t)e(t[n],n)},Ay=t=>aV(t).length,uV=t=>{for(const e in t)return!1;return!0},dV=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},fV=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),hV=(t,e)=>t===e||Ay(t)===Ay(e)&&dV(t,(n,r)=>(n!==void 0||fV(e,r))&&e[r]===n),Uh=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Uh(t,e,n+1)}},pV=(t,e)=>e.includes(t),cs=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let Gt;const mV=()=>{if(Gt===void 0)if(cs){Gt=on();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Gt.set(e,""),e=r):e!==null&&(Gt.set(e,r),e=null)}e!==null&&Gt.set(e,"")}else typeof location=="object"?(Gt=on(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Gt.set(`--${Sy(e,"-")}`,n),Gt.set(`-${Sy(e,"-")}`,n)}})):Gt=on();return Gt},of=t=>mV().has(t),sf=t=>Oy(cs?process.env[t.toUpperCase().replaceAll("-","_")]:sV.getItem(t)),Px=t=>of("--"+t)||sf(t)!==null;Px("production");const gV=cs&&pV(process.env.FORCE_COLOR,["true","1","2"]),yV=gV||!of("--no-colors")&&!Px("no-color")&&(!cs||process.stdout.isTTY)&&(!cs||of("--color")||sf("COLORTERM")!==null||(sf("TERM")||"").includes("color"));class bV{constructor(e,n){this.left=e,this.right=n}}const wn=(t,e)=>new bV(t,e);typeof DOMParser<"u"&&new DOMParser;const vV=t=>A5(t,(e,n)=>`${n}:${e};`).join(""),Fn=Symbol,Lx=Fn(),$x=Fn(),wV=Fn(),xV=Fn(),SV=Fn(),Bx=Fn(),CV=Fn(),Fx=Fn(),EV=Fn(),kV=t=>{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const i=t[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const i=t[r];i instanceof Symbol||n.push(i)}return n},MV={[Lx]:wn("font-weight","bold"),[$x]:wn("font-weight","normal"),[wV]:wn("color","blue"),[SV]:wn("color","green"),[xV]:wn("color","grey"),[Bx]:wn("color","red"),[CV]:wn("color","purple"),[Fx]:wn("color","orange"),[EV]:wn("color","black")},TV=t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],n=[],r=on();let o=[],i=0;for(;i<t.length;i++){const l=t[i],a=MV[l];if(a!==void 0)r.set(a.left,a.right);else{if(l===void 0)break;if(l.constructor===String||l.constructor===Number){const c=vV(r);i>0||c.length>0?(e.push("%c"+l),n.push(c)):e.push(l)}else break}}for(i>0&&(o=n,o.unshift(e.join("")));i<t.length;i++){const l=t[i];l instanceof Symbol||o.push(l)}return o},OV=yV?TV:kV,AV=(...t)=>{console.log(...OV(t)),RV.forEach(e=>e.print(t))},RV=qo(),jx=t=>({[Symbol.iterator](){return this},next:t}),NV=(t,e)=>jx(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Ru=(t,e)=>jx(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class DV{constructor(e,n){this.clock=e,this.len=n}}class _V{constructor(){this.clients=new Map}}const Hx=(t,e,n)=>e.clients.forEach((r,o)=>{const i=t.doc.store.clients.get(o);for(let s=0;s<r.length;s++){const l=r[s];qx(t,i,l.clock,l.len,n)}}),IV=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const o=to((n+r)/2),i=t[o],s=i.clock;if(s<=e){if(e<s+i.len)return o;n=o+1}else r=o-1}return null},zx=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&IV(n,e.clock)!==null},Vx=t=>{t.clients.forEach(e=>{e.sort((o,i)=>o.clock-i.clock);let n,r;for(n=1,r=1;n<e.length;n++){const o=e[r-1],i=e[n];o.clock+o.len>=i.clock?o.len=si(o.len,i.clock+i.len-o.clock):(r<n&&(e[r]=i),r++)}e.length=r})},Wx=(t,e,n,r)=>{ii(t.clients,e,()=>[]).push(new DV(n,r))},PV=(t,e)=>{ye(t.restEncoder,e.clients.size),Jo(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),ye(t.restEncoder,n);const o=r.length;ye(t.restEncoder,o);for(let i=0;i<o;i++){const s=r[i];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},Ux=_x;class Os extends D5{constructor({guid:e=rV(),collectionid:n=null,gc:r=!0,gcFilter:o=()=>!0,meta:i=null,autoLoad:s=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=o,this.clientID=Ux(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new WV,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=s,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=Ty(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>Ty(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Ce(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Jo(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Ce(this,e,n)}get(e,n=Xe){const r=ii(this.share,e,()=>{const i=new n;return i._integrate(this,null),i}),o=r.constructor;if(n!==Xe&&o!==n)if(o===Xe){const i=new n;i._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=i}),i._start=r._start;for(let s=i._start;s!==null;s=s.right)s.parent=i;return i._length=r._length,this.share.set(e,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Ii)}getText(e=""){return this.get(e,hs)}getMap(e=""){return this.get(e,_a)}getXmlElement(e=""){return this.get(e,ps)}getXmlFragment(e=""){return this.get(e,Xo)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){Jo(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new Os({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Ce(e.parent.doc,r=>{const o=n.doc;e.deleted||r.subdocsAdded.add(o),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class LV{constructor(){this.restEncoder=Hh()}toUint8Array(){return Mn(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ye(this.restEncoder,e)}writeDsLen(e){ye(this.restEncoder,e)}}class $V extends LV{writeLeftID(e){ye(this.restEncoder,e.client),ye(this.restEncoder,e.clock)}writeRightID(e){ye(this.restEncoder,e.client),ye(this.restEncoder,e.clock)}writeClient(e){ye(this.restEncoder,e)}writeInfo(e){nf(this.restEncoder,e)}writeString(e){_o(this.restEncoder,e)}writeParentInfo(e){ye(this.restEncoder,e?1:0)}writeTypeRef(e){ye(this.restEncoder,e)}writeLen(e){ye(this.restEncoder,e)}writeAny(e){as(this.restEncoder,e)}writeBuf(e){yt(this.restEncoder,e)}writeJSON(e){_o(this.restEncoder,JSON.stringify(e))}writeKey(e){_o(this.restEncoder,e)}}class BV{constructor(){this.restEncoder=Hh(),this.dsCurrVal=0}toUint8Array(){return Mn(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,ye(this.restEncoder,n)}writeDsLen(e){e===0&&vr(),ye(this.restEncoder,e-1),this.dsCurrVal+=e}}class FV extends BV{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Au,this.clientEncoder=new El,this.leftClockEncoder=new Au,this.rightClockEncoder=new Au,this.infoEncoder=new Ey(nf),this.stringEncoder=new eV,this.parentInfoEncoder=new Ey(nf),this.typeRefEncoder=new El,this.lenEncoder=new El}toUint8Array(){const e=Hh();return ye(e,0),yt(e,this.keyClockEncoder.toUint8Array()),yt(e,this.clientEncoder.toUint8Array()),yt(e,this.leftClockEncoder.toUint8Array()),yt(e,this.rightClockEncoder.toUint8Array()),yt(e,Mn(this.infoEncoder)),yt(e,this.stringEncoder.toUint8Array()),yt(e,Mn(this.parentInfoEncoder)),yt(e,this.typeRefEncoder.toUint8Array()),yt(e,this.lenEncoder.toUint8Array()),Vh(e,Mn(this.restEncoder)),Mn(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){as(this.restEncoder,e)}writeBuf(e){yt(this.restEncoder,e)}writeJSON(e){as(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const jV=(t,e,n,r)=>{r=si(r,e[0].id.clock);const o=Dn(e,r);ye(t.restEncoder,e.length-o),t.writeClient(n),ye(t.restEncoder,r);const i=e[o];i.write(t,r-i.id.clock);for(let s=o+1;s<e.length;s++)e[s].write(t,0)},HV=(t,e,n)=>{const r=new Map;n.forEach((o,i)=>{dt(e,i)>o&&r.set(i,o)}),Kh(e).forEach((o,i)=>{n.has(i)||r.set(i,0)}),ye(t.restEncoder,r.size),Jo(r.entries()).sort((o,i)=>i[0]-o[0]).forEach(([o,i])=>{jV(t,e.clients.get(o),o,i)})},zV=(t,e)=>HV(t,e.doc.store,e.beforeState);class VV{constructor(){this.l=[]}}const Ry=()=>new VV,Ny=(t,e)=>t.l.push(e),Dy=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(o=>e!==o),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Kx=(t,e,n)=>Uh(t.l,[e,n]);class kl{constructor(e,n){this.client=e,this.clock=n}}const sl=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ee=(t,e)=>new kl(t,e),us=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw vr()};class Ra{constructor(e,n,r,o=0){this.type=e,this.tname=n,this.item=r,this.assoc=o}}const ll=(t,e,n)=>{let r=null,o=null;return t._item===null?o=us(t):r=Ee(t._item.id.client,t._item.id.clock),new Ra(r,o,e,n)},Nu=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return ll(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return ll(t,Ee(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return ll(t,r.lastId,n);r=r.right}return ll(t,null,n)},Eo=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!zx(e.ds,t.id),lf=(t,e)=>{const n=ii(t.meta,lf,qo),r=t.doc.store;n.has(e)||(e.sv.forEach((o,i)=>{o<dt(r,i)&&wr(t,Ee(i,o))}),Hx(t,e.ds,o=>{}),n.add(e))};class WV{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Kh=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const o=n[n.length-1];e.set(r,o.id.clock+o.length)}),e},dt=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},Gx=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw vr()}n.push(e)},Dn=(t,e)=>{let n=0,r=t.length-1,o=t[r],i=o.id.clock;if(i===e)return r;let s=to(e/(i+o.length-1)*r);for(;n<=r;){if(o=t[s],i=o.id.clock,i<=e){if(e<i+o.length)return s;n=s+1}else r=s-1;s=to((n+r)/2)}throw vr()},UV=(t,e)=>{const n=t.clients.get(e.client);return n[Dn(n,e.clock)]},Du=UV,af=(t,e,n)=>{const r=Dn(e,n),o=e[r];return o.id.clock<n&&o instanceof tt?(e.splice(r+1,0,fS(t,o,n-o.id.clock)),r+1):r},wr=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[af(t,n,e.clock)]},_y=(t,e,n)=>{const r=e.clients.get(n.client),o=Dn(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==nr&&r.splice(o+1,0,fS(t,i,n.clock-i.id.clock+1)),i},KV=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Dn(r,e.id.clock)]=n},qx=(t,e,n,r,o)=>{if(r===0)return;const i=n+r;let s=af(t,e,n),l;do l=e[s++],i<l.id.clock+l.length&&af(t,e,i),o(l);while(s<e.length&&e[s].id.clock<i)};class GV{constructor(e,n,r){this.doc=e,this.deleteSet=new _V,this.beforeState=Kh(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Iy=(t,e)=>e.deleteSet.clients.size===0&&!R5(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Vx(e.deleteSet),zV(t,e),PV(t,e.deleteSet),!0),Py=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&ii(t.changed,e,qo).add(n)},Ml=(t,e)=>{let n=t[e],r=t[e-1],o=e;for(;o>0;n=r,r=t[--o-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof tt&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const i=e-o;return i&&t.splice(e+1-i,i),i},qV=(t,e,n)=>{for(const[r,o]of t.clients.entries()){const i=e.clients.get(r);for(let s=o.length-1;s>=0;s--){const l=o[s],a=l.clock+l.len;for(let c=Dn(i,l.clock),u=i[c];c<i.length&&u.id.clock<a;u=i[++c]){const d=i[c];if(l.clock+l.len<=d.id.clock)break;d instanceof tt&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},JV=(t,e)=>{t.clients.forEach((n,r)=>{const o=e.clients.get(r);for(let i=n.length-1;i>=0;i--){const s=n[i],l=Nx(o.length-1,1+Dn(o,s.clock+s.len-1));for(let a=l,c=o[a];a>0&&c.id.clock>=s.clock;c=o[a])a-=1+Ml(o,a)}})},Jx=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{Vx(i),n.afterState=Kh(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const l=[];n.changed.forEach((a,c)=>l.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,a)})),l.push(()=>{n.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(u=>u.target._item===null||!u.target._item.deleted),a.forEach(u=>{u.currentTarget=c,u._path=null}),a.sort((u,d)=>u.path.length-d.path.length),Kx(c._dEH,a,n))})}),l.push(()=>r.emit("afterTransaction",[n,r])),Uh(l,[]),n._needFormattingCleanup&&l4(n)}finally{r.gc&&qV(i,o,r.gcFilter),JV(i,o),n.afterState.forEach((u,d)=>{const f=n.beforeState.get(d)||0;if(f!==u){const h=o.clients.get(d),p=si(Dn(h,f),1);for(let m=h.length-1;m>=p;)m-=1+Ml(h,m)}});for(let u=s.length-1;u>=0;u--){const{client:d,clock:f}=s[u].id,h=o.clients.get(d),p=Dn(h,f);p+1<h.length&&Ml(h,p+1)>1||p>0&&Ml(h,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(AV(Fx,Lx,"[yjs] ",$x,Bx,"Changed the client-id because another client seems to be using it."),r.clientID=Ux()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new $V;Iy(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new FV;Iy(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=n;(l.size>0||c.size>0||a.size>0)&&(l.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,n]),c.forEach(u=>u.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):Jx(t,e+1)}}},Ce=(t,e,n=null,r=!0)=>{const o=t._transactionCleanups;let i=!1,s=null;t._transaction===null&&(i=!0,t._transaction=new GV(t,n,r),o.push(t._transaction),o.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(i){const l=t._transaction===o[0];t._transaction=null,l&&Jx(o,0)}}return s},Ly="You must not compute changes after the event-handler fired.";class xc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=YV(this.currentTarget,this.target))}deletes(e){return zx(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Yo(Ly);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(o=>{if(o!==null){const i=n._map.get(o);let s,l;if(this.adds(i)){let a=i.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(i))if(a!==null&&this.deletes(a))s="delete",l=ku(a.content.getContent());else return;else a!==null&&this.deletes(a)?(s="update",l=ku(a.content.getContent())):(s="add",l=void 0)}else if(this.deletes(i))s="delete",l=ku(i.content.getContent());else return;e.set(o,{action:s,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Yo(Ly);const n=this.target,r=qo(),o=qo(),i=[];if(e={added:r,deleted:o,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const a=()=>{l&&i.push(l)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,o.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const YV=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,o=e._item.parent._start;for(;o!==e._item&&o!==null;)!o.deleted&&o.countable&&(r+=o.length),o=o.right;n.unshift(r)}e=e._item.parent}return n},Yx=80;let Gh=0;class XV{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Gh++}}const ZV=t=>{t.timestamp=Gh++},Xx=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Gh++},QV=(t,e,n)=>{if(t.length>=Yx){const r=t.reduce((o,i)=>o.timestamp<i.timestamp?o:i);return Xx(r,e,n),r}else{const r=new XV(e,n);return t.push(r),r}},Sc=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((i,s)=>Cl(e-i.index)<Cl(e-s.index)?i:s);let r=t._start,o=0;for(n!==null&&(r=n.p,o=n.index,ZV(n));r.right!==null&&o<e;){if(!r.deleted&&r.countable){if(e<o+r.length)break;o+=r.length}r=r.right}for(;r.left!==null&&o>e;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return n!==null&&Cl(n.index-o)<r.parent.length/Yx?(Xx(n,r,o),n):QV(t._searchMarker,r,o)},ds=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const o=t[r];if(n>0){let i=o.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(o.index-=i.length);if(i===null||i.marker===!0){t.splice(r,1);continue}o.p=i,i.marker=!0}(e<o.index||n>0&&e===o.index)&&(o.index=si(e,o.index+n))}},Cc=(t,e,n)=>{const r=t,o=e.changedParentTypes;for(;ii(o,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;Kx(r._eH,n,e)};class Xe{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Ry(),this._dEH=Ry(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw sn()}clone(){throw sn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Ny(this._eH,e)}observeDeep(e){Ny(this._dEH,e)}unobserve(e){Dy(this._eH,e)}unobserveDeep(e){Dy(this._dEH,e)}toJSON(){}}const Zx=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const o=[];let i=t._start;for(;i!==null&&r>0;){if(i.countable&&!i.deleted){const s=i.content.getContent();if(s.length<=e)e-=s.length;else{for(let l=e;l<s.length&&r>0;l++)o.push(s[l]),r--;e=0}}i=i.right}return o},Qx=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let o=0;o<r.length;o++)e.push(r[o])}n=n.right}return e},fs=(t,e)=>{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let i=0;i<o.length;i++)e(o[i],n++,t)}r=r.right}},eS=(t,e)=>{const n=[];return fs(t,(r,o)=>{n.push(e(r,o,t))}),n},e4=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const o=n[r++];return n.length<=r&&(n=null),{done:!1,value:o}}}},tS=(t,e)=>{const n=Sc(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Na=(t,e,n,r)=>{let o=n;const i=t.doc,s=i.clientID,l=i.store,a=n===null?e._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new Zo(c)),o.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new Ec(new Uint8Array(d))),o.integrate(t,0);break;case Os:o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new kc(d)),o.integrate(t,0);break;default:if(d instanceof Xe)o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new Or(d)),o.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},nS=()=>Yo("Length exceeded!"),rS=(t,e,n,r)=>{if(n>e._length)throw nS();if(n===0)return e._searchMarker&&ds(e._searchMarker,n,r.length),Na(t,e,null,r);const o=n,i=Sc(e,n);let s=e._start;for(i!==null&&(s=i.p,n-=i.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&wr(t,Ee(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&ds(e._searchMarker,o,r.length),Na(t,e,s,r)},t4=(t,e,n)=>{let o=(e._searchMarker||[]).reduce((i,s)=>s.index>i.index?s:i,{index:0,p:e._start}).p;if(o)for(;o.right;)o=o.right;return Na(t,e,o,n)},oS=(t,e,n,r)=>{if(r===0)return;const o=n,i=r,s=Sc(e,n);let l=e._start;for(s!==null&&(l=s.p,n-=s.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&wr(t,Ee(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&wr(t,Ee(l.id.client,l.id.clock+r)),l.delete(t),r-=l.length),l=l.right;if(r>0)throw nS();e._searchMarker&&ds(e._searchMarker,o,-i+r)},Da=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},qh=(t,e,n,r)=>{const o=e._map.get(n)||null,i=t.doc,s=i.clientID;let l;if(r==null)l=new Zo([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:l=new Zo([r]);break;case Uint8Array:l=new Ec(r);break;case Os:l=new kc(r);break;default:if(r instanceof Xe)l=new Or(r);else throw new Error("Unexpected content type")}new tt(Ee(s,dt(i.store,s)),o,o&&o.lastId,null,null,e,n,l).integrate(t,0)},Jh=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},iS=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},sS=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},n4=(t,e)=>{const n={};return t._map.forEach((r,o)=>{let i=r;for(;i!==null&&(!e.sv.has(i.id.client)||i.id.clock>=(e.sv.get(i.id.client)||0));)i=i.left;i!==null&&Eo(i,e)&&(n[o]=i.content.getContent()[i.length-1])}),n},al=t=>NV(t.entries(),e=>!e[1].deleted);class r4 extends xc{}class Ii extends Xe{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Ii;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ii}clone(){const e=new Ii;return e.insert(0,this.toArray().map(n=>n instanceof Xe?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),Cc(this,e,new r4(this,e))}insert(e,n){this.doc!==null?Ce(this.doc,r=>{rS(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Ce(this.doc,n=>{t4(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Ce(this.doc,r=>{oS(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return tS(this,e)}toArray(){return Qx(this)}slice(e=0,n=this.length){return Zx(this,e,n)}toJSON(){return this.map(e=>e instanceof Xe?e.toJSON():e)}map(e){return eS(this,e)}forEach(e){fs(this,e)}[Symbol.iterator](){return e4(this)}_write(e){e.writeTypeRef(f4)}}class o4 extends xc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class _a extends Xe{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,o)=>{this.set(o,r)}),this._prelimContent=null}_copy(){return new _a}clone(){const e=new _a;return this.forEach((n,r)=>{e.set(r,n instanceof Xe?n.clone():n)}),e}_callObserver(e,n){Cc(this,e,new o4(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const o=n.content.getContent()[n.length-1];e[r]=o instanceof Xe?o.toJSON():o}}),e}get size(){return[...al(this._map)].length}keys(){return Ru(al(this._map),e=>e[0])}values(){return Ru(al(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Ru(al(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Ce(this.doc,n=>{Da(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Ce(this.doc,r=>{qh(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return Jh(this,e)}has(e){return sS(this,e)}clear(){this.doc!==null?Ce(this.doc,e=>{this.forEach(function(n,r,o){Da(e,o,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(h4)}}const lr=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&hV(t,e);class cf{constructor(e,n,r,o){this.left=e,this.right=n,this.index=r,this.currentAttributes=o}forward(){switch(this.right===null&&vr(),this.right.content.constructor){case Ke:this.right.deleted||li(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const $y=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Ke:e.right.deleted||li(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&wr(t,Ee(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},cl=(t,e,n,r)=>{const o=new Map,i=r?Sc(e,n):null;if(i){const s=new cf(i.p.left,i.p,i.index,o);return $y(t,s,n-i.index)}else{const s=new cf(null,e._start,0,o);return $y(t,s,n)}},lS=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Ke&&lr(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=t.doc,i=o.clientID;r.forEach((s,l)=>{const a=n.left,c=n.right,u=new tt(Ee(i,dt(o.store,i)),a,a&&a.lastId,c,c&&c.id,e,null,new Ke(l,s));u.integrate(t,0),n.right=u,n.forward()})},li=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},aS=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Ke&&lr(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},cS=(t,e,n,r)=>{const o=t.doc,i=o.clientID,s=new Map;for(const l in r){const a=r[l],c=n.currentAttributes.get(l)??null;if(!lr(c,a)){s.set(l,c);const{left:u,right:d}=n;n.right=new tt(Ee(i,dt(o.store,i)),u,u&&u.lastId,d,d&&d.id,e,null,new Ke(l,a)),n.right.integrate(t,0),n.forward()}}return s},_u=(t,e,n,r,o)=>{n.currentAttributes.forEach((f,h)=>{o[h]===void 0&&(o[h]=null)});const i=t.doc,s=i.clientID;aS(n,o);const l=cS(t,e,n,o),a=r.constructor===String?new _n(r):r instanceof Xe?new Or(r):new ai(r);let{left:c,right:u,index:d}=n;e._searchMarker&&ds(e._searchMarker,n.index,a.getLength()),u=new tt(Ee(s,dt(i.store,s)),c,c&&c.lastId,u,u&&u.id,e,null,a),u.integrate(t,0),n.right=u,n.index=d,n.forward(),lS(t,e,n,l)},By=(t,e,n,r,o)=>{const i=t.doc,s=i.clientID;aS(n,o);const l=cS(t,e,n,o);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===Ke));){if(!n.right.deleted)switch(n.right.content.constructor){case Ke:{const{key:a,value:c}=n.right.content,u=o[a];if(u!==void 0){if(lr(u,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}n.right.delete(t)}else n.currentAttributes.set(a,c);break}default:r<n.right.length&&wr(t,Ee(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
517
- `;n.right=new tt(Ee(s,dt(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new _n(a)),n.right.integrate(t,0),n.forward()}lS(t,e,n,l)},uS=(t,e,n,r,o)=>{let i=e;const s=on();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Ke){const c=i.content;s.set(c.key,c)}i=i.right}let l=0,a=!1;for(;e!==i;){if(n===e&&(a=!0),!e.deleted){const c=e.content;switch(c.constructor){case Ke:{const{key:u,value:d}=c,f=r.get(u)??null;(s.get(u)!==c||f===d)&&(e.delete(t),l++,!a&&(o.get(u)??null)===d&&f!==d&&(f===null?o.delete(u):o.set(u,f))),!a&&!e.deleted&&li(o,c);break}}}e=e.right}return l},i4=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Ke){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},s4=t=>{let e=0;return Ce(t.doc,n=>{let r=t._start,o=t._start,i=on();const s=tf(i);for(;o;){if(o.deleted===!1)switch(o.content.constructor){case Ke:li(s,o.content);break;default:e+=uS(n,r,o,i,s),i=tf(s),r=o;break}o=o.right}}),e},l4=t=>{const e=new Set,n=t.doc;for(const[r,o]of t.afterState.entries()){const i=t.beforeState.get(r)||0;o!==i&&qx(t,n.store.clients.get(r),i,o,s=>{!s.deleted&&s.content.constructor===Ke&&s.constructor!==nr&&e.add(s.parent)})}Ce(n,r=>{Hx(t,t.deleteSet,o=>{if(o instanceof nr||!o.parent._hasFormatting||e.has(o.parent))return;const i=o.parent;o.content.constructor===Ke?e.add(i):i4(r,o)});for(const o of e)s4(o)})},Fy=(t,e,n)=>{const r=n,o=tf(e.currentAttributes),i=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Or:case ai:case _n:n<e.right.length&&wr(t,Ee(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}i&&uS(t,i,e.right,o,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&ds(s._searchMarker,e.index,-r+n),e};class a4 extends xc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(o=>{o===null?this.childListChanged=!0:this.keysChanged.add(o)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Ce(e,r=>{const o=new Map,i=new Map;let s=this.target._start,l=null;const a={};let c="",u=0,d=0;const f=()=>{if(l!==null){let h=null;switch(l){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},o.size>0&&(h.attributes={},o.forEach((p,m)=>{p!==null&&(h.attributes[m]=p)}))),c="";break;case"retain":u>0&&(h={retain:u},uV(a)||(h.attributes=lV({},a))),u=0;break}h&&n.push(h),l=null}};for(;s!==null;){switch(s.content.constructor){case Or:case ai:this.adds(s)?this.deletes(s)||(f(),l="insert",c=s.content.getContent()[0],f()):this.deletes(s)?(l!=="delete"&&(f(),l="delete"),d+=1):s.deleted||(l!=="retain"&&(f(),l="retain"),u+=1);break;case _n:this.adds(s)?this.deletes(s)||(l!=="insert"&&(f(),l="insert"),c+=s.content.str):this.deletes(s)?(l!=="delete"&&(f(),l="delete"),d+=s.length):s.deleted||(l!=="retain"&&(f(),l="retain"),u+=s.length);break;case Ke:{const{key:h,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const m=o.get(h)??null;lr(m,p)?p!==null&&s.delete(r):(l==="retain"&&f(),lr(p,i.get(h)??null)?delete a[h]:a[h]=p)}}else if(this.deletes(s)){i.set(h,p);const m=o.get(h)??null;lr(m,p)||(l==="retain"&&f(),a[h]=m)}else if(!s.deleted){i.set(h,p);const m=a[h];m!==void 0&&(lr(m,p)?m!==null&&s.delete(r):(l==="retain"&&f(),p===null?delete a[h]:a[h]=p))}s.deleted||(l==="insert"&&f(),li(o,s.content));break}}s=s.right}for(f();n.length>0;){const h=n[n.length-1];if(h.retain!==void 0&&h.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class hs extends Xe{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new hs}clone(){const e=new hs;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new a4(this,e,n);Cc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===_n&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Ce(this.doc,r=>{const o=new cf(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const s=e[i];if(s.insert!==void 0){const l=!n&&typeof s.insert=="string"&&i===e.length-1&&o.right===null&&s.insert.slice(-1)===`
518
- `?s.insert.slice(0,-1):s.insert;(typeof l!="string"||l.length>0)&&_u(r,this,o,l,s.attributes||{})}else s.retain!==void 0?By(r,this,o,s.retain,s.attributes||{}):s.delete!==void 0&&Fy(r,o,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const o=[],i=new Map,s=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;i.forEach((p,m)=>{f=!0,d[m]=p});const h={insert:l};f&&(h.attributes=d),o.push(h),l=""}}const u=()=>{for(;a!==null;){if(Eo(a,e)||n!==void 0&&Eo(a,n))switch(a.content.constructor){case _n:{const d=i.get("ychange");e!==void 0&&!Eo(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),i.set("ychange",r?r("removed",a.id):{type:"removed"})):n!==void 0&&!Eo(a,n)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),i.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),i.delete("ychange")),l+=a.content.str;break}case Or:case ai:{c();const d={insert:a.content.getContent()[0]};if(i.size>0){const f={};d.attributes=f,i.forEach((h,p)=>{f[p]=h})}o.push(d);break}case Ke:Eo(a,e)&&(c(),li(i,a.content));break}a=a.right}c()};return e||n?Ce(s,d=>{e&&lf(d,e),n&&lf(d,n),u()},"cleanup"):u(),o}insert(e,n,r){if(n.length<=0)return;const o=this.doc;o!==null?Ce(o,i=>{const s=cl(i,this,e,!r);r||(r={},s.currentAttributes.forEach((l,a)=>{r[a]=l})),_u(i,this,s,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const o=this.doc;o!==null?Ce(o,i=>{const s=cl(i,this,e,!r);_u(i,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Ce(r,o=>{Fy(o,cl(o,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const o=this.doc;o!==null?Ce(o,i=>{const s=cl(i,this,e,!1);s.right!==null&&By(i,this,s,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Ce(this.doc,n=>{Da(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Ce(this.doc,r=>{qh(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return Jh(this,e)}getAttributes(){return iS(this)}_write(e){e.writeTypeRef(p4)}}class Iu{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===ps||n.constructor===Xo)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Xo extends Xe{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Xo}clone(){const e=new Xo;return e.insert(0,this.toArray().map(n=>n instanceof Xe?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Iu(this,e)}querySelector(e){e=e.toUpperCase();const r=new Iu(this,o=>o.nodeName&&o.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Jo(new Iu(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Cc(this,e,new c4(this,n,e))}toString(){return eS(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const o=e.createDocumentFragment();return r!==void 0&&r._createAssociation(o,this),fs(this,i=>{o.insertBefore(i.toDOM(e,n,r),null)}),o}insert(e,n){this.doc!==null?Ce(this.doc,r=>{rS(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Ce(this.doc,r=>{const o=e&&e instanceof Xe?e._item:e;Na(r,this,o,n)});else{const r=this._prelimContent,o=e===null?0:r.findIndex(i=>i===e)+1;if(o===0&&e!==null)throw Yo("Reference item not found");r.splice(o,0,...n)}}delete(e,n=1){this.doc!==null?Ce(this.doc,r=>{oS(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return Qx(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return tS(this,e)}slice(e=0,n=this.length){return Zx(this,e,n)}forEach(e){fs(this,e)}_write(e){e.writeTypeRef(g4)}}class ps extends Xo{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,o)=>{this.setAttribute(o,r)}),this._prelimAttrs=null}_copy(){return new ps(this.nodeName)}clone(){const e=new ps(this.nodeName),n=this.getAttributes();return cV(n,(r,o)=>{typeof r=="string"&&e.setAttribute(o,r)}),e.insert(0,this.toArray().map(r=>r instanceof Xe?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const l in e)r.push(l);r.sort();const o=r.length;for(let l=0;l<o;l++){const a=r[l];n.push(a+'="'+e[a]+'"')}const i=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${i}${s}>${super.toString()}</${i}>`}removeAttribute(e){this.doc!==null?Ce(this.doc,n=>{Da(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Ce(this.doc,r=>{qh(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return Jh(this,e)}hasAttribute(e){return sS(this,e)}getAttributes(e){return e?n4(this,e):iS(this)}toDOM(e=document,n={},r){const o=e.createElement(this.nodeName),i=this.getAttributes();for(const s in i){const l=i[s];typeof l=="string"&&o.setAttribute(s,l)}return fs(this,s=>{o.appendChild(s.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(o,this),o}_write(e){e.writeTypeRef(m4),e.writeKey(this.nodeName)}}class c4 extends xc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(o=>{o===null?this.childListChanged=!0:this.attributesChanged.add(o)})}}class ms extends hs{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new ms}clone(){const e=new ms;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const o=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(o,this),o}toString(){return this.toDelta().map(e=>{const n=[];for(const o in e.attributes){const i=[];for(const s in e.attributes[o])i.push({key:s,value:e.attributes[o][s]});i.sort((s,l)=>s.key<l.key?-1:1),n.push({nodeName:o,attrs:i})}n.sort((o,i)=>o.nodeName<i.nodeName?-1:1);let r="";for(let o=0;o<n.length;o++){const i=n[o];r+=`<${i.nodeName}`;for(let s=0;s<i.attrs.length;s++){const l=i.attrs[s];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let o=n.length-1;o>=0;o--)r+=`</${n[o].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(y4)}}class dS{constructor(e,n){this.id=e,this.length=n}get deleted(){throw sn()}mergeWith(e){return!1}write(e,n,r){throw sn()}integrate(e,n){throw sn()}}const u4=0;class nr extends dS{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),Gx(e.doc.store,this)}write(e,n){e.writeInfo(u4),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Ec{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ec(this.content)}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class Ia{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Ia(this.len)}splice(e){const n=new Ia(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Wx(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const d4=(t,e)=>new Os({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class kc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new kc(d4(this.doc.guid,this.opts))}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class ai{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ai(this.embed)}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class Ke{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ke(this.key,this.value)}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Zo{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Zo(this.arr)}splice(e){const n=new Zo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let o=n;o<r;o++){const i=this.arr[o];e.writeAny(i)}}getRef(){return 8}}class _n{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new _n(this.str)}splice(e){const n=new _n(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const f4=0,h4=1,p4=2,m4=3,g4=4,y4=6;class Or{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Or(this.type._copy())}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const fS=(t,e,n)=>{const{client:r,clock:o}=e.id,i=new tt(Ee(r,o+n),e,Ee(r,o+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),e.redone!==null&&(i.redone=Ee(e.redone.client,e.redone.clock+n)),e.right=i,i.right!==null&&(i.right.left=i),t._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),e.length=n,i};class tt extends dS{constructor(e,n,r,o,i,s,l,a){super(e,a.getLength()),this.origin=r,this.left=n,this.right=o,this.rightOrigin=i,this.parent=s,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?wy:0}set marker(e){(this.info&Tu)>0!==e&&(this.info^=Tu)}get marker(){return(this.info&Tu)>0}get keep(){return(this.info&vy)>0}set keep(e){this.keep!==e&&(this.info^=vy)}get countable(){return(this.info&wy)>0}get deleted(){return(this.info&Mu)>0}set deleted(e){this.deleted!==e&&(this.info^=Mu)}markDeleted(){this.info|=Mu}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=dt(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=dt(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===kl&&this.id.client!==this.parent.client&&this.parent.clock>=dt(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=_y(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=wr(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===nr||this.right&&this.right.constructor===nr)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===tt&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===tt&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===kl){const r=Du(n,this.parent);r.constructor===nr?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=_y(e,e.doc.store,Ee(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,o;if(r!==null)o=r.right;else if(this.parentSub!==null)for(o=this.parent._map.get(this.parentSub)||null;o!==null&&o.left!==null;)o=o.left;else o=this.parent._start;const i=new Set,s=new Set;for(;o!==null&&o!==this.right;){if(s.add(o),i.add(o),sl(this.origin,o.origin)){if(o.id.client<this.id.client)r=o,i.clear();else if(sl(this.rightOrigin,o.rightOrigin))break}else if(o.origin!==null&&s.has(Du(e.doc.store,o.origin)))i.has(Du(e.doc.store,o.origin))||(r=o,i.clear());else break;o=o.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Gx(e.doc.store,this),this.content.integrate(e,this),Py(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new nr(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ee(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&sl(e.origin,this.lastId)&&this.right===e&&sl(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Wx(e.deleteSet,this.id.client,this.id.clock,this.length),Py(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw vr();this.content.gc(e),n?KV(e,this,new nr(this.id,this.length)):this.content=new Ia(this.length)}write(e,n){const r=n>0?Ee(this.id.client,this.id.clock+n-1):this.origin,o=this.rightOrigin,i=this.parentSub,s=this.content.getRef()&P5|(r===null?0:Aa)|(o===null?0:Dx)|(i===null?0:I5);if(e.writeInfo(s),r!==null&&e.writeLeftID(r),o!==null&&e.writeRightID(o),r===null&&o===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=us(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===kl?(e.writeParentInfo(!1),e.writeLeftID(l)):vr();i!==null&&e.writeString(i)}this.content.write(e,n)}}const hS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},pS="__ $YJS$ __";hS[pS]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");hS[pS]=!0;const b4=new we("y-sync");new we("y-undo");new we("yjs-cursor");const v4=(t,e,n)=>{if(t===0)return Nu(e,0,-1);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof ms){if(r._length>=t)return Nu(r,t,-1);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<o)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&o>1)return new Ra(r._item===null?null:r._item.id,r._item===null?us(r):null,null);if(t-=o,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Ra(r._item===null?null:r._item.id,r._item===null?us(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw vr();if(t===0&&r.constructor!==ms&&r!==e)return w4(r._item.parent,r._item)}return Nu(e,e._length,-1)},w4=(t,e)=>{let n=null,r=null;return t._item===null?r=us(t):n=Ee(t._item.id.client,t._item.id.clock),new Ra(n,r,e.id)};function Yh(t,e,n){const r=[],o=t.node(0);n=typeof n=="number"&&n>=0?n:t.sameParent(e)?Math.max(0,t.sharedDepth(e.pos)-1):t.sharedDepth(e.pos);const i=new Li(t,e,n),s=i.depth===0?0:o.resolve(i.start).posAtIndex(0);return i.parent.forEach((l,a)=>{const c=s+a,u=c+l.nodeSize;if(c<i.start||c>=i.end)return;const d=new pf(o.resolve(c),o.resolve(u));r.push(d)}),r}class Xh{constructor(e,n){Ns(this,"anchor");Ns(this,"head");this.anchor=e,this.head=n}map(e){return new Xh(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return new Xt(n,r)}}class Xt extends Q{constructor(n,r,o,i=1){const{doc:s}=n,l=n===r,a=n.pos===s.content.size&&r.pos===s.content.size,c=l&&!a?s.resolve(r.pos+(i>0?1:-1)):r,u=l&&a?s.resolve(n.pos-(i>0?1:-1)):n,d=Yh(u.min(c),u.max(c),o);super(c.pos>=n.pos?d[0].$from:d[d.length-1].$to,c.pos>=n.pos?d[d.length-1].$to:d[0].$from,d);Ns(this,"depth");this.depth=o}get $to(){return this.ranges[this.ranges.length-1].$to}eq(n){return n instanceof Xt&&n.$from.pos===this.$from.pos&&n.$to.pos===this.$to.pos}map(n,r){const o=n.resolve(r.map(this.anchor)),i=n.resolve(r.map(this.head));return new Xt(o,i)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:n}=this.$from;if(this.isForwards&&this.ranges.length>1){const i=this.ranges.slice(0,-1),s=i[0].$from,l=i[i.length-1].$to;return new Xt(s,l,this.depth)}const r=this.ranges[0],o=n.resolve(Math.max(0,r.$from.pos-1));return new Xt(this.$anchor,o,this.depth)}extendForwards(){const{doc:n}=this.$from;if(this.isBackwards&&this.ranges.length>1){const i=this.ranges.slice(1),s=i[0].$from,l=i[i.length-1].$to;return new Xt(l,s,this.depth)}const r=this.ranges[this.ranges.length-1],o=n.resolve(Math.min(n.content.size,r.$to.pos+1));return new Xt(this.$anchor,o,this.depth)}static fromJSON(n,r){return new Xt(n.resolve(r.anchor),n.resolve(r.head))}static create(n,r,o,i,s=1){return new this(n.resolve(r),n.resolve(o),i,s)}getBookmark(){return new Xh(this.anchor,this.head)}}function x4(t){const e=t.cloneNode(!0),n=[t,...Array.from(t.getElementsByTagName("*"))],r=[e,...Array.from(e.getElementsByTagName("*"))];return n.forEach((o,i)=>{r[i].style.cssText=function(s){let l="";const a=getComputedStyle(s);for(let c=0;c<a.length;c+=1)l+=`${a[c]}:${a.getPropertyValue(a[c])};`;return l}(o)}),e}function ul(t,e){return window.getComputedStyle(t)[e]}function S4(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function jy(t){t.parentNode!==null&&t.parentNode!==void 0&&t.parentNode.removeChild(t)}const mS=t=>{const{x:e,y:n,direction:r,editor:o}=t;let i=null,s=null,l=null,a=e;for(;s===null&&a<window.innerWidth&&a>0;){const c=document.elementsFromPoint(a,n),u=c.findIndex(f=>f.classList.contains("ProseMirror")),d=c.slice(0,u);if(d.length>0){const f=d[0];if(i=f,l=o.view.posAtDOM(f,0),l>=0){s=o.state.doc.nodeAt(Math.max(l-1,0)),(s===null||s.isText)&&(s=o.state.doc.nodeAt(Math.max(l-1,0))),s||(s=o.state.doc.nodeAt(Math.max(l,0)));break}}r==="left"?a-=1:a+=1}return{resultElement:i,resultNode:s,pos:l!==null?l:null}};function C4(t,e){const{doc:n}=e.view.state,r=mS({editor:e,x:t.clientX,y:t.clientY,direction:"right"});if(!r.resultNode||r.pos===null)return[];const o=t.clientX,i=function(u,d,f){const h=parseInt(ul(u.dom,"paddingLeft"),10),p=parseInt(ul(u.dom,"paddingRight"),10),m=parseInt(ul(u.dom,"borderLeftWidth"),10),g=parseInt(ul(u.dom,"borderLeftWidth"),10),y=u.dom.getBoundingClientRect();return{left:S4(d,y.left+h+m,y.right-p-g),top:f}}(e.view,o,t.clientY),s=e.view.posAtCoords(i);if(!s)return[];const{pos:l}=s;if(!n.resolve(l).parent)return[];const a=n.resolve(r.pos),c=n.resolve(r.pos+1);return Yh(a,c,0)}const Hy=(t,e)=>{const n=t.resolve(e),{depth:r}=n;return r===0?e:n.pos-n.parentOffset-1},zy=(t,e)=>{const n=t.nodeAt(e),r=t.resolve(e);let{depth:o}=r,i=n;for(;o>0;){const s=r.node(o);o-=1,o===0&&(i=s)}return i},Pu=(t,e)=>{const n=b4.getState(t);return n?v4(e,n.type,n.binding.mapping):null},Vy=(t,e)=>{let n=e;for(;n&&n.parentNode&&n.parentNode!==t.dom;)n=n.parentNode;return n},gS=new we("dragHandle"),E4=({pluginKey:t=gS,element:e,editor:n,tippyOptions:r,onNodeChange:o})=>{const i=document.createElement("div");let s=null,l=!1,a=null,c=-1;return e.addEventListener("dragstart",u=>{const{view:d}=n;if(!u.dataTransfer)return;const{empty:f,$from:h,$to:p}=d.state.selection,m=C4(u,n),g=Yh(h,p,0),y=g.some(E=>m.find(O=>O.$from===E.$from&&O.$to===E.$to)),x=f||!y?m:g;if(!x.length)return;const{tr:S}=d.state,b=document.createElement("div"),C=x[0].$from.pos,w=x[x.length-1].$to.pos,k=Xt.create(d.state.doc,C,w),R=k.content();x.forEach(E=>{const O=x4(d.nodeDOM(E.$from.pos));b.append(O)}),b.style.position="absolute",b.style.top="-10000px",document.body.append(b),u.dataTransfer.clearData(),u.dataTransfer.setDragImage(b,0,0),d.dragging={slice:R,move:!0},S.setSelection(k),d.dispatch(S),document.addEventListener("drop",()=>jy(b),{once:!0}),setTimeout(()=>{e&&(e.style.pointerEvents="none")},0)}),e.addEventListener("dragend",()=>{e&&(e.style.pointerEvents="auto")}),new ke({key:typeof t=="string"?new we(t):t,state:{init:()=>({locked:!1}),apply(u,d,f,h){const p=u.getMeta("lockDragHandle"),m=u.getMeta("hideDragHandle");if(p!==void 0&&(l=p),m&&s)return s.hide(),l=!1,a=null,c=-1,o==null||o({editor:n,node:null,pos:-1}),d;if(u.docChanged&&c!==-1&&e&&s){const g=u.mapping.map(c);g!==c&&(c=g,Pu(h,c))}return d}},view:u=>{var d;return e.draggable=!0,e.style.pointerEvents="auto",(d=n.view.dom.parentElement)===null||d===void 0||d.appendChild(i),i.appendChild(e),i.style.pointerEvents="none",i.style.position="absolute",i.style.top="0",i.style.left="0",s=ao(u.dom,{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]},...r,appendTo:i,content:e}),{update(f,h){if(!e||!s||(e.draggable=!l,u.state.doc.eq(h.doc)||c===-1))return;let p=u.nodeDOM(c);if(p=Vy(u,p),p===u.dom||(p==null?void 0:p.nodeType)!==1)return;const m=u.posAtDOM(p,0),g=zy(n.state.doc,m);if(g!==a){const y=Hy(n.state.doc,m);a=g,c=y,Pu(u.state,c),o==null||o({editor:n,node:a,pos:c}),s.setProps({getReferenceClientRect:()=>p.getBoundingClientRect()}),s.show()}},destroy(){s==null||s.destroy(),e&&jy(i)}}},props:{handleDOMEvents:{mouseleave:(u,d)=>(l||d.target&&!i.contains(d.relatedTarget)&&(s==null||s.hide(),a=null,c=-1,o==null||o({editor:n,node:null,pos:-1})),!1),mousemove(u,d){if(!e||!s||l)return!1;const f=mS({x:d.clientX,y:d.clientY,direction:"right",editor:n});if(!f.resultElement)return!1;let h=f.resultElement;if(h=Vy(u,h),h===u.dom||(h==null?void 0:h.nodeType)!==1)return!1;const p=u.posAtDOM(h,0),m=zy(n.state.doc,p);if(m!==a){const g=Hy(n.state.doc,p);a=m,c=g,Pu(u.state,c),o==null||o({editor:n,node:a,pos:c}),s.setProps({getReferenceClientRect:()=>h.getBoundingClientRect()}),s.show()}return!1}}}})};exports.AllSelection=Nt;exports.BetweenHorizontalEnd=OT;exports.BetweenHorizontalStart=AT;exports.BetweenVerticalEnd=RT;exports.BetweenVerticalStart=NT;exports.Blockquote=G3;exports.Bold=DT;exports.Bold$1=ET;exports.BubbleMenu=oz;exports.BulletList=j3;exports.CellSelection=be;exports.CharacterCount=FF;exports.Check=_T;exports.CheckboxItem2=G_;exports.ChevronDown=IT;exports.ChevronRight=PT;exports.ChevronsUpDown=LT;exports.Circle=$T;exports.Clipboard=BT;exports.Code=jT;exports.Code$1=TN;exports.CodeBlockLowlight=A2;exports.CodeXml=FT;exports.Color=II;exports.Columns2=HT;exports.Columns3=zT;exports.Columns4=VT;exports.Content=xz;exports.Content2=mN;exports.Content2$1=W_;exports.Content2$2=_I;exports.Copy=WT;exports.Decoration=Le;exports.DecorationSet=me;exports.Document=jF;exports.DragHandlePlugin=E4;exports.Dropcursor=VF;exports.EditorContent=UH;exports.Eraser=UT;exports.Extension=Ie;exports.FocusClasses=WF;exports.FontFamily=N2;exports.Frame=KT;exports.Gapcursor=ZF;exports.GripVertical=GT;exports.HardBreak=QF;exports.Heading=vI;exports.Heading1=qT;exports.Heading2=JT;exports.Heading3=YT;exports.Highlight=B3;exports.History=BF;exports.HorizontalRule=OF;exports.Image=mz;exports.ImageUp=XT;exports.IndentDecrease=ZT;exports.IndentIncrease=QT;exports.Italic=eO;exports.Italic$1=wN;exports.Item2=K_;exports.ItemIndicator2=J_;exports.Label2=U_;exports.Link=tO;exports.Link$1=bF;exports.List=oO;exports.List$1=vz;exports.ListItem=ej;exports.ListOrdered=nO;exports.ListTodo=rO;exports.LoaderCircle=iO;exports.Maximize=sO;exports.Minimize=lO;exports.Minus=aO;exports.Node=Ne;exports.NodeViewWrapper=sz;exports.OrderedList=z3;exports.PaintRoller=cO;exports.PanelLeft=uO;exports.PanelRight=dO;exports.Paragraph=tj;exports.Pencil=fO;exports.Placeholder=nj;exports.Plugin=ke;exports.PluginKey=we;exports.Plus=hO;exports.Portal=DI;exports.Portal2=V_;exports.Provider=fN;exports.Quote=pO;exports.RadioItem2=q_;exports.ReactNodeViewRenderer=uz;exports.ReactRenderer=dx;exports.Redo2=mO;exports.Replace=gO;exports.Root=GO;exports.Root$1=P3;exports.Root$2=wF;exports.Root$3=MF;exports.Root2=H_;exports.Root2$1=RI;exports.Root2$2=bz;exports.Root3=hN;exports.Separator2=Y_;exports.Slot=Jr;exports.SmilePlus=yO;exports.Sparkles=bO;exports.Strike=EN;exports.Strikethrough=vO;exports.Sub2=X_;exports.SubContent2=Q_;exports.SubTrigger2=Z_;exports.Subscript=wO;exports.Subscript$1=oj;exports.Suggestion=hz;exports.Superscript=xO;exports.Superscript$1=ij;exports.Table=EO;exports.Table$1=M5;exports.TableCell=T5;exports.TableCellsMerge=SO;exports.TableCellsSplit=CO;exports.TableHeader=O5;exports.TableRow=Sz;exports.TaskItem=W3;exports.TaskList=U3;exports.Text=rj;exports.TextAlign=wI;exports.TextAlignCenterIcon=_O;exports.TextAlignJustifyIcon=PO;exports.TextAlignLeftIcon=$O;exports.TextAlignRightIcon=FO;exports.TextSelection=X;exports.TextStyle=R2;exports.Thumb=TF;exports.Trash=MO;exports.Trash2=kO;exports.Trigger=pN;exports.Trigger$1=z_;exports.Trigger$2=NI;exports.Trigger$3=wz;exports.Type=TO;exports.Underline=OO;exports.Underline$1=xN;exports.Undo2=AO;exports.Unlink=RO;exports.Video=NO;exports.Z=N3;exports.clsx=YO;exports.cva=JO;exports.debounce=fw;exports.deleteSelection=r0;exports.differenceBy=KB;exports.dragHandlePluginDefaultKey=gS;exports.getMarkRange=qa;exports.isActive=v0;exports.isList=od;exports.mergeAttributes=le;exports.proxy=lI;exports.sticky=FH;exports.throttle=d3;exports.tippy=ao;exports.truncate=m3;exports.twMerge=OA;exports.useEditor=nz;exports.useSnapshot=bI;
516
+ */var oy;function YH(){return oy||(oy=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=P,e=vc;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,l=t.useMemo,a=t.useDebugValue;function c(u,d,f,h,p){var m=i(null),g;m.current===null?(g={hasValue:!1,value:null},m.current=g):g=m.current;var y=l(function(){var C=!1,x,k,A=function(L){if(!C){C=!0,x=L;var H=h(L);if(p!==void 0&&g.hasValue){var U=g.value;if(p(U,H))return k=U,U}return k=H,H}var K=x,j=k;if(r(K,L))return j;var M=h(L);return p!==void 0&&p(j,M)?j:(x=L,k=M,M)},E=f===void 0?null:f,O=function(){return A(d())},_=E===null?void 0:function(){return A(E())};return[O,_]},[d,f,h,p]),w=y[0],S=y[1],b=o(u,w,S);return s(function(){g.hasValue=!0,g.value=b},[b]),a(b),b}Eu.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Eu}process.env.NODE_ENV==="production"?Jd.exports=JH():Jd.exports=YH();var XH=Jd.exports;class ZH{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function QH(t){const[e]=P.useState(()=>new ZH(t.editor)),n=XH.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);return P.useEffect(()=>e.watch(t.editor),[t.editor,e]),P.useDebugValue(n),n}const iy=process.env.NODE_ENV!=="production",Yd=typeof window>"u",ez=Yd||!!(typeof window<"u"&&window.next);class tz{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Yd||ez?(iy&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Yd&&iy)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return(i=(o=this.options.current).onBlur)===null||i===void 0?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onCreate)===null||i===void 0?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return(i=(o=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return(i=(o=this.options.current).onFocus)===null||i===void 0?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return(i=(o=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return(i=(o=this.options.current).onContentError)===null||i===void 0?void 0:i.call(o,...r)}};return new gT(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},0)}}function nz(t={},e=[]){const n=P.useRef(t);n.current=t;const[r]=P.useState(()=>new tz(n)),o=vc.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return P.useDebugValue(o),P.useEffect(r.onRender(e)),QH({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const cx=P.createContext({editor:null});cx.Consumer;const rz=()=>P.useContext(cx),oz=t=>{const[e,n]=P.useState(null),{editor:r}=rz();return P.useEffect(()=>{var o;if(!e||!((o=t.editor)===null||o===void 0)&&o.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:i="bubbleMenu",editor:s,tippyOptions:l={},updateDelay:a,shouldShow:c=null}=t,u=s||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=ax({updateDelay:a,editor:u,element:e,pluginKey:i,shouldShow:c,tippyOptions:l});return u.registerPlugin(d),()=>u.unregisterPlugin(i)},[t.editor,r,e]),P.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},ux=P.createContext({onDragStart:void 0}),iz=()=>P.useContext(ux),sz=P.forwardRef((t,e)=>{const{onDragStart:n}=iz(),r=t.as||"div";return P.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function lz(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function az(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class dx{constructor(e,{editor:n,props:r={},as:o="div",className:i="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),s&&Object.keys(s).forEach(l=>{this.element.setAttribute(l,s[l])}),this.editor.isInitialized?Ia.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,o=this.editor;(lz(n)||az(n))&&(r.ref=i=>{this.ref=i}),this.reactElement=P.createElement(n,r),(e=o==null?void 0:o.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}}class cz extends bT{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},i=this.component,s=P.memo(c=>P.createElement(ux.Provider,{value:o},P.createElement(i,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let l=this.node.isInline?"span":"div";this.options.as&&(l=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new dx(s,{editor:this.editor,props:e,as:l,className:`node-${this.node.type.name} ${a}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection;if(e<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n){const r=o=>{this.renderer.updateProps(o)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,i=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:o,oldDecorations:i,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function uz(t,e){return n=>n.editor.contentComponent?new cz(t,n,e):{}}function dz(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:s}=t,l=vT(n),a=new RegExp(`\\s${l}$`),c=i?"^":"",u=r?new RegExp(`${c}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${c}(?:^)?${l}[^\\s${l}]*`,"gm"),d=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!d)return null;const f=s.pos-d.length,h=Array.from(d.matchAll(u)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(p);if(o!==null&&!m)return null;const g=f+h.index;let y=g+h[0].length;return r&&a.test(d.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}const fz=new we("suggestion");function hz({pluginKey:t=fz,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:o=[" "],startOfLine:i=!1,decorationTag:s="span",decorationClass:l="suggestion",command:a=()=>null,items:c=()=>[],render:u=()=>({}),allow:d=()=>!0,findSuggestionMatch:f=dz}){let h;const p=u==null?void 0:u(),m=new ke({key:t,view(){return{update:async(g,y)=>{var w,S,b,C,x,k,A;const E=(w=this.key)===null||w===void 0?void 0:w.getState(y),O=(S=this.key)===null||S===void 0?void 0:S.getState(g.state),_=E.active&&O.active&&E.range.from!==O.range.from,L=!E.active&&O.active,H=E.active&&!O.active,U=!L&&!H&&E.query!==O.query,K=L,j=U||_,M=H;if(!K&&!j&&!M)return;const N=M&&!K?E:O,D=g.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`);h={editor:e,range:N.range,query:N.query,text:N.text,items:[],command:z=>a({editor:e,range:N.range,props:z}),decorationNode:D,clientRect:D?()=>{var z;const{decorationId:J}=(z=this.key)===null||z===void 0?void 0:z.getState(e.state),se=g.dom.querySelector(`[data-decoration-id="${J}"]`);return(se==null?void 0:se.getBoundingClientRect())||null}:null},K&&((b=p==null?void 0:p.onBeforeStart)===null||b===void 0||b.call(p,h)),j&&((C=p==null?void 0:p.onBeforeUpdate)===null||C===void 0||C.call(p,h)),(j||K)&&(h.items=await c({editor:e,query:N.query})),M&&((x=p==null?void 0:p.onExit)===null||x===void 0||x.call(p,h)),j&&((k=p==null?void 0:p.onUpdate)===null||k===void 0||k.call(p,h)),K&&((A=p==null?void 0:p.onStart)===null||A===void 0||A.call(p,h))},destroy:()=>{var g;h&&((g=p==null?void 0:p.onExit)===null||g===void 0||g.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,w,S){const{isEditable:b}=e,{composing:C}=e.view,{selection:x}=g,{empty:k,from:A}=x,E={...y};if(E.composing=C,b&&(k||e.view.composing)){(A<y.range.from||A>y.range.to)&&!C&&!y.composing&&(E.active=!1);const O=f({char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:x.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;O&&d({editor:e,state:S,range:O.range,isActive:y.active})?(E.active=!0,E.decorationId=y.decorationId?y.decorationId:_,E.range=O.range,E.query=O.query,E.text=O.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(g,y){var w;const{active:S,range:b}=m.getState(g.state);return S&&((w=p==null?void 0:p.onKeyDown)===null||w===void 0?void 0:w.call(p,{view:g,event:y,range:b}))||!1},decorations(g){const{active:y,range:w,decorationId:S}=m.getState(g);return y?me.create(g.doc,[Le.inline(w.from,w.to,{nodeName:s,class:l,"data-decoration-id":S})]):null}}});return m}const pz=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,mz=Ne.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",le(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[x0({find:pz,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Bh="Tabs",[gz,D4]=In(Bh,[cc]),fx=cc(),[yz,Fh]=gz(Bh),hx=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:a="automatic",...c}=t,u=Yf(l),[d,f]=Er({prop:r,onChange:o,defaultProp:i});return T.jsx(yz,{scope:n,baseId:hr(),value:d,onValueChange:f,orientation:s,dir:u,activationMode:a,children:T.jsx(ge.div,{dir:u,"data-orientation":s,...c,ref:e})})});hx.displayName=Bh;var px="TabsList",mx=v.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,i=Fh(px,n),s=fx(n);return T.jsx(Rv,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:T.jsx(ge.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:e})})});mx.displayName=px;var gx="TabsTrigger",yx=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=t,s=Fh(gx,n),l=fx(n),a=wx(s.baseId,r),c=xx(s.baseId,r),u=r===s.value;return T.jsx(Nv,{asChild:!0,...l,focusable:!o,active:u,children:T.jsx(ge.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:e,onMouseDown:ee(t.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ee(t.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ee(t.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});yx.displayName=gx;var bx="TabsContent",vx=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=t,l=Fh(bx,n),a=wx(l.baseId,r),c=xx(l.baseId,r),u=r===l.value,d=v.useRef(u);return v.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),T.jsx(Ln,{present:o||u,children:({present:f})=>T.jsx(ge.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":a,hidden:!f,id:c,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});vx.displayName=bx;function wx(t,e){return`${t}-trigger-${e}`}function xx(t,e){return`${t}-content-${e}`}var bz=hx,vz=mx,wz=yx,xz=vx;const Sz=Ne.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",le(this.options.HTMLAttributes,t),0]}});var Xd,Zd;if(typeof WeakMap<"u"){let t=new WeakMap;Xd=e=>t.get(e),Zd=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Xd=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},Zd=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var Re=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;s<this.height&&this.map[e+this.width*l]==n;l++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?i==0:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,a),right:Math.max(r,l),bottom:Math.max(i,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,!(o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const l=(t+1)*this.width;for(;s<l&&this.map[s]<o;)s++;return s==l?i-1:this.map[s]}o=i}}static get(t){return Xd(t)||Zd(t,Cz(t))}};function Cz(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Ez(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let p=0;;p++){for(;o<r.length&&r[o]!=0;)o++;if(p==d.childCount)break;const m=d.child(p),{colspan:g,rowspan:y,colwidth:w}=m.attrs;for(let S=0;S<y;S++){if(S+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-S});break}const b=o+S*e;for(let C=0;C<g;C++){r[b+C]==0?r[b+C]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:g-C});const x=w&&w[C];if(x){const k=(b+C)%e*2,A=s[k];A==null||A!=x&&s[k+1]==1?(s[k]=x,s[k+1]=1):A==x&&s[k+1]++}}}o+=g,u+=m.nodeSize}const f=(c+1)*e;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:c,n:h}),u++}const l=new Re(e,n,r,i);let a=!1;for(let c=0;!a&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(a=!0);return a&&kz(l,s,t),l}function Ez(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const l=t.child(s);for(let a=0;a<l.childCount;a++){const c=l.child(a);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const l=o.child(s);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function kz(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=s.attrs;for(let c=0;c<a.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!a.colwidth||a.colwidth[c]!=d)&&((l||(l=Mz(a)))[c]=d)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function Mz(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function rt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var tr=new we("selectingCells");function oi(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Tz(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Ut(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function wc(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=oi(e.$head)||Oz(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Oz(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Qd(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Az(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function jh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Sx(t,e,n){const r=t.node(-1),o=Re.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function Qr(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Cx(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function Rz(t,e,n){const r=rt(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var be=class Sn extends Q{constructor(e,n=e){const r=e.node(-1),o=Re.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=o.cellsInRect(s).filter(u=>u!=n.pos-i);a.unshift(n.pos-i);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new mf(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Qd(r)&&Qd(o)&&jh(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Sn.rowSelection(r,o):i&&this.isColSelection()?Sn.colSelection(r,o):new Sn(r,o)}return Z.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=Re.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let a=o.top;a<o.bottom;a++){const c=[];for(let u=a*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(i[f])continue;i[f]=!0;const h=n.findCell(f);let p=e.nodeAt(f);if(!p)throw RangeError(`No cell with offset ${f} found`);const m=o.left-h.left,g=h.right-o.right;if(m>0||g>0){let y=p.attrs;if(m>0&&(y=Qr(y,0,m)),g>0&&(y=Qr(y,y.colspan-g,g)),h.left<o.left){if(p=p.type.createAndFill(y),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(h.top<o.top||h.bottom>o.bottom){const y={...p.attrs,rowspan:Math.min(h.bottom,o.bottom)-Math.max(h.top,o.top)};h.top<o.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}c.push(p)}s.push(e.child(a).copy(I.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new B(I.from(l),1,1)}replace(e,n=B.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:l,$to:a}=o[s],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),s?B.empty:n)}const i=Q.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new B(I.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Re.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=Re.get(r),i=e.start(-1),s=o.findCell(e.pos-i),l=o.findCell(n.pos-i),a=e.node(0);return s.top<=l.top?(s.top>0&&(e=a.resolve(i+o.map[s.left])),l.bottom<o.height&&(n=a.resolve(i+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+o.map[l.left])),s.bottom<o.height&&(e=a.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Sn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Re.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Sn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=Re.get(r),i=e.start(-1),s=o.findCell(e.pos-i),l=o.findCell(n.pos-i),a=e.node(0);return s.left<=l.left?(s.left>0&&(e=a.resolve(i+o.map[s.top*o.width])),l.right<o.width&&(n=a.resolve(i+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+o.map[l.top*o.width])),s.right<o.width&&(e=a.resolve(i+o.map[o.width*(s.top+1)-1]))),new Sn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Sn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Sn(e.resolve(n),e.resolve(r))}getBookmark(){return new Nz(this.$anchorCell.pos,this.$headCell.pos)}};be.prototype.visible=!1;Q.jsonID("cell",be);var Nz=class Ex{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ex(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&jh(n,r)?new be(n,r):Q.near(r,1)}};function Dz(t){if(!(t.selection instanceof be))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Le.node(r,r+n.nodeSize,{class:"selectedCell"}))}),me.create(t.doc,e)}function _z({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function Iz({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function Pz(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof Y&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=be.create(o,r.from);else if(s=="row"){const l=o.resolve(r.from+1);i=be.rowSelection(l,l)}else if(!n){const l=Re.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];i=be.create(o,a+1,c)}}else r instanceof Z&&_z(r)?i=Z.create(o,r.from):r instanceof Z&&Iz(r)&&(i=Z.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var Lz=new we("fix-tables");function kx(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,l=0;s<i;s++){const a=e.child(s);for(let c=l,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==a){l=c+1,n+=a.nodeSize;continue e}r(a,n),l<o&&t.child(l).sameMarkup(a)?kx(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Mx(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=$z(t,o,i,n))};return e?e.doc!=t.doc&&kx(e.doc,t.doc,0,r):t.doc.descendants(r),n}function $z(t,e,n,r){const o=Re.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let a=0;a<o.height;a++)i.push(0);for(let a=0;a<o.problems.length;a++){const c=o.problems[a];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)i[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Qr(d,d.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let s,l;for(let a=0;a<i.length;a++)i[a]&&(s==null&&(s=a),l=a);for(let a=0,c=n+1;a<o.height;a++){const u=e.child(a),d=c+u.nodeSize,f=i[a];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<f;g++){const y=rt(t.schema)[h].createAndFill();y&&p.push(y)}const m=(a==0||s==a-1)&&l==a?c+1:d-1;r.insert(r.mapping.map(m),p)}c=d}return r.setMeta(Lz,{fixTables:!0})}function Bz(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,l=[];if(i=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const u=a?0:Math.max(0,n-1),d=a<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=ef(rt(s).row,new B(c,u,d)).content),l.push(c)}else if(i=="cell"||i=="header_cell")l.push(n||r?ef(rt(s).row,new B(e,n,r)).content:e);else return null;return Fz(s,l)}function Fz(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:l,colspan:a}=i.child(s).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+a}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(I.empty),n[o]<r){const i=rt(t).cell.createAndFill(),s=[];for(let l=n[o];l<r;l++)s.push(i);e[o]=e[o].append(I.from(s))}return{height:e.length,width:r,rows:e}}function ef(t,e){const n=t.createAndFill();return new pf(n).replace(0,n.content.size,e).doc}function jz({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let l=0;l<n.length;l++){const a=n[l],c=[];for(let u=i[l]||0,d=0;u<r;d++){let f=a.child(d%a.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(Qr(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)i[l+h]=(i[l+h]||0)+f.attrs.colspan}s.push(I.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,l=0;s<o;s++,l++){const a=[],c=n[l%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);s+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),a.push(d)}i.push(I.from(a))}n=i,e=o}return{width:t,height:e,rows:n}}function Hz(t,e,n,r,o,i,s){const l=t.doc.type.schema,a=rt(l);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const h=n.child(d);f+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==a.cell?m=c||(c=a.cell.createAndFill()):m=u||(u=a.header_cell.createAndFill());for(let g=e.width;g<o;g++)p.push(m);t.insert(t.mapping.slice(s).map(f-1+r),p)}if(i>e.height){const d=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,o);p++){const g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==a.header_cell;d.push(g?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,I.from(d)),h=[];for(let p=e.height;p<i;p++)h.push(f);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!!(c||u)}function sy(t,e,n,r,o,i,s,l){if(s==0||s==e.height)return!1;let a=!1;for(let c=o;c<i;c++){const u=s*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){a=!0;const f=n.nodeAt(d),{top:h,left:p}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:s-h}),t.insert(t.mapping.slice(l).map(e.positionAt(s,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),c+=f.attrs.colspan-1}}return a}function ly(t,e,n,r,o,i,s,l){if(s==0||s==e.width)return!1;let a=!1;for(let c=o;c<i;c++){const u=c*e.width+s,d=e.map[u];if(e.map[u-1]==d){a=!0;const f=n.nodeAt(d),h=e.colCount(d),p=t.mapping.slice(l).map(d+r);t.setNodeMarkup(p,null,Qr(f.attrs,s-h,f.attrs.colspan-(s-h))),t.insert(p+f.nodeSize,f.type.createAndFill(Qr(f.attrs,0,s-h))),c+=f.attrs.rowspan-1}}return a}function ay(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=Re.get(i);const{top:l,left:a}=r,c=a+o.width,u=l+o.height,d=t.tr;let f=0;function h(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");s=Re.get(i),f=d.mapping.maps.length}Hz(d,s,i,n,c,u,f)&&h(),sy(d,s,i,n,a,c,l,f)&&h(),sy(d,s,i,n,a,c,u,f)&&h(),ly(d,s,i,n,l,u,a,f)&&h(),ly(d,s,i,n,l,u,c,f)&&h();for(let p=l;p<u;p++){const m=s.positionAt(p,a,i),g=s.positionAt(p,c,i);d.replace(d.mapping.slice(f).map(m+n),d.mapping.slice(f).map(g+n),new B(o.rows[p-l],0,0))}h(),d.setSelection(new be(d.doc.resolve(n+s.positionAt(l,a,i)),d.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(d)}var zz=kf({ArrowLeft:tl("horiz",-1),ArrowRight:tl("horiz",1),ArrowUp:tl("vert",-1),ArrowDown:tl("vert",1),"Shift-ArrowLeft":nl("horiz",-1),"Shift-ArrowRight":nl("horiz",1),"Shift-ArrowUp":nl("vert",-1),"Shift-ArrowDown":nl("vert",1),Backspace:rl,"Mod-Backspace":rl,Delete:rl,"Mod-Delete":rl});function wl(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function tl(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof be)return wl(n,r,Q.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=Tx(o,t,e);if(s==null)return!1;if(t=="horiz")return wl(n,r,Q.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(s),a=Sx(l,t,e);let c;return a?c=Q.near(a,1):e<0?c=Q.near(n.doc.resolve(l.before(-1)),-1):c=Q.near(n.doc.resolve(l.after(-1)),1),wl(n,r,c)}}}function nl(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof be)s=i;else{const a=Tx(o,t,e);if(a==null)return!1;s=new be(n.doc.resolve(a))}const l=Sx(s.$headCell,t,e);return l?wl(n,r,new be(s.$anchorCell,l)):!1}}function rl(t,e){const n=t.selection;if(!(n instanceof be))return!1;if(e){const r=t.tr,o=rt(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new B(o,0,0))}),r.docChanged&&e(r)}return!0}function Vz(t,e){const n=t.state.doc,r=oi(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new be(r))),!0):!1}function Wz(t,e,n){if(!Ut(t.state))return!1;let r=Bz(n);const o=t.state.selection;if(o instanceof be){r||(r={width:1,height:1,rows:[I.from(ef(rt(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),l=Re.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=jz(r,l.right-l.left,l.bottom-l.top),ay(t.state,t.dispatch,s,l,r),!0}else if(r){const i=wc(t.state),s=i.start(-1);return ay(t.state,t.dispatch,s,Re.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function Uz(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=cy(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof be)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=oi(t.state.selection.$anchor))!=null&&((n=ku(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(a,c){let u=ku(t,c);const d=tr.getState(t.state)==null;if(!u||!jh(a,u))if(d)u=a;else return;const f=new be(a,u);if(d||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);d&&h.setMeta(tr,a.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),tr.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(tr,-1))}function l(a){const c=a,u=tr.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(cy(t,c.target)!=r&&(d=ku(t,e),!d))return s();d&&i(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function Tx(t,e,n){if(!(t.state.selection instanceof Z))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const l=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?l:null}}return null}function cy(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function ku(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?oi(t.state.doc.resolve(n.pos)):null}var Kz=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),tf(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,tf(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function tf(t,e,n,r,o,i){var s;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:h,colwidth:p}=u.child(d).attrs;for(let m=0;m<h;m++,f++){const g=o==f?i:p&&p[m],y=g?g+"px":"";l+=g||r,g||(a=!1),c?(c.style.width!=y&&(c.style.width=y),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=y}}for(;c;){const d=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=d}a?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var Rt=new we("tableColumnResizing");function Gz({handleWidth:t=5,cellMinWidth:e=25,View:n=Kz,lastColumnResizable:r=!0}={}){const o=new ke({key:Rt,state:{init(i,s){var l,a;const c=(a=(l=o.spec)==null?void 0:l.props)==null?void 0:a.nodeViews,u=rt(s.schema).table.name;return n&&c&&(c[u]=(d,f)=>new n(d,e,f)),new qz(-1,!1)},apply(i,s){return s.apply(i)}},props:{attributes:i=>{const s=Rt.getState(i);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(i,s)=>{Jz(i,s,t,e,r)},mouseleave:i=>{Yz(i)},mousedown:(i,s)=>{Xz(i,s,e)}},decorations:i=>{const s=Rt.getState(i);if(s&&s.activeHandle>-1)return r5(i,s.activeHandle)},nodeViews:{}}});return o}var qz=class xl{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Rt);if(r&&r.setHandle!=null)return new xl(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new xl(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Qd(e.doc.resolve(o))||(o=-1),new xl(o,n.dragging)}return n}};function Jz(t,e,n,r,o){const i=Rt.getState(t.state);if(i&&!i.dragging){const s=Qz(e.target);let l=-1;if(s){const{left:a,right:c}=s.getBoundingClientRect();e.clientX-a<=n?l=uy(t,e,"left",n):c-e.clientX<=n&&(l=uy(t,e,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const a=t.state.doc.resolve(l),c=a.node(-1),u=Re.get(c),d=a.start(-1);if(u.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==u.width-1)return}Ox(t,l)}}}function Yz(t){const e=Rt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Ox(t,-1)}function Xz(t,e,n){var r;const o=(r=t.dom.ownerDocument.defaultView)!=null?r:window,i=Rt.getState(t.state);if(!i||i.activeHandle==-1||i.dragging)return!1;const s=t.state.doc.nodeAt(i.activeHandle),l=Zz(t,i.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Rt,{setDragging:{startX:e.clientX,startWidth:l}}));function a(u){o.removeEventListener("mouseup",a),o.removeEventListener("mousemove",c);const d=Rt.getState(t.state);d!=null&&d.dragging&&(e5(t,d.activeHandle,dy(d.dragging,u,n)),t.dispatch(t.state.tr.setMeta(Rt,{setDragging:null})))}function c(u){if(!u.which)return a(u);const d=Rt.getState(t.state);if(d&&d.dragging){const f=dy(d.dragging,u,n);t5(t,d.activeHandle,f,n)}}return o.addEventListener("mouseup",a),o.addEventListener("mousemove",c),e.preventDefault(),!0}function Zz(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let l=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],a--);return l/a}function Qz(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function uy(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,l=oi(t.state.doc.resolve(s));if(!l)return-1;if(n=="right")return l.pos;const a=Re.get(l.node(-1)),c=l.start(-1),u=a.map.indexOf(l.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function dy(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Ox(t,e){t.dispatch(t.state.tr.setMeta(Rt,{setHandle:e}))}function e5(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=Re.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+l;if(c&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],f=o.nodeAt(d).attrs,h=f.colspan==1?0:l-i.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():n5(f.colspan);p[h]=n,a.setNodeMarkup(s+d,null,{...f,colwidth:p})}a.docChanged&&t.dispatch(a)}function t5(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),l=Re.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let a=t.domAtPos(o.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&tf(i,a.firstChild,a,r,l,n)}function n5(t){return Array(t).fill(0)}function r5(t,e){const n=[],r=t.doc.resolve(e),o=r.node(-1);if(!o)return me.empty;const i=Re.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let a=0;a<i.height;a++){const c=l+a*i.width;if((l==i.width-1||i.map[c]!=i.map[c+1])&&(a==0||i.map[c]!=i.map[c-i.width])){const u=i.map[c],d=s+u+o.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",n.push(Le.widget(d,f))}}return me.create(t.doc,n)}function pn(t){const e=t.selection,n=wc(t),r=n.node(-1),o=n.start(-1),i=Re.get(r);return{...e instanceof be?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function Ax(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;Rz(e,r,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){const l=s*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],c=r.nodeAt(a);t.setNodeMarkup(t.mapping.map(n+a),null,Cx(c.attrs,o-e.colCount(a))),s+=c.attrs.rowspan-1}else{const a=i==null?rt(r.type.schema).cell:r.nodeAt(e.map[l+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),a.createAndFill())}}return t}function o5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Ax(t.tr,n,n.left))}return!0}function i5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Ax(t.tr,n,n.right))}return!0}function s5(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const l=s*e.width+o,a=e.map[l],c=n.nodeAt(a),u=c.attrs;if(o>0&&e.map[l-1]==a||o<e.width-1&&e.map[l+1]==a)t.setNodeMarkup(t.mapping.slice(i).map(r+a),null,Qr(u,o-e.colCount(a)));else{const d=t.mapping.slice(i).map(r+a);t.delete(d,d+c.nodeSize)}s+=u.rowspan}}function l5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;s5(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Re.get(i)}e(r)}return!0}function a5(t,e,n){var r;const o=rt(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((r=e.nodeAt(t.map[i+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Rx(t,{map:e,tableStart:n,table:r},o){var i;let s=n;for(let c=0;c<o;c++)s+=r.child(c).nodeSize;const l=[];let a=o>0?-1:0;a5(e,r,o+a)&&(a=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=a==null?rt(r.type.schema).cell:(i=r.nodeAt(e.map[u+a*e.width]))==null?void 0:i.type,f=d==null?void 0:d.createAndFill();f&&l.push(f)}return t.insert(s,rt(r.type.schema).row.create(null,l)),t}function c5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Rx(t.tr,n,n.top))}return!0}function u5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t);e(Rx(t.tr,n,n.bottom))}return!0}function d5(t,{map:e,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const s=i+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(i+r,s+r);const a=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const d=e.map[u];if(!a.has(d)){if(a.add(d),o>0&&d==e.map[u-e.width]){const f=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(o<e.height&&d==e.map[u+e.width]){const f=n.nodeAt(d),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+m),p),c+=h.colspan-1}}}}function f5(t,e){if(!Ut(t))return!1;if(e){const n=pn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;d5(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Re.get(n.table)}e(r)}return!0}function fy(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function h5({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[l]==n[l+1])return!0;i+=t,l+=t}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}function hy(t,e){const n=t.selection;if(!(n instanceof be)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=pn(t),{map:o}=r;if(h5(o,r))return!1;if(e){const i=t.tr,s={};let l=I.empty,a,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],h=r.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,a==null)a=f,c=h;else{fy(h)||(l=l.append(h.content));const p=i.mapping.map(f+r.tableStart);i.delete(p,p+h.nodeSize)}}if(a==null||c==null)return!0;if(i.setNodeMarkup(a+r.tableStart,null,{...Cx(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const u=a+1+c.content.size,d=fy(c)?a+1:u;i.replaceWith(d+r.tableStart,u+r.tableStart,l)}i.setSelection(new be(i.doc.resolve(a+r.tableStart))),e(i)}return!0}function py(t,e){const n=rt(t.schema);return p5(({node:r})=>n[r.type.spec.tableRole])(t,e)}function p5(t){return(e,n)=>{var r;const o=e.selection;let i,s;if(o instanceof be){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=Tz(o.$from),!i)return!1;s=(r=oi(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let l=i.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const u=pn(e),d=e.tr;for(let h=0;h<u.right-u.left;h++)a.push(c?{...l,colwidth:c&&c[h]?[c[h]]:null}:l);let f;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=i.nodeSize);for(let m=u.left,g=0;m<u.right;m++,g++)m==u.left&&h==u.top||d.insert(f=d.mapping.map(p+u.tableStart,1),t({node:i,row:h,col:m}).createAndFill(a[g]))}d.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),a[0]),o instanceof be&&d.setSelection(new be(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function m5(t,e){return function(n,r){if(!Ut(n))return!1;const o=wc(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof be?n.selection.forEachCell((s,l)=>{s.attrs[t]!==e&&i.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}function g5(t){return function(e,n){if(!Ut(e))return!1;if(n){const r=rt(e.schema),o=pn(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=s.map(a=>o.table.nodeAt(a));for(let a=0;a<s.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[a],r.cell,l[a].attrs);if(i.steps.length==0)for(let a=0;a<s.length;a++)i.setNodeMarkup(o.tableStart+s[a],r.header_cell,l[a].attrs);n(i)}return!0}}function my(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function ss(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?g5(t):function(n,r){if(!Ut(n))return!1;if(r){const o=rt(n.schema),i=pn(n),s=n.tr,l=my("row",i,o),a=my("column",i,o),u=(t==="column"?l:t==="row"?a:!1)?1:0,d=t=="column"?{left:0,top:u,right:1,bottom:i.map.height}:t=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,f=t=="column"?a?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;i.map.cellsInRect(d).forEach(h=>{const p=h+i.tableStart,m=s.doc.nodeAt(p);m&&s.setNodeMarkup(p,f,m.attrs)}),r(s)}return!0}}ss("row",{useDeprecatedLogic:!0});ss("column",{useDeprecatedLogic:!0});var y5=ss("cell",{useDeprecatedLogic:!0});function b5(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function gy(t){return function(e,n){if(!Ut(e))return!1;const r=b5(wc(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Z.between(o,Az(o))).scrollIntoView())}return!0}}function v5(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function w5({allowTableNodeSelection:t=!1}={}){return new ke({key:tr,state:{init(){return null},apply(e,n){const r=e.getMeta(tr);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:Dz,handleDOMEvents:{mousedown:Uz},createSelectionBetween(e){return tr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Vz,handleKeyDown:zz,handlePaste:Wz},appendTransaction(e,n,r){return Pz(r,Mx(r,n),t)}})}function yy(t,e,n,r,o,i){let s=0,l=!0,a=e.firstChild;const c=t.firstChild;for(let u=0,d=0;u<c.childCount;u+=1){const{colspan:f,colwidth:h}=c.child(u).attrs;for(let p=0;p<f;p+=1,d+=1){const m=o===d?i:h&&h[p],g=m?`${m}px`:"";s+=m||r,m||(l=!1),a?(a.style.width!==g&&(a.style.width=g),a=a.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;a;){const u=a.nextSibling;a.parentNode.removeChild(a),a=u}l?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}class x5{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),yy(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,yy(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function S5(t,e,n,r){let o=0,i=!0;const s=[],l=t.firstChild;if(!l)return{};for(let d=0,f=0;d<l.childCount;d+=1){const{colspan:h,colwidth:p}=l.child(d).attrs;for(let m=0;m<h;m+=1,f+=1){const g=n===f?r:p&&p[m],y=g?`${g}px`:"";o+=g||e,g||(i=!1),s.push(["col",y?{style:`width: ${y}`}:{}])}}const a=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:a,tableMinWidth:c}}function by(t,e){return t.createAndFill()}function C5(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function E5(t,e,n,r,o){const i=C5(t),s=[],l=[];for(let c=0;c<n;c+=1){const u=by(i.cell);if(u&&l.push(u),r){const d=by(i.header_cell);d&&s.push(d)}}const a=[];for(let c=0;c<e;c+=1)a.push(i.row.createChecked(null,r&&c===0?s:l));return i.table.createChecked(null,a)}function k5(t){return t instanceof be}const ol=({editor:t})=>{const{selection:e}=t.state;if(!k5(e))return!1;let n=0;const r=y0(e.ranges[0].$from,i=>i.type.name==="table");return r==null||r.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},M5=Ne.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:x5,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=S5(t,this.options.cellMinWidth);return["table",le(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=E5(i.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(Z.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>o5(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>i5(t,e),deleteColumn:()=>({state:t,dispatch:e})=>l5(t,e),addRowBefore:()=>({state:t,dispatch:e})=>c5(t,e),addRowAfter:()=>({state:t,dispatch:e})=>u5(t,e),deleteRow:()=>({state:t,dispatch:e})=>f5(t,e),deleteTable:()=>({state:t,dispatch:e})=>v5(t,e),mergeCells:()=>({state:t,dispatch:e})=>hy(t,e),splitCell:()=>({state:t,dispatch:e})=>py(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ss("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ss("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>y5(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>hy(t,e)?!0:py(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>m5(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>gy(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>gy(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Mx(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=be.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ol,"Mod-Backspace":ol,Delete:ol,"Mod-Delete":ol}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Gz({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],w5({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ie(V(t,"tableRole",e))}}}),T5=Ne.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",le(this.options.HTMLAttributes,t),0]}}),O5=Ne.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",le(this.options.HTMLAttributes,t),0]}}),on=()=>new Map,nf=t=>{const e=on();return t.forEach((n,r)=>{e.set(r,n)}),e},ii=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},A5=(t,e)=>{const n=[];for(const[r,o]of t)n.push(e(o,r));return n},R5=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},qo=()=>new Set,Mu=t=>t[t.length-1],Jo=Array.from,N5=Array.isArray;class D5{constructor(){this._observers=on()}on(e,n){return ii(this._observers,e,qo).add(n),n}once(e,n){const r=(...o)=>{this.off(e,r),n(...o)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Jo((this._observers.get(e)||on()).values()).forEach(r=>r(...n))}destroy(){this._observers=on()}}const eo=Math.floor,Sl=Math.abs,Nx=(t,e)=>t<e?t:e,si=(t,e)=>t>e?t:e,_5=t=>t!==0?t<0:1/t<0,vy=1,wy=2,Tu=4,Ou=8,I5=32,Dx=64,Oa=128,P5=31,xy=63,_i=127,L5=2147483647,$5=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&eo(t)===t),B5=t=>t.toLowerCase(),F5=/^\s*/g,j5=t=>t.replace(F5,""),H5=/([A-Z])/g,Sy=(t,e)=>j5(t.replace(H5,n=>`${e}${B5(n)}`)),z5=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=e.codePointAt(o);return r},ls=typeof TextEncoder<"u"?new TextEncoder:null,V5=t=>ls.encode(t),W5=ls?V5:z5;let Au=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Au&&Au.decode(new Uint8Array).length===1&&(Au=null);class Ts{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Hh=()=>new Ts,U5=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Mn=t=>{const e=new Uint8Array(U5(t));let n=0;for(let r=0;r<t.bufs.length;r++){const o=t.bufs[r];e.set(o,n),n+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},K5=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(si(n,e)*2),t.cpos=0)},He=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},rf=He,ye=(t,e)=>{for(;e>_i;)He(t,Oa|_i&e),e=eo(e/128);He(t,_i&e)},zh=(t,e)=>{const n=_5(e);for(n&&(e=-e),He(t,(e>xy?Oa:0)|(n?Dx:0)|xy&e),e=eo(e/64);e>0;)He(t,(e>_i?Oa:0)|_i&e),e=eo(e/128)},of=new Uint8Array(3e4),G5=of.length/3,q5=(t,e)=>{if(e.length<G5){const n=ls.encodeInto(e,of).written||0;ye(t,n);for(let r=0;r<n;r++)He(t,of[r])}else yt(t,W5(e))},J5=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;ye(t,r);for(let o=0;o<r;o++)He(t,n.codePointAt(o))},_o=ls&&ls.encodeInto?q5:J5,Vh=(t,e)=>{const n=t.cbuf.length,r=t.cpos,o=Nx(n-r,e.length),i=e.length-o;t.cbuf.set(e.subarray(0,o),r),t.cpos+=o,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(si(n*2,i)),t.cbuf.set(e.subarray(o)),t.cpos=i)},yt=(t,e)=>{ye(t,e.byteLength),Vh(t,e)},Wh=(t,e)=>{K5(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Y5=(t,e)=>Wh(t,4).setFloat32(0,e,!1),X5=(t,e)=>Wh(t,8).setFloat64(0,e,!1),Z5=(t,e)=>Wh(t,8).setBigInt64(0,e,!1),Cy=new DataView(new ArrayBuffer(4)),Q5=t=>(Cy.setFloat32(0,t),Cy.getFloat32(0)===t),as=(t,e)=>{switch(typeof e){case"string":He(t,119),_o(t,e);break;case"number":$5(e)&&Sl(e)<=L5?(He(t,125),zh(t,e)):Q5(e)?(He(t,124),Y5(t,e)):(He(t,123),X5(t,e));break;case"bigint":He(t,122),Z5(t,e);break;case"object":if(e===null)He(t,126);else if(N5(e)){He(t,117),ye(t,e.length);for(let n=0;n<e.length;n++)as(t,e[n])}else if(e instanceof Uint8Array)He(t,116),yt(t,e);else{He(t,118);const n=Object.keys(e);ye(t,n.length);for(let r=0;r<n.length;r++){const o=n[r];_o(t,o),as(t,e[o])}}break;case"boolean":He(t,e?120:121);break;default:He(t,127)}};class Ey extends Ts{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ye(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const ky=t=>{t.count>0&&(zh(t.encoder,t.count===1?t.s:-t.s),t.count>1&&ye(t.encoder,t.count-2))};class Cl{constructor(){this.encoder=new Ts,this.s=0,this.count=0}write(e){this.s===e?this.count++:(ky(this),this.count=1,this.s=e)}toUint8Array(){return ky(this),Mn(this.encoder)}}const My=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);zh(t.encoder,e),t.count>1&&ye(t.encoder,t.count-2)}};class Ru{constructor(){this.encoder=new Ts,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(My(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return My(this),Mn(this.encoder)}}class eV{constructor(){this.sarr=[],this.s="",this.lensE=new Cl}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Ts;return this.sarr.push(this.s),this.s="",_o(e,this.sarr.join("")),Vh(e,this.lensE.toUint8Array()),Mn(e)}}const Yo=t=>new Error(t),sn=()=>{throw Yo("Method unimplemented")},vr=()=>{throw Yo("Unexpected case")},tV=crypto.getRandomValues.bind(crypto),_x=()=>tV(new Uint32Array(1))[0],nV="10000000-1000-4000-8000"+-1e11,rV=()=>nV.replace(/[018]/g,t=>(t^_x()&15>>t/4).toString(16)),Ty=t=>new Promise(t);Promise.all.bind(Promise);const Oy=t=>t===void 0?null:t;class oV{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let Ix=new oV,iV=!0;try{typeof localStorage<"u"&&localStorage&&(Ix=localStorage,iV=!1)}catch{}const sV=Ix,lV=Object.assign,aV=Object.keys,cV=(t,e)=>{for(const n in t)e(t[n],n)},Ay=t=>aV(t).length,uV=t=>{for(const e in t)return!1;return!0},dV=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},fV=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),hV=(t,e)=>t===e||Ay(t)===Ay(e)&&dV(t,(n,r)=>(n!==void 0||fV(e,r))&&e[r]===n),Uh=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Uh(t,e,n+1)}},pV=(t,e)=>e.includes(t),cs=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let Gt;const mV=()=>{if(Gt===void 0)if(cs){Gt=on();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Gt.set(e,""),e=r):e!==null&&(Gt.set(e,r),e=null)}e!==null&&Gt.set(e,"")}else typeof location=="object"?(Gt=on(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Gt.set(`--${Sy(e,"-")}`,n),Gt.set(`-${Sy(e,"-")}`,n)}})):Gt=on();return Gt},sf=t=>mV().has(t),lf=t=>Oy(cs?process.env[t.toUpperCase().replaceAll("-","_")]:sV.getItem(t)),Px=t=>sf("--"+t)||lf(t)!==null;Px("production");const gV=cs&&pV(process.env.FORCE_COLOR,["true","1","2"]),yV=gV||!sf("--no-colors")&&!Px("no-color")&&(!cs||process.stdout.isTTY)&&(!cs||sf("--color")||lf("COLORTERM")!==null||(lf("TERM")||"").includes("color"));class bV{constructor(e,n){this.left=e,this.right=n}}const wn=(t,e)=>new bV(t,e);typeof DOMParser<"u"&&new DOMParser;const vV=t=>A5(t,(e,n)=>`${n}:${e};`).join(""),Fn=Symbol,Lx=Fn(),$x=Fn(),wV=Fn(),xV=Fn(),SV=Fn(),Bx=Fn(),CV=Fn(),Fx=Fn(),EV=Fn(),kV=t=>{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const i=t[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const i=t[r];i instanceof Symbol||n.push(i)}return n},MV={[Lx]:wn("font-weight","bold"),[$x]:wn("font-weight","normal"),[wV]:wn("color","blue"),[SV]:wn("color","green"),[xV]:wn("color","grey"),[Bx]:wn("color","red"),[CV]:wn("color","purple"),[Fx]:wn("color","orange"),[EV]:wn("color","black")},TV=t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],n=[],r=on();let o=[],i=0;for(;i<t.length;i++){const l=t[i],a=MV[l];if(a!==void 0)r.set(a.left,a.right);else{if(l===void 0)break;if(l.constructor===String||l.constructor===Number){const c=vV(r);i>0||c.length>0?(e.push("%c"+l),n.push(c)):e.push(l)}else break}}for(i>0&&(o=n,o.unshift(e.join("")));i<t.length;i++){const l=t[i];l instanceof Symbol||o.push(l)}return o},OV=yV?TV:kV,AV=(...t)=>{console.log(...OV(t)),RV.forEach(e=>e.print(t))},RV=qo(),jx=t=>({[Symbol.iterator](){return this},next:t}),NV=(t,e)=>jx(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Nu=(t,e)=>jx(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class DV{constructor(e,n){this.clock=e,this.len=n}}class _V{constructor(){this.clients=new Map}}const Hx=(t,e,n)=>e.clients.forEach((r,o)=>{const i=t.doc.store.clients.get(o);for(let s=0;s<r.length;s++){const l=r[s];qx(t,i,l.clock,l.len,n)}}),IV=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const o=eo((n+r)/2),i=t[o],s=i.clock;if(s<=e){if(e<s+i.len)return o;n=o+1}else r=o-1}return null},zx=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&IV(n,e.clock)!==null},Vx=t=>{t.clients.forEach(e=>{e.sort((o,i)=>o.clock-i.clock);let n,r;for(n=1,r=1;n<e.length;n++){const o=e[r-1],i=e[n];o.clock+o.len>=i.clock?o.len=si(o.len,i.clock+i.len-o.clock):(r<n&&(e[r]=i),r++)}e.length=r})},Wx=(t,e,n,r)=>{ii(t.clients,e,()=>[]).push(new DV(n,r))},PV=(t,e)=>{ye(t.restEncoder,e.clients.size),Jo(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),ye(t.restEncoder,n);const o=r.length;ye(t.restEncoder,o);for(let i=0;i<o;i++){const s=r[i];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},Ux=_x;class Os extends D5{constructor({guid:e=rV(),collectionid:n=null,gc:r=!0,gcFilter:o=()=>!0,meta:i=null,autoLoad:s=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=o,this.clientID=Ux(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new WV,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=s,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=Ty(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>Ty(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Ce(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Jo(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Ce(this,e,n)}get(e,n=Xe){const r=ii(this.share,e,()=>{const i=new n;return i._integrate(this,null),i}),o=r.constructor;if(n!==Xe&&o!==n)if(o===Xe){const i=new n;i._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=i}),i._start=r._start;for(let s=i._start;s!==null;s=s.right)s.parent=i;return i._length=r._length,this.share.set(e,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Ii)}getText(e=""){return this.get(e,hs)}getMap(e=""){return this.get(e,Da)}getXmlElement(e=""){return this.get(e,ps)}getXmlFragment(e=""){return this.get(e,Xo)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){Jo(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new Os({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Ce(e.parent.doc,r=>{const o=n.doc;e.deleted||r.subdocsAdded.add(o),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class LV{constructor(){this.restEncoder=Hh()}toUint8Array(){return Mn(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ye(this.restEncoder,e)}writeDsLen(e){ye(this.restEncoder,e)}}class $V extends LV{writeLeftID(e){ye(this.restEncoder,e.client),ye(this.restEncoder,e.clock)}writeRightID(e){ye(this.restEncoder,e.client),ye(this.restEncoder,e.clock)}writeClient(e){ye(this.restEncoder,e)}writeInfo(e){rf(this.restEncoder,e)}writeString(e){_o(this.restEncoder,e)}writeParentInfo(e){ye(this.restEncoder,e?1:0)}writeTypeRef(e){ye(this.restEncoder,e)}writeLen(e){ye(this.restEncoder,e)}writeAny(e){as(this.restEncoder,e)}writeBuf(e){yt(this.restEncoder,e)}writeJSON(e){_o(this.restEncoder,JSON.stringify(e))}writeKey(e){_o(this.restEncoder,e)}}class BV{constructor(){this.restEncoder=Hh(),this.dsCurrVal=0}toUint8Array(){return Mn(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,ye(this.restEncoder,n)}writeDsLen(e){e===0&&vr(),ye(this.restEncoder,e-1),this.dsCurrVal+=e}}class FV extends BV{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ru,this.clientEncoder=new Cl,this.leftClockEncoder=new Ru,this.rightClockEncoder=new Ru,this.infoEncoder=new Ey(rf),this.stringEncoder=new eV,this.parentInfoEncoder=new Ey(rf),this.typeRefEncoder=new Cl,this.lenEncoder=new Cl}toUint8Array(){const e=Hh();return ye(e,0),yt(e,this.keyClockEncoder.toUint8Array()),yt(e,this.clientEncoder.toUint8Array()),yt(e,this.leftClockEncoder.toUint8Array()),yt(e,this.rightClockEncoder.toUint8Array()),yt(e,Mn(this.infoEncoder)),yt(e,this.stringEncoder.toUint8Array()),yt(e,Mn(this.parentInfoEncoder)),yt(e,this.typeRefEncoder.toUint8Array()),yt(e,this.lenEncoder.toUint8Array()),Vh(e,Mn(this.restEncoder)),Mn(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){as(this.restEncoder,e)}writeBuf(e){yt(this.restEncoder,e)}writeJSON(e){as(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const jV=(t,e,n,r)=>{r=si(r,e[0].id.clock);const o=Dn(e,r);ye(t.restEncoder,e.length-o),t.writeClient(n),ye(t.restEncoder,r);const i=e[o];i.write(t,r-i.id.clock);for(let s=o+1;s<e.length;s++)e[s].write(t,0)},HV=(t,e,n)=>{const r=new Map;n.forEach((o,i)=>{dt(e,i)>o&&r.set(i,o)}),Kh(e).forEach((o,i)=>{n.has(i)||r.set(i,0)}),ye(t.restEncoder,r.size),Jo(r.entries()).sort((o,i)=>i[0]-o[0]).forEach(([o,i])=>{jV(t,e.clients.get(o),o,i)})},zV=(t,e)=>HV(t,e.doc.store,e.beforeState);class VV{constructor(){this.l=[]}}const Ry=()=>new VV,Ny=(t,e)=>t.l.push(e),Dy=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(o=>e!==o),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Kx=(t,e,n)=>Uh(t.l,[e,n]);class El{constructor(e,n){this.client=e,this.clock=n}}const il=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ee=(t,e)=>new El(t,e),us=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw vr()};class Aa{constructor(e,n,r,o=0){this.type=e,this.tname=n,this.item=r,this.assoc=o}}const sl=(t,e,n)=>{let r=null,o=null;return t._item===null?o=us(t):r=Ee(t._item.id.client,t._item.id.clock),new Aa(r,o,e,n)},Du=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return sl(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return sl(t,Ee(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return sl(t,r.lastId,n);r=r.right}return sl(t,null,n)},Co=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!zx(e.ds,t.id),af=(t,e)=>{const n=ii(t.meta,af,qo),r=t.doc.store;n.has(e)||(e.sv.forEach((o,i)=>{o<dt(r,i)&&wr(t,Ee(i,o))}),Hx(t,e.ds,o=>{}),n.add(e))};class WV{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Kh=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const o=n[n.length-1];e.set(r,o.id.clock+o.length)}),e},dt=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},Gx=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw vr()}n.push(e)},Dn=(t,e)=>{let n=0,r=t.length-1,o=t[r],i=o.id.clock;if(i===e)return r;let s=eo(e/(i+o.length-1)*r);for(;n<=r;){if(o=t[s],i=o.id.clock,i<=e){if(e<i+o.length)return s;n=s+1}else r=s-1;s=eo((n+r)/2)}throw vr()},UV=(t,e)=>{const n=t.clients.get(e.client);return n[Dn(n,e.clock)]},_u=UV,cf=(t,e,n)=>{const r=Dn(e,n),o=e[r];return o.id.clock<n&&o instanceof tt?(e.splice(r+1,0,fS(t,o,n-o.id.clock)),r+1):r},wr=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[cf(t,n,e.clock)]},_y=(t,e,n)=>{const r=e.clients.get(n.client),o=Dn(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==nr&&r.splice(o+1,0,fS(t,i,n.clock-i.id.clock+1)),i},KV=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Dn(r,e.id.clock)]=n},qx=(t,e,n,r,o)=>{if(r===0)return;const i=n+r;let s=cf(t,e,n),l;do l=e[s++],i<l.id.clock+l.length&&cf(t,e,i),o(l);while(s<e.length&&e[s].id.clock<i)};class GV{constructor(e,n,r){this.doc=e,this.deleteSet=new _V,this.beforeState=Kh(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Iy=(t,e)=>e.deleteSet.clients.size===0&&!R5(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Vx(e.deleteSet),zV(t,e),PV(t,e.deleteSet),!0),Py=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&ii(t.changed,e,qo).add(n)},kl=(t,e)=>{let n=t[e],r=t[e-1],o=e;for(;o>0;n=r,r=t[--o-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof tt&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const i=e-o;return i&&t.splice(e+1-i,i),i},qV=(t,e,n)=>{for(const[r,o]of t.clients.entries()){const i=e.clients.get(r);for(let s=o.length-1;s>=0;s--){const l=o[s],a=l.clock+l.len;for(let c=Dn(i,l.clock),u=i[c];c<i.length&&u.id.clock<a;u=i[++c]){const d=i[c];if(l.clock+l.len<=d.id.clock)break;d instanceof tt&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},JV=(t,e)=>{t.clients.forEach((n,r)=>{const o=e.clients.get(r);for(let i=n.length-1;i>=0;i--){const s=n[i],l=Nx(o.length-1,1+Dn(o,s.clock+s.len-1));for(let a=l,c=o[a];a>0&&c.id.clock>=s.clock;c=o[a])a-=1+kl(o,a)}})},Jx=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{Vx(i),n.afterState=Kh(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const l=[];n.changed.forEach((a,c)=>l.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,a)})),l.push(()=>{n.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(u=>u.target._item===null||!u.target._item.deleted),a.forEach(u=>{u.currentTarget=c,u._path=null}),a.sort((u,d)=>u.path.length-d.path.length),Kx(c._dEH,a,n))})}),l.push(()=>r.emit("afterTransaction",[n,r])),Uh(l,[]),n._needFormattingCleanup&&l4(n)}finally{r.gc&&qV(i,o,r.gcFilter),JV(i,o),n.afterState.forEach((u,d)=>{const f=n.beforeState.get(d)||0;if(f!==u){const h=o.clients.get(d),p=si(Dn(h,f),1);for(let m=h.length-1;m>=p;)m-=1+kl(h,m)}});for(let u=s.length-1;u>=0;u--){const{client:d,clock:f}=s[u].id,h=o.clients.get(d),p=Dn(h,f);p+1<h.length&&kl(h,p+1)>1||p>0&&kl(h,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(AV(Fx,Lx,"[yjs] ",$x,Bx,"Changed the client-id because another client seems to be using it."),r.clientID=Ux()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new $V;Iy(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new FV;Iy(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=n;(l.size>0||c.size>0||a.size>0)&&(l.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,n]),c.forEach(u=>u.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):Jx(t,e+1)}}},Ce=(t,e,n=null,r=!0)=>{const o=t._transactionCleanups;let i=!1,s=null;t._transaction===null&&(i=!0,t._transaction=new GV(t,n,r),o.push(t._transaction),o.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(i){const l=t._transaction===o[0];t._transaction=null,l&&Jx(o,0)}}return s},Ly="You must not compute changes after the event-handler fired.";class xc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=YV(this.currentTarget,this.target))}deletes(e){return zx(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Yo(Ly);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(o=>{if(o!==null){const i=n._map.get(o);let s,l;if(this.adds(i)){let a=i.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(i))if(a!==null&&this.deletes(a))s="delete",l=Mu(a.content.getContent());else return;else a!==null&&this.deletes(a)?(s="update",l=Mu(a.content.getContent())):(s="add",l=void 0)}else if(this.deletes(i))s="delete",l=Mu(i.content.getContent());else return;e.set(o,{action:s,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Yo(Ly);const n=this.target,r=qo(),o=qo(),i=[];if(e={added:r,deleted:o,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const a=()=>{l&&i.push(l)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,o.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const YV=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,o=e._item.parent._start;for(;o!==e._item&&o!==null;)!o.deleted&&o.countable&&(r+=o.length),o=o.right;n.unshift(r)}e=e._item.parent}return n},Yx=80;let Gh=0;class XV{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Gh++}}const ZV=t=>{t.timestamp=Gh++},Xx=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Gh++},QV=(t,e,n)=>{if(t.length>=Yx){const r=t.reduce((o,i)=>o.timestamp<i.timestamp?o:i);return Xx(r,e,n),r}else{const r=new XV(e,n);return t.push(r),r}},Sc=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((i,s)=>Sl(e-i.index)<Sl(e-s.index)?i:s);let r=t._start,o=0;for(n!==null&&(r=n.p,o=n.index,ZV(n));r.right!==null&&o<e;){if(!r.deleted&&r.countable){if(e<o+r.length)break;o+=r.length}r=r.right}for(;r.left!==null&&o>e;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return n!==null&&Sl(n.index-o)<r.parent.length/Yx?(Xx(n,r,o),n):QV(t._searchMarker,r,o)},ds=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const o=t[r];if(n>0){let i=o.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(o.index-=i.length);if(i===null||i.marker===!0){t.splice(r,1);continue}o.p=i,i.marker=!0}(e<o.index||n>0&&e===o.index)&&(o.index=si(e,o.index+n))}},Cc=(t,e,n)=>{const r=t,o=e.changedParentTypes;for(;ii(o,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;Kx(r._eH,n,e)};class Xe{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Ry(),this._dEH=Ry(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw sn()}clone(){throw sn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Ny(this._eH,e)}observeDeep(e){Ny(this._dEH,e)}unobserve(e){Dy(this._eH,e)}unobserveDeep(e){Dy(this._dEH,e)}toJSON(){}}const Zx=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const o=[];let i=t._start;for(;i!==null&&r>0;){if(i.countable&&!i.deleted){const s=i.content.getContent();if(s.length<=e)e-=s.length;else{for(let l=e;l<s.length&&r>0;l++)o.push(s[l]),r--;e=0}}i=i.right}return o},Qx=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let o=0;o<r.length;o++)e.push(r[o])}n=n.right}return e},fs=(t,e)=>{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let i=0;i<o.length;i++)e(o[i],n++,t)}r=r.right}},eS=(t,e)=>{const n=[];return fs(t,(r,o)=>{n.push(e(r,o,t))}),n},e4=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const o=n[r++];return n.length<=r&&(n=null),{done:!1,value:o}}}},tS=(t,e)=>{const n=Sc(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Ra=(t,e,n,r)=>{let o=n;const i=t.doc,s=i.clientID,l=i.store,a=n===null?e._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new Zo(c)),o.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new Ec(new Uint8Array(d))),o.integrate(t,0);break;case Os:o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new kc(d)),o.integrate(t,0);break;default:if(d instanceof Xe)o=new tt(Ee(s,dt(l,s)),o,o&&o.lastId,a,a&&a.id,e,null,new Or(d)),o.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},nS=()=>Yo("Length exceeded!"),rS=(t,e,n,r)=>{if(n>e._length)throw nS();if(n===0)return e._searchMarker&&ds(e._searchMarker,n,r.length),Ra(t,e,null,r);const o=n,i=Sc(e,n);let s=e._start;for(i!==null&&(s=i.p,n-=i.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&wr(t,Ee(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&ds(e._searchMarker,o,r.length),Ra(t,e,s,r)},t4=(t,e,n)=>{let o=(e._searchMarker||[]).reduce((i,s)=>s.index>i.index?s:i,{index:0,p:e._start}).p;if(o)for(;o.right;)o=o.right;return Ra(t,e,o,n)},oS=(t,e,n,r)=>{if(r===0)return;const o=n,i=r,s=Sc(e,n);let l=e._start;for(s!==null&&(l=s.p,n-=s.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&wr(t,Ee(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&wr(t,Ee(l.id.client,l.id.clock+r)),l.delete(t),r-=l.length),l=l.right;if(r>0)throw nS();e._searchMarker&&ds(e._searchMarker,o,-i+r)},Na=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},qh=(t,e,n,r)=>{const o=e._map.get(n)||null,i=t.doc,s=i.clientID;let l;if(r==null)l=new Zo([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:l=new Zo([r]);break;case Uint8Array:l=new Ec(r);break;case Os:l=new kc(r);break;default:if(r instanceof Xe)l=new Or(r);else throw new Error("Unexpected content type")}new tt(Ee(s,dt(i.store,s)),o,o&&o.lastId,null,null,e,n,l).integrate(t,0)},Jh=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},iS=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},sS=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},n4=(t,e)=>{const n={};return t._map.forEach((r,o)=>{let i=r;for(;i!==null&&(!e.sv.has(i.id.client)||i.id.clock>=(e.sv.get(i.id.client)||0));)i=i.left;i!==null&&Co(i,e)&&(n[o]=i.content.getContent()[i.length-1])}),n},ll=t=>NV(t.entries(),e=>!e[1].deleted);class r4 extends xc{}class Ii extends Xe{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Ii;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ii}clone(){const e=new Ii;return e.insert(0,this.toArray().map(n=>n instanceof Xe?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),Cc(this,e,new r4(this,e))}insert(e,n){this.doc!==null?Ce(this.doc,r=>{rS(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Ce(this.doc,n=>{t4(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Ce(this.doc,r=>{oS(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return tS(this,e)}toArray(){return Qx(this)}slice(e=0,n=this.length){return Zx(this,e,n)}toJSON(){return this.map(e=>e instanceof Xe?e.toJSON():e)}map(e){return eS(this,e)}forEach(e){fs(this,e)}[Symbol.iterator](){return e4(this)}_write(e){e.writeTypeRef(f4)}}class o4 extends xc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Da extends Xe{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,o)=>{this.set(o,r)}),this._prelimContent=null}_copy(){return new Da}clone(){const e=new Da;return this.forEach((n,r)=>{e.set(r,n instanceof Xe?n.clone():n)}),e}_callObserver(e,n){Cc(this,e,new o4(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const o=n.content.getContent()[n.length-1];e[r]=o instanceof Xe?o.toJSON():o}}),e}get size(){return[...ll(this._map)].length}keys(){return Nu(ll(this._map),e=>e[0])}values(){return Nu(ll(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Nu(ll(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Ce(this.doc,n=>{Na(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Ce(this.doc,r=>{qh(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return Jh(this,e)}has(e){return sS(this,e)}clear(){this.doc!==null?Ce(this.doc,e=>{this.forEach(function(n,r,o){Na(e,o,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(h4)}}const lr=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&hV(t,e);class uf{constructor(e,n,r,o){this.left=e,this.right=n,this.index=r,this.currentAttributes=o}forward(){switch(this.right===null&&vr(),this.right.content.constructor){case Ke:this.right.deleted||li(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const $y=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Ke:e.right.deleted||li(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&wr(t,Ee(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},al=(t,e,n,r)=>{const o=new Map,i=r?Sc(e,n):null;if(i){const s=new uf(i.p.left,i.p,i.index,o);return $y(t,s,n-i.index)}else{const s=new uf(null,e._start,0,o);return $y(t,s,n)}},lS=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Ke&&lr(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=t.doc,i=o.clientID;r.forEach((s,l)=>{const a=n.left,c=n.right,u=new tt(Ee(i,dt(o.store,i)),a,a&&a.lastId,c,c&&c.id,e,null,new Ke(l,s));u.integrate(t,0),n.right=u,n.forward()})},li=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},aS=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Ke&&lr(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},cS=(t,e,n,r)=>{const o=t.doc,i=o.clientID,s=new Map;for(const l in r){const a=r[l],c=n.currentAttributes.get(l)??null;if(!lr(c,a)){s.set(l,c);const{left:u,right:d}=n;n.right=new tt(Ee(i,dt(o.store,i)),u,u&&u.lastId,d,d&&d.id,e,null,new Ke(l,a)),n.right.integrate(t,0),n.forward()}}return s},Iu=(t,e,n,r,o)=>{n.currentAttributes.forEach((f,h)=>{o[h]===void 0&&(o[h]=null)});const i=t.doc,s=i.clientID;aS(n,o);const l=cS(t,e,n,o),a=r.constructor===String?new _n(r):r instanceof Xe?new Or(r):new ai(r);let{left:c,right:u,index:d}=n;e._searchMarker&&ds(e._searchMarker,n.index,a.getLength()),u=new tt(Ee(s,dt(i.store,s)),c,c&&c.lastId,u,u&&u.id,e,null,a),u.integrate(t,0),n.right=u,n.index=d,n.forward(),lS(t,e,n,l)},By=(t,e,n,r,o)=>{const i=t.doc,s=i.clientID;aS(n,o);const l=cS(t,e,n,o);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===Ke));){if(!n.right.deleted)switch(n.right.content.constructor){case Ke:{const{key:a,value:c}=n.right.content,u=o[a];if(u!==void 0){if(lr(u,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}n.right.delete(t)}else n.currentAttributes.set(a,c);break}default:r<n.right.length&&wr(t,Ee(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
517
+ `;n.right=new tt(Ee(s,dt(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new _n(a)),n.right.integrate(t,0),n.forward()}lS(t,e,n,l)},uS=(t,e,n,r,o)=>{let i=e;const s=on();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Ke){const c=i.content;s.set(c.key,c)}i=i.right}let l=0,a=!1;for(;e!==i;){if(n===e&&(a=!0),!e.deleted){const c=e.content;switch(c.constructor){case Ke:{const{key:u,value:d}=c,f=r.get(u)??null;(s.get(u)!==c||f===d)&&(e.delete(t),l++,!a&&(o.get(u)??null)===d&&f!==d&&(f===null?o.delete(u):o.set(u,f))),!a&&!e.deleted&&li(o,c);break}}}e=e.right}return l},i4=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Ke){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},s4=t=>{let e=0;return Ce(t.doc,n=>{let r=t._start,o=t._start,i=on();const s=nf(i);for(;o;){if(o.deleted===!1)switch(o.content.constructor){case Ke:li(s,o.content);break;default:e+=uS(n,r,o,i,s),i=nf(s),r=o;break}o=o.right}}),e},l4=t=>{const e=new Set,n=t.doc;for(const[r,o]of t.afterState.entries()){const i=t.beforeState.get(r)||0;o!==i&&qx(t,n.store.clients.get(r),i,o,s=>{!s.deleted&&s.content.constructor===Ke&&s.constructor!==nr&&e.add(s.parent)})}Ce(n,r=>{Hx(t,t.deleteSet,o=>{if(o instanceof nr||!o.parent._hasFormatting||e.has(o.parent))return;const i=o.parent;o.content.constructor===Ke?e.add(i):i4(r,o)});for(const o of e)s4(o)})},Fy=(t,e,n)=>{const r=n,o=nf(e.currentAttributes),i=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Or:case ai:case _n:n<e.right.length&&wr(t,Ee(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}i&&uS(t,i,e.right,o,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&ds(s._searchMarker,e.index,-r+n),e};class a4 extends xc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(o=>{o===null?this.childListChanged=!0:this.keysChanged.add(o)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Ce(e,r=>{const o=new Map,i=new Map;let s=this.target._start,l=null;const a={};let c="",u=0,d=0;const f=()=>{if(l!==null){let h=null;switch(l){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},o.size>0&&(h.attributes={},o.forEach((p,m)=>{p!==null&&(h.attributes[m]=p)}))),c="";break;case"retain":u>0&&(h={retain:u},uV(a)||(h.attributes=lV({},a))),u=0;break}h&&n.push(h),l=null}};for(;s!==null;){switch(s.content.constructor){case Or:case ai:this.adds(s)?this.deletes(s)||(f(),l="insert",c=s.content.getContent()[0],f()):this.deletes(s)?(l!=="delete"&&(f(),l="delete"),d+=1):s.deleted||(l!=="retain"&&(f(),l="retain"),u+=1);break;case _n:this.adds(s)?this.deletes(s)||(l!=="insert"&&(f(),l="insert"),c+=s.content.str):this.deletes(s)?(l!=="delete"&&(f(),l="delete"),d+=s.length):s.deleted||(l!=="retain"&&(f(),l="retain"),u+=s.length);break;case Ke:{const{key:h,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const m=o.get(h)??null;lr(m,p)?p!==null&&s.delete(r):(l==="retain"&&f(),lr(p,i.get(h)??null)?delete a[h]:a[h]=p)}}else if(this.deletes(s)){i.set(h,p);const m=o.get(h)??null;lr(m,p)||(l==="retain"&&f(),a[h]=m)}else if(!s.deleted){i.set(h,p);const m=a[h];m!==void 0&&(lr(m,p)?m!==null&&s.delete(r):(l==="retain"&&f(),p===null?delete a[h]:a[h]=p))}s.deleted||(l==="insert"&&f(),li(o,s.content));break}}s=s.right}for(f();n.length>0;){const h=n[n.length-1];if(h.retain!==void 0&&h.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class hs extends Xe{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new hs}clone(){const e=new hs;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new a4(this,e,n);Cc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===_n&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Ce(this.doc,r=>{const o=new uf(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const s=e[i];if(s.insert!==void 0){const l=!n&&typeof s.insert=="string"&&i===e.length-1&&o.right===null&&s.insert.slice(-1)===`
518
+ `?s.insert.slice(0,-1):s.insert;(typeof l!="string"||l.length>0)&&Iu(r,this,o,l,s.attributes||{})}else s.retain!==void 0?By(r,this,o,s.retain,s.attributes||{}):s.delete!==void 0&&Fy(r,o,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const o=[],i=new Map,s=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;i.forEach((p,m)=>{f=!0,d[m]=p});const h={insert:l};f&&(h.attributes=d),o.push(h),l=""}}const u=()=>{for(;a!==null;){if(Co(a,e)||n!==void 0&&Co(a,n))switch(a.content.constructor){case _n:{const d=i.get("ychange");e!==void 0&&!Co(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),i.set("ychange",r?r("removed",a.id):{type:"removed"})):n!==void 0&&!Co(a,n)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),i.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),i.delete("ychange")),l+=a.content.str;break}case Or:case ai:{c();const d={insert:a.content.getContent()[0]};if(i.size>0){const f={};d.attributes=f,i.forEach((h,p)=>{f[p]=h})}o.push(d);break}case Ke:Co(a,e)&&(c(),li(i,a.content));break}a=a.right}c()};return e||n?Ce(s,d=>{e&&af(d,e),n&&af(d,n),u()},"cleanup"):u(),o}insert(e,n,r){if(n.length<=0)return;const o=this.doc;o!==null?Ce(o,i=>{const s=al(i,this,e,!r);r||(r={},s.currentAttributes.forEach((l,a)=>{r[a]=l})),Iu(i,this,s,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const o=this.doc;o!==null?Ce(o,i=>{const s=al(i,this,e,!r);Iu(i,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Ce(r,o=>{Fy(o,al(o,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const o=this.doc;o!==null?Ce(o,i=>{const s=al(i,this,e,!1);s.right!==null&&By(i,this,s,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Ce(this.doc,n=>{Na(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Ce(this.doc,r=>{qh(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return Jh(this,e)}getAttributes(){return iS(this)}_write(e){e.writeTypeRef(p4)}}class Pu{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===ps||n.constructor===Xo)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Xo extends Xe{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Xo}clone(){const e=new Xo;return e.insert(0,this.toArray().map(n=>n instanceof Xe?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Pu(this,e)}querySelector(e){e=e.toUpperCase();const r=new Pu(this,o=>o.nodeName&&o.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Jo(new Pu(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Cc(this,e,new c4(this,n,e))}toString(){return eS(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const o=e.createDocumentFragment();return r!==void 0&&r._createAssociation(o,this),fs(this,i=>{o.insertBefore(i.toDOM(e,n,r),null)}),o}insert(e,n){this.doc!==null?Ce(this.doc,r=>{rS(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Ce(this.doc,r=>{const o=e&&e instanceof Xe?e._item:e;Ra(r,this,o,n)});else{const r=this._prelimContent,o=e===null?0:r.findIndex(i=>i===e)+1;if(o===0&&e!==null)throw Yo("Reference item not found");r.splice(o,0,...n)}}delete(e,n=1){this.doc!==null?Ce(this.doc,r=>{oS(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return Qx(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return tS(this,e)}slice(e=0,n=this.length){return Zx(this,e,n)}forEach(e){fs(this,e)}_write(e){e.writeTypeRef(g4)}}class ps extends Xo{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,o)=>{this.setAttribute(o,r)}),this._prelimAttrs=null}_copy(){return new ps(this.nodeName)}clone(){const e=new ps(this.nodeName),n=this.getAttributes();return cV(n,(r,o)=>{typeof r=="string"&&e.setAttribute(o,r)}),e.insert(0,this.toArray().map(r=>r instanceof Xe?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const l in e)r.push(l);r.sort();const o=r.length;for(let l=0;l<o;l++){const a=r[l];n.push(a+'="'+e[a]+'"')}const i=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${i}${s}>${super.toString()}</${i}>`}removeAttribute(e){this.doc!==null?Ce(this.doc,n=>{Na(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Ce(this.doc,r=>{qh(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return Jh(this,e)}hasAttribute(e){return sS(this,e)}getAttributes(e){return e?n4(this,e):iS(this)}toDOM(e=document,n={},r){const o=e.createElement(this.nodeName),i=this.getAttributes();for(const s in i){const l=i[s];typeof l=="string"&&o.setAttribute(s,l)}return fs(this,s=>{o.appendChild(s.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(o,this),o}_write(e){e.writeTypeRef(m4),e.writeKey(this.nodeName)}}class c4 extends xc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(o=>{o===null?this.childListChanged=!0:this.attributesChanged.add(o)})}}class ms extends hs{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new ms}clone(){const e=new ms;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const o=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(o,this),o}toString(){return this.toDelta().map(e=>{const n=[];for(const o in e.attributes){const i=[];for(const s in e.attributes[o])i.push({key:s,value:e.attributes[o][s]});i.sort((s,l)=>s.key<l.key?-1:1),n.push({nodeName:o,attrs:i})}n.sort((o,i)=>o.nodeName<i.nodeName?-1:1);let r="";for(let o=0;o<n.length;o++){const i=n[o];r+=`<${i.nodeName}`;for(let s=0;s<i.attrs.length;s++){const l=i.attrs[s];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let o=n.length-1;o>=0;o--)r+=`</${n[o].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(y4)}}class dS{constructor(e,n){this.id=e,this.length=n}get deleted(){throw sn()}mergeWith(e){return!1}write(e,n,r){throw sn()}integrate(e,n){throw sn()}}const u4=0;class nr extends dS{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),Gx(e.doc.store,this)}write(e,n){e.writeInfo(u4),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Ec{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ec(this.content)}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class _a{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new _a(this.len)}splice(e){const n=new _a(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Wx(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const d4=(t,e)=>new Os({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class kc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new kc(d4(this.doc.guid,this.opts))}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class ai{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ai(this.embed)}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class Ke{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ke(this.key,this.value)}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Zo{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Zo(this.arr)}splice(e){const n=new Zo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let o=n;o<r;o++){const i=this.arr[o];e.writeAny(i)}}getRef(){return 8}}class _n{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new _n(this.str)}splice(e){const n=new _n(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const f4=0,h4=1,p4=2,m4=3,g4=4,y4=6;class Or{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Or(this.type._copy())}splice(e){throw sn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const fS=(t,e,n)=>{const{client:r,clock:o}=e.id,i=new tt(Ee(r,o+n),e,Ee(r,o+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),e.redone!==null&&(i.redone=Ee(e.redone.client,e.redone.clock+n)),e.right=i,i.right!==null&&(i.right.left=i),t._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),e.length=n,i};class tt extends dS{constructor(e,n,r,o,i,s,l,a){super(e,a.getLength()),this.origin=r,this.left=n,this.right=o,this.rightOrigin=i,this.parent=s,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?wy:0}set marker(e){(this.info&Ou)>0!==e&&(this.info^=Ou)}get marker(){return(this.info&Ou)>0}get keep(){return(this.info&vy)>0}set keep(e){this.keep!==e&&(this.info^=vy)}get countable(){return(this.info&wy)>0}get deleted(){return(this.info&Tu)>0}set deleted(e){this.deleted!==e&&(this.info^=Tu)}markDeleted(){this.info|=Tu}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=dt(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=dt(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===El&&this.id.client!==this.parent.client&&this.parent.clock>=dt(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=_y(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=wr(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===nr||this.right&&this.right.constructor===nr)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===tt&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===tt&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===El){const r=_u(n,this.parent);r.constructor===nr?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=_y(e,e.doc.store,Ee(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,o;if(r!==null)o=r.right;else if(this.parentSub!==null)for(o=this.parent._map.get(this.parentSub)||null;o!==null&&o.left!==null;)o=o.left;else o=this.parent._start;const i=new Set,s=new Set;for(;o!==null&&o!==this.right;){if(s.add(o),i.add(o),il(this.origin,o.origin)){if(o.id.client<this.id.client)r=o,i.clear();else if(il(this.rightOrigin,o.rightOrigin))break}else if(o.origin!==null&&s.has(_u(e.doc.store,o.origin)))i.has(_u(e.doc.store,o.origin))||(r=o,i.clear());else break;o=o.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Gx(e.doc.store,this),this.content.integrate(e,this),Py(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new nr(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ee(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&il(e.origin,this.lastId)&&this.right===e&&il(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Wx(e.deleteSet,this.id.client,this.id.clock,this.length),Py(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw vr();this.content.gc(e),n?KV(e,this,new nr(this.id,this.length)):this.content=new _a(this.length)}write(e,n){const r=n>0?Ee(this.id.client,this.id.clock+n-1):this.origin,o=this.rightOrigin,i=this.parentSub,s=this.content.getRef()&P5|(r===null?0:Oa)|(o===null?0:Dx)|(i===null?0:I5);if(e.writeInfo(s),r!==null&&e.writeLeftID(r),o!==null&&e.writeRightID(o),r===null&&o===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=us(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===El?(e.writeParentInfo(!1),e.writeLeftID(l)):vr();i!==null&&e.writeString(i)}this.content.write(e,n)}}const hS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},pS="__ $YJS$ __";hS[pS]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");hS[pS]=!0;const b4=new we("y-sync");new we("y-undo");new we("yjs-cursor");const v4=(t,e,n)=>{if(t===0)return Du(e,0,-1);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof ms){if(r._length>=t)return Du(r,t,-1);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<o)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&o>1)return new Aa(r._item===null?null:r._item.id,r._item===null?us(r):null,null);if(t-=o,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Aa(r._item===null?null:r._item.id,r._item===null?us(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw vr();if(t===0&&r.constructor!==ms&&r!==e)return w4(r._item.parent,r._item)}return Du(e,e._length,-1)},w4=(t,e)=>{let n=null,r=null;return t._item===null?r=us(t):n=Ee(t._item.id.client,t._item.id.clock),new Aa(n,r,e.id)};function Yh(t,e,n){const r=[],o=t.node(0);n=typeof n=="number"&&n>=0?n:t.sameParent(e)?Math.max(0,t.sharedDepth(e.pos)-1):t.sharedDepth(e.pos);const i=new Li(t,e,n),s=i.depth===0?0:o.resolve(i.start).posAtIndex(0);return i.parent.forEach((l,a)=>{const c=s+a,u=c+l.nodeSize;if(c<i.start||c>=i.end)return;const d=new mf(o.resolve(c),o.resolve(u));r.push(d)}),r}class Xh{constructor(e,n){Ns(this,"anchor");Ns(this,"head");this.anchor=e,this.head=n}map(e){return new Xh(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return new Xt(n,r)}}class Xt extends Q{constructor(n,r,o,i=1){const{doc:s}=n,l=n===r,a=n.pos===s.content.size&&r.pos===s.content.size,c=l&&!a?s.resolve(r.pos+(i>0?1:-1)):r,u=l&&a?s.resolve(n.pos-(i>0?1:-1)):n,d=Yh(u.min(c),u.max(c),o);super(c.pos>=n.pos?d[0].$from:d[d.length-1].$to,c.pos>=n.pos?d[d.length-1].$to:d[0].$from,d);Ns(this,"depth");this.depth=o}get $to(){return this.ranges[this.ranges.length-1].$to}eq(n){return n instanceof Xt&&n.$from.pos===this.$from.pos&&n.$to.pos===this.$to.pos}map(n,r){const o=n.resolve(r.map(this.anchor)),i=n.resolve(r.map(this.head));return new Xt(o,i)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:n}=this.$from;if(this.isForwards&&this.ranges.length>1){const i=this.ranges.slice(0,-1),s=i[0].$from,l=i[i.length-1].$to;return new Xt(s,l,this.depth)}const r=this.ranges[0],o=n.resolve(Math.max(0,r.$from.pos-1));return new Xt(this.$anchor,o,this.depth)}extendForwards(){const{doc:n}=this.$from;if(this.isBackwards&&this.ranges.length>1){const i=this.ranges.slice(1),s=i[0].$from,l=i[i.length-1].$to;return new Xt(l,s,this.depth)}const r=this.ranges[this.ranges.length-1],o=n.resolve(Math.min(n.content.size,r.$to.pos+1));return new Xt(this.$anchor,o,this.depth)}static fromJSON(n,r){return new Xt(n.resolve(r.anchor),n.resolve(r.head))}static create(n,r,o,i,s=1){return new this(n.resolve(r),n.resolve(o),i,s)}getBookmark(){return new Xh(this.anchor,this.head)}}function x4(t){const e=t.cloneNode(!0),n=[t,...Array.from(t.getElementsByTagName("*"))],r=[e,...Array.from(e.getElementsByTagName("*"))];return n.forEach((o,i)=>{r[i].style.cssText=function(s){let l="";const a=getComputedStyle(s);for(let c=0;c<a.length;c+=1)l+=`${a[c]}:${a.getPropertyValue(a[c])};`;return l}(o)}),e}function cl(t,e){return window.getComputedStyle(t)[e]}function S4(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function jy(t){t.parentNode!==null&&t.parentNode!==void 0&&t.parentNode.removeChild(t)}const mS=t=>{const{x:e,y:n,direction:r,editor:o}=t;let i=null,s=null,l=null,a=e;for(;s===null&&a<window.innerWidth&&a>0;){const c=document.elementsFromPoint(a,n),u=c.findIndex(f=>f.classList.contains("ProseMirror")),d=c.slice(0,u);if(d.length>0){const f=d[0];if(i=f,l=o.view.posAtDOM(f,0),l>=0){s=o.state.doc.nodeAt(Math.max(l-1,0)),(s===null||s.isText)&&(s=o.state.doc.nodeAt(Math.max(l-1,0))),s||(s=o.state.doc.nodeAt(Math.max(l,0)));break}}r==="left"?a-=1:a+=1}return{resultElement:i,resultNode:s,pos:l!==null?l:null}};function C4(t,e){const{doc:n}=e.view.state,r=mS({editor:e,x:t.clientX,y:t.clientY,direction:"right"});if(!r.resultNode||r.pos===null)return[];const o=t.clientX,i=function(u,d,f){const h=parseInt(cl(u.dom,"paddingLeft"),10),p=parseInt(cl(u.dom,"paddingRight"),10),m=parseInt(cl(u.dom,"borderLeftWidth"),10),g=parseInt(cl(u.dom,"borderLeftWidth"),10),y=u.dom.getBoundingClientRect();return{left:S4(d,y.left+h+m,y.right-p-g),top:f}}(e.view,o,t.clientY),s=e.view.posAtCoords(i);if(!s)return[];const{pos:l}=s;if(!n.resolve(l).parent)return[];const a=n.resolve(r.pos),c=n.resolve(r.pos+1);return Yh(a,c,0)}const Hy=(t,e)=>{const n=t.resolve(e),{depth:r}=n;return r===0?e:n.pos-n.parentOffset-1},zy=(t,e)=>{const n=t.nodeAt(e),r=t.resolve(e);let{depth:o}=r,i=n;for(;o>0;){const s=r.node(o);o-=1,o===0&&(i=s)}return i},Lu=(t,e)=>{const n=b4.getState(t);return n?v4(e,n.type,n.binding.mapping):null},Vy=(t,e)=>{let n=e;for(;n&&n.parentNode&&n.parentNode!==t.dom;)n=n.parentNode;return n},gS=new we("dragHandle"),E4=({pluginKey:t=gS,element:e,editor:n,tippyOptions:r,onNodeChange:o})=>{const i=document.createElement("div");let s=null,l=!1,a=null,c=-1;return e.addEventListener("dragstart",u=>{const{view:d}=n;if(!u.dataTransfer)return;const{empty:f,$from:h,$to:p}=d.state.selection,m=C4(u,n),g=Yh(h,p,0),y=g.some(E=>m.find(O=>O.$from===E.$from&&O.$to===E.$to)),w=f||!y?m:g;if(!w.length)return;const{tr:S}=d.state,b=document.createElement("div"),C=w[0].$from.pos,x=w[w.length-1].$to.pos,k=Xt.create(d.state.doc,C,x),A=k.content();w.forEach(E=>{const O=x4(d.nodeDOM(E.$from.pos));b.append(O)}),b.style.position="absolute",b.style.top="-10000px",document.body.append(b),u.dataTransfer.clearData(),u.dataTransfer.setDragImage(b,0,0),d.dragging={slice:A,move:!0},S.setSelection(k),d.dispatch(S),document.addEventListener("drop",()=>jy(b),{once:!0}),setTimeout(()=>{e&&(e.style.pointerEvents="none")},0)}),e.addEventListener("dragend",()=>{e&&(e.style.pointerEvents="auto")}),new ke({key:typeof t=="string"?new we(t):t,state:{init:()=>({locked:!1}),apply(u,d,f,h){const p=u.getMeta("lockDragHandle"),m=u.getMeta("hideDragHandle");if(p!==void 0&&(l=p),m&&s)return s.hide(),l=!1,a=null,c=-1,o==null||o({editor:n,node:null,pos:-1}),d;if(u.docChanged&&c!==-1&&e&&s){const g=u.mapping.map(c);g!==c&&(c=g,Lu(h,c))}return d}},view:u=>{var d;return e.draggable=!0,e.style.pointerEvents="auto",(d=n.view.dom.parentElement)===null||d===void 0||d.appendChild(i),i.appendChild(e),i.style.pointerEvents="none",i.style.position="absolute",i.style.top="0",i.style.left="0",s=lo(u.dom,{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]},...r,appendTo:i,content:e}),{update(f,h){if(!e||!s||(e.draggable=!l,u.state.doc.eq(h.doc)||c===-1))return;let p=u.nodeDOM(c);if(p=Vy(u,p),p===u.dom||(p==null?void 0:p.nodeType)!==1)return;const m=u.posAtDOM(p,0),g=zy(n.state.doc,m);if(g!==a){const y=Hy(n.state.doc,m);a=g,c=y,Lu(u.state,c),o==null||o({editor:n,node:a,pos:c}),s.setProps({getReferenceClientRect:()=>p.getBoundingClientRect()}),s.show()}},destroy(){s==null||s.destroy(),e&&jy(i)}}},props:{handleDOMEvents:{mouseleave:(u,d)=>(l||d.target&&!i.contains(d.relatedTarget)&&(s==null||s.hide(),a=null,c=-1,o==null||o({editor:n,node:null,pos:-1})),!1),mousemove(u,d){if(!e||!s||l)return!1;const f=mS({x:d.clientX,y:d.clientY,direction:"right",editor:n});if(!f.resultElement)return!1;let h=f.resultElement;if(h=Vy(u,h),h===u.dom||(h==null?void 0:h.nodeType)!==1)return!1;const p=u.posAtDOM(h,0),m=zy(n.state.doc,p);if(m!==a){const g=Hy(n.state.doc,p);a=m,c=g,Lu(u.state,c),o==null||o({editor:n,node:a,pos:c}),s.setProps({getReferenceClientRect:()=>h.getBoundingClientRect()}),s.show()}return!1}}}})};exports.AllSelection=Nt;exports.BetweenHorizontalEnd=DT;exports.BetweenHorizontalStart=_T;exports.BetweenVerticalEnd=IT;exports.BetweenVerticalStart=PT;exports.Blockquote=G3;exports.Bold=LT;exports.Bold$1=ET;exports.BubbleMenu=oz;exports.BulletList=j3;exports.CellSelection=be;exports.CharacterCount=FF;exports.Check=$T;exports.CheckboxItem2=G_;exports.ChevronDown=BT;exports.ChevronRight=FT;exports.ChevronsUpDown=jT;exports.Circle=HT;exports.Clipboard=zT;exports.Code=WT;exports.Code$1=TN;exports.CodeBlockLowlight=A2;exports.CodeXml=VT;exports.Color=II;exports.Columns2=UT;exports.Columns3=KT;exports.Columns4=GT;exports.Content=xz;exports.Content2=mN;exports.Content2$1=W_;exports.Content2$2=_I;exports.Copy=qT;exports.Decoration=Le;exports.DecorationSet=me;exports.Document=jF;exports.DragHandlePlugin=E4;exports.Dropcursor=VF;exports.EditorContent=qH;exports.Eraser=JT;exports.Extension=Ie;exports.FocusClasses=WF;exports.FontFamily=N2;exports.Frame=YT;exports.Gapcursor=ZF;exports.GripVertical=XT;exports.HardBreak=QF;exports.Heading=vI;exports.Heading1=ZT;exports.Heading2=QT;exports.Heading3=eO;exports.Highlight=B3;exports.History=BF;exports.HorizontalRule=OF;exports.Image=mz;exports.ImageUp=tO;exports.IndentDecrease=nO;exports.IndentIncrease=rO;exports.Italic=oO;exports.Italic$1=wN;exports.Item2=K_;exports.ItemIndicator2=J_;exports.Label2=U_;exports.Link=iO;exports.Link$1=bF;exports.List=aO;exports.List$1=vz;exports.ListItem=ej;exports.ListOrdered=sO;exports.ListTodo=lO;exports.LoaderCircle=cO;exports.Maximize=uO;exports.Minimize=dO;exports.Minus=fO;exports.Node=Ne;exports.NodeViewWrapper=sz;exports.OrderedList=z3;exports.PaintRoller=hO;exports.PanelLeft=pO;exports.PanelRight=mO;exports.Paragraph=tj;exports.Pencil=gO;exports.Placeholder=nj;exports.Plugin=ke;exports.PluginKey=we;exports.Plus=yO;exports.Portal=DI;exports.Portal2=V_;exports.Provider=fN;exports.Quote=bO;exports.RadioItem2=q_;exports.ReactNodeViewRenderer=uz;exports.ReactRenderer=dx;exports.Redo2=vO;exports.Replace=wO;exports.Root=GO;exports.Root$1=P3;exports.Root$2=wF;exports.Root$3=MF;exports.Root2=H_;exports.Root2$1=RI;exports.Root2$2=bz;exports.Root3=hN;exports.Separator2=Y_;exports.Slot=qr;exports.SmilePlus=xO;exports.Sparkles=SO;exports.Strike=EN;exports.Strikethrough=CO;exports.Sub2=X_;exports.SubContent2=Q_;exports.SubTrigger2=Z_;exports.Subscript=EO;exports.Subscript$1=oj;exports.Suggestion=hz;exports.Superscript=kO;exports.Superscript$1=ij;exports.Table=OO;exports.Table$1=M5;exports.TableCell=T5;exports.TableCellsMerge=MO;exports.TableCellsSplit=TO;exports.TableHeader=O5;exports.TableRow=Sz;exports.TaskItem=W3;exports.TaskList=U3;exports.Text=rj;exports.TextAlign=wI;exports.TextAlignCenterIcon=$O;exports.TextAlignJustifyIcon=FO;exports.TextAlignLeftIcon=HO;exports.TextAlignRightIcon=VO;exports.TextSelection=Z;exports.TextStyle=R2;exports.Thumb=TF;exports.Trash=RO;exports.Trash2=AO;exports.Trigger=pN;exports.Trigger$1=z_;exports.Trigger$2=NI;exports.Trigger$3=wz;exports.Type=NO;exports.Underline=DO;exports.Underline$1=xN;exports.Undo2=_O;exports.Unlink=IO;exports.Video=PO;exports.Z=N3;exports.clsx=YO;exports.cva=JO;exports.debounce=fw;exports.deleteSelection=r0;exports.differenceBy=KB;exports.dragHandlePluginDefaultKey=gS;exports.getMarkRange=Ga;exports.isActive=v0;exports.isList=id;exports.mergeAttributes=le;exports.proxy=lI;exports.sticky=FH;exports.throttle=d3;exports.tippy=lo;exports.truncate=m3;exports.twMerge=OA;exports.useEditor=nz;exports.useSnapshot=bI;