richtor 1.0.4 → 1.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.
- package/dist/editor.es.js +15 -14
- package/dist/editor.umd.js +3 -3
- package/dist/richtor.css +1 -1
- package/package.json +1 -1
package/dist/editor.umd.js
CHANGED
|
@@ -214,11 +214,11 @@ ${u}`),u}async function Une(t,e){let n=await ik(e),a=n.preprocess?await n.prepro
|
|
|
214
214
|
`,m)}return{formatted:A,cursorOffset:p,comments:u.comments}}function lk(t,e,n){return typeof e!="number"||Number.isNaN(e)||e<0||e>t.length?n:e}function CO(t,e){let{cursorOffset:n,rangeStart:a,rangeEnd:r}=e;return n=lk(t,n,-1),a=lk(t,a,0),r=lk(t,r,t.length),{...e,cursorOffset:n,rangeStart:a,rangeEnd:r}}function _O(t,e){let{cursorOffset:n,rangeStart:a,rangeEnd:r,endOfLine:i}=CO(t,e),o=t.charAt(0)===yO;if(o&&(t=t.slice(1),n--,a--,r--),i==="auto"&&(i=hee(t)),t.includes("\r")){let s=c=>cF(t.slice(0,Math.max(c,0)),`\r
|
|
215
215
|
`);n-=s(n),a-=s(a),r-=s(r),t=yee(t)}return{hasBOM:o,text:t,options:CO(t,{...e,cursorOffset:n,rangeStart:a,rangeEnd:r,endOfLine:i})}}async function BO(t,e){let n=await ik(e);return!n.hasPragma||n.hasPragma(t)}async function dae(t,e){return(await ik(e)).hasIgnorePragma?.(t)}async function EO(t,e){let{hasBOM:n,text:a,options:r}=_O(t,await mc(e));if(r.rangeStart>=r.rangeEnd&&a!==""||r.requirePragma&&!await BO(a,r)||r.checkIgnorePragma&&await dae(a,r))return{formatted:t,cursorOffset:e.cursorOffset,comments:[]};let i;return r.rangeStart>0||r.rangeEnd<a.length?i=await uae(a,r):(!r.requirePragma&&r.insertPragma&&r.printer.insertPragma&&!await BO(a,r)&&(a=r.printer.insertPragma(a)),i=await kO(a,r)),n&&(i.formatted=yO+i.formatted,i.cursorOffset>=0&&i.cursorOffset++),i}async function pae(t,e,n){let{text:a,options:r}=_O(t,await mc(e)),i=await vu(a,r);return n&&(n.preprocessForPrint&&(i.ast=await mO(i.ast,r)),n.massage&&(i.ast=eae(i.ast,r))),i}async function Aae(t,e){e=await mc(e);let n=await lm(t,e);return im(n,e)}async function mae(t,e){let n=Jee(t),{formatted:a}=await EO(n,{...e,parser:"__js_expression"});return a}async function gae(t,e){e=await mc(e);let{ast:n}=await vu(t,e);return e.cursorOffset>=0&&(e={...e,...gO(n,e)}),lm(n,e)}async function fae(t,e){return im(t,await mc(e))}var vO={};Pw(vO,{builders:()=>bae,printer:()=>hae,utils:()=>yae});var bae={join:bF,line:hF,softline:Yee,hardline:Wr,literalline:wF,group:fF,conditionalGroup:zee,fill:Gee,lineSuffix:Hw,lineSuffixBoundary:Kee,cursor:Ro,breakParent:am,ifBreak:Hee,trim:Wee,indent:nm,indentIfBreak:Uee,align:dc,addAlignmentToDoc:gF,markAsRoot:mF,dedentToRoot:jee,dedent:qee,hardlineWithoutBreakParent:zw,literallineWithoutBreakParent:yF,label:Zee,concat:t=>t},hae={printDocToString:im},yae={willBreak:See,traverseDoc:qw,findInDoc:Gw,mapDoc:em,removeLines:Nee,stripTrailingHardline:AF,replaceEndOfLine:Lee,canBreak:Ree},wae="3.7.1",xO={};Pw(xO,{addDanglingComment:()=>jo,addLeadingComment:()=>Bu,addTrailingComment:()=>Eu,getAlignmentSize:()=>Yw,getIndentSize:()=>vae,getMaxContinuousCount:()=>Iae,getNextNonSpaceNonCommentCharacter:()=>Sae,getNextNonSpaceNonCommentCharacterIndex:()=>Rae,getPreferredQuote:()=>Oae,getStringWidth:()=>Uw,hasNewline:()=>Pi,hasNewlineInRange:()=>Tae,hasSpaces:()=>Lae,isNextLineEmpty:()=>zae,isNextLineEmptyAfterIndex:()=>Ak,isPreviousLineEmpty:()=>jae,makeString:()=>Gae,skip:()=>_u,skipEverythingButNewLine:()=>EF,skipInlineComment:()=>uk,skipNewline:()=>Po,skipSpaces:()=>Ri,skipToLineEnd:()=>BF,skipTrailingComment:()=>dk,skipWhitespace:()=>Ate});function kae(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let n=e+2;n<t.length;++n)if(t.charAt(n)==="*"&&t.charAt(n+1)==="/")return n+2}return e}var uk=kae;function Cae(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?EF(t,e):e}var dk=Cae;function _ae(t,e){let n=null,a=e;for(;a!==n;)n=a,a=Ri(t,a),a=uk(t,a),a=dk(t,a),a=Po(t,a);return a}var pk=_ae;function Bae(t,e){let n=null,a=e;for(;a!==n;)n=a,a=BF(t,a),a=uk(t,a),a=Ri(t,a);return a=dk(t,a),a=Po(t,a),a!==!1&&Pi(t,a)}var Ak=Bae;function Eae(t,e){let n=t.lastIndexOf(`
|
|
216
216
|
`);return n===-1?0:Yw(t.slice(n+1).match(/^[\t ]*/u)[0],e)}var vae=Eae;function xae(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Qae(t,e){let n=t.matchAll(new RegExp(`(?:${xae(e)})+`,"gu"));return n.reduce||(n=[...n]),n.reduce((a,[r])=>Math.max(a,r.length),0)/e.length}var Iae=Qae;function Dae(t,e){let n=pk(t,e);return n===!1?"":t.charAt(n)}var Sae=Dae;function Fae(t,e){let n=e===!0||e==="'"?"'":'"',a=n==="'"?'"':"'",r=0,i=0;for(let o of t)o===n?r++:o===a&&i++;return r>i?a:n}var Oae=Fae;function Nae(t,e,n){for(let a=e;a<n;++a)if(t.charAt(a)===`
|
|
217
|
-
`)return!0;return!1}var Tae=Nae;function $ae(t,e,n={}){return Ri(t,n.backwards?e-1:e,n)!==e}var Lae=$ae;function Mae(t,e,n){return pk(t,n(e))}function Rae(t,e){return arguments.length===2||typeof e=="number"?pk(t,e):Mae(...arguments)}function Pae(t,e,n){return Vw(t,n(e))}function jae(t,e){return arguments.length===2||typeof e=="number"?Vw(t,e):Pae(...arguments)}function qae(t,e,n){return Ak(t,n(e))}function Gae(t,e,n){let a=e==='"'?"'":'"',r=XA(0,t,/\\(.)|(["'])/gsu,(i,o,s)=>o===a?o:s===e?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(o)?o:"\\"+o));return e+r+e}function zae(t,e){return arguments.length===2||typeof e=="number"?Ak(t,e):qae(...arguments)}function qo(t,e=1){return async(...n)=>{let a=n[e]??{},r=a.plugins??[];return n[e]={...a,plugins:Array.isArray(r)?r:Object.values(r)},t(...n)}}var QO=qo(EO);async function IO(t,e){let{formatted:n}=await QO(t,{...e,cursorOffset:-1});return n}async function Hae(t,e){return await IO(t,e)===t}var Uae=qo(LF,0),Zae={parse:qo(pae),formatAST:qo(Aae),formatDoc:qo(mae),printToDoc:qo(gae),printDocToString:qo(fae)};function Yae(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}const Kae=async t=>{try{const e=Yae(t).trim();return await sF.format(e,{parser:"html",plugins:[j2],printWidth:80,htmlWhitespaceSensitivity:"ignore",bracketSameLine:!0,singleAttributePerLine:!0,useTabs:!1,tabWidth:2})}catch{return t}},DO=F.forwardRef(({initialContent:t,onChange:e},n)=>{const[a,r]=F.useState(""),i=DK({initialContent:a});return F.useEffect(()=>{Kae(t).then(r)},[t]),F.useImperativeHandle(n,()=>i.current,[i]),w.jsx("div",{ref:i})});DO.displayName="SourceEditor";function Wae(){const[,t]=F.useState({});return F.useCallback(()=>t({}),[])}function Jae({ref:t,placeholder:e,...n}){const a=Wae(),r=nG(n,[]);return F.useImperativeHandle(t,()=>({getInstance:()=>r}),[r]),F.useEffect(()=>{const i=n.editable;!r||r.isEditable===i||(r.setOptions({editable:!!i}),a())},[r,n.editable]),F.useEffect(()=>{r&&(r.setOptions({editorProps:{placeholder:e}}),a())},[r,e]),F.useEffect(()=>()=>{r?.destroy()},[]),r}const SO=F.createContext({}),Me=()=>F.useContext(SO),Vae=({children:t,editorOptions:e,slotBefore:n,slotAfter:a})=>{const r=F.useRef(null),i=Jae(e),[o,s]=F.useState(!1),[c,l]=F.useState(!1),[u,d]=F.useState(!1);if(!i)return null;const p=m=>{const g=m.target,f=r.current;f&&g.contains(f)&&(f.style.display="flex",setTimeout(()=>{f.style.display=""},0))},A=w.jsxs("div",{className:ln("rte-editor",o&&"rte-editor--fullscreen"),children:[n,w.jsx("div",{className:"rte-editor__container",onMouseDown:p,children:c?w.jsx(DO,{initialContent:i.getHTML()||""}):w.jsx(Jq,{ref:r,editor:i,className:"rte-editor__content"})}),t,a]});return w.jsx(SO.Provider,{value:{editor:i,contentElement:r,isFullScreen:o,isResizing:u,isSourceMode:c,setIsResizing:d,toggleFullScreen:()=>s(m=>!m),toggleSourceMode:()=>l(m=>!m)},children:A})},FO=F.forwardRef(({active:t,icon:e,text:n,shortcuts:a,className:r,children:i,type:o,buttonType:s,hideText:c=!0,hideArrow:l=!1,tooltip:u=!0,buttonClass:d,buttonStyle:p,dropdownClass:A,dropdownStyle:m,disabled:g,...f},h)=>{const{editor:y,contentElement:k}=Me(),_=o==="dropdown"||o==="popover"&&!l,C=c&&!_,Q=F.useMemo(()=>{if(u===!1)return null;const T={title:typeof u=="string"?u:n,shortcuts:a?`(${a.map(Yz).join(" + ")})`:""};return`${T.title} ${T.shortcuts}`},[u,n,a]),x=F.useMemo(()=>e?w.jsx(yl,{name:e,className:"rte-button-icon"}):null,[e]),S=w.jsx(Sr,{ref:h,type:s,variant:"ghost",className:ln("rte-menu__button",d),style:p,iconOnly:C,slotBefore:!C&&x,slotAfter:_&&w.jsx("span",{className:"rte-icon-arrow",children:w.jsx(yl,{name:"ChevronDown",size:16})}),onFocusCapture:T=>T.stopPropagation(),"data-active":y.isEditable&&t||void 0,"aria-label":typeof u=="string"?u:n,disabled:!y.isEditable||g,...f,children:C?x:!c&&n}),P=Q?w.jsx(wh,{content:Q,options:{collisionBoundary:k.current?.parentElement},children:S}):S;return o==="dropdown"?w.jsxs(_z,{modal:!1,children:[w.jsx(Bz,{asChild:!0,children:P}),w.jsx(SQ,{className:A,style:m,onCloseAutoFocus:T=>T.preventDefault(),children:i})]}):o==="popover"?w.jsxs(xz,{modal:!1,children:[w.jsx(Qz,{asChild:!0,children:P}),w.jsx(FQ,{className:A,style:m,onCloseAutoFocus:T=>T.preventDefault(),children:i})]}):P});FO.displayName="MenuButton";const ye=F.memo(FO),Xae=()=>{const{editor:t}=Me(),e=He({editor:t,selector:()=>({})});return w.jsx(ye,{icon:"Table",tooltip:"Table",type:"popover",hideArrow:!0,...e,children:w.jsx(O4,{onCreate:({rows:n,cols:a})=>t.chain().insertTable({rows:n,cols:a,withHeaderRow:!1}).focus().run()})})},ere=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"center"}),disabled:!n.editor.can().setTextAlign("center")})});return w.jsx(ye,{icon:"AlignCenter",tooltip:"Center",shortcuts:["Mod","Shift","E"],onClick:()=>t.chain().focus().setTextAlign("center").run(),...e})},tre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"justify"}),disabled:!n.editor.can().setTextAlign("justify")})});return w.jsx(ye,{icon:"AlignJustify",tooltip:"Justify",shortcuts:["Mod","Shift","F"],onClick:()=>t.chain().focus().setTextAlign("justify").run(),...e})},nre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"left"}),disabled:!n.editor.can().setTextAlign("left")})});return w.jsx(ye,{icon:"AlignLeft",tooltip:"Left",shortcuts:["Mod","Shift","L"],onClick:()=>t.chain().focus().setTextAlign("left").run(),...e})},are=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"right"}),disabled:!n.editor.can().setTextAlign("right")})});return w.jsx(ye,{icon:"AlignRight",tooltip:"Right",shortcuts:["Mod","Shift","R"],onClick:()=>t.chain().focus().setTextAlign("right").run(),...e})},rre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:a=>a.editor.isActive({textAlign:"right"})?"AlignRight":a.editor.isActive({textAlign:"center"})?"AlignCenter":a.editor.isActive({textAlign:"justify"})?"AlignJustify":"AlignLeft"}),n=!t.isEditable||!t.can().setTextAlign("left");return w.jsx(ye,{type:"popover",icon:e,tooltip:"Alignment",disabled:n,children:w.jsx(gh,{asChild:!0,children:w.jsxs(Pa,{dense:!0,children:[w.jsx(nre,{}),w.jsx(ere,{}),w.jsx(are,{}),w.jsx(tre,{})]})})})},ire=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("bold"),disabled:!n.editor.can().toggleBold()})});return w.jsx(ye,{icon:"Bold",tooltip:"Bold",shortcuts:["Mod","B"],onClick:()=>t.chain().focus().toggleBold().run(),...e})},ore=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("bulletList"),disabled:!n.editor.isEditable})});return w.jsx(ye,{icon:"BulletList",tooltip:"Bullet List",shortcuts:["Mod","Shift","8"],onClick:()=>t.chain().focus().toggleBulletList().run(),...e})},sre=[1,2,3,4,5,6],cre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:i=>{const{editor:o}=i;if(o.isActive("paragraph"))return"p";const s=sre.find(c=>o.isActive("heading",{level:c}));return s?`h${s}`:null}}),n=F.useMemo(()=>[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],[]),a=F.useCallback(i=>{i.startsWith("h")?t.chain().focus().setHeading({level:+i[1]}).run():t.chain().focus().setParagraph().run()},[t]),r=n.find(i=>i.value===e)?.label||"Headings";return w.jsx(ye,{type:"dropdown",text:r,tooltip:"Headings",hideText:!1,disabled:!t.isEditable||!e,buttonStyle:{minWidth:"6.5rem"},dropdownClass:"rte-heading-dropdown",children:n.map(i=>w.jsx(mh,{"data-active":i.value===e||void 0,"data-heading":i.value,onSelect:()=>a(i.value),children:i.label},i.value))})},lre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("italic"),disabled:!n.editor.can().toggleItalic()})});return w.jsx(ye,{icon:"Italic",tooltip:"Italic",shortcuts:["Mod","I"],onClick:()=>t.chain().focus().toggleItalic().run(),...e})},ure=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("link"),disabled:!n.editor.can().setLink({href:""})})});return w.jsx(ye,{icon:"Link",tooltip:"Link",shortcuts:["Mod","K"],onClick:()=>t.commands.startEditLink(),...e})},dre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("code"),disabled:!n.editor.can().toggleCode()})});return w.jsx(ye,{icon:"CodeInline",tooltip:"Inline code",shortcuts:["Mod","E"],onClick:()=>t.chain().focus().toggleCode().run(),...e})},pre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("strike"),disabled:!n.editor.can().toggleStrike()})});return w.jsx(ye,{icon:"Strike",tooltip:"Strikethrough",shortcuts:["Mod","Shift","S"],onClick:()=>t.chain().focus().toggleStrike().run(),...e})},Are=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("subscript"),disabled:!n.editor.can().toggleSubscript()})});return w.jsx(ye,{icon:"Subscript",tooltip:"Subscript",shortcuts:["Mod",","],onClick:()=>t.chain().focus().toggleSubscript().run(),...e})},mre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("superscript"),disabled:!n.editor.can().toggleSuperscript()})});return w.jsx(ye,{icon:"Superscript",tooltip:"Superscript",shortcuts:["Mod","."],onClick:()=>t.chain().focus().toggleSuperscript().run(),...e})},gre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>!n.editor.can().setStrike()&&!n.editor.can().setSuperscript()&&!n.editor.can().setSubscript()&&!n.editor.can().setCode()});return w.jsx(ye,{type:"popover",icon:"LetterCase",tooltip:"More format",disabled:e,children:w.jsx(gh,{asChild:!0,children:w.jsxs(Pa,{dense:!0,children:[w.jsx(pre,{}),w.jsx(mre,{}),w.jsx(Are,{}),w.jsx(dre,{})]})})})},fre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("orderedList"),disabled:!n.editor.isEditable})});return w.jsx(ye,{icon:"OrderedList",tooltip:"Numbered List",shortcuts:["Mod","Shift","7"],onClick:()=>t.chain().focus().toggleOrderedList().run(),...e})},bre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({disabled:!n.editor.can().redo()})});return w.jsx(ye,{icon:"Redo",tooltip:"Redo",shortcuts:["Mod","Y"],onClick:()=>t.chain().focus().redo().run(),...e})};function OO(){const[t,e]=F.useState(!1);return F.useEffect(()=>e(!0),[]),t}const hre=["#B12318","#EB3323","#F6C143","#FFFE55","#A0CD63","#4FAD5B","#4CAFEA","#2D70BA","#68389B"],yre=["#FFFFFF","#000000","#3B74EC","#45A2EF","#529867","#CD4A3F","#EA8D40","#EEC543","#8E45D0","#F2F2F2","#7F7F7F","#CBDCFC","#E8F6FE","#EDFAF2","#FCEAE9","#FDF3EC","#FEF9E5","#FAECFE","#EEEEEE","#595959","#CEEBFD","#DDE9FE","#CBE9D7","#F7CBC9","#FADDC7","#FDEEB5","#EBCAFC","#BFBFBF","#3F3F3F","#A0BEFA","#A7DCFC","#A6D5B8","#F2A19C","#F5BC8C","#FBE281","#CB94F9","#A5A5A5","#262626","#2452B2","#3473A1","#417A53","#922B22","#AD642A","#9E8329","#57297D","#939393","#0D0D0D","#15316A","#1C415A","#284D34","#511712","#573213","#635217","#36194E"];function um(){return(um=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(this,arguments)}function NO(t,e){if(t==null)return{};var n,a,r={},i=Object.keys(t);for(a=0;a<i.length;a++)e.indexOf(n=i[a])>=0||(r[n]=t[n]);return r}function mk(t){var e=F.useRef(t),n=F.useRef(function(a){e.current&&e.current(a)});return e.current=t,n.current}var xu=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Qu=function(t){return"touches"in t},gk=function(t){return t&&t.ownerDocument.defaultView||self},TO=function(t,e,n){var a=t.getBoundingClientRect(),r=Qu(e)?(function(i,o){for(var s=0;s<i.length;s++)if(i[s].identifier===o)return i[s];return i[0]})(e.touches,n):e;return{left:xu((r.pageX-(a.left+gk(t).pageXOffset))/a.width),top:xu((r.pageY-(a.top+gk(t).pageYOffset))/a.height)}},$O=function(t){!Qu(t)&&t.preventDefault()},LO=F.memo(function(t){var e=t.onMove,n=t.onKey,a=NO(t,["onMove","onKey"]),r=F.useRef(null),i=mk(e),o=mk(n),s=F.useRef(null),c=F.useRef(!1),l=F.useMemo(function(){var A=function(f){$O(f),(Qu(f)?f.touches.length>0:f.buttons>0)&&r.current?i(TO(r.current,f,s.current)):g(!1)},m=function(){return g(!1)};function g(f){var h=c.current,y=gk(r.current),k=f?y.addEventListener:y.removeEventListener;k(h?"touchmove":"mousemove",A),k(h?"touchend":"mouseup",m)}return[function(f){var h=f.nativeEvent,y=r.current;if(y&&($O(h),!(function(_,C){return C&&!Qu(_)})(h,c.current)&&y)){if(Qu(h)){c.current=!0;var k=h.changedTouches||[];k.length&&(s.current=k[0].identifier)}y.focus(),i(TO(y,h,s.current)),g(!0)}},function(f){var h=f.which||f.keyCode;h<37||h>40||(f.preventDefault(),o({left:h===39?.05:h===37?-.05:0,top:h===40?.05:h===38?-.05:0}))},g]},[o,i]),u=l[0],d=l[1],p=l[2];return F.useEffect(function(){return p},[p]),F.createElement("div",um({},a,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:r,onKeyDown:d,tabIndex:0,role:"slider"}))}),fk=function(t){return t.filter(Boolean).join(" ")},MO=function(t){var e=t.color,n=t.left,a=t.top,r=a===void 0?.5:a,i=fk(["react-colorful__pointer",t.className]);return F.createElement("div",{className:i,style:{top:100*r+"%",left:100*n+"%"}},F.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},rn=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},wre=function(t){return Ere(bk(t))},bk=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?rn(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?rn(parseInt(t.substring(6,8),16)/255,2):1}},kre=function(t){return Bre(_re(t))},Cre=function(t){var e=t.s,n=t.v,a=t.a,r=(200-e)*n/100;return{h:rn(t.h),s:rn(r>0&&r<200?e*n/100/(r<=100?r:200-r)*100:0),l:rn(r/2),a:rn(a,2)}},hk=function(t){var e=Cre(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},_re=function(t){var e=t.h,n=t.s,a=t.v,r=t.a;e=e/360*6,n/=100,a/=100;var i=Math.floor(e),o=a*(1-n),s=a*(1-(e-i)*n),c=a*(1-(1-e+i)*n),l=i%6;return{r:rn(255*[a,s,o,o,c,a][l]),g:rn(255*[c,a,a,s,o,o][l]),b:rn(255*[o,o,c,a,a,s][l]),a:rn(r,2)}},dm=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Bre=function(t){var e=t.r,n=t.g,a=t.b,r=t.a,i=r<1?dm(rn(255*r)):"";return"#"+dm(e)+dm(n)+dm(a)+i},Ere=function(t){var e=t.r,n=t.g,a=t.b,r=t.a,i=Math.max(e,n,a),o=i-Math.min(e,n,a),s=o?i===e?(n-a)/o:i===n?2+(a-e)/o:4+(e-n)/o:0;return{h:rn(60*(s<0?s+6:s)),s:rn(i?o/i*100:0),v:rn(i/255*100),a:r}},vre=F.memo(function(t){var e=t.hue,n=t.onChange,a=fk(["react-colorful__hue",t.className]);return F.createElement("div",{className:a},F.createElement(LO,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:xu(e+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":rn(e),"aria-valuemax":"360","aria-valuemin":"0"},F.createElement(MO,{className:"react-colorful__hue-pointer",left:e/360,color:hk({h:e,s:100,v:100,a:1})})))}),xre=F.memo(function(t){var e=t.hsva,n=t.onChange,a={backgroundColor:hk({h:e.h,s:100,v:100,a:1})};return F.createElement("div",{className:"react-colorful__saturation",style:a},F.createElement(LO,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:xu(e.s+100*r.left,0,100),v:xu(e.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+rn(e.s)+"%, Brightness "+rn(e.v)+"%"},F.createElement(MO,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:hk(e)})))}),RO=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},Qre=function(t,e){return t.toLowerCase()===e.toLowerCase()||RO(bk(t),bk(e))};function Ire(t,e,n){var a=mk(n),r=F.useState(function(){return t.toHsva(e)}),i=r[0],o=r[1],s=F.useRef({color:e,hsva:i});F.useEffect(function(){if(!t.equal(e,s.current.color)){var l=t.toHsva(e);s.current={hsva:l,color:e},o(l)}},[e,t]),F.useEffect(function(){var l;RO(i,s.current.hsva)||t.equal(l=t.fromHsva(i),s.current.color)||(s.current={hsva:i,color:l},a(l))},[i,t,a]);var c=F.useCallback(function(l){o(function(u){return Object.assign({},u,l)})},[]);return[i,c]}var Dre=typeof window<"u"?F.useLayoutEffect:F.useEffect,Sre=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},PO=new Map,Fre=function(t){Dre(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!PO.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}`,PO.set(e,n);var a=Sre();a&&n.setAttribute("nonce",a),e.head.appendChild(n)}},[])},Ore=function(t){var e=t.className,n=t.colorModel,a=t.color,r=a===void 0?n.defaultColor:a,i=t.onChange,o=NO(t,["className","colorModel","color","onChange"]),s=F.useRef(null);Fre(s);var c=Ire(n,r,i),l=c[0],u=c[1],d=fk(["react-colorful",e]);return F.createElement("div",um({},o,{ref:s,className:d}),F.createElement(xre,{hsva:l,onChange:u}),F.createElement(vre,{hue:l.h,onChange:u,className:"react-colorful__last-control"}))},Nre={defaultColor:"000",toHsva:wre,fromHsva:function(t){return kre({h:t.h,s:t.s,v:t.v,a:1})},equal:Qre},Tre=function(t){return F.createElement(Ore,um({},t,{colorModel:Nre}))};const Go=B.forwardRef(({className:t,type:e="text",...n},a)=>w.jsx("input",{type:e,className:ln("rte-input",t),ref:a,...n}));Go.displayName="Input";const pm=({as:t="label",children:e,className:n=""})=>w.jsx(t,{className:ln("rte-label",n),children:e}),jO=({color:t,tooltip:e=!0,active:n,onClick:a})=>{const r=w.jsx("button",{type:"button",tabIndex:-1,"data-active":n?"true":void 0,className:"rte-color__btn",style:{background:t},onClick:()=>a?.(t)});return e?w.jsx(wh,{content:t,children:r}):r},qO=t=>{const[e,n]=F.useState("swatches"),[a,r]=F.useState(t.color),i=u=>{const d=u.startsWith("#")?u:`#${u}`;return d.length===4?`${d}${d.slice(1)}`:d},o=(u,d)=>i(u).toUpperCase()===i(d).toUpperCase(),s=u=>{r(u)},c=()=>{a&&/^#?[0-9A-F]{3,6}$/i.test(a)&&t.onChange?.(i(a))},l=(u,d)=>w.jsxs("div",{children:[w.jsx(pm,{as:"span",children:d}),w.jsx("div",{className:"rte-color__list",children:u.map(p=>w.jsx(jO,{active:o(p,a),color:p,onClick:()=>s(p)},p))})]});return w.jsxs("div",{className:"rte-cp",children:[w.jsx("div",{className:"rte-cp__tabs",children:["swatches","custom"].map(u=>w.jsx(Sr,{variant:"ghost","data-active":e===u||void 0,onClick:()=>n(u),className:"rte-cp__tab",children:u.charAt(0).toUpperCase()+u.slice(1)},u))}),w.jsxs("div",{className:"rte-cp__main",children:[e==="swatches"&&w.jsxs("div",{className:"rte-cp-swatches",children:[l(hre,"Default Colors"),l(yre,"More Colors")]}),e==="custom"&&w.jsxs("div",{className:"rte-cp-custom",children:[w.jsx(Tre,{className:"rte-cp-custom__picker",style:{width:"100%"},color:a,onChange:s}),w.jsxs("div",{className:"rte-cp-custom__preview",children:[w.jsx(jO,{color:a,tooltip:!1}),w.jsx(Go,{value:a,style:{textTransform:"uppercase"},onChange:u=>s(u.target.value),autoFocus:!0})]})]})]}),w.jsx(Zd,{asChild:!0,children:w.jsxs("div",{className:"rte-cp__actions",children:[w.jsx(Sr,{variant:"secondary",iconOnly:!0,onClick:t.onReset,children:w.jsx(yl,{name:"PaletteOff"})}),w.jsx(Sr,{style:{width:"100%"},onClick:c,children:"Apply"})]})})]})},$re=()=>{const t=F.useRef(null),e=OO(),{editor:n}=Me(),a=He({editor:n,selector:o=>({color:o.editor.getAttributes("textStyle").color||"DEFAULT",disabled:!o.editor.can().setColor("")})}),r={position:"absolute",bottom:1.5,insetInline:4,height:4,borderRadius:4,pointerEvents:"none",background:a.color==="DEFAULT"?"var(--rte-fg, black)":a.color},i=e&&t.current?ao.createPortal(w.jsx("div",{style:r}),t.current):null;return w.jsxs(w.Fragment,{children:[w.jsx(ye,{ref:t,type:"popover",icon:"TextColor",hideArrow:!0,tooltip:"Color",disabled:a.disabled,children:w.jsx(qO,{color:a.color,onChange:o=>n.chain().focus().setColor(o).run(),onReset:()=>n.chain().focus().unsetColor().run()})}),i]})},Lre=()=>{const t=F.useRef(null),e=OO(),{editor:n}=Me(),a=He({editor:n,selector:o=>({color:o.editor.getAttributes("highlight").color||"DEFAULT",disabled:!o.editor.can().setHighlight()})}),r={position:"absolute",bottom:1.5,insetInline:4,height:4,borderRadius:4,pointerEvents:"none",background:a.color==="DEFAULT"?"var(--rte-bg, white)":a.color},i=e&&t.current?ao.createPortal(w.jsx("div",{style:r}),t.current):null;return w.jsxs(w.Fragment,{children:[w.jsx(ye,{ref:t,type:"popover",icon:"TextHighlight",hideArrow:!0,tooltip:"Highlight",disabled:a.disabled,children:w.jsx(qO,{color:a.color,onChange:o=>n.chain().focus().setHighlight({color:o}).run(),onReset:()=>n.chain().focus().unsetHighlight().run()})}),i]})},Mre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("underline"),disabled:!n.editor.can().toggleUnderline()})});return w.jsx(ye,{icon:"Underline",tooltip:"Underline",shortcuts:["Mod","U"],onClick:()=>t.chain().focus().toggleUnderline().run(),...e})},Rre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({disabled:!n.editor.can().undo()})});return w.jsx(ye,{icon:"Undo",tooltip:"Undo",shortcuts:["Mod","Z"],onClick:()=>t.chain().focus().undo().run(),...e})},Pre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:i=>({active:i.editor.isActive("image"),disabled:!i.editor.isEditable})}),n=F.useRef(null),a=F.useCallback(()=>{n.current?.click()},[]),r=F.useCallback(i=>{const s=i.target.files?.[0];if(s?.type.startsWith("image/")){const c=URL.createObjectURL(s);t.chain().setImage({src:c}).focus().run()}},[t]);return w.jsxs(F.Fragment,{children:[w.jsx(ye,{icon:"Image",tooltip:"Image",...e,onClick:a}),w.jsx("input",{style:{display:"none"},type:"file",accept:"image/*",ref:n,onChange:r})]})};var Am="Dialog",[GO]=ii(Am),[jre,Fa]=GO(Am),zO=t=>{const{__scopeDialog:e,children:n,open:a,defaultOpen:r,onOpenChange:i,modal:o=!0}=t,s=B.useRef(null),c=B.useRef(null),[l,u]=Gc({prop:a,defaultProp:r??!1,onChange:i,caller:Am});return w.jsx(jre,{scope:e,triggerRef:s,contentRef:c,contentId:ci(),titleId:ci(),descriptionId:ci(),open:l,onOpenChange:u,onOpenToggle:B.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};zO.displayName=Am;var HO="DialogTrigger",qre=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(HO,n),i=kt(e,r.triggerRef);return w.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":kk(r.open),...a,ref:i,onClick:we(t.onClick,r.onOpenToggle)})});qre.displayName=HO;var yk="DialogPortal",[Gre,UO]=GO(yk,{forceMount:void 0}),ZO=t=>{const{__scopeDialog:e,forceMount:n,children:a,container:r}=t,i=Fa(yk,e);return w.jsx(Gre,{scope:e,forceMount:n,children:B.Children.map(a,o=>w.jsx(za,{present:n||i.open,children:w.jsx(Of,{asChild:!0,container:r,children:o})}))})};ZO.displayName=yk;var mm="DialogOverlay",YO=B.forwardRef((t,e)=>{const n=UO(mm,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=Fa(mm,t.__scopeDialog);return i.modal?w.jsx(za,{present:a||i.open,children:w.jsx(Hre,{...r,ref:e})}):null});YO.displayName=mm;var zre=cs("DialogOverlay.RemoveScroll"),Hre=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(mm,n);return w.jsx(Hd,{as:zre,allowPinchZoom:!0,shards:[r.contentRef],children:w.jsx(pt.div,{"data-state":kk(r.open),...a,ref:e,style:{pointerEvents:"auto",...a.style}})})}),zo="DialogContent",KO=B.forwardRef((t,e)=>{const n=UO(zo,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=Fa(zo,t.__scopeDialog);return w.jsx(za,{present:a||i.open,children:i.modal?w.jsx(Ure,{...r,ref:e}):w.jsx(Zre,{...r,ref:e})})});KO.displayName=zo;var Ure=B.forwardRef((t,e)=>{const n=Fa(zo,t.__scopeDialog),a=B.useRef(null),r=kt(e,n.contentRef,a);return B.useEffect(()=>{const i=a.current;if(i)return Tf(i)},[]),w.jsx(WO,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:we(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:we(t.onFocusOutside,i=>i.preventDefault())})}),Zre=B.forwardRef((t,e)=>{const n=Fa(zo,t.__scopeDialog),a=B.useRef(!1),r=B.useRef(!1);return w.jsx(WO,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(a.current||n.triggerRef.current?.focus(),i.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(a.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),WO=B.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=t,s=Fa(zo,n),c=B.useRef(null),l=kt(e,c);return Af(),w.jsxs(w.Fragment,{children:[w.jsx(Ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:i,children:w.jsx(Pc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":kk(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(Yre,{titleId:s.titleId}),w.jsx(Wre,{contentRef:c,descriptionId:s.descriptionId})]})]})}),wk="DialogTitle",JO=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(wk,n);return w.jsx(pt.h2,{id:r.titleId,...a,ref:e})});JO.displayName=wk;var VO="DialogDescription",XO=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(VO,n);return w.jsx(pt.p,{id:r.descriptionId,...a,ref:e})});XO.displayName=VO;var e8="DialogClose",t8=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(e8,n);return w.jsx(pt.button,{type:"button",...a,ref:e,onClick:we(t.onClick,()=>r.onOpenChange(!1))})});t8.displayName=e8;function kk(t){return t?"open":"closed"}var n8="DialogTitleWarning",[sDe,a8]=RL(n8,{contentName:zo,titleName:wk,docsSlug:"dialog"}),Yre=({titleId:t})=>{const e=a8(n8),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
217
|
+
`)return!0;return!1}var Tae=Nae;function $ae(t,e,n={}){return Ri(t,n.backwards?e-1:e,n)!==e}var Lae=$ae;function Mae(t,e,n){return pk(t,n(e))}function Rae(t,e){return arguments.length===2||typeof e=="number"?pk(t,e):Mae(...arguments)}function Pae(t,e,n){return Vw(t,n(e))}function jae(t,e){return arguments.length===2||typeof e=="number"?Vw(t,e):Pae(...arguments)}function qae(t,e,n){return Ak(t,n(e))}function Gae(t,e,n){let a=e==='"'?"'":'"',r=XA(0,t,/\\(.)|(["'])/gsu,(i,o,s)=>o===a?o:s===e?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(o)?o:"\\"+o));return e+r+e}function zae(t,e){return arguments.length===2||typeof e=="number"?Ak(t,e):qae(...arguments)}function qo(t,e=1){return async(...n)=>{let a=n[e]??{},r=a.plugins??[];return n[e]={...a,plugins:Array.isArray(r)?r:Object.values(r)},t(...n)}}var QO=qo(EO);async function IO(t,e){let{formatted:n}=await QO(t,{...e,cursorOffset:-1});return n}async function Hae(t,e){return await IO(t,e)===t}var Uae=qo(LF,0),Zae={parse:qo(pae),formatAST:qo(Aae),formatDoc:qo(mae),printToDoc:qo(gae),printDocToString:qo(fae)};function Yae(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}const Kae=async t=>{try{const e=Yae(t).trim();return await sF.format(e,{parser:"html",plugins:[j2],printWidth:80,htmlWhitespaceSensitivity:"ignore",bracketSameLine:!0,singleAttributePerLine:!0,useTabs:!1,tabWidth:2})}catch{return t}},DO=F.forwardRef(({initialContent:t,onChange:e},n)=>{const[a,r]=F.useState(""),i=DK({initialContent:a});return F.useEffect(()=>{Kae(t).then(r)},[t]),F.useImperativeHandle(n,()=>i.current,[i]),w.jsx("div",{ref:i})});DO.displayName="SourceEditor";function Wae(){const[,t]=F.useState({});return F.useCallback(()=>t({}),[])}function Jae({ref:t,placeholder:e,...n}){const a=Wae(),r=nG(n,[]);return F.useImperativeHandle(t,()=>({getInstance:()=>r}),[r]),F.useEffect(()=>{const i=n.editable;!r||r.isEditable===i||(r.setOptions({editable:!!i}),a())},[r,n.editable]),F.useEffect(()=>{r&&(r.setOptions({editorProps:{placeholder:e}}),a())},[r,e]),F.useEffect(()=>()=>{r?.destroy()},[]),r}const SO=F.createContext({}),Me=()=>F.useContext(SO),Vae=({children:t,editorOptions:e,slotBefore:n,slotAfter:a})=>{const r=F.useRef(null),i=Jae(e),[o,s]=F.useState(!1),[c,l]=F.useState(!1),[u,d]=F.useState(!1);if(!i)return null;const p=m=>{const g=m.target,f=r.current;f&&g.contains(f)&&(f.style.display="flex",setTimeout(()=>{f.style.display=""},0))},A=w.jsxs("div",{className:ln("rte-editor",o&&"rte-editor--fullscreen"),children:[n,w.jsx("div",{className:"rte-editor__container",onMouseDown:p,children:c?w.jsx(DO,{initialContent:i.getHTML()||""}):w.jsx(Jq,{ref:r,editor:i,className:"rte-editor__content"})}),t,a]});return w.jsx(SO.Provider,{value:{editor:i,contentElement:r,isFullScreen:o,isResizing:u,isSourceMode:c,setIsResizing:d,toggleFullScreen:()=>s(m=>!m),toggleSourceMode:()=>l(m=>!m)},children:A})},FO=F.forwardRef(({active:t,icon:e,text:n,shortcuts:a,className:r,children:i,type:o,buttonType:s,hideText:c=!0,hideArrow:l=!1,tooltip:u=!0,buttonClass:d,buttonStyle:p,dropdownClass:A,dropdownStyle:m,disabled:g,...f},h)=>{const{editor:y,contentElement:k}=Me(),_=o==="dropdown"||o==="popover"&&!l,C=c&&!_,Q=F.useMemo(()=>{if(u===!1)return null;const T={title:typeof u=="string"?u:n,shortcuts:a?`(${a.map(Yz).join(" + ")})`:""};return`${T.title} ${T.shortcuts}`},[u,n,a]),x=F.useMemo(()=>e?w.jsx(yl,{name:e,className:"rte-button-icon"}):null,[e]),S=w.jsx(Sr,{ref:h,type:s,variant:"ghost",className:ln("rte-menu__button",d),style:p,iconOnly:C,slotBefore:!C&&x,slotAfter:_&&w.jsx("span",{className:"rte-icon-arrow",children:w.jsx(yl,{name:"ChevronDown",size:16})}),onFocusCapture:T=>T.stopPropagation(),"data-active":y.isEditable&&t||void 0,"aria-label":typeof u=="string"?u:n,disabled:!y.isEditable||g,...f,children:C?x:!c&&n}),P=Q?w.jsx(wh,{content:Q,options:{collisionBoundary:k.current?.parentElement},children:S}):S;return o==="dropdown"?w.jsxs(_z,{modal:!1,children:[w.jsx(Bz,{asChild:!0,children:P}),w.jsx(SQ,{className:A,style:m,onCloseAutoFocus:T=>T.preventDefault(),children:i})]}):o==="popover"?w.jsxs(xz,{modal:!1,children:[w.jsx(Qz,{asChild:!0,children:P}),w.jsx(FQ,{className:A,style:m,onCloseAutoFocus:T=>T.preventDefault(),children:i})]}):P});FO.displayName="MenuButton";const ye=F.memo(FO),Xae=()=>{const{editor:t}=Me(),e=He({editor:t,selector:()=>({})});return w.jsx(ye,{icon:"Table",tooltip:"Table",type:"popover",hideArrow:!0,...e,children:w.jsx(O4,{onCreate:({rows:n,cols:a})=>t.chain().insertTable({rows:n,cols:a,withHeaderRow:!1}).focus().run()})})},ere=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"center"}),disabled:!n.editor.can().setTextAlign("center")})});return w.jsx(ye,{icon:"AlignCenter",tooltip:"Center",shortcuts:["Mod","Shift","E"],onClick:()=>t.chain().focus().setTextAlign("center").run(),...e})},tre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"justify"}),disabled:!n.editor.can().setTextAlign("justify")})});return w.jsx(ye,{icon:"AlignJustify",tooltip:"Justify",shortcuts:["Mod","Shift","F"],onClick:()=>t.chain().focus().setTextAlign("justify").run(),...e})},nre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"left"}),disabled:!n.editor.can().setTextAlign("left")})});return w.jsx(ye,{icon:"AlignLeft",tooltip:"Left",shortcuts:["Mod","Shift","L"],onClick:()=>t.chain().focus().setTextAlign("left").run(),...e})},are=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive({textAlign:"right"}),disabled:!n.editor.can().setTextAlign("right")})});return w.jsx(ye,{icon:"AlignRight",tooltip:"Right",shortcuts:["Mod","Shift","R"],onClick:()=>t.chain().focus().setTextAlign("right").run(),...e})},rre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:a=>a.editor.isActive({textAlign:"right"})?"AlignRight":a.editor.isActive({textAlign:"center"})?"AlignCenter":a.editor.isActive({textAlign:"justify"})?"AlignJustify":"AlignLeft"}),n=!t.isEditable||!t.can().setTextAlign("left");return w.jsx(ye,{type:"popover",icon:e,tooltip:"Alignment",disabled:n,children:w.jsx(gh,{asChild:!0,children:w.jsxs(Pa,{dense:!0,children:[w.jsx(nre,{}),w.jsx(ere,{}),w.jsx(are,{}),w.jsx(tre,{})]})})})},ire=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("bold"),disabled:!n.editor.can().toggleBold()})});return w.jsx(ye,{icon:"Bold",tooltip:"Bold",shortcuts:["Mod","B"],onClick:()=>t.chain().focus().toggleBold().run(),...e})},ore=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("bulletList"),disabled:!n.editor.isEditable})});return w.jsx(ye,{icon:"BulletList",tooltip:"Bullet List",shortcuts:["Mod","Shift","8"],onClick:()=>t.chain().focus().toggleBulletList().run(),...e})},sre=[1,2,3,4,5,6],cre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:i=>{const{editor:o}=i;if(o.isActive("paragraph"))return"p";const s=sre.find(c=>o.isActive("heading",{level:c}));return s?`h${s}`:null}}),n=F.useMemo(()=>[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"}],[]),a=F.useCallback(i=>{i.startsWith("h")?t.chain().focus().setHeading({level:+i[1]}).run():t.chain().focus().setParagraph().run()},[t]),r=n.find(i=>i.value===e)?.label||"Headings";return w.jsx(ye,{type:"dropdown",text:r,tooltip:"Headings",hideText:!1,disabled:!t.isEditable||!e,buttonStyle:{minWidth:"6.5rem"},dropdownClass:"rte-heading-dropdown",children:n.map(i=>w.jsx(mh,{"data-active":i.value===e||void 0,"data-heading":i.value,onSelect:()=>a(i.value),children:i.label},i.value))})},lre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("italic"),disabled:!n.editor.can().toggleItalic()})});return w.jsx(ye,{icon:"Italic",tooltip:"Italic",shortcuts:["Mod","I"],onClick:()=>t.chain().focus().toggleItalic().run(),...e})},ure=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("link"),disabled:!n.editor.can().setLink({href:""})})});return w.jsx(ye,{icon:"Link",tooltip:"Link",shortcuts:["Mod","K"],onClick:()=>t.commands.startEditLink(),...e})},dre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("code"),disabled:!n.editor.can().toggleCode()})});return w.jsx(ye,{icon:"CodeInline",tooltip:"Inline code",shortcuts:["Mod","E"],onClick:()=>t.chain().focus().toggleCode().run(),...e})},pre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("strike"),disabled:!n.editor.can().toggleStrike()})});return w.jsx(ye,{icon:"Strike",tooltip:"Strikethrough",shortcuts:["Mod","Shift","S"],onClick:()=>t.chain().focus().toggleStrike().run(),...e})},Are=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("subscript"),disabled:!n.editor.can().toggleSubscript()})});return w.jsx(ye,{icon:"Subscript",tooltip:"Subscript",shortcuts:["Mod",","],onClick:()=>t.chain().focus().toggleSubscript().run(),...e})},mre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("superscript"),disabled:!n.editor.can().toggleSuperscript()})});return w.jsx(ye,{icon:"Superscript",tooltip:"Superscript",shortcuts:["Mod","."],onClick:()=>t.chain().focus().toggleSuperscript().run(),...e})},gre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>!n.editor.can().setStrike()&&!n.editor.can().setSuperscript()&&!n.editor.can().setSubscript()&&!n.editor.can().setCode()});return w.jsx(ye,{type:"popover",icon:"LetterCase",tooltip:"More format",disabled:e,children:w.jsx(gh,{asChild:!0,children:w.jsxs(Pa,{dense:!0,children:[w.jsx(pre,{}),w.jsx(mre,{}),w.jsx(Are,{}),w.jsx(dre,{})]})})})},fre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("orderedList"),disabled:!n.editor.isEditable})});return w.jsx(ye,{icon:"OrderedList",tooltip:"Numbered List",shortcuts:["Mod","Shift","7"],onClick:()=>t.chain().focus().toggleOrderedList().run(),...e})},bre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({disabled:!n.editor.can().redo()})});return w.jsx(ye,{icon:"Redo",tooltip:"Redo",shortcuts:["Mod","Y"],onClick:()=>t.chain().focus().redo().run(),...e})};function OO(){const[t,e]=F.useState(!1);return F.useEffect(()=>e(!0),[]),t}const hre=["#B12318","#EB3323","#F6C143","#FFFE55","#A0CD63","#4FAD5B","#4CAFEA","#2D70BA","#68389B"],yre=["#FFFFFF","#000000","#3B74EC","#45A2EF","#529867","#CD4A3F","#EA8D40","#EEC543","#8E45D0","#F2F2F2","#7F7F7F","#CBDCFC","#E8F6FE","#EDFAF2","#FCEAE9","#FDF3EC","#FEF9E5","#FAECFE","#EEEEEE","#595959","#CEEBFD","#DDE9FE","#CBE9D7","#F7CBC9","#FADDC7","#FDEEB5","#EBCAFC","#BFBFBF","#3F3F3F","#A0BEFA","#A7DCFC","#A6D5B8","#F2A19C","#F5BC8C","#FBE281","#CB94F9","#A5A5A5","#262626","#2452B2","#3473A1","#417A53","#922B22","#AD642A","#9E8329","#57297D","#939393","#0D0D0D","#15316A","#1C415A","#284D34","#511712","#573213","#635217","#36194E"];function um(){return(um=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(this,arguments)}function NO(t,e){if(t==null)return{};var n,a,r={},i=Object.keys(t);for(a=0;a<i.length;a++)e.indexOf(n=i[a])>=0||(r[n]=t[n]);return r}function mk(t){var e=F.useRef(t),n=F.useRef(function(a){e.current&&e.current(a)});return e.current=t,n.current}var xu=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Qu=function(t){return"touches"in t},gk=function(t){return t&&t.ownerDocument.defaultView||self},TO=function(t,e,n){var a=t.getBoundingClientRect(),r=Qu(e)?(function(i,o){for(var s=0;s<i.length;s++)if(i[s].identifier===o)return i[s];return i[0]})(e.touches,n):e;return{left:xu((r.pageX-(a.left+gk(t).pageXOffset))/a.width),top:xu((r.pageY-(a.top+gk(t).pageYOffset))/a.height)}},$O=function(t){!Qu(t)&&t.preventDefault()},LO=F.memo(function(t){var e=t.onMove,n=t.onKey,a=NO(t,["onMove","onKey"]),r=F.useRef(null),i=mk(e),o=mk(n),s=F.useRef(null),c=F.useRef(!1),l=F.useMemo(function(){var A=function(f){$O(f),(Qu(f)?f.touches.length>0:f.buttons>0)&&r.current?i(TO(r.current,f,s.current)):g(!1)},m=function(){return g(!1)};function g(f){var h=c.current,y=gk(r.current),k=f?y.addEventListener:y.removeEventListener;k(h?"touchmove":"mousemove",A),k(h?"touchend":"mouseup",m)}return[function(f){var h=f.nativeEvent,y=r.current;if(y&&($O(h),!(function(_,C){return C&&!Qu(_)})(h,c.current)&&y)){if(Qu(h)){c.current=!0;var k=h.changedTouches||[];k.length&&(s.current=k[0].identifier)}y.focus(),i(TO(y,h,s.current)),g(!0)}},function(f){var h=f.which||f.keyCode;h<37||h>40||(f.preventDefault(),o({left:h===39?.05:h===37?-.05:0,top:h===40?.05:h===38?-.05:0}))},g]},[o,i]),u=l[0],d=l[1],p=l[2];return F.useEffect(function(){return p},[p]),F.createElement("div",um({},a,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:r,onKeyDown:d,tabIndex:0,role:"slider"}))}),fk=function(t){return t.filter(Boolean).join(" ")},MO=function(t){var e=t.color,n=t.left,a=t.top,r=a===void 0?.5:a,i=fk(["react-colorful__pointer",t.className]);return F.createElement("div",{className:i,style:{top:100*r+"%",left:100*n+"%"}},F.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},rn=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},wre=function(t){return Ere(bk(t))},bk=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?rn(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?rn(parseInt(t.substring(6,8),16)/255,2):1}},kre=function(t){return Bre(_re(t))},Cre=function(t){var e=t.s,n=t.v,a=t.a,r=(200-e)*n/100;return{h:rn(t.h),s:rn(r>0&&r<200?e*n/100/(r<=100?r:200-r)*100:0),l:rn(r/2),a:rn(a,2)}},hk=function(t){var e=Cre(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},_re=function(t){var e=t.h,n=t.s,a=t.v,r=t.a;e=e/360*6,n/=100,a/=100;var i=Math.floor(e),o=a*(1-n),s=a*(1-(e-i)*n),c=a*(1-(1-e+i)*n),l=i%6;return{r:rn(255*[a,s,o,o,c,a][l]),g:rn(255*[c,a,a,s,o,o][l]),b:rn(255*[o,o,c,a,a,s][l]),a:rn(r,2)}},dm=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Bre=function(t){var e=t.r,n=t.g,a=t.b,r=t.a,i=r<1?dm(rn(255*r)):"";return"#"+dm(e)+dm(n)+dm(a)+i},Ere=function(t){var e=t.r,n=t.g,a=t.b,r=t.a,i=Math.max(e,n,a),o=i-Math.min(e,n,a),s=o?i===e?(n-a)/o:i===n?2+(a-e)/o:4+(e-n)/o:0;return{h:rn(60*(s<0?s+6:s)),s:rn(i?o/i*100:0),v:rn(i/255*100),a:r}},vre=F.memo(function(t){var e=t.hue,n=t.onChange,a=fk(["react-colorful__hue",t.className]);return F.createElement("div",{className:a},F.createElement(LO,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:xu(e+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":rn(e),"aria-valuemax":"360","aria-valuemin":"0"},F.createElement(MO,{className:"react-colorful__hue-pointer",left:e/360,color:hk({h:e,s:100,v:100,a:1})})))}),xre=F.memo(function(t){var e=t.hsva,n=t.onChange,a={backgroundColor:hk({h:e.h,s:100,v:100,a:1})};return F.createElement("div",{className:"react-colorful__saturation",style:a},F.createElement(LO,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:xu(e.s+100*r.left,0,100),v:xu(e.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+rn(e.s)+"%, Brightness "+rn(e.v)+"%"},F.createElement(MO,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:hk(e)})))}),RO=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},Qre=function(t,e){return t.toLowerCase()===e.toLowerCase()||RO(bk(t),bk(e))};function Ire(t,e,n){var a=mk(n),r=F.useState(function(){return t.toHsva(e)}),i=r[0],o=r[1],s=F.useRef({color:e,hsva:i});F.useEffect(function(){if(!t.equal(e,s.current.color)){var l=t.toHsva(e);s.current={hsva:l,color:e},o(l)}},[e,t]),F.useEffect(function(){var l;RO(i,s.current.hsva)||t.equal(l=t.fromHsva(i),s.current.color)||(s.current={hsva:i,color:l},a(l))},[i,t,a]);var c=F.useCallback(function(l){o(function(u){return Object.assign({},u,l)})},[]);return[i,c]}var Dre=typeof window<"u"?F.useLayoutEffect:F.useEffect,Sre=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},PO=new Map,Fre=function(t){Dre(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!PO.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}`,PO.set(e,n);var a=Sre();a&&n.setAttribute("nonce",a),e.head.appendChild(n)}},[])},Ore=function(t){var e=t.className,n=t.colorModel,a=t.color,r=a===void 0?n.defaultColor:a,i=t.onChange,o=NO(t,["className","colorModel","color","onChange"]),s=F.useRef(null);Fre(s);var c=Ire(n,r,i),l=c[0],u=c[1],d=fk(["react-colorful",e]);return F.createElement("div",um({},o,{ref:s,className:d}),F.createElement(xre,{hsva:l,onChange:u}),F.createElement(vre,{hue:l.h,onChange:u,className:"react-colorful__last-control"}))},Nre={defaultColor:"000",toHsva:wre,fromHsva:function(t){return kre({h:t.h,s:t.s,v:t.v,a:1})},equal:Qre},Tre=function(t){return F.createElement(Ore,um({},t,{colorModel:Nre}))};const Go=B.forwardRef(({className:t,type:e="text",...n},a)=>w.jsx("input",{type:e,className:ln("rte-input",t),ref:a,...n}));Go.displayName="Input";const pm=({as:t="label",children:e,className:n=""})=>w.jsx(t,{className:ln("rte-label",n),children:e}),jO=({color:t,tooltip:e=!0,active:n,onClick:a})=>{const r=w.jsx("button",{type:"button",tabIndex:-1,"data-active":n?"true":void 0,className:"rte-color__btn",style:{background:t},onClick:()=>a?.(t)});return e?w.jsx(wh,{content:t,children:r}):r},qO=t=>{const[e,n]=F.useState("swatches"),[a,r]=F.useState(t.color),i=u=>{const d=u.startsWith("#")?u:`#${u}`;return d.length===4?`${d}${d.slice(1)}`:d},o=(u,d)=>i(u).toUpperCase()===i(d).toUpperCase(),s=u=>{r(u)},c=()=>{a&&/^#?[0-9A-F]{3,6}$/i.test(a)&&t.onChange?.(i(a))},l=(u,d)=>w.jsxs("div",{children:[w.jsx(pm,{as:"span",children:d}),w.jsx("div",{className:"rte-color__list",children:u.map(p=>w.jsx(jO,{active:o(p,a),color:p,onClick:()=>s(p)},p))})]});return w.jsxs("div",{className:"rte-cp",children:[w.jsx("div",{className:"rte-cp__tabs",children:["swatches","custom"].map(u=>w.jsx(Sr,{type:"button",variant:"ghost","data-active":e===u||void 0,onClick:()=>n(u),className:"rte-cp__tab",children:u.charAt(0).toUpperCase()+u.slice(1)},u))}),w.jsxs("div",{className:"rte-cp__main",children:[e==="swatches"&&w.jsxs("div",{className:"rte-cp-swatches",children:[l(hre,"Default Colors"),l(yre,"More Colors")]}),e==="custom"&&w.jsxs("div",{className:"rte-cp-custom",children:[w.jsx(Tre,{className:"rte-cp-custom__picker",style:{width:"100%"},color:a,onChange:s}),w.jsxs("div",{className:"rte-cp-custom__preview",children:[w.jsx(jO,{color:a,tooltip:!1}),w.jsx(Go,{value:a,style:{textTransform:"uppercase"},onChange:u=>s(u.target.value),autoFocus:!0})]})]})]}),w.jsx(Zd,{asChild:!0,children:w.jsxs("div",{className:"rte-cp__actions",children:[w.jsx(Sr,{variant:"secondary",iconOnly:!0,type:"button",onClick:t.onReset,children:w.jsx(yl,{name:"PaletteOff"})}),w.jsx(Sr,{style:{width:"100%"},type:"button",onClick:c,children:"Apply"})]})})]})},$re=()=>{const t=F.useRef(null),e=OO(),{editor:n}=Me(),a=He({editor:n,selector:o=>({color:o.editor.getAttributes("textStyle").color||"DEFAULT",disabled:!o.editor.can().setColor("")})}),r={position:"absolute",bottom:1.5,insetInline:4,height:4,borderRadius:4,pointerEvents:"none",background:a.color==="DEFAULT"?"var(--rte-fg, black)":a.color},i=e&&t.current?ao.createPortal(w.jsx("div",{style:r}),t.current):null;return w.jsxs(w.Fragment,{children:[w.jsx(ye,{ref:t,type:"popover",icon:"TextColor",hideArrow:!0,tooltip:"Color",disabled:a.disabled,children:w.jsx(qO,{color:a.color,onChange:o=>n.chain().focus().setColor(o).run(),onReset:()=>n.chain().focus().unsetColor().run()})}),i]})},Lre=()=>{const t=F.useRef(null),e=OO(),{editor:n}=Me(),a=He({editor:n,selector:o=>({color:o.editor.getAttributes("highlight").color||"DEFAULT",disabled:!o.editor.can().setHighlight()})}),r={position:"absolute",bottom:1.5,insetInline:4,height:4,borderRadius:4,pointerEvents:"none",background:a.color==="DEFAULT"?"var(--rte-bg, white)":a.color},i=e&&t.current?ao.createPortal(w.jsx("div",{style:r}),t.current):null;return w.jsxs(w.Fragment,{children:[w.jsx(ye,{ref:t,type:"popover",icon:"TextHighlight",hideArrow:!0,tooltip:"Highlight",disabled:a.disabled,children:w.jsx(qO,{color:a.color,onChange:o=>n.chain().focus().setHighlight({color:o}).run(),onReset:()=>n.chain().focus().unsetHighlight().run()})}),i]})},Mre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("underline"),disabled:!n.editor.can().toggleUnderline()})});return w.jsx(ye,{icon:"Underline",tooltip:"Underline",shortcuts:["Mod","U"],onClick:()=>t.chain().focus().toggleUnderline().run(),...e})},Rre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({disabled:!n.editor.can().undo()})});return w.jsx(ye,{icon:"Undo",tooltip:"Undo",shortcuts:["Mod","Z"],onClick:()=>t.chain().focus().undo().run(),...e})},Pre=()=>{const{editor:t}=Me(),e=He({editor:t,selector:i=>({active:i.editor.isActive("image"),disabled:!i.editor.isEditable})}),n=F.useRef(null),a=F.useCallback(()=>{n.current?.click()},[]),r=F.useCallback(i=>{const s=i.target.files?.[0];if(s?.type.startsWith("image/")){const c=URL.createObjectURL(s);t.chain().setImage({src:c}).focus().run()}},[t]);return w.jsxs(F.Fragment,{children:[w.jsx(ye,{icon:"Image",tooltip:"Image",...e,onClick:a}),w.jsx("input",{style:{display:"none"},type:"file",accept:"image/*",ref:n,onChange:r})]})};var Am="Dialog",[GO]=ii(Am),[jre,Fa]=GO(Am),zO=t=>{const{__scopeDialog:e,children:n,open:a,defaultOpen:r,onOpenChange:i,modal:o=!0}=t,s=B.useRef(null),c=B.useRef(null),[l,u]=Gc({prop:a,defaultProp:r??!1,onChange:i,caller:Am});return w.jsx(jre,{scope:e,triggerRef:s,contentRef:c,contentId:ci(),titleId:ci(),descriptionId:ci(),open:l,onOpenChange:u,onOpenToggle:B.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};zO.displayName=Am;var HO="DialogTrigger",qre=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(HO,n),i=kt(e,r.triggerRef);return w.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":kk(r.open),...a,ref:i,onClick:we(t.onClick,r.onOpenToggle)})});qre.displayName=HO;var yk="DialogPortal",[Gre,UO]=GO(yk,{forceMount:void 0}),ZO=t=>{const{__scopeDialog:e,forceMount:n,children:a,container:r}=t,i=Fa(yk,e);return w.jsx(Gre,{scope:e,forceMount:n,children:B.Children.map(a,o=>w.jsx(za,{present:n||i.open,children:w.jsx(Of,{asChild:!0,container:r,children:o})}))})};ZO.displayName=yk;var mm="DialogOverlay",YO=B.forwardRef((t,e)=>{const n=UO(mm,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=Fa(mm,t.__scopeDialog);return i.modal?w.jsx(za,{present:a||i.open,children:w.jsx(Hre,{...r,ref:e})}):null});YO.displayName=mm;var zre=cs("DialogOverlay.RemoveScroll"),Hre=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(mm,n);return w.jsx(Hd,{as:zre,allowPinchZoom:!0,shards:[r.contentRef],children:w.jsx(pt.div,{"data-state":kk(r.open),...a,ref:e,style:{pointerEvents:"auto",...a.style}})})}),zo="DialogContent",KO=B.forwardRef((t,e)=>{const n=UO(zo,t.__scopeDialog),{forceMount:a=n.forceMount,...r}=t,i=Fa(zo,t.__scopeDialog);return w.jsx(za,{present:a||i.open,children:i.modal?w.jsx(Ure,{...r,ref:e}):w.jsx(Zre,{...r,ref:e})})});KO.displayName=zo;var Ure=B.forwardRef((t,e)=>{const n=Fa(zo,t.__scopeDialog),a=B.useRef(null),r=kt(e,n.contentRef,a);return B.useEffect(()=>{const i=a.current;if(i)return Tf(i)},[]),w.jsx(WO,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:we(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:we(t.onFocusOutside,i=>i.preventDefault())})}),Zre=B.forwardRef((t,e)=>{const n=Fa(zo,t.__scopeDialog),a=B.useRef(!1),r=B.useRef(!1);return w.jsx(WO,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(a.current||n.triggerRef.current?.focus(),i.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(a.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),WO=B.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=t,s=Fa(zo,n),c=B.useRef(null),l=kt(e,c);return Af(),w.jsxs(w.Fragment,{children:[w.jsx(Ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:i,children:w.jsx(Pc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":kk(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(Yre,{titleId:s.titleId}),w.jsx(Wre,{contentRef:c,descriptionId:s.descriptionId})]})]})}),wk="DialogTitle",JO=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(wk,n);return w.jsx(pt.h2,{id:r.titleId,...a,ref:e})});JO.displayName=wk;var VO="DialogDescription",XO=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(VO,n);return w.jsx(pt.p,{id:r.descriptionId,...a,ref:e})});XO.displayName=VO;var e8="DialogClose",t8=B.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,r=Fa(e8,n);return w.jsx(pt.button,{type:"button",...a,ref:e,onClick:we(t.onClick,()=>r.onOpenChange(!1))})});t8.displayName=e8;function kk(t){return t?"open":"closed"}var n8="DialogTitleWarning",[sDe,a8]=RL(n8,{contentName:zo,titleName:wk,docsSlug:"dialog"}),Yre=({titleId:t})=>{const e=a8(n8),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
218
218
|
|
|
219
219
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
220
220
|
|
|
221
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return B.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Kre="DialogDescriptionWarning",Wre=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a8(Kre).contentName}}.`;return B.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},Jre=zO,Vre=ZO,Xre=YO,eie=KO,tie=JO,nie=XO,r8=t8;const aie=(t,e)=>{const n=new Array(t.length+e.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<e.length;a++)n[t.length+a]=e[a];return n},rie=(t,e)=>({classGroupId:t,validator:e}),i8=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),gm="-",o8=[],iie="arbitrary..",oie=t=>{const e=cie(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return sie(o);const s=o.split(gm),c=s[0]===""&&s.length>1?1:0;return s8(s,c,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const c=a[o],l=n[o];return c?l?aie(l,c):c:l||o8}return n[o]||o8}}},s8=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],i=n.nextPart.get(r);if(i){const l=s8(t,e+1,i);if(l)return l}const o=n.validators;if(o===null)return;const s=e===0?t.join(gm):t.slice(e).join(gm),c=o.length;for(let l=0;l<c;l++){const u=o[l];if(u.validator(s))return u.classGroupId}},sie=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),a=e.slice(0,n);return a?iie+a:void 0})(),cie=t=>{const{theme:e,classGroups:n}=t;return lie(n,e)},lie=(t,e)=>{const n=i8();for(const a in t){const r=t[a];Ck(r,n,a,e)}return n},Ck=(t,e,n,a)=>{const r=t.length;for(let i=0;i<r;i++){const o=t[i];uie(o,e,n,a)}},uie=(t,e,n,a)=>{if(typeof t=="string"){die(t,e,n);return}if(typeof t=="function"){pie(t,e,n,a);return}Aie(t,e,n,a)},die=(t,e,n)=>{const a=t===""?e:c8(e,t);a.classGroupId=n},pie=(t,e,n,a)=>{if(mie(t)){Ck(t(a),e,n,a);return}e.validators===null&&(e.validators=[]),e.validators.push(rie(n,t))},Aie=(t,e,n,a)=>{const r=Object.entries(t),i=r.length;for(let o=0;o<i;o++){const[s,c]=r[o];Ck(c,c8(e,s),n,a)}},c8=(t,e)=>{let n=t;const a=e.split(gm),r=a.length;for(let i=0;i<r;i++){const o=a[i];let s=n.nextPart.get(o);s||(s=i8(),n.nextPart.set(o,s)),n=s}return n},mie=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,gie=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),a=Object.create(null);const r=(i,o)=>{n[i]=o,e++,e>t&&(e=0,a=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=a[i])!==void 0)return r(i,o),o},set(i,o){i in n?n[i]=o:r(i,o)}}},_k="!",l8=":",fie=[],u8=(t,e,n,a,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),bie=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const i=[];let o=0,s=0,c=0,l;const u=r.length;for(let g=0;g<u;g++){const f=r[g];if(o===0&&s===0){if(f===l8){i.push(r.slice(c,g)),c=g+1;continue}if(f==="/"){l=g;continue}}f==="["?o++:f==="]"?o--:f==="("?s++:f===")"&&s--}const d=i.length===0?r:r.slice(c);let p=d,A=!1;d.endsWith(_k)?(p=d.slice(0,-1),A=!0):d.startsWith(_k)&&(p=d.slice(1),A=!0);const m=l&&l>c?l-c:void 0;return u8(i,A,p,m)};if(e){const r=e+l8,i=a;a=o=>o.startsWith(r)?i(o.slice(r.length)):u8(fie,!1,o,void 0,!0)}if(n){const r=a;a=i=>n({className:i,parseClassName:r})}return a},hie=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{e.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i],s=o[0]==="[",c=e.has(o);s||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(o)):r.push(o)}return r.length>0&&(r.sort(),a.push(...r)),a}},yie=t=>({cache:gie(t.cacheSize),parseClassName:bie(t),sortModifiers:hie(t),...oie(t)}),wie=/\s+/,kie=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:i}=e,o=[],s=t.trim().split(wie);let c="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{isExternal:d,modifiers:p,hasImportantModifier:A,baseClassName:m,maybePostfixModifierPosition:g}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let f=!!g,h=a(f?m.substring(0,g):m);if(!h){if(!f){c=u+(c.length>0?" "+c:c);continue}if(h=a(m),!h){c=u+(c.length>0?" "+c:c);continue}f=!1}const y=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=A?y+_k:y,_=k+h;if(o.indexOf(_)>-1)continue;o.push(_);const C=r(h,f);for(let Q=0;Q<C.length;++Q){const x=C[Q];o.push(k+x)}c=u+(c.length>0?" "+c:c)}return c},Cie=(...t)=>{let e=0,n,a,r="";for(;e<t.length;)(n=t[e++])&&(a=d8(n))&&(r&&(r+=" "),r+=a);return r},d8=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=d8(t[a]))&&(n&&(n+=" "),n+=e);return n},_ie=(t,...e)=>{let n,a,r,i;const o=c=>{const l=e.reduce((u,d)=>d(u),t());return n=yie(l),a=n.cache.get,r=n.cache.set,i=s,s(c)},s=c=>{const l=a(c);if(l)return l;const u=kie(c,n);return r(c,u),u};return i=o,(...c)=>i(Cie(...c))},Bie=[],$t=t=>{const e=n=>n[t]||Bie;return e.isThemeGetter=!0,e},p8=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A8=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Eie=/^\d+\/\d+$/,vie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xie=/\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$/,Qie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Iie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Die=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gc=t=>Eie.test(t),Oe=t=>!!t&&!Number.isNaN(Number(t)),qi=t=>!!t&&Number.isInteger(Number(t)),Bk=t=>t.endsWith("%")&&Oe(t.slice(0,-1)),Vr=t=>vie.test(t),Sie=()=>!0,Fie=t=>xie.test(t)&&!Qie.test(t),m8=()=>!1,Oie=t=>Iie.test(t),Nie=t=>Die.test(t),Tie=t=>!se(t)&&!ce(t),$ie=t=>fc(t,y8,m8),se=t=>p8.test(t),Ho=t=>fc(t,w8,Fie),Ek=t=>fc(t,jie,Oe),g8=t=>fc(t,b8,m8),Lie=t=>fc(t,h8,Nie),fm=t=>fc(t,k8,Oie),ce=t=>A8.test(t),Iu=t=>bc(t,w8),Mie=t=>bc(t,qie),f8=t=>bc(t,b8),Rie=t=>bc(t,y8),Pie=t=>bc(t,h8),bm=t=>bc(t,k8,!0),fc=(t,e,n)=>{const a=p8.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},bc=(t,e,n=!1)=>{const a=A8.exec(t);return a?a[1]?e(a[1]):n:!1},b8=t=>t==="position"||t==="percentage",h8=t=>t==="image"||t==="url",y8=t=>t==="length"||t==="size"||t==="bg-size",w8=t=>t==="length",jie=t=>t==="number",qie=t=>t==="family-name",k8=t=>t==="shadow",Gie=_ie(()=>{const t=$t("color"),e=$t("font"),n=$t("text"),a=$t("font-weight"),r=$t("tracking"),i=$t("leading"),o=$t("breakpoint"),s=$t("container"),c=$t("spacing"),l=$t("radius"),u=$t("shadow"),d=$t("inset-shadow"),p=$t("text-shadow"),A=$t("drop-shadow"),m=$t("blur"),g=$t("perspective"),f=$t("aspect"),h=$t("ease"),y=$t("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),ce,se],Q=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],S=()=>[ce,se,c],P=()=>[gc,"full","auto",...S()],T=()=>[qi,"none","subgrid",ce,se],j=()=>["auto",{span:["full",qi,ce,se]},qi,ce,se],U=()=>[qi,"auto",ce,se],L=()=>["auto","min","max","fr",ce,se],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...S()],de=()=>[gc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],$=()=>[t,ce,se],V=()=>[..._(),f8,g8,{position:[ce,se]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Te=()=>["auto","cover","contain",Rie,$ie,{size:[ce,se]}],Re=()=>[Bk,Iu,Ho],Fe=()=>["","none","full",l,ce,se],Je=()=>["",Oe,Iu,Ho],Kt=()=>["solid","dashed","dotted","double"],sn=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[Oe,Bk,f8,g8],fr=()=>["","none",m,ce,se],ts=()=>["none",Oe,ce,se],La=()=>["none",Oe,ce,se],ns=()=>[Oe,ce,se],eo=()=>[gc,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vr],breakpoint:[Vr],color:[Sie],container:[Vr],"drop-shadow":[Vr],ease:["in","out","in-out"],font:[Tie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vr],shadow:[Vr],spacing:["px",Oe],text:[Vr],"text-shadow":[Vr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gc,se,ce,f]}],container:["container"],columns:[{columns:[Oe,se,ce,s]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[qi,"auto",ce,se]}],basis:[{basis:[gc,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,gc,"auto","initial","none",se]}],grow:[{grow:["",Oe,ce,se]}],shrink:[{shrink:["",Oe,ce,se]}],order:[{order:[qi,"first","last","none",ce,se]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:j()}],"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":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:de()}],w:[{w:[s,"screen",...de()]}],"min-w":[{"min-w":[s,"screen","none",...de()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...de()]}],h:[{h:["screen","lh",...de()]}],"min-h":[{"min-h":["screen","lh","none",...de()]}],"max-h":[{"max-h":["screen","lh",...de()]}],"font-size":[{text:["base",n,Iu,Ho]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ce,Ek]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bk,se]}],"font-family":[{font:[Mie,se,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ce,se]}],"line-clamp":[{"line-clamp":[Oe,"none",ce,Ek]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",ce,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Kt(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ce,Ho]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Oe,"auto",ce,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:Te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qi,ce,se],radial:["",ce,se],conic:[qi,ce,se]},Pie,Lie]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Fe()}],"rounded-s":[{"rounded-s":Fe()}],"rounded-e":[{"rounded-e":Fe()}],"rounded-t":[{"rounded-t":Fe()}],"rounded-r":[{"rounded-r":Fe()}],"rounded-b":[{"rounded-b":Fe()}],"rounded-l":[{"rounded-l":Fe()}],"rounded-ss":[{"rounded-ss":Fe()}],"rounded-se":[{"rounded-se":Fe()}],"rounded-ee":[{"rounded-ee":Fe()}],"rounded-es":[{"rounded-es":Fe()}],"rounded-tl":[{"rounded-tl":Fe()}],"rounded-tr":[{"rounded-tr":Fe()}],"rounded-br":[{"rounded-br":Fe()}],"rounded-bl":[{"rounded-bl":Fe()}],"border-w":[{border:Je()}],"border-w-x":[{"border-x":Je()}],"border-w-y":[{"border-y":Je()}],"border-w-s":[{"border-s":Je()}],"border-w-e":[{"border-e":Je()}],"border-w-t":[{"border-t":Je()}],"border-w-r":[{"border-r":Je()}],"border-w-b":[{"border-b":Je()}],"border-w-l":[{"border-l":Je()}],"divide-x":[{"divide-x":Je()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Je()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Kt(),"hidden","none"]}],"divide-style":[{divide:[...Kt(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Kt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ce,se]}],"outline-w":[{outline:["",Oe,Iu,Ho]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",u,bm,fm]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",d,bm,fm]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Oe,Ho]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Je()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",p,bm,fm]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Oe,ce,se]}],"mix-blend":[{"mix-blend":[...sn(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":sn()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ce,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:Te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,se]}],filter:[{filter:["","none",ce,se]}],blur:[{blur:fr()}],brightness:[{brightness:[Oe,ce,se]}],contrast:[{contrast:[Oe,ce,se]}],"drop-shadow":[{"drop-shadow":["","none",A,bm,fm]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Oe,ce,se]}],"hue-rotate":[{"hue-rotate":[Oe,ce,se]}],invert:[{invert:["",Oe,ce,se]}],saturate:[{saturate:[Oe,ce,se]}],sepia:[{sepia:["",Oe,ce,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,se]}],"backdrop-blur":[{"backdrop-blur":fr()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ce,se]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ce,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ce,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ce,se]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ce,se]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ce,se]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ce,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ce,se]}],"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:["","all","colors","opacity","shadow","transform","none",ce,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ce,se]}],ease:[{ease:["linear","initial",h,ce,se]}],delay:[{delay:[Oe,ce,se]}],animate:[{animate:["none",y,ce,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,ce,se]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ts()}],"rotate-x":[{"rotate-x":ts()}],"rotate-y":[{"rotate-y":ts()}],"rotate-z":[{"rotate-z":ts()}],scale:[{scale:La()}],"scale-x":[{"scale-x":La()}],"scale-y":[{"scale-y":La()}],"scale-z":[{"scale-z":La()}],"scale-3d":["scale-3d"],skew:[{skew:ns()}],"skew-x":[{"skew-x":ns()}],"skew-y":[{"skew-y":ns()}],transform:[{transform:[ce,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eo()}],"translate-x":[{"translate-x":eo()}],"translate-y":[{"translate-y":eo()}],"translate-z":[{"translate-z":eo()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",ce,se]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Oe,Iu,Ho,Ek]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function hc(...t){return Gie(ln(t))}function zie({...t}){return w.jsx(Jre,{"data-slot":"dialog",...t})}function Hie({...t}){return w.jsx(Vre,{"data-slot":"dialog-portal",...t})}function Uie({...t}){return w.jsx(r8,{"data-slot":"dialog-close",...t})}function Zie({className:t,...e}){return w.jsx(Xre,{"data-slot":"dialog-overlay",className:hc("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Yie({className:t,children:e,showCloseButton:n=!0,...a}){return w.jsxs(Hie,{"data-slot":"dialog-portal",children:[w.jsx(Zie,{}),w.jsxs(eie,{"data-slot":"dialog-content",className:hc("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...a,children:[e,n&&w.jsxs(r8,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[w.jsx(EQ,{}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Kie({className:t,...e}){return w.jsx("div",{"data-slot":"dialog-header",className:hc("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Wie({className:t,...e}){return w.jsx("div",{"data-slot":"dialog-footer",className:hc("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function Jie({className:t,...e}){return w.jsx(tie,{"data-slot":"dialog-title",className:hc("text-lg leading-none font-semibold",t),...e})}function Vie({className:t,...e}){return w.jsx(nie,{"data-slot":"dialog-description",className:hc("text-muted-foreground text-sm",t),...e})}const Xie=()=>{const{editor:t}=Me(),[e,n]=F.useState(!1),[a,r]=F.useState("https://www.youtube.com/watch?v=DupfnOCH-JI"),i=He({editor:t,selector:s=>({active:s.editor.isActive("youtube"),disabled:!s.editor.isEditable})}),o=s=>{s.preventDefault(),a.trim()&&(t.chain().focus().embedYoutube({src:a}).run(),n(!1),r("https://www.youtube.com/watch?v=DupfnOCH-JI"))};return w.jsxs(zie,{open:e,onOpenChange:n,children:[w.jsx(ye,{icon:"Youtube",tooltip:"Youtube",onClick:()=>n(!0),...i}),w.jsx(Yie,{className:"sm:max-w-[425px]",children:w.jsxs("form",{onSubmit:o,children:[w.jsxs(Kie,{children:[w.jsx(Jie,{children:"Embed YouTube Video"}),w.jsx(Vie,{children:"Enter the YouTube video URL to embed it in your content."})]}),w.jsx("div",{className:"grid gap-4 py-4",children:w.jsxs("div",{className:"grid gap-3",children:[w.jsx(pm,{children:"YouTube URL"}),w.jsx(Go,{id:"youtube-url",placeholder:"https://www.youtube.com/watch?v=...",value:a,onChange:s=>r(s.target.value),autoFocus:!0})]})}),w.jsxs(Wie,{children:[w.jsx(Uie,{asChild:!0,children:w.jsx(Sr,{variant:"outline",children:"Cancel"})}),w.jsx(Sr,{type:"submit",variant:"primary",children:"Embed Video"})]})]})})]})},eoe=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("codeBlock"),disabled:!n.editor.can().toggleCodeBlock()})});return w.jsx(ye,{icon:"Code",tooltip:"Code block",onClick:()=>t.chain().focus().setCodeBlock().run(),...e})},toe=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("blockquote"),disabled:!n.editor.can().toggleBlockquote()})});return w.jsx(ye,{icon:"Quote",tooltip:"Quote",shortcuts:["Mod","Shift","B"],onClick:()=>t.chain().focus().toggleBlockquote().run(),...e})},noe=()=>w.jsx("div",{className:"rte-menu-bar",children:w.jsxs(Pa,{dense:!0,children:[w.jsx(Rre,{}),w.jsx(bre,{}),w.jsx(kr,{}),w.jsx(cre,{}),w.jsx(kr,{}),w.jsx(ire,{}),w.jsx(lre,{}),w.jsx(Mre,{}),w.jsx(gre,{}),w.jsx(kr,{}),w.jsx($re,{}),w.jsx(Lre,{}),w.jsx(kr,{}),w.jsx(rre,{}),w.jsx(ore,{}),w.jsx(fre,{}),w.jsx(kr,{}),w.jsx(toe,{}),w.jsx(ure,{}),w.jsx(Pre,{}),w.jsx(Xie,{}),w.jsx(eoe,{}),w.jsx(Xae,{})]})}),aoe=F.memo(noe),roe=(t,e,n)=>Math.min(n,Math.max(e,t)),ioe=()=>{const{editor:t,contentElement:e,setIsResizing:n}=Me(),a=F.useRef(null),r=F.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),i=He({editor:t,selector:A=>{if(!A.editor.isFocused||!A.editor.isEditable)return null;const m=A.editor.isActive("image")?"image":A.editor.isActive("youtube")?"youtube":null;if(!m)return null;const{selection:g}=A.editor.state;return{node:A.editor.view.nodeDOM(g.anchor),nodeType:m,nodePos:g.anchor}}}),{maxWidth:o,minWidth:s}=F.useMemo(()=>{const A=e.current?.getBoundingClientRect().width||0;return{maxWidth:A,minWidth:A*.25}},[e.current]),c=(A,m)=>{A.preventDefault();const g=r.current;g.startX=A.clientX,g.startY=A.clientY,g.isResizing=!0,g.direction=m,document.addEventListener("pointermove",l),document.addEventListener("pointerup",u),n(!0)},l=A=>{const m=i?.node,g=r.current;if(!m||!g.isResizing)return;let f=g.startX-A.clientX;f=g.direction?-f:f;const h=roe(g.startWidth+f,s,o),y=h/g.ratio;g.currentWidth=h,g.currentHeight=y,m.style.width=`${h}px`,m.style.height=`${y}px`,d()},u=()=>{const A=r.current;A.isResizing&&(A.isResizing=!1,document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",u),n(!1),requestAnimationFrame(()=>t?.commands.updateAttributes(i.nodeType,{width:Math.round(A.currentWidth/o*100)})))},d=F.useCallback(()=>{const A=i.node,m=a.current,{offsetTop:g,offsetLeft:f,offsetWidth:h,offsetHeight:y}=A;requestAnimationFrame(()=>{m.style.width=`${h}px`,m.style.height=`${y}px`,m.style.transform=`translate(${f}px, ${g}px)`})},[i]);if(F.useEffect(()=>{const A=i?.node;if(!A)return;const{width:m,height:g}=A.getBoundingClientRect(),f=r.current;f.startWidth=m,f.startHeight=g,f.currentWidth=m,f.currentHeight=g,f.ratio=m/g,d()},[i]),!i||!e.current)return;const p=(A,m,g)=>w.jsx("div",{className:"rte-resizer__control",style:{cursor:A,...g},onPointerDown:f=>c(f,m)});return ao.createPortal(w.jsxs("div",{ref:a,className:"rte-resizer",children:[p("nw-resize",0,{width:12,left:-10,top:-10}),p("sw-resize",0,{width:12,left:-10,bottom:-10}),p("sw-resize",1,{width:12,right:-10,top:-10}),p("nw-resize",1,{width:12,right:-10,bottom:-10})]}),e.current)},ooe=F.memo(ioe),soe=()=>{const{editor:t,isFullScreen:e,toggleFullScreen:n}=Me(),a=He({editor:t,selector:r=>({words:r.editor.storage.characterCount.words(),characters:r.editor.storage.characterCount.characters()})});return w.jsxs("div",{className:"rte-status-bar",children:[w.jsx(Pa,{dense:!0,children:w.jsx(ye,{icon:e?"Minimize":"Maximize",text:"Fullscreen",active:e,onClick:n})}),w.jsxs("div",{className:"rte-counter",children:[w.jsxs("span",{className:"rte-word-count",children:["Words: ",a.words]}),w.jsxs("span",{className:"rte-charater",children:["Characters: ",a.characters]})]})]})},coe=F.memo(soe);function C8(){const[t,e]=F.useState(!1),n=F.useRef(null),a=async r=>{if(!t)try{await navigator.clipboard.writeText(r),e(!0),n.current=setTimeout(()=>e(!1),2500)}catch{e(!1),n.current&&clearTimeout(n.current)}};return F.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),{isCopied:t,copy:a}}const hm=(t,e)=>{const{view:n,state:{selection:{from:a}}}=t;let i=n.nodeDOM(a)||n.domAtPos(a).node;for(;i&&i?.nodeName.toLocaleLowerCase()!==e.toLocaleLowerCase();)i=i.parentElement;return i};var vk,xk;if(typeof WeakMap<"u"){let t=new WeakMap;vk=e=>t.get(e),xk=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;vk=a=>{for(let r=0;r<t.length;r+=2)if(t[r]==a)return t[r+1]},xk=(a,r)=>(n==10&&(n=0),t[n++]=a,t[n++]=r)}var ht=class{constructor(t,e,n,a){this.width=t,this.height=e,this.map=n,this.problems=a}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const a=e%this.width,r=e/this.width|0;let i=a+1,o=r+1;for(let s=1;i<this.width&&this.map[e+s]==n;s++)i++;for(let s=1;o<this.height&&this.map[e+this.width*s]==n;s++)o++;return{left:a,top:r,right:i,bottom:o}}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:a,right:r,top:i,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?a==0:r==this.width)?null:this.map[i*this.width+(n<0?a-1:r)]:(n<0?i==0:o==this.height)?null:this.map[a+this.width*(n<0?i-1:o)]}rectBetween(t,e){const{left:n,right:a,top:r,bottom:i}=this.findCell(t),{left:o,right:s,top:c,bottom:l}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(r,c),right:Math.max(a,s),bottom:Math.max(i,l)}}cellsInRect(t){const e=[],n={};for(let a=t.top;a<t.bottom;a++)for(let r=t.left;r<t.right;r++){const i=a*this.width+r,o=this.map[i];n[o]||(n[o]=!0,!(r==t.left&&r&&this.map[i-1]==o||a==t.top&&a&&this.map[i-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let a=0,r=0;;a++){const i=r+n.child(a).nodeSize;if(a==t){let o=e+t*this.width;const s=(t+1)*this.width;for(;o<s&&this.map[o]<r;)o++;return o==s?i-1:this.map[o]}r=i}}static get(t){return vk(t)||xk(t,loe(t))}};function loe(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=uoe(t),n=t.childCount,a=[];let r=0,i=null;const o=[];for(let l=0,u=e*n;l<u;l++)a[l]=0;for(let l=0,u=0;l<n;l++){const d=t.child(l);u++;for(let m=0;;m++){for(;r<a.length&&a[r]!=0;)r++;if(m==d.childCount)break;const g=d.child(m),{colspan:f,rowspan:h,colwidth:y}=g.attrs;for(let k=0;k<h;k++){if(k+l>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:h-k});break}const _=r+k*e;for(let C=0;C<f;C++){a[_+C]==0?a[_+C]=u:(i||(i=[])).push({type:"collision",row:l,pos:u,n:f-C});const Q=y&&y[C];if(Q){const x=(_+C)%e*2,S=o[x];S==null||S!=Q&&o[x+1]==1?(o[x]=Q,o[x+1]=1):S==Q&&o[x+1]++}}}r+=f,u+=g.nodeSize}const p=(l+1)*e;let A=0;for(;r<p;)a[r++]==0&&A++;A&&(i||(i=[])).push({type:"missing",row:l,n:A}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const s=new ht(e,n,a,i);let c=!1;for(let l=0;!c&&l<o.length;l+=2)o[l]!=null&&o[l+1]<n&&(c=!0);return c&&doe(s,o,t),s}function uoe(t){let e=-1,n=!1;for(let a=0;a<t.childCount;a++){const r=t.child(a);let i=0;if(n)for(let o=0;o<a;o++){const s=t.child(o);for(let c=0;c<s.childCount;c++){const l=s.child(c);o+l.attrs.rowspan>a&&(i+=l.attrs.colspan)}}for(let o=0;o<r.childCount;o++){const s=r.child(o);i+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function doe(t,e,n){t.problems||(t.problems=[]);const a={};for(let r=0;r<t.map.length;r++){const i=t.map[r];if(a[i])continue;a[i]=!0;const o=n.nodeAt(i);if(!o)throw new RangeError(`No cell with offset ${i} found`);let s=null;const c=o.attrs;for(let l=0;l<c.colspan;l++){const u=(r+l)%t.width,d=e[u*2];d!=null&&(!c.colwidth||c.colwidth[l]!=d)&&((s||(s=poe(c)))[l]=d)}s&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}function poe(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function hn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const a=t.nodes[n],r=a.spec.tableRole;r&&(e[r]=a)}}return e}var Gi=new tt("selectingCells");function yc(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 Aoe(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 Oa(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 ym(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=yc(e.$head)||moe(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function moe(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const a=e.type.spec.tableRole;if(a=="cell"||a=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const a=e.type.spec.tableRole;if(a=="cell"||a=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Qk(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function goe(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Ik(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _8(t,e,n){const a=t.node(-1),r=ht.get(a),i=t.start(-1),o=r.nextCell(t.pos-i,e,n);return o==null?null:t.node(0).resolve(i+o)}function Uo(t,e,n=1){const a={...t,colspan:t.colspan-n};return a.colwidth&&(a.colwidth=a.colwidth.slice(),a.colwidth.splice(e,n),a.colwidth.some(r=>r>0)||(a.colwidth=null)),a}function B8(t,e,n=1){const a={...t,colspan:t.colspan+n};if(a.colwidth){a.colwidth=a.colwidth.slice();for(let r=0;r<n;r++)a.colwidth.splice(e,0,0)}return a}function foe(t,e,n){const a=hn(e.type.schema).header_cell;for(let r=0;r<t.height;r++)if(e.nodeAt(t.map[n+r*t.width]).type!=a)return!1;return!0}var at=class ri extends ke{constructor(e,n=e){const a=e.node(-1),r=ht.get(a),i=e.start(-1),o=r.rectBetween(e.pos-i,n.pos-i),s=e.node(0),c=r.cellsInRect(o).filter(u=>u!=n.pos-i);c.unshift(n.pos-i);const l=c.map(u=>{const d=a.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const p=i+u+1;return new t0(s.resolve(p),s.resolve(p+d.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=n}map(e,n){const a=e.resolve(n.map(this.$anchorCell.pos)),r=e.resolve(n.map(this.$headCell.pos));if(Qk(a)&&Qk(r)&&Ik(a,r)){const i=this.$anchorCell.node(-1)!=a.node(-1);return i&&this.isRowSelection()?ri.rowSelection(a,r):i&&this.isColSelection()?ri.colSelection(a,r):new ri(a,r)}return pe.between(a,r)}content(){const e=this.$anchorCell.node(-1),n=ht.get(e),a=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-a,this.$headCell.pos-a),i={},o=[];for(let c=r.top;c<r.bottom;c++){const l=[];for(let u=c*n.width+r.left,d=r.left;d<r.right;d++,u++){const p=n.map[u];if(i[p])continue;i[p]=!0;const A=n.findCell(p);let m=e.nodeAt(p);if(!m)throw RangeError(`No cell with offset ${p} found`);const g=r.left-A.left,f=A.right-r.right;if(g>0||f>0){let h=m.attrs;if(g>0&&(h=Uo(h,0,g)),f>0&&(h=Uo(h,h.colspan-f,f)),A.left<r.left){if(m=m.type.createAndFill(h),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(h)}`)}else m=m.type.create(h,m.content)}if(A.top<r.top||A.bottom>r.bottom){const h={...m.attrs,rowspan:Math.min(A.bottom,r.bottom)-Math.max(A.top,r.top)};A.top<r.top?m=m.type.createAndFill(h):m=m.type.create(h,m.content)}l.push(m)}o.push(e.child(c).copy(H.from(l)))}const s=this.isColSelection()&&this.isRowSelection()?e:o;return new ee(H.from(s),1,1)}replace(e,n=ee.empty){const a=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:s,$to:c}=r[o],l=e.mapping.slice(a);e.replace(l.map(s.pos),l.map(c.pos),o?ee.empty:n)}const i=ke.findFrom(e.doc.resolve(e.mapping.slice(a).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ee(H.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),a=ht.get(n),r=this.$anchorCell.start(-1),i=a.cellsInRect(a.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<i.length;o++)e(n.nodeAt(i[o]),r+i[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const a=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(a,r)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const a=e.node(-1),r=ht.get(a),i=e.start(-1),o=r.findCell(e.pos-i),s=r.findCell(n.pos-i),c=e.node(0);return o.top<=s.top?(o.top>0&&(e=c.resolve(i+r.map[o.left])),s.bottom<r.height&&(n=c.resolve(i+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(i+r.map[s.left])),o.bottom<r.height&&(e=c.resolve(i+r.map[r.width*(r.height-1)+o.right-1]))),new ri(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=ht.get(e),a=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-a),i=n.colCount(this.$headCell.pos-a);if(Math.min(r,i)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==n.width}eq(e){return e instanceof ri&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const a=e.node(-1),r=ht.get(a),i=e.start(-1),o=r.findCell(e.pos-i),s=r.findCell(n.pos-i),c=e.node(0);return o.left<=s.left?(o.left>0&&(e=c.resolve(i+r.map[o.top*r.width])),s.right<r.width&&(n=c.resolve(i+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(i+r.map[s.top*r.width])),o.right<r.width&&(e=c.resolve(i+r.map[r.width*(o.top+1)-1]))),new ri(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new ri(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,a=n){return new ri(e.resolve(n),e.resolve(a))}getBookmark(){return new boe(this.$anchorCell.pos,this.$headCell.pos)}};at.prototype.visible=!1,ke.jsonID("cell",at);var boe=class $L{constructor(e,n){this.anchor=e,this.head=n}map(e){return new $L(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),a=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&a.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&a.index()<a.parent.childCount&&Ik(n,a)?new at(n,a):ke.near(a,1)}};function hoe(t){if(!(t.selection instanceof at))return null;const e=[];return t.selection.forEachCell((n,a)=>{e.push(Xt.node(a,a+n.nodeSize,{class:"selectedCell"}))}),Ge.create(t.doc,e)}function yoe({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,a=e.pos,r=t.depth;for(;r>=0&&!(t.after(r+1)<t.end(r));r--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,a--);return n==a&&/row|table/.test(t.node(r).type.spec.tableRole)}function woe({$from:t,$to:e}){let n,a;for(let r=t.depth;r>0;r--){const i=t.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let r=e.depth;r>0;r--){const i=e.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){a=i;break}}return n!==a&&e.parentOffset===0}function koe(t,e,n){const a=(e||t).selection,r=(e||t).doc;let i,o;if(a instanceof Ae&&(o=a.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")i=at.create(r,a.from);else if(o=="row"){const s=r.resolve(a.from+1);i=at.rowSelection(s,s)}else if(!n){const s=ht.get(a.node),c=a.from+1,l=c+s.map[s.width*s.height-1];i=at.create(r,c+1,l)}}else a instanceof pe&&yoe(a)?i=pe.create(r,a.from):a instanceof pe&&woe(a)&&(i=pe.create(r,a.$from.start(),a.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var Coe=new tt("fix-tables");function E8(t,e,n,a){const r=t.childCount,i=e.childCount;e:for(let o=0,s=0;o<i;o++){const c=e.child(o);for(let l=s,u=Math.min(r,o+3);l<u;l++)if(t.child(l)==c){s=l+1,n+=c.nodeSize;continue e}a(c,n),s<r&&t.child(s).sameMarkup(c)?E8(t.child(s),c,n+1,a):c.nodesBetween(0,c.content.size,a,n+1),n+=c.nodeSize}}function v8(t,e){let n;const a=(r,i)=>{r.type.spec.tableRole=="table"&&(n=_oe(t,r,i,n))};return e?e.doc!=t.doc&&E8(e.doc,t.doc,0,a):t.doc.descendants(a),n}function _oe(t,e,n,a){const r=ht.get(e);if(!r.problems)return a;a||(a=t.tr);const i=[];for(let c=0;c<r.height;c++)i.push(0);for(let c=0;c<r.problems.length;c++){const l=r.problems[c];if(l.type=="collision"){const u=e.nodeAt(l.pos);if(!u)continue;const d=u.attrs;for(let p=0;p<d.rowspan;p++)i[l.row+p]+=l.n;a.setNodeMarkup(a.mapping.map(n+1+l.pos),null,Uo(d,d.colspan-l.n,l.n))}else if(l.type=="missing")i[l.row]+=l.n;else if(l.type=="overlong_rowspan"){const u=e.nodeAt(l.pos);if(!u)continue;a.setNodeMarkup(a.mapping.map(n+1+l.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-l.n})}else if(l.type=="colwidth mismatch"){const u=e.nodeAt(l.pos);if(!u)continue;a.setNodeMarkup(a.mapping.map(n+1+l.pos),null,{...u.attrs,colwidth:l.colwidth})}else if(l.type=="zero_sized"){const u=a.mapping.map(n);a.delete(u,u+e.nodeSize)}}let o,s;for(let c=0;c<i.length;c++)i[c]&&(o==null&&(o=c),s=c);for(let c=0,l=n+1;c<r.height;c++){const u=e.child(c),d=l+u.nodeSize,p=i[c];if(p>0){let A="cell";u.firstChild&&(A=u.firstChild.type.spec.tableRole);const m=[];for(let f=0;f<p;f++){const h=hn(t.schema)[A].createAndFill();h&&m.push(h)}const g=(c==0||o==c-1)&&s==c?l+1:d-1;a.insert(a.mapping.map(g),m)}l=d}return a.setMeta(Coe,{fixTables:!0})}function ur(t){const e=t.selection,n=ym(t),a=n.node(-1),r=n.start(-1),i=ht.get(a);return{...e instanceof at?i.rectBetween(e.$anchorCell.pos-r,e.$headCell.pos-r):i.findCell(n.pos-r),tableStart:r,map:i,table:a}}function x8(t,{map:e,tableStart:n,table:a},r){let i=r>0?-1:0;foe(e,a,r+i)&&(i=r==0||r==e.width?null:0);for(let o=0;o<e.height;o++){const s=o*e.width+r;if(r>0&&r<e.width&&e.map[s-1]==e.map[s]){const c=e.map[s],l=a.nodeAt(c);t.setNodeMarkup(t.mapping.map(n+c),null,B8(l.attrs,r-e.colCount(c))),o+=l.attrs.rowspan-1}else{const c=i==null?hn(a.type.schema).cell:a.nodeAt(e.map[s+i]).type,l=e.positionAt(o,r,a);t.insert(t.mapping.map(n+l),c.createAndFill())}}return t}function Boe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(x8(t.tr,n,n.left))}return!0}function Eoe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(x8(t.tr,n,n.right))}return!0}function voe(t,{map:e,table:n,tableStart:a},r){const i=t.mapping.maps.length;for(let o=0;o<e.height;){const s=o*e.width+r,c=e.map[s],l=n.nodeAt(c),u=l.attrs;if(r>0&&e.map[s-1]==c||r<e.width-1&&e.map[s+1]==c)t.setNodeMarkup(t.mapping.slice(i).map(a+c),null,Uo(u,r-e.colCount(c)));else{const d=t.mapping.slice(i).map(a+c);t.delete(d,d+l.nodeSize)}o+=u.rowspan}}function xoe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t),a=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;voe(a,n,r),r!=n.left;r--){const i=n.tableStart?a.doc.nodeAt(n.tableStart-1):a.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=ht.get(i)}e(a)}return!0}function Qoe(t,e,n){var a;const r=hn(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((a=e.nodeAt(t.map[i+n*t.width]))==null?void 0:a.type)!=r)return!1;return!0}function Q8(t,{map:e,tableStart:n,table:a},r){var i;let o=n;for(let l=0;l<r;l++)o+=a.child(l).nodeSize;const s=[];let c=r>0?-1:0;Qoe(e,a,r+c)&&(c=r==0||r==e.height?null:0);for(let l=0,u=e.width*r;l<e.width;l++,u++)if(r>0&&r<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],p=a.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...p,rowspan:p.rowspan+1}),l+=p.colspan-1}else{const d=c==null?hn(a.type.schema).cell:(i=a.nodeAt(e.map[u+c*e.width]))==null?void 0:i.type,p=d?.createAndFill();p&&s.push(p)}return t.insert(o,hn(a.type.schema).row.create(null,s)),t}function Ioe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(Q8(t.tr,n,n.top))}return!0}function Doe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(Q8(t.tr,n,n.bottom))}return!0}function Soe(t,{map:e,table:n,tableStart:a},r){let i=0;for(let l=0;l<r;l++)i+=n.child(l).nodeSize;const o=i+n.child(r).nodeSize,s=t.mapping.maps.length;t.delete(i+a,o+a);const c=new Set;for(let l=0,u=r*e.width;l<e.width;l++,u++){const d=e.map[u];if(!c.has(d)){if(c.add(d),r>0&&d==e.map[u-e.width]){const p=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(s).map(d+a),null,{...p,rowspan:p.rowspan-1}),l+=p.colspan-1}else if(r<e.height&&d==e.map[u+e.width]){const p=n.nodeAt(d),A=p.attrs,m=p.type.create({...A,rowspan:p.attrs.rowspan-1},p.content),g=e.positionAt(r+1,l,n);t.insert(t.mapping.slice(s).map(a+g),m),l+=A.colspan-1}}}}function Foe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t),a=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;Soe(a,n,r),r!=n.top;r--){const i=n.tableStart?a.doc.nodeAt(n.tableStart-1):a.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=ht.get(n.table)}e(a)}return!0}function I8(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Ooe({width:t,height:e,map:n},a){let r=a.top*t+a.left,i=r,o=(a.bottom-1)*t+a.left,s=r+(a.right-a.left-1);for(let c=a.top;c<a.bottom;c++){if(a.left>0&&n[i]==n[i-1]||a.right<t&&n[s]==n[s+1])return!0;i+=t,s+=t}for(let c=a.left;c<a.right;c++){if(a.top>0&&n[r]==n[r-t]||a.bottom<e&&n[o]==n[o+t])return!0;r++,o++}return!1}function D8(t,e){const n=t.selection;if(!(n instanceof at)||n.$anchorCell.pos==n.$headCell.pos)return!1;const a=ur(t),{map:r}=a;if(Ooe(r,a))return!1;if(e){const i=t.tr,o={};let s=H.empty,c,l;for(let u=a.top;u<a.bottom;u++)for(let d=a.left;d<a.right;d++){const p=r.map[u*r.width+d],A=a.table.nodeAt(p);if(!(o[p]||!A))if(o[p]=!0,c==null)c=p,l=A;else{I8(A)||(s=s.append(A.content));const m=i.mapping.map(p+a.tableStart);i.delete(m,m+A.nodeSize)}}if(c==null||l==null)return!0;if(i.setNodeMarkup(c+a.tableStart,null,{...B8(l.attrs,l.attrs.colspan,a.right-a.left-l.attrs.colspan),rowspan:a.bottom-a.top}),s.size){const u=c+1+l.content.size,d=I8(l)?c+1:u;i.replaceWith(d+a.tableStart,u+a.tableStart,s)}i.setSelection(new at(i.doc.resolve(c+a.tableStart))),e(i)}return!0}function S8(t,e){const n=hn(t.schema);return Noe(({node:a})=>n[a.type.spec.tableRole])(t,e)}function Noe(t){return(e,n)=>{var a;const r=e.selection;let i,o;if(r instanceof at){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,o=r.$anchorCell.pos}else{if(i=Aoe(r.$from),!i)return!1;o=(a=yc(r.$from))==null?void 0:a.pos}if(i==null||o==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let s=i.attrs;const c=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=ur(e),d=e.tr;for(let A=0;A<u.right-u.left;A++)c.push(l?{...s,colwidth:l&&l[A]?[l[A]]:null}:s);let p;for(let A=u.top;A<u.bottom;A++){let m=u.map.positionAt(A,u.left,u.table);A==u.top&&(m+=i.nodeSize);for(let g=u.left,f=0;g<u.right;g++,f++)g==u.left&&A==u.top||d.insert(p=d.mapping.map(m+u.tableStart,1),t({node:i,row:A,col:g}).createAndFill(c[f]))}d.setNodeMarkup(o,t({node:i,row:u.top,col:u.left}),c[0]),r instanceof at&&d.setSelection(new at(d.doc.resolve(r.$anchorCell.pos),p?d.doc.resolve(p):void 0)),n(d)}return!0}}function Toe(t,e){return function(n,a){if(!Oa(n))return!1;const r=ym(n);if(r.nodeAfter.attrs[t]===e)return!1;if(a){const i=n.tr;n.selection instanceof at?n.selection.forEachCell((o,s)=>{o.attrs[t]!==e&&i.setNodeMarkup(s,null,{...o.attrs,[t]:e})}):i.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[t]:e}),a(i)}return!0}}function $oe(t){return function(e,n){if(!Oa(e))return!1;if(n){const a=hn(e.schema),r=ur(e),i=e.tr,o=r.map.cellsInRect(t=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:t=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),s=o.map(c=>r.table.nodeAt(c));for(let c=0;c<o.length;c++)s[c].type==a.header_cell&&i.setNodeMarkup(r.tableStart+o[c],a.cell,s[c].attrs);if(i.steps.length==0)for(let c=0;c<o.length;c++)i.setNodeMarkup(r.tableStart+o[c],a.header_cell,s[c].attrs);n(i)}return!0}}function F8(t,e,n){const a=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let r=0;r<a.length;r++){const i=e.table.nodeAt(a[r]);if(i&&i.type!==n.header_cell)return!1}return!0}function Du(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?$oe(t):function(n,a){if(!Oa(n))return!1;if(a){const r=hn(n.schema),i=ur(n),o=n.tr,s=F8("row",i,r),c=F8("column",i,r),u=(t==="column"?s:t==="row"?c:!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,p=t=="column"?c?r.cell:r.header_cell:t=="row"?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(d).forEach(A=>{const m=A+i.tableStart,g=o.doc.nodeAt(m);g&&o.setNodeMarkup(m,p,g.attrs)}),a(o)}return!0}}Du("row",{useDeprecatedLogic:!0}),Du("column",{useDeprecatedLogic:!0});var Loe=Du("cell",{useDeprecatedLogic:!0});function Moe(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let a=t.index(-1)-1,r=t.before();a>=0;a--){const i=t.node(-1).child(a),o=i.lastChild;if(o)return r-1-o.nodeSize;r-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let a=t.indexAfter(-1),r=t.after();a<n.childCount;a++){const i=n.child(a);if(i.childCount)return r+1;r+=i.nodeSize}}return null}function O8(t){return function(e,n){if(!Oa(e))return!1;const a=Moe(ym(e),t);if(a==null)return!1;if(n){const r=e.doc.resolve(a);n(e.tr.setSelection(pe.between(r,goe(r))).scrollIntoView())}return!0}}function Roe(t,e){const n=t.selection.$anchor;for(let a=n.depth;a>0;a--)if(n.node(a).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(a),n.after(a)).scrollIntoView()),!0;return!1}function wm(t,e){const n=t.selection;if(!(n instanceof at))return!1;if(e){const a=t.tr,r=hn(t.schema).cell.createAndFill().content;n.forEachCell((i,o)=>{i.content.eq(r)||a.replace(a.mapping.map(o+1),a.mapping.map(o+i.nodeSize-1),new ee(r,0,0))}),a.docChanged&&e(a)}return!0}function Poe(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:a}=t;for(;e.childCount==1&&(n>0&&a>0||e.child(0).type.spec.tableRole=="table");)n--,a--,e=e.child(0).content;const r=e.child(0),i=r.type.spec.tableRole,o=r.type.schema,s=[];if(i=="row")for(let c=0;c<e.childCount;c++){let l=e.child(c).content;const u=c?0:Math.max(0,n-1),d=c<e.childCount-1?0:Math.max(0,a-1);(u||d)&&(l=Dk(hn(o).row,new ee(l,u,d)).content),s.push(l)}else if(i=="cell"||i=="header_cell")s.push(n||a?Dk(hn(o).row,new ee(e,n,a)).content:e);else return null;return joe(o,s)}function joe(t,e){const n=[];for(let r=0;r<e.length;r++){const i=e[r];for(let o=i.childCount-1;o>=0;o--){const{rowspan:s,colspan:c}=i.child(o).attrs;for(let l=r;l<r+s;l++)n[l]=(n[l]||0)+c}}let a=0;for(let r=0;r<n.length;r++)a=Math.max(a,n[r]);for(let r=0;r<n.length;r++)if(r>=e.length&&e.push(H.empty),n[r]<a){const i=hn(t).cell.createAndFill(),o=[];for(let s=n[r];s<a;s++)o.push(i);e[r]=e[r].append(H.from(o))}return{height:e.length,width:a,rows:e}}function Dk(t,e){const n=t.createAndFill();return new tb(n).replace(0,n.content.size,e).doc}function qoe({width:t,height:e,rows:n},a,r){if(t!=a){const i=[],o=[];for(let s=0;s<n.length;s++){const c=n[s],l=[];for(let u=i[s]||0,d=0;u<a;d++){let p=c.child(d%c.childCount);u+p.attrs.colspan>a&&(p=p.type.createChecked(Uo(p.attrs,p.attrs.colspan,u+p.attrs.colspan-a),p.content)),l.push(p),u+=p.attrs.colspan;for(let A=1;A<p.attrs.rowspan;A++)i[s+A]=(i[s+A]||0)+p.attrs.colspan}o.push(H.from(l))}n=o,t=a}if(e!=r){const i=[];for(let o=0,s=0;o<r;o++,s++){const c=[],l=n[s%e];for(let u=0;u<l.childCount;u++){let d=l.child(u);o+d.attrs.rowspan>r&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,r-d.attrs.rowspan)},d.content)),c.push(d)}i.push(H.from(c))}n=i,e=r}return{width:t,height:e,rows:n}}function Goe(t,e,n,a,r,i,o){const s=t.doc.type.schema,c=hn(s);let l,u;if(r>e.width)for(let d=0,p=0;d<e.height;d++){const A=n.child(d);p+=A.nodeSize;const m=[];let g;A.lastChild==null||A.lastChild.type==c.cell?g=l||(l=c.cell.createAndFill()):g=u||(u=c.header_cell.createAndFill());for(let f=e.width;f<r;f++)m.push(g);t.insert(t.mapping.slice(o).map(p-1+a),m)}if(i>e.height){const d=[];for(let m=0,g=(e.height-1)*e.width;m<Math.max(e.width,r);m++){const f=m>=e.width?!1:n.nodeAt(e.map[g+m]).type==c.header_cell;d.push(f?u||(u=c.header_cell.createAndFill()):l||(l=c.cell.createAndFill()))}const p=c.row.create(null,H.from(d)),A=[];for(let m=e.height;m<i;m++)A.push(p);t.insert(t.mapping.slice(o).map(a+n.nodeSize-2),A)}return!!(l||u)}function N8(t,e,n,a,r,i,o,s){if(o==0||o==e.height)return!1;let c=!1;for(let l=r;l<i;l++){const u=o*e.width+l,d=e.map[u];if(e.map[u-e.width]==d){c=!0;const p=n.nodeAt(d),{top:A,left:m}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(s).map(d+a),null,{...p.attrs,rowspan:o-A}),t.insert(t.mapping.slice(s).map(e.positionAt(o,m,n)),p.type.createAndFill({...p.attrs,rowspan:A+p.attrs.rowspan-o})),l+=p.attrs.colspan-1}}return c}function T8(t,e,n,a,r,i,o,s){if(o==0||o==e.width)return!1;let c=!1;for(let l=r;l<i;l++){const u=l*e.width+o,d=e.map[u];if(e.map[u-1]==d){c=!0;const p=n.nodeAt(d),A=e.colCount(d),m=t.mapping.slice(s).map(d+a);t.setNodeMarkup(m,null,Uo(p.attrs,o-A,p.attrs.colspan-(o-A))),t.insert(m+p.nodeSize,p.type.createAndFill(Uo(p.attrs,0,o-A))),l+=p.attrs.rowspan-1}}return c}function $8(t,e,n,a,r){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let o=ht.get(i);const{top:s,left:c}=a,l=c+r.width,u=s+r.height,d=t.tr;let p=0;function A(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");o=ht.get(i),p=d.mapping.maps.length}Goe(d,o,i,n,l,u,p)&&A(),N8(d,o,i,n,c,l,s,p)&&A(),N8(d,o,i,n,c,l,u,p)&&A(),T8(d,o,i,n,s,u,c,p)&&A(),T8(d,o,i,n,s,u,l,p)&&A();for(let m=s;m<u;m++){const g=o.positionAt(m,c,i),f=o.positionAt(m,l,i);d.replace(d.mapping.slice(p).map(g+n),d.mapping.slice(p).map(f+n),new ee(r.rows[m-s],0,0))}A(),d.setSelection(new at(d.doc.resolve(n+o.positionAt(s,c,i)),d.doc.resolve(n+o.positionAt(u-1,l-1,i)))),e(d)}var zoe=$b({ArrowLeft:Cm("horiz",-1),ArrowRight:Cm("horiz",1),ArrowUp:Cm("vert",-1),ArrowDown:Cm("vert",1),"Shift-ArrowLeft":_m("horiz",-1),"Shift-ArrowRight":_m("horiz",1),"Shift-ArrowUp":_m("vert",-1),"Shift-ArrowDown":_m("vert",1),Backspace:wm,"Mod-Backspace":wm,Delete:wm,"Mod-Delete":wm});function km(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Cm(t,e){return(n,a,r)=>{if(!r)return!1;const i=n.selection;if(i instanceof at)return km(n,a,ke.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=L8(r,t,e);if(o==null)return!1;if(t=="horiz")return km(n,a,ke.near(n.doc.resolve(i.head+e),e));{const s=n.doc.resolve(o),c=_8(s,t,e);let l;return c?l=ke.near(c,1):e<0?l=ke.near(n.doc.resolve(s.before(-1)),-1):l=ke.near(n.doc.resolve(s.after(-1)),1),km(n,a,l)}}}function _m(t,e){return(n,a,r)=>{if(!r)return!1;const i=n.selection;let o;if(i instanceof at)o=i;else{const c=L8(r,t,e);if(c==null)return!1;o=new at(n.doc.resolve(c))}const s=_8(o.$headCell,t,e);return s?km(n,a,new at(o.$anchorCell,s)):!1}}function Hoe(t,e){const n=t.state.doc,a=yc(n.resolve(e));return a?(t.dispatch(t.state.tr.setSelection(new at(a))),!0):!1}function Uoe(t,e,n){if(!Oa(t.state))return!1;let a=Poe(n);const r=t.state.selection;if(r instanceof at){a||(a={width:1,height:1,rows:[H.from(Dk(hn(t.state.schema).cell,n))]});const i=r.$anchorCell.node(-1),o=r.$anchorCell.start(-1),s=ht.get(i).rectBetween(r.$anchorCell.pos-o,r.$headCell.pos-o);return a=qoe(a,s.right-s.left,s.bottom-s.top),$8(t.state,t.dispatch,o,s,a),!0}else if(a){const i=ym(t.state),o=i.start(-1);return $8(t.state,t.dispatch,o,ht.get(i.node(-1)).findCell(i.pos-o),a),!0}else return!1}function Zoe(t,e){var n;if(e.ctrlKey||e.metaKey)return;const a=M8(t,e.target);let r;if(e.shiftKey&&t.state.selection instanceof at)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&a&&(r=yc(t.state.selection.$anchor))!=null&&((n=Sk(t,e))==null?void 0:n.pos)!=r.pos)i(r,e),e.preventDefault();else if(!a)return;function i(c,l){let u=Sk(t,l);const d=Gi.getState(t.state)==null;if(!u||!Ik(c,u))if(d)u=c;else return;const p=new at(c,u);if(d||!t.state.selection.eq(p)){const A=t.state.tr.setSelection(p);d&&A.setMeta(Gi,c.pos),t.dispatch(A)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",s),Gi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Gi,-1))}function s(c){const l=c,u=Gi.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(M8(t,l.target)!=a&&(d=Sk(t,e),!d))return o();d&&i(d,l)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",s)}function L8(t,e,n){if(!(t.state.selection instanceof pe))return null;const{$head:a}=t.state.selection;for(let r=a.depth-1;r>=0;r--){const i=a.node(r);if((n<0?a.index(r):a.indexAfter(r))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const s=a.before(r),c=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(c)?s:null}}return null}function M8(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Sk(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?yc(t.state.doc.resolve(n.pos)):null}var Yoe=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Fk(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,Fk(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Fk(t,e,n,a,r,i){var o;let s=0,c=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,p=0;d<u.childCount;d++){const{colspan:A,colwidth:m}=u.child(d).attrs;for(let g=0;g<A;g++,p++){const f=r==p?i:m&&m[g],h=f?f+"px":"";if(s+=f||a,f||(c=!1),l)l.style.width!=h&&(l.style.width=h),l=l.nextSibling;else{const y=document.createElement("col");y.style.width=h,e.appendChild(y)}}}for(;l;){const d=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=d}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Jn=new tt("tableColumnResizing");function Koe({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:a=Yoe,lastColumnResizable:r=!0}={}){const i=new qe({key:Jn,state:{init(o,s){var c,l;const u=(l=(c=i.spec)==null?void 0:c.props)==null?void 0:l.nodeViews,d=hn(s.schema).table.name;return a&&u&&(u[d]=(p,A)=>new a(p,n,A)),new Woe(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=Jn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{Joe(o,s,t,r)},mouseleave:o=>{Voe(o)},mousedown:(o,s)=>{Xoe(o,s,e,n)}},decorations:o=>{const s=Jn.getState(o);if(s&&s.activeHandle>-1)return rse(o,s.activeHandle)},nodeViews:{}}});return i}var Woe=class cf{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,a=e.getMeta(Jn);if(a&&a.setHandle!=null)return new cf(a.setHandle,!1);if(a&&a.setDragging!==void 0)return new cf(n.activeHandle,a.setDragging);if(n.activeHandle>-1&&e.docChanged){let r=e.mapping.map(n.activeHandle,-1);return Qk(e.doc.resolve(r))||(r=-1),new cf(r,n.dragging)}return n}};function Joe(t,e,n,a){if(!t.editable)return;const r=Jn.getState(t.state);if(r&&!r.dragging){const i=tse(e.target);let o=-1;if(i){const{left:s,right:c}=i.getBoundingClientRect();e.clientX-s<=n?o=R8(t,e,"left",n):c-e.clientX<=n&&(o=R8(t,e,"right",n))}if(o!=r.activeHandle){if(!a&&o!==-1){const s=t.state.doc.resolve(o),c=s.node(-1),l=ht.get(c),u=s.start(-1);if(l.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==l.width-1)return}j8(t,o)}}}function Voe(t){if(!t.editable)return;const e=Jn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&j8(t,-1)}function Xoe(t,e,n,a){var r;if(!t.editable)return!1;const i=(r=t.dom.ownerDocument.defaultView)!=null?r:window,o=Jn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=t.state.doc.nodeAt(o.activeHandle),c=ese(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Jn,{setDragging:{startX:e.clientX,startWidth:c}}));function l(d){i.removeEventListener("mouseup",l),i.removeEventListener("mousemove",u);const p=Jn.getState(t.state);p?.dragging&&(nse(t,p.activeHandle,P8(p.dragging,d,n)),t.dispatch(t.state.tr.setMeta(Jn,{setDragging:null})))}function u(d){if(!d.which)return l(d);const p=Jn.getState(t.state);if(p&&p.dragging){const A=P8(p.dragging,d,n);q8(t,p.activeHandle,A,a)}}return q8(t,o.activeHandle,c,a),i.addEventListener("mouseup",l),i.addEventListener("mousemove",u),e.preventDefault(),!0}function ese(t,e,{colspan:n,colwidth:a}){const r=a&&a[a.length-1];if(r)return r;const i=t.domAtPos(e);let s=i.node.childNodes[i.offset].offsetWidth,c=n;if(a)for(let l=0;l<n;l++)a[l]&&(s-=a[l],c--);return s/c}function tse(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function R8(t,e,n,a){const r=n=="right"?-a:a,i=t.posAtCoords({left:e.clientX+r,top:e.clientY});if(!i)return-1;const{pos:o}=i,s=yc(t.state.doc.resolve(o));if(!s)return-1;if(n=="right")return s.pos;const c=ht.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function P8(t,e,n){const a=e.clientX-t.startX;return Math.max(n,t.startWidth+a)}function j8(t,e){t.dispatch(t.state.tr.setMeta(Jn,{setHandle:e}))}function nse(t,e,n){const a=t.state.doc.resolve(e),r=a.node(-1),i=ht.get(r),o=a.start(-1),s=i.colCount(a.pos-o)+a.nodeAfter.attrs.colspan-1,c=t.state.tr;for(let l=0;l<i.height;l++){const u=l*i.width+s;if(l&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],p=r.nodeAt(d).attrs,A=p.colspan==1?0:s-i.colCount(d);if(p.colwidth&&p.colwidth[A]==n)continue;const m=p.colwidth?p.colwidth.slice():ase(p.colspan);m[A]=n,c.setNodeMarkup(o+d,null,{...p,colwidth:m})}c.docChanged&&t.dispatch(c)}function q8(t,e,n,a){const r=t.state.doc.resolve(e),i=r.node(-1),o=r.start(-1),s=ht.get(i).colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;let c=t.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&Fk(i,c.firstChild,c,a,s,n)}function ase(t){return Array(t).fill(0)}function rse(t,e){var n;const a=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return Ge.empty;const o=ht.get(i),s=r.start(-1),c=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let l=0;l<o.height;l++){const u=c+l*o.width;if((c==o.width-1||o.map[u]!=o.map[u+1])&&(l==0||o.map[u]!=o.map[u-o.width])){const d=o.map[u],p=s+d+i.nodeAt(d).nodeSize-1,A=document.createElement("div");A.className="column-resize-handle",(n=Jn.getState(t))!=null&&n.dragging&&a.push(Xt.node(s+d,s+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),a.push(Xt.widget(p,A))}}return Ge.create(t.doc,a)}function ise({allowTableNodeSelection:t=!1}={}){return new qe({key:Gi,state:{init(){return null},apply(e,n){const a=e.getMeta(Gi);if(a!=null)return a==-1?null:a;if(n==null||!e.docChanged)return n;const{deleted:r,pos:i}=e.mapping.mapResult(n);return r?null:i}},props:{decorations:hoe,handleDOMEvents:{mousedown:Zoe},createSelectionBetween(e){return Gi.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Hoe,handleKeyDown:zoe,handlePaste:Uoe},appendTransaction(e,n,a){return koe(a,v8(a,n),t)}})}function ose(t,e){const n=Math.min(t.top,e.top),a=Math.max(t.bottom,e.bottom),r=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-r,s=a-n,c=r,l=n;return new DOMRect(c,l,o,s)}var sse=class{constructor({editor:t,element:e,view:n,updateDelay:a=250,resizeDelay:r=60,shouldShow:i,appendTo:o,getReferencedVirtualElement:s,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:u,state:d,from:p,to:A})=>{const{doc:m,selection:g}=d,{empty:f}=g,h=!m.textBetween(p,A).length&&Rb(d.selection),y=this.element.contains(document.activeElement);return!(!(u.hasFocus()||y)||f||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,d)=>{const p=!d?.selection.eq(u.state.selection),A=!d?.doc.eq(u.state.doc);!p&&!A||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,p,A,d)},this.updateDelay))},this.updateHandler=(u,d,p,A)=>{const{composing:m}=u;if(m||!d&&!p)return;if(!this.getShouldShow(A)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:u})=>{u.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var l;this.editor=t,this.element=e,this.view=n,this.updateDelay=a,this.resizeDelay=r,this.appendTo=o,this.scrollTarget=(l=c?.scrollTarget)!=null?l:window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,i&&(this.shouldShow=i),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.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(_B(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(CB(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(kB(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(vf(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(BB(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(rM(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(EB(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(iM(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t;const{selection:e}=this.editor.state,n=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(n)return n;const a=U6(this.view,e.from,e.to);let r={getBoundingClientRect:()=>a,getClientRects:()=>[a]};if(e instanceof Ae){let i=this.view.nodeDOM(e.from);const o=i.dataset.nodeViewWrapper?i:i.querySelector("[data-node-view-wrapper]");o&&(i=o),i&&(r={getBoundingClientRect:()=>i.getBoundingClientRect(),getClientRects:()=>[i.getBoundingClientRect()]})}if(e instanceof at){const{$anchorCell:i,$headCell:o}=e,s=i?i.pos:o.pos,c=o?o.pos:i.pos,l=this.view.nodeDOM(s),u=this.view.nodeDOM(c);if(!l||!u)return;const d=l===u?l.getBoundingClientRect():ose(l.getBoundingClientRect(),u.getBoundingClientRect());r={getBoundingClientRect:()=>d,getClientRects:()=>[d]}}return r}updatePosition(){const t=this.virtualElement;t&&vB(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:a})=>{this.element.style.width="max-content",this.element.style.position=a,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const{state:n}=t,a=n.selection.from!==n.selection.to;if(this.updateDelay>0&&a){this.handleDebouncedUpdate(t,e);return}const r=!e?.selection.eq(t.state.selection),i=!e?.doc.eq(t.state.doc);this.updateHandler(t,r,i,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:a}=n,{ranges:r}=a,i=Math.min(...r.map(c=>c.$from.pos)),o=Math.max(...r.map(c=>c.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:i,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},G8=t=>new qe({key:typeof t.pluginKey=="string"?new tt(t.pluginKey):t.pluginKey,view:e=>new sse({view:e,...t})});ze.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[G8({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});const Bm=({editor:t,className:e,children:n,...a})=>{const r=F.useRef(document.createElement("div"));return F.useEffect(()=>{if(t?.isDestroyed)return;const{pluginKey:o="bubbleMenu",options:s={},updateDelay:c,resizeDelay:l,shouldShow:u=null,appendTo:d,getReferencedVirtualElement:p}=a,A=t;if(!A){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const m=G8({updateDelay:c,resizeDelay:l,editor:A||t,element:r.current,pluginKey:o,shouldShow:u,appendTo:d,getReferencedVirtualElement:p,options:s});return A.registerPlugin(m),()=>{A.unregisterPlugin(o),window.requestAnimationFrame(()=>{r.current.parentNode&&r.current.parentNode.removeChild(r.current)})}},[t]),ao.createPortal(w.jsx("div",{className:ln("rte-bubble-menu",e),children:n}),r.current)},wc="plaintext",z8=[{syntax:"bash",alias:"sh",label:"Bash"},{syntax:"c",alias:"h",label:"C"},{syntax:"csharp",alias:"cs, c#, dotnet",label:"C#"},{syntax:"css",label:"CSS"},{syntax:"go",alias:"golang",label:"Go"},{syntax:"graphql",alias:"gql",label:"GraphQL"},{syntax:"java",alias:"jsp",label:"Java"},{syntax:"javascript",alias:"js, jsx, mjs, cjs",label:"Javascript"},{syntax:"json",label:"JSON"},{syntax:"kotlin",alias:"kt, kts",label:"Kotlin"},{syntax:"less",label:"Less"},{syntax:"makefile",alias:"mk, mak, make",label:"Makefile"},{syntax:"markdown",alias:"md, mkdown, mkd",label:"Markdown"},{syntax:"objectivec",alias:"mm, objc, obj-c, obj-c++, objective-c++",label:"Objective-C"},{syntax:"php",label:"PHP"},{syntax:"plaintext",alias:"text, txt",label:"Text"},{syntax:"python",alias:"py, gyp, ipython",label:"Python"},{syntax:"scss",label:"SCSS"},{syntax:"shell",alias:"console, shellsession",label:"Shell"},{syntax:"sql",label:"SQL"},{syntax:"typescript",alias:"ts, tsx",label:"TypeScript"},{syntax:"vbnet",alias:"vb",label:"VB .NET"},{syntax:"xml",alias:"html, xhtml, rss, atom, xjb, xsd, xsl, plist, wsf, svg",label:"HTML, XML"}],cse=({value:t,onSelect:e})=>{const{contentElement:n}=Me(),[a,r]=F.useState(""),i=z8.map(s=>({label:s.label,value:s.syntax})),o=F.useMemo(()=>a?i.filter(s=>s.label.includes(a)):i,[i,a]);return w.jsxs(ye,{type:"popover",text:i.find(s=>s.value===t)?.label,hideText:!1,tooltip:!1,buttonStyle:{minWidth:"6rem"},dropdownClass:"rte-code-dropdown",dropdownStyle:{minWidth:"10rem"},children:[w.jsx(Go,{className:"code-search",placeholder:"Seach language...",style:{width:"10rem"},value:a,onChange:s=>r(s.target.value.trim())}),w.jsx("div",{className:"code-list",style:{maxHeight:`${(n.current?.clientHeight||0)*.375}px`},children:o.map(s=>w.jsx(gh,{asChild:!0,children:w.jsxs("div",{className:"code-item",onClick:()=>{e(s.value),r("")},children:[s.label,s.value===t&&w.jsx(yl,{name:"Check",className:"code-item__indicator",size:14,strokeWidth:2.5})]})},s.value))})]})},H8=()=>{const{editor:t,contentElement:e}=Me(),{isCopied:n,copy:a}=C8(),r=He({editor:t,selector:u=>u.editor.isActive("codeBlock")?u.editor.getAttributes("codeBlock").language:null}),i=F.useCallback(({editor:u})=>u.isActive("codeBlock"),[]),o=F.useCallback(u=>t.commands.updateAttributes("codeBlock",{language:u}),[t]),s=F.useCallback(()=>{const u=hm(t,"pre");u?.textContent&&a(u.textContent)},[t]),c=F.useCallback(()=>{t.chain().focus().deleteNode("codeBlock").run()},[t]),l=F.useCallback(()=>{const u=hm(t,"pre");return u?{getBoundingClientRect:()=>u.getBoundingClientRect()}:null},[t]);return w.jsx(Bm,{editor:t,pluginKey:"code-block-bubble",shouldShow:i,updateDelay:100,appendTo:()=>e.current,getReferencedVirtualElement:l,options:{placement:"top"},children:w.jsxs(Pa,{children:[w.jsx(cse,{value:r,onSelect:o}),w.jsx(kr,{}),w.jsx(ye,{icon:n?"Check":"Clipboard",tooltip:"Copy code",onClick:s}),w.jsx(ye,{icon:"Trash",tooltip:"Delete code",onClick:c})]})})};F.memo(H8);const lse=({initialText:t,onApply:e,onCancel:n})=>{const[a,r]=F.useState(t||""),i=o=>{o.preventDefault(),e(a)};return w.jsxs("form",{className:"rte-text-alternative__form",onSubmit:i,children:[w.jsx(Go,{value:a,onChange:o=>r(o.target.value),placeholder:"Text alternative",autoFocus:!0}),w.jsx(ye,{buttonType:"submit",icon:"Check",tooltip:!1}),w.jsx(ye,{icon:"Close",tooltip:!1,onClick:n})]})},use=({value:t,onChange:e})=>{const n=[null,25,50,75,100];return w.jsx(ye,{type:"dropdown",buttonStyle:{width:"6.5rem"},dropdownStyle:{width:"7rem"},icon:"Ruler",text:t?`${t}%`:"Default",hideText:!1,tooltip:!1,children:n.map((a,r)=>w.jsx(mh,{"data-active":a==t||void 0,onSelect:()=>e(a),children:a?`${a}% width`:"Default"},r))})},dse=()=>{const t=F.useRef(null),{editor:e,isResizing:n,contentElement:a}=Me(),[r,i]=F.useState(!1),o=He({editor:e,selector:g=>{if(!g.editor.isActive("image")&&!g.editor.isActive("imageFigure"))return null;const{node:f,pos:h}=pse(g.editor.state.selection);return f?{pos:h,src:f.attrs.src,alt:f.attrs.alt,width:f.attrs.width,hasCaption:g.editor.isActive("imageFigure")}:null}}),s=F.useCallback(()=>{const g=e.isActive("imageFigure")?"figure":"img",f=hm(e,g);return f?{getBoundingClientRect:()=>f.getBoundingClientRect()}:null},[e]),c=(g,f)=>{const{state:{selection:h}}=e;return e.chain().command(({commands:y})=>o?.pos&&h.from!==o.pos?y.setNodeSelection(o.pos):!0).updateAttributes("image",{[g]:f}).focus().run()},l=()=>e.chain().focus()[o?.hasCaption?"figureToImage":"imageToFigure"]().run(),u=()=>{i(g=>!g),requestAnimationFrame(()=>t.current?.updatePosition?.())},d=g=>{c("alt",g),u()},p=g=>c("width",g),A=()=>e.chain().focus().removeImage().run(),m=F.useCallback(async()=>{if(o?.src)try{const g=await fetch(o.src);if(!g.ok)throw new Error("Failed to fetch the image.");const f=await g.blob(),h=f.type.split(/\/|\+/)[1],y=URL.createObjectURL(f),k=document.createElement("a");k.href=y,k.download=`image.${h}`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(y)}catch{}},[o]);return n?null:w.jsx(Bm,{editor:e,pluginKey:"image-bubble",shouldShow:({editor:g})=>g.isActive("imageFigure")||g.isActive("image"),updateDelay:100,appendTo:()=>a.current,getReferencedVirtualElement:s,options:{offset:15,onShow:()=>{t.current={updatePosition:()=>{}}},onDestroy:()=>t.current=null,onHide:()=>i(!1)},children:r?w.jsx(lse,{initialText:o?.alt,onApply:d,onCancel:()=>{e.commands.focus(),u()}}):w.jsxs(Pa,{children:[w.jsx(ye,{text:"Alt text",hideText:!1,tooltip:"Alternative text",onClick:u}),w.jsx(ye,{icon:"ImageCaption",tooltip:`Caption: ${o?.hasCaption?"ON":"OFF"}`,active:o?.hasCaption,onClick:l}),w.jsx(kr,{}),w.jsx(use,{value:o?.width,onChange:p}),w.jsx(kr,{}),w.jsx(ye,{icon:"Download",tooltip:"Download",onClick:m}),w.jsx(ye,{icon:"Trash",tooltip:"Delete",onClick:A})]})})},pse=t=>{let e=null,n=null;if(t instanceof pe){const a=t.$anchor;e=a.node(-1).firstChild,n=a.before(-1)+1}else t instanceof Ae&&(e=t.node,n=t.from,e.type.name==="imageFigure"&&(e=e.firstChild,n+=1));return{node:e,pos:n}},Ase=({initialUrl:t,initialText:e,isCreate:n,onApply:a,onCancel:r})=>{const[i,o]=F.useState(t||""),[s,c]=F.useState(e||""),[l,u]=F.useState(n),d=p=>{p.preventDefault(),l&&a(i,s)};return F.useEffect(()=>{n||u(i&&i!==t||s!==e)},[s,i]),w.jsxs("form",{className:"rte-link__form",onSubmit:d,children:[w.jsx(pm,{className:"rte-link__label",children:"URL"}),w.jsx(Go,{value:i,onChange:p=>o(p.target.value),className:"rte-link__input",placeholder:"Paste link",type:"url",required:!0,autoFocus:!0}),w.jsx(pm,{className:"rte-link__label",children:"Display Text"}),w.jsx(Go,{value:s,onChange:p=>c(p.target.value),className:"rte-link__input",placeholder:"Enter link text"}),w.jsxs("div",{className:"rte-link__actions",children:[w.jsx(Sr,{variant:"secondary",onClick:r,children:"Cancel"}),w.jsx(Sr,{type:"submit",disabled:!l,children:"Apply"})]})]})},mse=({url:t,onEdit:e,onRemove:n})=>{const{copy:a,isCopied:r}=C8();return w.jsxs(Pa,{children:[w.jsx(ye,{text:"Edit link",hideText:!1,onClick:e}),w.jsx(ye,{icon:"ExternalLink",text:"Open in new tab",onClick:()=>window.open(t,"_blank")}),w.jsx(ye,{icon:r?"Check":"Clipboard",text:r?"Copied":"Copy link",onClick:()=>a(t)}),w.jsx(ye,{icon:"Unlink",text:"Remove link",onClick:n})]})},U8=()=>{const{editor:t,contentElement:e}=Me(),[n,a]=F.useState(!1),r=F.useRef(0),i=He({editor:t,selector:d=>{if(r.current=d.editor.storage.link?.mode||0,!d.editor.isActive("link"))return null;const{state:{selection:p,doc:A}}=d.editor,m=d.editor.getAttributes("link").href,g=A.textBetween(p.from,p.to);return{url:m,text:g}}}),o=F.useCallback(({editor:d,from:p,to:A})=>(a(r.current==-1),d.isActive("link")&&(r.current==-1||p!==A)),[]),s=F.useCallback((d,p)=>{t.chain().confirmEditLink({href:d,text:p||d}).run(),a(!1)},[]),c=F.useCallback(()=>{t.chain().focus().unsetLink().run()},[t]),l=F.useCallback(()=>{a(!0)},[]),u=F.useCallback(()=>{r.current==-1?t.commands.confirmEditLink():a(!1)},[t]);return w.jsx(Bm,{editor:t,pluginKey:"link-menu",updateDelay:100,shouldShow:o,appendTo:()=>e.current,options:{placement:"bottom-start",onHide:()=>a(!1)},children:n?w.jsx(Ase,{initialUrl:i?.url,initialText:i?.text,isCreate:r.current===-1,onApply:s,onCancel:u}):w.jsx(mse,{url:i?.url,onEdit:l,onRemove:c})})};F.memo(U8);var gse=Object.defineProperty,fse=(t,e)=>{for(var n in e)gse(t,n,{get:e[n],enumerable:!0})},bse="listItem",Z8="textStyle",Y8=/^\s*([-+*])\s$/,K8=Ct.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",Pe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
221
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return B.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Kre="DialogDescriptionWarning",Wre=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a8(Kre).contentName}}.`;return B.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},Jre=zO,Vre=ZO,Xre=YO,eie=KO,tie=JO,nie=XO,r8=t8;const aie=(t,e)=>{const n=new Array(t.length+e.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<e.length;a++)n[t.length+a]=e[a];return n},rie=(t,e)=>({classGroupId:t,validator:e}),i8=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),gm="-",o8=[],iie="arbitrary..",oie=t=>{const e=cie(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return sie(o);const s=o.split(gm),c=s[0]===""&&s.length>1?1:0;return s8(s,c,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const c=a[o],l=n[o];return c?l?aie(l,c):c:l||o8}return n[o]||o8}}},s8=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],i=n.nextPart.get(r);if(i){const l=s8(t,e+1,i);if(l)return l}const o=n.validators;if(o===null)return;const s=e===0?t.join(gm):t.slice(e).join(gm),c=o.length;for(let l=0;l<c;l++){const u=o[l];if(u.validator(s))return u.classGroupId}},sie=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),a=e.slice(0,n);return a?iie+a:void 0})(),cie=t=>{const{theme:e,classGroups:n}=t;return lie(n,e)},lie=(t,e)=>{const n=i8();for(const a in t){const r=t[a];Ck(r,n,a,e)}return n},Ck=(t,e,n,a)=>{const r=t.length;for(let i=0;i<r;i++){const o=t[i];uie(o,e,n,a)}},uie=(t,e,n,a)=>{if(typeof t=="string"){die(t,e,n);return}if(typeof t=="function"){pie(t,e,n,a);return}Aie(t,e,n,a)},die=(t,e,n)=>{const a=t===""?e:c8(e,t);a.classGroupId=n},pie=(t,e,n,a)=>{if(mie(t)){Ck(t(a),e,n,a);return}e.validators===null&&(e.validators=[]),e.validators.push(rie(n,t))},Aie=(t,e,n,a)=>{const r=Object.entries(t),i=r.length;for(let o=0;o<i;o++){const[s,c]=r[o];Ck(c,c8(e,s),n,a)}},c8=(t,e)=>{let n=t;const a=e.split(gm),r=a.length;for(let i=0;i<r;i++){const o=a[i];let s=n.nextPart.get(o);s||(s=i8(),n.nextPart.set(o,s)),n=s}return n},mie=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,gie=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),a=Object.create(null);const r=(i,o)=>{n[i]=o,e++,e>t&&(e=0,a=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=a[i])!==void 0)return r(i,o),o},set(i,o){i in n?n[i]=o:r(i,o)}}},_k="!",l8=":",fie=[],u8=(t,e,n,a,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),bie=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const i=[];let o=0,s=0,c=0,l;const u=r.length;for(let g=0;g<u;g++){const f=r[g];if(o===0&&s===0){if(f===l8){i.push(r.slice(c,g)),c=g+1;continue}if(f==="/"){l=g;continue}}f==="["?o++:f==="]"?o--:f==="("?s++:f===")"&&s--}const d=i.length===0?r:r.slice(c);let p=d,A=!1;d.endsWith(_k)?(p=d.slice(0,-1),A=!0):d.startsWith(_k)&&(p=d.slice(1),A=!0);const m=l&&l>c?l-c:void 0;return u8(i,A,p,m)};if(e){const r=e+l8,i=a;a=o=>o.startsWith(r)?i(o.slice(r.length)):u8(fie,!1,o,void 0,!0)}if(n){const r=a;a=i=>n({className:i,parseClassName:r})}return a},hie=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{e.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i],s=o[0]==="[",c=e.has(o);s||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(o)):r.push(o)}return r.length>0&&(r.sort(),a.push(...r)),a}},yie=t=>({cache:gie(t.cacheSize),parseClassName:bie(t),sortModifiers:hie(t),...oie(t)}),wie=/\s+/,kie=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:i}=e,o=[],s=t.trim().split(wie);let c="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{isExternal:d,modifiers:p,hasImportantModifier:A,baseClassName:m,maybePostfixModifierPosition:g}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let f=!!g,h=a(f?m.substring(0,g):m);if(!h){if(!f){c=u+(c.length>0?" "+c:c);continue}if(h=a(m),!h){c=u+(c.length>0?" "+c:c);continue}f=!1}const y=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=A?y+_k:y,_=k+h;if(o.indexOf(_)>-1)continue;o.push(_);const C=r(h,f);for(let Q=0;Q<C.length;++Q){const x=C[Q];o.push(k+x)}c=u+(c.length>0?" "+c:c)}return c},Cie=(...t)=>{let e=0,n,a,r="";for(;e<t.length;)(n=t[e++])&&(a=d8(n))&&(r&&(r+=" "),r+=a);return r},d8=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=d8(t[a]))&&(n&&(n+=" "),n+=e);return n},_ie=(t,...e)=>{let n,a,r,i;const o=c=>{const l=e.reduce((u,d)=>d(u),t());return n=yie(l),a=n.cache.get,r=n.cache.set,i=s,s(c)},s=c=>{const l=a(c);if(l)return l;const u=kie(c,n);return r(c,u),u};return i=o,(...c)=>i(Cie(...c))},Bie=[],$t=t=>{const e=n=>n[t]||Bie;return e.isThemeGetter=!0,e},p8=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A8=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Eie=/^\d+\/\d+$/,vie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xie=/\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$/,Qie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Iie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Die=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gc=t=>Eie.test(t),Oe=t=>!!t&&!Number.isNaN(Number(t)),qi=t=>!!t&&Number.isInteger(Number(t)),Bk=t=>t.endsWith("%")&&Oe(t.slice(0,-1)),Vr=t=>vie.test(t),Sie=()=>!0,Fie=t=>xie.test(t)&&!Qie.test(t),m8=()=>!1,Oie=t=>Iie.test(t),Nie=t=>Die.test(t),Tie=t=>!se(t)&&!ce(t),$ie=t=>fc(t,y8,m8),se=t=>p8.test(t),Ho=t=>fc(t,w8,Fie),Ek=t=>fc(t,jie,Oe),g8=t=>fc(t,b8,m8),Lie=t=>fc(t,h8,Nie),fm=t=>fc(t,k8,Oie),ce=t=>A8.test(t),Iu=t=>bc(t,w8),Mie=t=>bc(t,qie),f8=t=>bc(t,b8),Rie=t=>bc(t,y8),Pie=t=>bc(t,h8),bm=t=>bc(t,k8,!0),fc=(t,e,n)=>{const a=p8.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},bc=(t,e,n=!1)=>{const a=A8.exec(t);return a?a[1]?e(a[1]):n:!1},b8=t=>t==="position"||t==="percentage",h8=t=>t==="image"||t==="url",y8=t=>t==="length"||t==="size"||t==="bg-size",w8=t=>t==="length",jie=t=>t==="number",qie=t=>t==="family-name",k8=t=>t==="shadow",Gie=_ie(()=>{const t=$t("color"),e=$t("font"),n=$t("text"),a=$t("font-weight"),r=$t("tracking"),i=$t("leading"),o=$t("breakpoint"),s=$t("container"),c=$t("spacing"),l=$t("radius"),u=$t("shadow"),d=$t("inset-shadow"),p=$t("text-shadow"),A=$t("drop-shadow"),m=$t("blur"),g=$t("perspective"),f=$t("aspect"),h=$t("ease"),y=$t("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),ce,se],Q=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],S=()=>[ce,se,c],P=()=>[gc,"full","auto",...S()],T=()=>[qi,"none","subgrid",ce,se],j=()=>["auto",{span:["full",qi,ce,se]},qi,ce,se],U=()=>[qi,"auto",ce,se],L=()=>["auto","min","max","fr",ce,se],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...S()],de=()=>[gc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],$=()=>[t,ce,se],V=()=>[..._(),f8,g8,{position:[ce,se]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Te=()=>["auto","cover","contain",Rie,$ie,{size:[ce,se]}],Re=()=>[Bk,Iu,Ho],Fe=()=>["","none","full",l,ce,se],Je=()=>["",Oe,Iu,Ho],Kt=()=>["solid","dashed","dotted","double"],sn=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[Oe,Bk,f8,g8],fr=()=>["","none",m,ce,se],ts=()=>["none",Oe,ce,se],La=()=>["none",Oe,ce,se],ns=()=>[Oe,ce,se],eo=()=>[gc,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vr],breakpoint:[Vr],color:[Sie],container:[Vr],"drop-shadow":[Vr],ease:["in","out","in-out"],font:[Tie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vr],shadow:[Vr],spacing:["px",Oe],text:[Vr],"text-shadow":[Vr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gc,se,ce,f]}],container:["container"],columns:[{columns:[Oe,se,ce,s]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[qi,"auto",ce,se]}],basis:[{basis:[gc,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,gc,"auto","initial","none",se]}],grow:[{grow:["",Oe,ce,se]}],shrink:[{shrink:["",Oe,ce,se]}],order:[{order:[qi,"first","last","none",ce,se]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:j()}],"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":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:de()}],w:[{w:[s,"screen",...de()]}],"min-w":[{"min-w":[s,"screen","none",...de()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...de()]}],h:[{h:["screen","lh",...de()]}],"min-h":[{"min-h":["screen","lh","none",...de()]}],"max-h":[{"max-h":["screen","lh",...de()]}],"font-size":[{text:["base",n,Iu,Ho]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ce,Ek]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bk,se]}],"font-family":[{font:[Mie,se,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ce,se]}],"line-clamp":[{"line-clamp":[Oe,"none",ce,Ek]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",ce,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Kt(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ce,Ho]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Oe,"auto",ce,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:Te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qi,ce,se],radial:["",ce,se],conic:[qi,ce,se]},Pie,Lie]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Fe()}],"rounded-s":[{"rounded-s":Fe()}],"rounded-e":[{"rounded-e":Fe()}],"rounded-t":[{"rounded-t":Fe()}],"rounded-r":[{"rounded-r":Fe()}],"rounded-b":[{"rounded-b":Fe()}],"rounded-l":[{"rounded-l":Fe()}],"rounded-ss":[{"rounded-ss":Fe()}],"rounded-se":[{"rounded-se":Fe()}],"rounded-ee":[{"rounded-ee":Fe()}],"rounded-es":[{"rounded-es":Fe()}],"rounded-tl":[{"rounded-tl":Fe()}],"rounded-tr":[{"rounded-tr":Fe()}],"rounded-br":[{"rounded-br":Fe()}],"rounded-bl":[{"rounded-bl":Fe()}],"border-w":[{border:Je()}],"border-w-x":[{"border-x":Je()}],"border-w-y":[{"border-y":Je()}],"border-w-s":[{"border-s":Je()}],"border-w-e":[{"border-e":Je()}],"border-w-t":[{"border-t":Je()}],"border-w-r":[{"border-r":Je()}],"border-w-b":[{"border-b":Je()}],"border-w-l":[{"border-l":Je()}],"divide-x":[{"divide-x":Je()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Je()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Kt(),"hidden","none"]}],"divide-style":[{divide:[...Kt(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Kt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ce,se]}],"outline-w":[{outline:["",Oe,Iu,Ho]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",u,bm,fm]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",d,bm,fm]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Oe,Ho]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Je()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",p,bm,fm]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Oe,ce,se]}],"mix-blend":[{"mix-blend":[...sn(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":sn()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ce,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:Te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,se]}],filter:[{filter:["","none",ce,se]}],blur:[{blur:fr()}],brightness:[{brightness:[Oe,ce,se]}],contrast:[{contrast:[Oe,ce,se]}],"drop-shadow":[{"drop-shadow":["","none",A,bm,fm]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Oe,ce,se]}],"hue-rotate":[{"hue-rotate":[Oe,ce,se]}],invert:[{invert:["",Oe,ce,se]}],saturate:[{saturate:[Oe,ce,se]}],sepia:[{sepia:["",Oe,ce,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,se]}],"backdrop-blur":[{"backdrop-blur":fr()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ce,se]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ce,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ce,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ce,se]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ce,se]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ce,se]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ce,se]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ce,se]}],"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:["","all","colors","opacity","shadow","transform","none",ce,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ce,se]}],ease:[{ease:["linear","initial",h,ce,se]}],delay:[{delay:[Oe,ce,se]}],animate:[{animate:["none",y,ce,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,ce,se]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ts()}],"rotate-x":[{"rotate-x":ts()}],"rotate-y":[{"rotate-y":ts()}],"rotate-z":[{"rotate-z":ts()}],scale:[{scale:La()}],"scale-x":[{"scale-x":La()}],"scale-y":[{"scale-y":La()}],"scale-z":[{"scale-z":La()}],"scale-3d":["scale-3d"],skew:[{skew:ns()}],"skew-x":[{"skew-x":ns()}],"skew-y":[{"skew-y":ns()}],transform:[{transform:[ce,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eo()}],"translate-x":[{"translate-x":eo()}],"translate-y":[{"translate-y":eo()}],"translate-z":[{"translate-z":eo()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",ce,se]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Oe,Iu,Ho,Ek]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function hc(...t){return Gie(ln(t))}function zie({...t}){return w.jsx(Jre,{"data-slot":"dialog",...t})}function Hie({...t}){return w.jsx(Vre,{"data-slot":"dialog-portal",...t})}function Uie({...t}){return w.jsx(r8,{"data-slot":"dialog-close",...t})}function Zie({className:t,...e}){return w.jsx(Xre,{"data-slot":"dialog-overlay",className:hc("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Yie({className:t,children:e,showCloseButton:n=!0,...a}){return w.jsxs(Hie,{"data-slot":"dialog-portal",children:[w.jsx(Zie,{}),w.jsxs(eie,{"data-slot":"dialog-content",className:hc("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...a,children:[e,n&&w.jsxs(r8,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[w.jsx(EQ,{}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Kie({className:t,...e}){return w.jsx("div",{"data-slot":"dialog-header",className:hc("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Wie({className:t,...e}){return w.jsx("div",{"data-slot":"dialog-footer",className:hc("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function Jie({className:t,...e}){return w.jsx(tie,{"data-slot":"dialog-title",className:hc("text-lg leading-none font-semibold",t),...e})}function Vie({className:t,...e}){return w.jsx(nie,{"data-slot":"dialog-description",className:hc("text-muted-foreground text-sm",t),...e})}const Xie=()=>{const{editor:t}=Me(),[e,n]=F.useState(!1),[a,r]=F.useState("https://www.youtube.com/watch?v=DupfnOCH-JI"),i=He({editor:t,selector:s=>({active:s.editor.isActive("youtube"),disabled:!s.editor.isEditable})}),o=()=>{a.trim()&&(t.chain().focus().embedYoutube({src:a}).run(),r("https://www.youtube.com/watch?v=DupfnOCH-JI"),n(!1))};return w.jsxs(zie,{open:e,onOpenChange:n,children:[w.jsx(ye,{icon:"Youtube",tooltip:"Youtube",onClick:()=>n(!0),...i}),w.jsxs(Yie,{className:"sm:max-w-[425px]",children:[w.jsxs(Kie,{children:[w.jsx(Jie,{children:"Embed YouTube Video"}),w.jsx(Vie,{children:"Enter the YouTube video URL to embed it in your content."})]}),w.jsx("div",{className:"grid gap-4 py-4",children:w.jsxs("div",{className:"grid gap-3",children:[w.jsx(pm,{children:"YouTube URL"}),w.jsx(Go,{id:"youtube-url",placeholder:"https://www.youtube.com/watch?v=...",value:a,onChange:s=>r(s.target.value),autoFocus:!0})]})}),w.jsxs(Wie,{children:[w.jsx(Uie,{asChild:!0,children:w.jsx(Sr,{type:"button",variant:"outline",children:"Cancel"})}),w.jsx(Sr,{onClick:o,type:"button",variant:"primary",children:"Embed Video"})]})]})]})},eoe=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("codeBlock"),disabled:!n.editor.can().toggleCodeBlock()})});return w.jsx(ye,{icon:"Code",tooltip:"Code block",onClick:()=>t.chain().focus().setCodeBlock().run(),...e})},toe=()=>{const{editor:t}=Me(),e=He({editor:t,selector:n=>({active:n.editor.isActive("blockquote"),disabled:!n.editor.can().toggleBlockquote()})});return w.jsx(ye,{icon:"Quote",tooltip:"Quote",shortcuts:["Mod","Shift","B"],onClick:()=>t.chain().focus().toggleBlockquote().run(),...e})},noe=()=>w.jsx("div",{className:"rte-menu-bar",children:w.jsxs(Pa,{dense:!0,children:[w.jsx(Rre,{}),w.jsx(bre,{}),w.jsx(kr,{}),w.jsx(cre,{}),w.jsx(kr,{}),w.jsx(ire,{}),w.jsx(lre,{}),w.jsx(Mre,{}),w.jsx(gre,{}),w.jsx(kr,{}),w.jsx($re,{}),w.jsx(Lre,{}),w.jsx(kr,{}),w.jsx(rre,{}),w.jsx(ore,{}),w.jsx(fre,{}),w.jsx(kr,{}),w.jsx(toe,{}),w.jsx(ure,{}),w.jsx(Pre,{}),w.jsx(Xie,{}),w.jsx(eoe,{}),w.jsx(Xae,{})]})}),aoe=F.memo(noe),roe=(t,e,n)=>Math.min(n,Math.max(e,t)),ioe=()=>{const{editor:t,contentElement:e,setIsResizing:n}=Me(),a=F.useRef(null),r=F.useRef({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),i=He({editor:t,selector:A=>{if(!A.editor.isFocused||!A.editor.isEditable)return null;const m=A.editor.isActive("image")?"image":A.editor.isActive("youtube")?"youtube":null;if(!m)return null;const{selection:g}=A.editor.state;return{node:A.editor.view.nodeDOM(g.anchor),nodeType:m,nodePos:g.anchor}}}),{maxWidth:o,minWidth:s}=F.useMemo(()=>{const A=e.current?.getBoundingClientRect().width||0;return{maxWidth:A,minWidth:A*.25}},[e.current]),c=(A,m)=>{A.preventDefault();const g=r.current;g.startX=A.clientX,g.startY=A.clientY,g.isResizing=!0,g.direction=m,document.addEventListener("pointermove",l),document.addEventListener("pointerup",u),n(!0)},l=A=>{const m=i?.node,g=r.current;if(!m||!g.isResizing)return;let f=g.startX-A.clientX;f=g.direction?-f:f;const h=roe(g.startWidth+f,s,o),y=h/g.ratio;g.currentWidth=h,g.currentHeight=y,m.style.width=`${h}px`,m.style.height=`${y}px`,d()},u=()=>{const A=r.current;A.isResizing&&(A.isResizing=!1,document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",u),n(!1),requestAnimationFrame(()=>t?.commands.updateAttributes(i.nodeType,{width:Math.round(A.currentWidth/o*100)})))},d=F.useCallback(()=>{const A=i.node,m=a.current,{offsetTop:g,offsetLeft:f,offsetWidth:h,offsetHeight:y}=A;requestAnimationFrame(()=>{m.style.width=`${h}px`,m.style.height=`${y}px`,m.style.transform=`translate(${f}px, ${g}px)`})},[i]);if(F.useEffect(()=>{const A=i?.node;if(!A)return;const{width:m,height:g}=A.getBoundingClientRect(),f=r.current;f.startWidth=m,f.startHeight=g,f.currentWidth=m,f.currentHeight=g,f.ratio=m/g,d()},[i]),!i||!e.current)return;const p=(A,m,g)=>w.jsx("div",{className:"rte-resizer__control",style:{cursor:A,...g},onPointerDown:f=>c(f,m)});return ao.createPortal(w.jsxs("div",{ref:a,className:"rte-resizer",children:[p("nw-resize",0,{width:12,left:-10,top:-10}),p("sw-resize",0,{width:12,left:-10,bottom:-10}),p("sw-resize",1,{width:12,right:-10,top:-10}),p("nw-resize",1,{width:12,right:-10,bottom:-10})]}),e.current)},ooe=F.memo(ioe),soe=()=>{const{editor:t,isFullScreen:e,toggleFullScreen:n}=Me(),a=He({editor:t,selector:r=>({words:r.editor.storage.characterCount.words(),characters:r.editor.storage.characterCount.characters()})});return w.jsxs("div",{className:"rte-status-bar",children:[w.jsx(Pa,{dense:!0,children:w.jsx(ye,{icon:e?"Minimize":"Maximize",text:"Fullscreen",active:e,onClick:n})}),w.jsxs("div",{className:"rte-counter",children:[w.jsxs("span",{className:"rte-word-count",children:["Words: ",a.words]}),w.jsxs("span",{className:"rte-charater",children:["Characters: ",a.characters]})]})]})},coe=F.memo(soe);function C8(){const[t,e]=F.useState(!1),n=F.useRef(null),a=async r=>{if(!t)try{await navigator.clipboard.writeText(r),e(!0),n.current=setTimeout(()=>e(!1),2500)}catch{e(!1),n.current&&clearTimeout(n.current)}};return F.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),{isCopied:t,copy:a}}const hm=(t,e)=>{const{view:n,state:{selection:{from:a}}}=t;let i=n.nodeDOM(a)||n.domAtPos(a).node;for(;i&&i?.nodeName.toLocaleLowerCase()!==e.toLocaleLowerCase();)i=i.parentElement;return i};var vk,xk;if(typeof WeakMap<"u"){let t=new WeakMap;vk=e=>t.get(e),xk=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;vk=a=>{for(let r=0;r<t.length;r+=2)if(t[r]==a)return t[r+1]},xk=(a,r)=>(n==10&&(n=0),t[n++]=a,t[n++]=r)}var ht=class{constructor(t,e,n,a){this.width=t,this.height=e,this.map=n,this.problems=a}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const a=e%this.width,r=e/this.width|0;let i=a+1,o=r+1;for(let s=1;i<this.width&&this.map[e+s]==n;s++)i++;for(let s=1;o<this.height&&this.map[e+this.width*s]==n;s++)o++;return{left:a,top:r,right:i,bottom:o}}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:a,right:r,top:i,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?a==0:r==this.width)?null:this.map[i*this.width+(n<0?a-1:r)]:(n<0?i==0:o==this.height)?null:this.map[a+this.width*(n<0?i-1:o)]}rectBetween(t,e){const{left:n,right:a,top:r,bottom:i}=this.findCell(t),{left:o,right:s,top:c,bottom:l}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(r,c),right:Math.max(a,s),bottom:Math.max(i,l)}}cellsInRect(t){const e=[],n={};for(let a=t.top;a<t.bottom;a++)for(let r=t.left;r<t.right;r++){const i=a*this.width+r,o=this.map[i];n[o]||(n[o]=!0,!(r==t.left&&r&&this.map[i-1]==o||a==t.top&&a&&this.map[i-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let a=0,r=0;;a++){const i=r+n.child(a).nodeSize;if(a==t){let o=e+t*this.width;const s=(t+1)*this.width;for(;o<s&&this.map[o]<r;)o++;return o==s?i-1:this.map[o]}r=i}}static get(t){return vk(t)||xk(t,loe(t))}};function loe(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=uoe(t),n=t.childCount,a=[];let r=0,i=null;const o=[];for(let l=0,u=e*n;l<u;l++)a[l]=0;for(let l=0,u=0;l<n;l++){const d=t.child(l);u++;for(let m=0;;m++){for(;r<a.length&&a[r]!=0;)r++;if(m==d.childCount)break;const g=d.child(m),{colspan:f,rowspan:h,colwidth:y}=g.attrs;for(let k=0;k<h;k++){if(k+l>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:h-k});break}const _=r+k*e;for(let C=0;C<f;C++){a[_+C]==0?a[_+C]=u:(i||(i=[])).push({type:"collision",row:l,pos:u,n:f-C});const Q=y&&y[C];if(Q){const x=(_+C)%e*2,S=o[x];S==null||S!=Q&&o[x+1]==1?(o[x]=Q,o[x+1]=1):S==Q&&o[x+1]++}}}r+=f,u+=g.nodeSize}const p=(l+1)*e;let A=0;for(;r<p;)a[r++]==0&&A++;A&&(i||(i=[])).push({type:"missing",row:l,n:A}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const s=new ht(e,n,a,i);let c=!1;for(let l=0;!c&&l<o.length;l+=2)o[l]!=null&&o[l+1]<n&&(c=!0);return c&&doe(s,o,t),s}function uoe(t){let e=-1,n=!1;for(let a=0;a<t.childCount;a++){const r=t.child(a);let i=0;if(n)for(let o=0;o<a;o++){const s=t.child(o);for(let c=0;c<s.childCount;c++){const l=s.child(c);o+l.attrs.rowspan>a&&(i+=l.attrs.colspan)}}for(let o=0;o<r.childCount;o++){const s=r.child(o);i+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function doe(t,e,n){t.problems||(t.problems=[]);const a={};for(let r=0;r<t.map.length;r++){const i=t.map[r];if(a[i])continue;a[i]=!0;const o=n.nodeAt(i);if(!o)throw new RangeError(`No cell with offset ${i} found`);let s=null;const c=o.attrs;for(let l=0;l<c.colspan;l++){const u=(r+l)%t.width,d=e[u*2];d!=null&&(!c.colwidth||c.colwidth[l]!=d)&&((s||(s=poe(c)))[l]=d)}s&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}function poe(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function hn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const a=t.nodes[n],r=a.spec.tableRole;r&&(e[r]=a)}}return e}var Gi=new tt("selectingCells");function yc(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 Aoe(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 Oa(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 ym(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=yc(e.$head)||moe(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function moe(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const a=e.type.spec.tableRole;if(a=="cell"||a=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const a=e.type.spec.tableRole;if(a=="cell"||a=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Qk(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function goe(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Ik(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _8(t,e,n){const a=t.node(-1),r=ht.get(a),i=t.start(-1),o=r.nextCell(t.pos-i,e,n);return o==null?null:t.node(0).resolve(i+o)}function Uo(t,e,n=1){const a={...t,colspan:t.colspan-n};return a.colwidth&&(a.colwidth=a.colwidth.slice(),a.colwidth.splice(e,n),a.colwidth.some(r=>r>0)||(a.colwidth=null)),a}function B8(t,e,n=1){const a={...t,colspan:t.colspan+n};if(a.colwidth){a.colwidth=a.colwidth.slice();for(let r=0;r<n;r++)a.colwidth.splice(e,0,0)}return a}function foe(t,e,n){const a=hn(e.type.schema).header_cell;for(let r=0;r<t.height;r++)if(e.nodeAt(t.map[n+r*t.width]).type!=a)return!1;return!0}var at=class ri extends ke{constructor(e,n=e){const a=e.node(-1),r=ht.get(a),i=e.start(-1),o=r.rectBetween(e.pos-i,n.pos-i),s=e.node(0),c=r.cellsInRect(o).filter(u=>u!=n.pos-i);c.unshift(n.pos-i);const l=c.map(u=>{const d=a.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const p=i+u+1;return new t0(s.resolve(p),s.resolve(p+d.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=n}map(e,n){const a=e.resolve(n.map(this.$anchorCell.pos)),r=e.resolve(n.map(this.$headCell.pos));if(Qk(a)&&Qk(r)&&Ik(a,r)){const i=this.$anchorCell.node(-1)!=a.node(-1);return i&&this.isRowSelection()?ri.rowSelection(a,r):i&&this.isColSelection()?ri.colSelection(a,r):new ri(a,r)}return pe.between(a,r)}content(){const e=this.$anchorCell.node(-1),n=ht.get(e),a=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-a,this.$headCell.pos-a),i={},o=[];for(let c=r.top;c<r.bottom;c++){const l=[];for(let u=c*n.width+r.left,d=r.left;d<r.right;d++,u++){const p=n.map[u];if(i[p])continue;i[p]=!0;const A=n.findCell(p);let m=e.nodeAt(p);if(!m)throw RangeError(`No cell with offset ${p} found`);const g=r.left-A.left,f=A.right-r.right;if(g>0||f>0){let h=m.attrs;if(g>0&&(h=Uo(h,0,g)),f>0&&(h=Uo(h,h.colspan-f,f)),A.left<r.left){if(m=m.type.createAndFill(h),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(h)}`)}else m=m.type.create(h,m.content)}if(A.top<r.top||A.bottom>r.bottom){const h={...m.attrs,rowspan:Math.min(A.bottom,r.bottom)-Math.max(A.top,r.top)};A.top<r.top?m=m.type.createAndFill(h):m=m.type.create(h,m.content)}l.push(m)}o.push(e.child(c).copy(H.from(l)))}const s=this.isColSelection()&&this.isRowSelection()?e:o;return new ee(H.from(s),1,1)}replace(e,n=ee.empty){const a=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:s,$to:c}=r[o],l=e.mapping.slice(a);e.replace(l.map(s.pos),l.map(c.pos),o?ee.empty:n)}const i=ke.findFrom(e.doc.resolve(e.mapping.slice(a).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ee(H.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),a=ht.get(n),r=this.$anchorCell.start(-1),i=a.cellsInRect(a.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<i.length;o++)e(n.nodeAt(i[o]),r+i[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const a=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(a,r)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const a=e.node(-1),r=ht.get(a),i=e.start(-1),o=r.findCell(e.pos-i),s=r.findCell(n.pos-i),c=e.node(0);return o.top<=s.top?(o.top>0&&(e=c.resolve(i+r.map[o.left])),s.bottom<r.height&&(n=c.resolve(i+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(i+r.map[s.left])),o.bottom<r.height&&(e=c.resolve(i+r.map[r.width*(r.height-1)+o.right-1]))),new ri(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=ht.get(e),a=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-a),i=n.colCount(this.$headCell.pos-a);if(Math.min(r,i)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==n.width}eq(e){return e instanceof ri&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const a=e.node(-1),r=ht.get(a),i=e.start(-1),o=r.findCell(e.pos-i),s=r.findCell(n.pos-i),c=e.node(0);return o.left<=s.left?(o.left>0&&(e=c.resolve(i+r.map[o.top*r.width])),s.right<r.width&&(n=c.resolve(i+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(i+r.map[s.top*r.width])),o.right<r.width&&(e=c.resolve(i+r.map[r.width*(o.top+1)-1]))),new ri(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new ri(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,a=n){return new ri(e.resolve(n),e.resolve(a))}getBookmark(){return new boe(this.$anchorCell.pos,this.$headCell.pos)}};at.prototype.visible=!1,ke.jsonID("cell",at);var boe=class $L{constructor(e,n){this.anchor=e,this.head=n}map(e){return new $L(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),a=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&a.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&a.index()<a.parent.childCount&&Ik(n,a)?new at(n,a):ke.near(a,1)}};function hoe(t){if(!(t.selection instanceof at))return null;const e=[];return t.selection.forEachCell((n,a)=>{e.push(Xt.node(a,a+n.nodeSize,{class:"selectedCell"}))}),Ge.create(t.doc,e)}function yoe({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,a=e.pos,r=t.depth;for(;r>=0&&!(t.after(r+1)<t.end(r));r--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,a--);return n==a&&/row|table/.test(t.node(r).type.spec.tableRole)}function woe({$from:t,$to:e}){let n,a;for(let r=t.depth;r>0;r--){const i=t.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let r=e.depth;r>0;r--){const i=e.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){a=i;break}}return n!==a&&e.parentOffset===0}function koe(t,e,n){const a=(e||t).selection,r=(e||t).doc;let i,o;if(a instanceof Ae&&(o=a.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")i=at.create(r,a.from);else if(o=="row"){const s=r.resolve(a.from+1);i=at.rowSelection(s,s)}else if(!n){const s=ht.get(a.node),c=a.from+1,l=c+s.map[s.width*s.height-1];i=at.create(r,c+1,l)}}else a instanceof pe&&yoe(a)?i=pe.create(r,a.from):a instanceof pe&&woe(a)&&(i=pe.create(r,a.$from.start(),a.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var Coe=new tt("fix-tables");function E8(t,e,n,a){const r=t.childCount,i=e.childCount;e:for(let o=0,s=0;o<i;o++){const c=e.child(o);for(let l=s,u=Math.min(r,o+3);l<u;l++)if(t.child(l)==c){s=l+1,n+=c.nodeSize;continue e}a(c,n),s<r&&t.child(s).sameMarkup(c)?E8(t.child(s),c,n+1,a):c.nodesBetween(0,c.content.size,a,n+1),n+=c.nodeSize}}function v8(t,e){let n;const a=(r,i)=>{r.type.spec.tableRole=="table"&&(n=_oe(t,r,i,n))};return e?e.doc!=t.doc&&E8(e.doc,t.doc,0,a):t.doc.descendants(a),n}function _oe(t,e,n,a){const r=ht.get(e);if(!r.problems)return a;a||(a=t.tr);const i=[];for(let c=0;c<r.height;c++)i.push(0);for(let c=0;c<r.problems.length;c++){const l=r.problems[c];if(l.type=="collision"){const u=e.nodeAt(l.pos);if(!u)continue;const d=u.attrs;for(let p=0;p<d.rowspan;p++)i[l.row+p]+=l.n;a.setNodeMarkup(a.mapping.map(n+1+l.pos),null,Uo(d,d.colspan-l.n,l.n))}else if(l.type=="missing")i[l.row]+=l.n;else if(l.type=="overlong_rowspan"){const u=e.nodeAt(l.pos);if(!u)continue;a.setNodeMarkup(a.mapping.map(n+1+l.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-l.n})}else if(l.type=="colwidth mismatch"){const u=e.nodeAt(l.pos);if(!u)continue;a.setNodeMarkup(a.mapping.map(n+1+l.pos),null,{...u.attrs,colwidth:l.colwidth})}else if(l.type=="zero_sized"){const u=a.mapping.map(n);a.delete(u,u+e.nodeSize)}}let o,s;for(let c=0;c<i.length;c++)i[c]&&(o==null&&(o=c),s=c);for(let c=0,l=n+1;c<r.height;c++){const u=e.child(c),d=l+u.nodeSize,p=i[c];if(p>0){let A="cell";u.firstChild&&(A=u.firstChild.type.spec.tableRole);const m=[];for(let f=0;f<p;f++){const h=hn(t.schema)[A].createAndFill();h&&m.push(h)}const g=(c==0||o==c-1)&&s==c?l+1:d-1;a.insert(a.mapping.map(g),m)}l=d}return a.setMeta(Coe,{fixTables:!0})}function ur(t){const e=t.selection,n=ym(t),a=n.node(-1),r=n.start(-1),i=ht.get(a);return{...e instanceof at?i.rectBetween(e.$anchorCell.pos-r,e.$headCell.pos-r):i.findCell(n.pos-r),tableStart:r,map:i,table:a}}function x8(t,{map:e,tableStart:n,table:a},r){let i=r>0?-1:0;foe(e,a,r+i)&&(i=r==0||r==e.width?null:0);for(let o=0;o<e.height;o++){const s=o*e.width+r;if(r>0&&r<e.width&&e.map[s-1]==e.map[s]){const c=e.map[s],l=a.nodeAt(c);t.setNodeMarkup(t.mapping.map(n+c),null,B8(l.attrs,r-e.colCount(c))),o+=l.attrs.rowspan-1}else{const c=i==null?hn(a.type.schema).cell:a.nodeAt(e.map[s+i]).type,l=e.positionAt(o,r,a);t.insert(t.mapping.map(n+l),c.createAndFill())}}return t}function Boe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(x8(t.tr,n,n.left))}return!0}function Eoe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(x8(t.tr,n,n.right))}return!0}function voe(t,{map:e,table:n,tableStart:a},r){const i=t.mapping.maps.length;for(let o=0;o<e.height;){const s=o*e.width+r,c=e.map[s],l=n.nodeAt(c),u=l.attrs;if(r>0&&e.map[s-1]==c||r<e.width-1&&e.map[s+1]==c)t.setNodeMarkup(t.mapping.slice(i).map(a+c),null,Uo(u,r-e.colCount(c)));else{const d=t.mapping.slice(i).map(a+c);t.delete(d,d+l.nodeSize)}o+=u.rowspan}}function xoe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t),a=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;voe(a,n,r),r!=n.left;r--){const i=n.tableStart?a.doc.nodeAt(n.tableStart-1):a.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=ht.get(i)}e(a)}return!0}function Qoe(t,e,n){var a;const r=hn(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((a=e.nodeAt(t.map[i+n*t.width]))==null?void 0:a.type)!=r)return!1;return!0}function Q8(t,{map:e,tableStart:n,table:a},r){var i;let o=n;for(let l=0;l<r;l++)o+=a.child(l).nodeSize;const s=[];let c=r>0?-1:0;Qoe(e,a,r+c)&&(c=r==0||r==e.height?null:0);for(let l=0,u=e.width*r;l<e.width;l++,u++)if(r>0&&r<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],p=a.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...p,rowspan:p.rowspan+1}),l+=p.colspan-1}else{const d=c==null?hn(a.type.schema).cell:(i=a.nodeAt(e.map[u+c*e.width]))==null?void 0:i.type,p=d?.createAndFill();p&&s.push(p)}return t.insert(o,hn(a.type.schema).row.create(null,s)),t}function Ioe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(Q8(t.tr,n,n.top))}return!0}function Doe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t);e(Q8(t.tr,n,n.bottom))}return!0}function Soe(t,{map:e,table:n,tableStart:a},r){let i=0;for(let l=0;l<r;l++)i+=n.child(l).nodeSize;const o=i+n.child(r).nodeSize,s=t.mapping.maps.length;t.delete(i+a,o+a);const c=new Set;for(let l=0,u=r*e.width;l<e.width;l++,u++){const d=e.map[u];if(!c.has(d)){if(c.add(d),r>0&&d==e.map[u-e.width]){const p=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(s).map(d+a),null,{...p,rowspan:p.rowspan-1}),l+=p.colspan-1}else if(r<e.height&&d==e.map[u+e.width]){const p=n.nodeAt(d),A=p.attrs,m=p.type.create({...A,rowspan:p.attrs.rowspan-1},p.content),g=e.positionAt(r+1,l,n);t.insert(t.mapping.slice(s).map(a+g),m),l+=A.colspan-1}}}}function Foe(t,e){if(!Oa(t))return!1;if(e){const n=ur(t),a=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;Soe(a,n,r),r!=n.top;r--){const i=n.tableStart?a.doc.nodeAt(n.tableStart-1):a.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=ht.get(n.table)}e(a)}return!0}function I8(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Ooe({width:t,height:e,map:n},a){let r=a.top*t+a.left,i=r,o=(a.bottom-1)*t+a.left,s=r+(a.right-a.left-1);for(let c=a.top;c<a.bottom;c++){if(a.left>0&&n[i]==n[i-1]||a.right<t&&n[s]==n[s+1])return!0;i+=t,s+=t}for(let c=a.left;c<a.right;c++){if(a.top>0&&n[r]==n[r-t]||a.bottom<e&&n[o]==n[o+t])return!0;r++,o++}return!1}function D8(t,e){const n=t.selection;if(!(n instanceof at)||n.$anchorCell.pos==n.$headCell.pos)return!1;const a=ur(t),{map:r}=a;if(Ooe(r,a))return!1;if(e){const i=t.tr,o={};let s=H.empty,c,l;for(let u=a.top;u<a.bottom;u++)for(let d=a.left;d<a.right;d++){const p=r.map[u*r.width+d],A=a.table.nodeAt(p);if(!(o[p]||!A))if(o[p]=!0,c==null)c=p,l=A;else{I8(A)||(s=s.append(A.content));const m=i.mapping.map(p+a.tableStart);i.delete(m,m+A.nodeSize)}}if(c==null||l==null)return!0;if(i.setNodeMarkup(c+a.tableStart,null,{...B8(l.attrs,l.attrs.colspan,a.right-a.left-l.attrs.colspan),rowspan:a.bottom-a.top}),s.size){const u=c+1+l.content.size,d=I8(l)?c+1:u;i.replaceWith(d+a.tableStart,u+a.tableStart,s)}i.setSelection(new at(i.doc.resolve(c+a.tableStart))),e(i)}return!0}function S8(t,e){const n=hn(t.schema);return Noe(({node:a})=>n[a.type.spec.tableRole])(t,e)}function Noe(t){return(e,n)=>{var a;const r=e.selection;let i,o;if(r instanceof at){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,o=r.$anchorCell.pos}else{if(i=Aoe(r.$from),!i)return!1;o=(a=yc(r.$from))==null?void 0:a.pos}if(i==null||o==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let s=i.attrs;const c=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=ur(e),d=e.tr;for(let A=0;A<u.right-u.left;A++)c.push(l?{...s,colwidth:l&&l[A]?[l[A]]:null}:s);let p;for(let A=u.top;A<u.bottom;A++){let m=u.map.positionAt(A,u.left,u.table);A==u.top&&(m+=i.nodeSize);for(let g=u.left,f=0;g<u.right;g++,f++)g==u.left&&A==u.top||d.insert(p=d.mapping.map(m+u.tableStart,1),t({node:i,row:A,col:g}).createAndFill(c[f]))}d.setNodeMarkup(o,t({node:i,row:u.top,col:u.left}),c[0]),r instanceof at&&d.setSelection(new at(d.doc.resolve(r.$anchorCell.pos),p?d.doc.resolve(p):void 0)),n(d)}return!0}}function Toe(t,e){return function(n,a){if(!Oa(n))return!1;const r=ym(n);if(r.nodeAfter.attrs[t]===e)return!1;if(a){const i=n.tr;n.selection instanceof at?n.selection.forEachCell((o,s)=>{o.attrs[t]!==e&&i.setNodeMarkup(s,null,{...o.attrs,[t]:e})}):i.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[t]:e}),a(i)}return!0}}function $oe(t){return function(e,n){if(!Oa(e))return!1;if(n){const a=hn(e.schema),r=ur(e),i=e.tr,o=r.map.cellsInRect(t=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:t=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),s=o.map(c=>r.table.nodeAt(c));for(let c=0;c<o.length;c++)s[c].type==a.header_cell&&i.setNodeMarkup(r.tableStart+o[c],a.cell,s[c].attrs);if(i.steps.length==0)for(let c=0;c<o.length;c++)i.setNodeMarkup(r.tableStart+o[c],a.header_cell,s[c].attrs);n(i)}return!0}}function F8(t,e,n){const a=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let r=0;r<a.length;r++){const i=e.table.nodeAt(a[r]);if(i&&i.type!==n.header_cell)return!1}return!0}function Du(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?$oe(t):function(n,a){if(!Oa(n))return!1;if(a){const r=hn(n.schema),i=ur(n),o=n.tr,s=F8("row",i,r),c=F8("column",i,r),u=(t==="column"?s:t==="row"?c:!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,p=t=="column"?c?r.cell:r.header_cell:t=="row"?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(d).forEach(A=>{const m=A+i.tableStart,g=o.doc.nodeAt(m);g&&o.setNodeMarkup(m,p,g.attrs)}),a(o)}return!0}}Du("row",{useDeprecatedLogic:!0}),Du("column",{useDeprecatedLogic:!0});var Loe=Du("cell",{useDeprecatedLogic:!0});function Moe(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let a=t.index(-1)-1,r=t.before();a>=0;a--){const i=t.node(-1).child(a),o=i.lastChild;if(o)return r-1-o.nodeSize;r-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let a=t.indexAfter(-1),r=t.after();a<n.childCount;a++){const i=n.child(a);if(i.childCount)return r+1;r+=i.nodeSize}}return null}function O8(t){return function(e,n){if(!Oa(e))return!1;const a=Moe(ym(e),t);if(a==null)return!1;if(n){const r=e.doc.resolve(a);n(e.tr.setSelection(pe.between(r,goe(r))).scrollIntoView())}return!0}}function Roe(t,e){const n=t.selection.$anchor;for(let a=n.depth;a>0;a--)if(n.node(a).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(a),n.after(a)).scrollIntoView()),!0;return!1}function wm(t,e){const n=t.selection;if(!(n instanceof at))return!1;if(e){const a=t.tr,r=hn(t.schema).cell.createAndFill().content;n.forEachCell((i,o)=>{i.content.eq(r)||a.replace(a.mapping.map(o+1),a.mapping.map(o+i.nodeSize-1),new ee(r,0,0))}),a.docChanged&&e(a)}return!0}function Poe(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:a}=t;for(;e.childCount==1&&(n>0&&a>0||e.child(0).type.spec.tableRole=="table");)n--,a--,e=e.child(0).content;const r=e.child(0),i=r.type.spec.tableRole,o=r.type.schema,s=[];if(i=="row")for(let c=0;c<e.childCount;c++){let l=e.child(c).content;const u=c?0:Math.max(0,n-1),d=c<e.childCount-1?0:Math.max(0,a-1);(u||d)&&(l=Dk(hn(o).row,new ee(l,u,d)).content),s.push(l)}else if(i=="cell"||i=="header_cell")s.push(n||a?Dk(hn(o).row,new ee(e,n,a)).content:e);else return null;return joe(o,s)}function joe(t,e){const n=[];for(let r=0;r<e.length;r++){const i=e[r];for(let o=i.childCount-1;o>=0;o--){const{rowspan:s,colspan:c}=i.child(o).attrs;for(let l=r;l<r+s;l++)n[l]=(n[l]||0)+c}}let a=0;for(let r=0;r<n.length;r++)a=Math.max(a,n[r]);for(let r=0;r<n.length;r++)if(r>=e.length&&e.push(H.empty),n[r]<a){const i=hn(t).cell.createAndFill(),o=[];for(let s=n[r];s<a;s++)o.push(i);e[r]=e[r].append(H.from(o))}return{height:e.length,width:a,rows:e}}function Dk(t,e){const n=t.createAndFill();return new tb(n).replace(0,n.content.size,e).doc}function qoe({width:t,height:e,rows:n},a,r){if(t!=a){const i=[],o=[];for(let s=0;s<n.length;s++){const c=n[s],l=[];for(let u=i[s]||0,d=0;u<a;d++){let p=c.child(d%c.childCount);u+p.attrs.colspan>a&&(p=p.type.createChecked(Uo(p.attrs,p.attrs.colspan,u+p.attrs.colspan-a),p.content)),l.push(p),u+=p.attrs.colspan;for(let A=1;A<p.attrs.rowspan;A++)i[s+A]=(i[s+A]||0)+p.attrs.colspan}o.push(H.from(l))}n=o,t=a}if(e!=r){const i=[];for(let o=0,s=0;o<r;o++,s++){const c=[],l=n[s%e];for(let u=0;u<l.childCount;u++){let d=l.child(u);o+d.attrs.rowspan>r&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,r-d.attrs.rowspan)},d.content)),c.push(d)}i.push(H.from(c))}n=i,e=r}return{width:t,height:e,rows:n}}function Goe(t,e,n,a,r,i,o){const s=t.doc.type.schema,c=hn(s);let l,u;if(r>e.width)for(let d=0,p=0;d<e.height;d++){const A=n.child(d);p+=A.nodeSize;const m=[];let g;A.lastChild==null||A.lastChild.type==c.cell?g=l||(l=c.cell.createAndFill()):g=u||(u=c.header_cell.createAndFill());for(let f=e.width;f<r;f++)m.push(g);t.insert(t.mapping.slice(o).map(p-1+a),m)}if(i>e.height){const d=[];for(let m=0,g=(e.height-1)*e.width;m<Math.max(e.width,r);m++){const f=m>=e.width?!1:n.nodeAt(e.map[g+m]).type==c.header_cell;d.push(f?u||(u=c.header_cell.createAndFill()):l||(l=c.cell.createAndFill()))}const p=c.row.create(null,H.from(d)),A=[];for(let m=e.height;m<i;m++)A.push(p);t.insert(t.mapping.slice(o).map(a+n.nodeSize-2),A)}return!!(l||u)}function N8(t,e,n,a,r,i,o,s){if(o==0||o==e.height)return!1;let c=!1;for(let l=r;l<i;l++){const u=o*e.width+l,d=e.map[u];if(e.map[u-e.width]==d){c=!0;const p=n.nodeAt(d),{top:A,left:m}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(s).map(d+a),null,{...p.attrs,rowspan:o-A}),t.insert(t.mapping.slice(s).map(e.positionAt(o,m,n)),p.type.createAndFill({...p.attrs,rowspan:A+p.attrs.rowspan-o})),l+=p.attrs.colspan-1}}return c}function T8(t,e,n,a,r,i,o,s){if(o==0||o==e.width)return!1;let c=!1;for(let l=r;l<i;l++){const u=l*e.width+o,d=e.map[u];if(e.map[u-1]==d){c=!0;const p=n.nodeAt(d),A=e.colCount(d),m=t.mapping.slice(s).map(d+a);t.setNodeMarkup(m,null,Uo(p.attrs,o-A,p.attrs.colspan-(o-A))),t.insert(m+p.nodeSize,p.type.createAndFill(Uo(p.attrs,0,o-A))),l+=p.attrs.rowspan-1}}return c}function $8(t,e,n,a,r){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let o=ht.get(i);const{top:s,left:c}=a,l=c+r.width,u=s+r.height,d=t.tr;let p=0;function A(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");o=ht.get(i),p=d.mapping.maps.length}Goe(d,o,i,n,l,u,p)&&A(),N8(d,o,i,n,c,l,s,p)&&A(),N8(d,o,i,n,c,l,u,p)&&A(),T8(d,o,i,n,s,u,c,p)&&A(),T8(d,o,i,n,s,u,l,p)&&A();for(let m=s;m<u;m++){const g=o.positionAt(m,c,i),f=o.positionAt(m,l,i);d.replace(d.mapping.slice(p).map(g+n),d.mapping.slice(p).map(f+n),new ee(r.rows[m-s],0,0))}A(),d.setSelection(new at(d.doc.resolve(n+o.positionAt(s,c,i)),d.doc.resolve(n+o.positionAt(u-1,l-1,i)))),e(d)}var zoe=$b({ArrowLeft:Cm("horiz",-1),ArrowRight:Cm("horiz",1),ArrowUp:Cm("vert",-1),ArrowDown:Cm("vert",1),"Shift-ArrowLeft":_m("horiz",-1),"Shift-ArrowRight":_m("horiz",1),"Shift-ArrowUp":_m("vert",-1),"Shift-ArrowDown":_m("vert",1),Backspace:wm,"Mod-Backspace":wm,Delete:wm,"Mod-Delete":wm});function km(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Cm(t,e){return(n,a,r)=>{if(!r)return!1;const i=n.selection;if(i instanceof at)return km(n,a,ke.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=L8(r,t,e);if(o==null)return!1;if(t=="horiz")return km(n,a,ke.near(n.doc.resolve(i.head+e),e));{const s=n.doc.resolve(o),c=_8(s,t,e);let l;return c?l=ke.near(c,1):e<0?l=ke.near(n.doc.resolve(s.before(-1)),-1):l=ke.near(n.doc.resolve(s.after(-1)),1),km(n,a,l)}}}function _m(t,e){return(n,a,r)=>{if(!r)return!1;const i=n.selection;let o;if(i instanceof at)o=i;else{const c=L8(r,t,e);if(c==null)return!1;o=new at(n.doc.resolve(c))}const s=_8(o.$headCell,t,e);return s?km(n,a,new at(o.$anchorCell,s)):!1}}function Hoe(t,e){const n=t.state.doc,a=yc(n.resolve(e));return a?(t.dispatch(t.state.tr.setSelection(new at(a))),!0):!1}function Uoe(t,e,n){if(!Oa(t.state))return!1;let a=Poe(n);const r=t.state.selection;if(r instanceof at){a||(a={width:1,height:1,rows:[H.from(Dk(hn(t.state.schema).cell,n))]});const i=r.$anchorCell.node(-1),o=r.$anchorCell.start(-1),s=ht.get(i).rectBetween(r.$anchorCell.pos-o,r.$headCell.pos-o);return a=qoe(a,s.right-s.left,s.bottom-s.top),$8(t.state,t.dispatch,o,s,a),!0}else if(a){const i=ym(t.state),o=i.start(-1);return $8(t.state,t.dispatch,o,ht.get(i.node(-1)).findCell(i.pos-o),a),!0}else return!1}function Zoe(t,e){var n;if(e.ctrlKey||e.metaKey)return;const a=M8(t,e.target);let r;if(e.shiftKey&&t.state.selection instanceof at)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&a&&(r=yc(t.state.selection.$anchor))!=null&&((n=Sk(t,e))==null?void 0:n.pos)!=r.pos)i(r,e),e.preventDefault();else if(!a)return;function i(c,l){let u=Sk(t,l);const d=Gi.getState(t.state)==null;if(!u||!Ik(c,u))if(d)u=c;else return;const p=new at(c,u);if(d||!t.state.selection.eq(p)){const A=t.state.tr.setSelection(p);d&&A.setMeta(Gi,c.pos),t.dispatch(A)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",s),Gi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Gi,-1))}function s(c){const l=c,u=Gi.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(M8(t,l.target)!=a&&(d=Sk(t,e),!d))return o();d&&i(d,l)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",s)}function L8(t,e,n){if(!(t.state.selection instanceof pe))return null;const{$head:a}=t.state.selection;for(let r=a.depth-1;r>=0;r--){const i=a.node(r);if((n<0?a.index(r):a.indexAfter(r))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const s=a.before(r),c=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(c)?s:null}}return null}function M8(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Sk(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?yc(t.state.doc.resolve(n.pos)):null}var Yoe=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Fk(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,Fk(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Fk(t,e,n,a,r,i){var o;let s=0,c=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,p=0;d<u.childCount;d++){const{colspan:A,colwidth:m}=u.child(d).attrs;for(let g=0;g<A;g++,p++){const f=r==p?i:m&&m[g],h=f?f+"px":"";if(s+=f||a,f||(c=!1),l)l.style.width!=h&&(l.style.width=h),l=l.nextSibling;else{const y=document.createElement("col");y.style.width=h,e.appendChild(y)}}}for(;l;){const d=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=d}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Jn=new tt("tableColumnResizing");function Koe({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:a=Yoe,lastColumnResizable:r=!0}={}){const i=new qe({key:Jn,state:{init(o,s){var c,l;const u=(l=(c=i.spec)==null?void 0:c.props)==null?void 0:l.nodeViews,d=hn(s.schema).table.name;return a&&u&&(u[d]=(p,A)=>new a(p,n,A)),new Woe(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=Jn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{Joe(o,s,t,r)},mouseleave:o=>{Voe(o)},mousedown:(o,s)=>{Xoe(o,s,e,n)}},decorations:o=>{const s=Jn.getState(o);if(s&&s.activeHandle>-1)return rse(o,s.activeHandle)},nodeViews:{}}});return i}var Woe=class cf{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,a=e.getMeta(Jn);if(a&&a.setHandle!=null)return new cf(a.setHandle,!1);if(a&&a.setDragging!==void 0)return new cf(n.activeHandle,a.setDragging);if(n.activeHandle>-1&&e.docChanged){let r=e.mapping.map(n.activeHandle,-1);return Qk(e.doc.resolve(r))||(r=-1),new cf(r,n.dragging)}return n}};function Joe(t,e,n,a){if(!t.editable)return;const r=Jn.getState(t.state);if(r&&!r.dragging){const i=tse(e.target);let o=-1;if(i){const{left:s,right:c}=i.getBoundingClientRect();e.clientX-s<=n?o=R8(t,e,"left",n):c-e.clientX<=n&&(o=R8(t,e,"right",n))}if(o!=r.activeHandle){if(!a&&o!==-1){const s=t.state.doc.resolve(o),c=s.node(-1),l=ht.get(c),u=s.start(-1);if(l.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==l.width-1)return}j8(t,o)}}}function Voe(t){if(!t.editable)return;const e=Jn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&j8(t,-1)}function Xoe(t,e,n,a){var r;if(!t.editable)return!1;const i=(r=t.dom.ownerDocument.defaultView)!=null?r:window,o=Jn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=t.state.doc.nodeAt(o.activeHandle),c=ese(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Jn,{setDragging:{startX:e.clientX,startWidth:c}}));function l(d){i.removeEventListener("mouseup",l),i.removeEventListener("mousemove",u);const p=Jn.getState(t.state);p?.dragging&&(nse(t,p.activeHandle,P8(p.dragging,d,n)),t.dispatch(t.state.tr.setMeta(Jn,{setDragging:null})))}function u(d){if(!d.which)return l(d);const p=Jn.getState(t.state);if(p&&p.dragging){const A=P8(p.dragging,d,n);q8(t,p.activeHandle,A,a)}}return q8(t,o.activeHandle,c,a),i.addEventListener("mouseup",l),i.addEventListener("mousemove",u),e.preventDefault(),!0}function ese(t,e,{colspan:n,colwidth:a}){const r=a&&a[a.length-1];if(r)return r;const i=t.domAtPos(e);let s=i.node.childNodes[i.offset].offsetWidth,c=n;if(a)for(let l=0;l<n;l++)a[l]&&(s-=a[l],c--);return s/c}function tse(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function R8(t,e,n,a){const r=n=="right"?-a:a,i=t.posAtCoords({left:e.clientX+r,top:e.clientY});if(!i)return-1;const{pos:o}=i,s=yc(t.state.doc.resolve(o));if(!s)return-1;if(n=="right")return s.pos;const c=ht.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function P8(t,e,n){const a=e.clientX-t.startX;return Math.max(n,t.startWidth+a)}function j8(t,e){t.dispatch(t.state.tr.setMeta(Jn,{setHandle:e}))}function nse(t,e,n){const a=t.state.doc.resolve(e),r=a.node(-1),i=ht.get(r),o=a.start(-1),s=i.colCount(a.pos-o)+a.nodeAfter.attrs.colspan-1,c=t.state.tr;for(let l=0;l<i.height;l++){const u=l*i.width+s;if(l&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],p=r.nodeAt(d).attrs,A=p.colspan==1?0:s-i.colCount(d);if(p.colwidth&&p.colwidth[A]==n)continue;const m=p.colwidth?p.colwidth.slice():ase(p.colspan);m[A]=n,c.setNodeMarkup(o+d,null,{...p,colwidth:m})}c.docChanged&&t.dispatch(c)}function q8(t,e,n,a){const r=t.state.doc.resolve(e),i=r.node(-1),o=r.start(-1),s=ht.get(i).colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;let c=t.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&Fk(i,c.firstChild,c,a,s,n)}function ase(t){return Array(t).fill(0)}function rse(t,e){var n;const a=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return Ge.empty;const o=ht.get(i),s=r.start(-1),c=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let l=0;l<o.height;l++){const u=c+l*o.width;if((c==o.width-1||o.map[u]!=o.map[u+1])&&(l==0||o.map[u]!=o.map[u-o.width])){const d=o.map[u],p=s+d+i.nodeAt(d).nodeSize-1,A=document.createElement("div");A.className="column-resize-handle",(n=Jn.getState(t))!=null&&n.dragging&&a.push(Xt.node(s+d,s+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),a.push(Xt.widget(p,A))}}return Ge.create(t.doc,a)}function ise({allowTableNodeSelection:t=!1}={}){return new qe({key:Gi,state:{init(){return null},apply(e,n){const a=e.getMeta(Gi);if(a!=null)return a==-1?null:a;if(n==null||!e.docChanged)return n;const{deleted:r,pos:i}=e.mapping.mapResult(n);return r?null:i}},props:{decorations:hoe,handleDOMEvents:{mousedown:Zoe},createSelectionBetween(e){return Gi.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Hoe,handleKeyDown:zoe,handlePaste:Uoe},appendTransaction(e,n,a){return koe(a,v8(a,n),t)}})}function ose(t,e){const n=Math.min(t.top,e.top),a=Math.max(t.bottom,e.bottom),r=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-r,s=a-n,c=r,l=n;return new DOMRect(c,l,o,s)}var sse=class{constructor({editor:t,element:e,view:n,updateDelay:a=250,resizeDelay:r=60,shouldShow:i,appendTo:o,getReferencedVirtualElement:s,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:u,state:d,from:p,to:A})=>{const{doc:m,selection:g}=d,{empty:f}=g,h=!m.textBetween(p,A).length&&Rb(d.selection),y=this.element.contains(document.activeElement);return!(!(u.hasFocus()||y)||f||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,d)=>{const p=!d?.selection.eq(u.state.selection),A=!d?.doc.eq(u.state.doc);!p&&!A||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,p,A,d)},this.updateDelay))},this.updateHandler=(u,d,p,A)=>{const{composing:m}=u;if(m||!d&&!p)return;if(!this.getShouldShow(A)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:u})=>{u.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var l;this.editor=t,this.element=e,this.view=n,this.updateDelay=a,this.resizeDelay=r,this.appendTo=o,this.scrollTarget=(l=c?.scrollTarget)!=null?l:window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,i&&(this.shouldShow=i),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.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(_B(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(CB(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(kB(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(vf(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(BB(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(rM(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(EB(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(iM(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t;const{selection:e}=this.editor.state,n=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(n)return n;const a=U6(this.view,e.from,e.to);let r={getBoundingClientRect:()=>a,getClientRects:()=>[a]};if(e instanceof Ae){let i=this.view.nodeDOM(e.from);const o=i.dataset.nodeViewWrapper?i:i.querySelector("[data-node-view-wrapper]");o&&(i=o),i&&(r={getBoundingClientRect:()=>i.getBoundingClientRect(),getClientRects:()=>[i.getBoundingClientRect()]})}if(e instanceof at){const{$anchorCell:i,$headCell:o}=e,s=i?i.pos:o.pos,c=o?o.pos:i.pos,l=this.view.nodeDOM(s),u=this.view.nodeDOM(c);if(!l||!u)return;const d=l===u?l.getBoundingClientRect():ose(l.getBoundingClientRect(),u.getBoundingClientRect());r={getBoundingClientRect:()=>d,getClientRects:()=>[d]}}return r}updatePosition(){const t=this.virtualElement;t&&vB(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:a})=>{this.element.style.width="max-content",this.element.style.position=a,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const{state:n}=t,a=n.selection.from!==n.selection.to;if(this.updateDelay>0&&a){this.handleDebouncedUpdate(t,e);return}const r=!e?.selection.eq(t.state.selection),i=!e?.doc.eq(t.state.doc);this.updateHandler(t,r,i,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:a}=n,{ranges:r}=a,i=Math.min(...r.map(c=>c.$from.pos)),o=Math.max(...r.map(c=>c.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:i,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},G8=t=>new qe({key:typeof t.pluginKey=="string"?new tt(t.pluginKey):t.pluginKey,view:e=>new sse({view:e,...t})});ze.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[G8({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});const Bm=({editor:t,className:e,children:n,...a})=>{const r=F.useRef(document.createElement("div"));return F.useEffect(()=>{if(t?.isDestroyed)return;const{pluginKey:o="bubbleMenu",options:s={},updateDelay:c,resizeDelay:l,shouldShow:u=null,appendTo:d,getReferencedVirtualElement:p}=a,A=t;if(!A){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const m=G8({updateDelay:c,resizeDelay:l,editor:A||t,element:r.current,pluginKey:o,shouldShow:u,appendTo:d,getReferencedVirtualElement:p,options:s});return A.registerPlugin(m),()=>{A.unregisterPlugin(o),window.requestAnimationFrame(()=>{r.current.parentNode&&r.current.parentNode.removeChild(r.current)})}},[t]),ao.createPortal(w.jsx("div",{className:ln("rte-bubble-menu",e),children:n}),r.current)},wc="plaintext",z8=[{syntax:"bash",alias:"sh",label:"Bash"},{syntax:"c",alias:"h",label:"C"},{syntax:"csharp",alias:"cs, c#, dotnet",label:"C#"},{syntax:"css",label:"CSS"},{syntax:"go",alias:"golang",label:"Go"},{syntax:"graphql",alias:"gql",label:"GraphQL"},{syntax:"java",alias:"jsp",label:"Java"},{syntax:"javascript",alias:"js, jsx, mjs, cjs",label:"Javascript"},{syntax:"json",label:"JSON"},{syntax:"kotlin",alias:"kt, kts",label:"Kotlin"},{syntax:"less",label:"Less"},{syntax:"makefile",alias:"mk, mak, make",label:"Makefile"},{syntax:"markdown",alias:"md, mkdown, mkd",label:"Markdown"},{syntax:"objectivec",alias:"mm, objc, obj-c, obj-c++, objective-c++",label:"Objective-C"},{syntax:"php",label:"PHP"},{syntax:"plaintext",alias:"text, txt",label:"Text"},{syntax:"python",alias:"py, gyp, ipython",label:"Python"},{syntax:"scss",label:"SCSS"},{syntax:"shell",alias:"console, shellsession",label:"Shell"},{syntax:"sql",label:"SQL"},{syntax:"typescript",alias:"ts, tsx",label:"TypeScript"},{syntax:"vbnet",alias:"vb",label:"VB .NET"},{syntax:"xml",alias:"html, xhtml, rss, atom, xjb, xsd, xsl, plist, wsf, svg",label:"HTML, XML"}],cse=({value:t,onSelect:e})=>{const{contentElement:n}=Me(),[a,r]=F.useState(""),i=z8.map(s=>({label:s.label,value:s.syntax})),o=F.useMemo(()=>a?i.filter(s=>s.label.includes(a)):i,[i,a]);return w.jsxs(ye,{type:"popover",text:i.find(s=>s.value===t)?.label,hideText:!1,tooltip:!1,buttonStyle:{minWidth:"6rem"},dropdownClass:"rte-code-dropdown",dropdownStyle:{minWidth:"10rem"},children:[w.jsx(Go,{className:"code-search",placeholder:"Seach language...",style:{width:"10rem"},value:a,onChange:s=>r(s.target.value.trim())}),w.jsx("div",{className:"code-list",style:{maxHeight:`${(n.current?.clientHeight||0)*.375}px`},children:o.map(s=>w.jsx(gh,{asChild:!0,children:w.jsxs("div",{className:"code-item",onClick:()=>{e(s.value),r("")},children:[s.label,s.value===t&&w.jsx(yl,{name:"Check",className:"code-item__indicator",size:14,strokeWidth:2.5})]})},s.value))})]})},H8=()=>{const{editor:t,contentElement:e}=Me(),{isCopied:n,copy:a}=C8(),r=He({editor:t,selector:u=>u.editor.isActive("codeBlock")?u.editor.getAttributes("codeBlock").language:null}),i=F.useCallback(({editor:u})=>u.isActive("codeBlock"),[]),o=F.useCallback(u=>t.commands.updateAttributes("codeBlock",{language:u}),[t]),s=F.useCallback(()=>{const u=hm(t,"pre");u?.textContent&&a(u.textContent)},[t]),c=F.useCallback(()=>{t.chain().focus().deleteNode("codeBlock").run()},[t]),l=F.useCallback(()=>{const u=hm(t,"pre");return u?{getBoundingClientRect:()=>u.getBoundingClientRect()}:null},[t]);return w.jsx(Bm,{editor:t,pluginKey:"code-block-bubble",shouldShow:i,updateDelay:100,appendTo:()=>e.current,getReferencedVirtualElement:l,options:{placement:"top"},children:w.jsxs(Pa,{children:[w.jsx(cse,{value:r,onSelect:o}),w.jsx(kr,{}),w.jsx(ye,{icon:n?"Check":"Clipboard",tooltip:"Copy code",onClick:s}),w.jsx(ye,{icon:"Trash",tooltip:"Delete code",onClick:c})]})})};F.memo(H8);const lse=({initialText:t,onApply:e,onCancel:n})=>{const[a,r]=F.useState(t||""),i=o=>{o.preventDefault(),e(a)};return w.jsxs("form",{className:"rte-text-alternative__form",onSubmit:i,children:[w.jsx(Go,{value:a,onChange:o=>r(o.target.value),placeholder:"Text alternative",autoFocus:!0}),w.jsx(ye,{buttonType:"submit",icon:"Check",tooltip:!1}),w.jsx(ye,{icon:"Close",tooltip:!1,onClick:n})]})},use=({value:t,onChange:e})=>{const n=[null,25,50,75,100];return w.jsx(ye,{type:"dropdown",buttonStyle:{width:"6.5rem"},dropdownStyle:{width:"7rem"},icon:"Ruler",text:t?`${t}%`:"Default",hideText:!1,tooltip:!1,children:n.map((a,r)=>w.jsx(mh,{"data-active":a==t||void 0,onSelect:()=>e(a),children:a?`${a}% width`:"Default"},r))})},dse=()=>{const t=F.useRef(null),{editor:e,isResizing:n,contentElement:a}=Me(),[r,i]=F.useState(!1),o=He({editor:e,selector:g=>{if(!g.editor.isActive("image")&&!g.editor.isActive("imageFigure"))return null;const{node:f,pos:h}=pse(g.editor.state.selection);return f?{pos:h,src:f.attrs.src,alt:f.attrs.alt,width:f.attrs.width,hasCaption:g.editor.isActive("imageFigure")}:null}}),s=F.useCallback(()=>{const g=e.isActive("imageFigure")?"figure":"img",f=hm(e,g);return f?{getBoundingClientRect:()=>f.getBoundingClientRect()}:null},[e]),c=(g,f)=>{const{state:{selection:h}}=e;return e.chain().command(({commands:y})=>o?.pos&&h.from!==o.pos?y.setNodeSelection(o.pos):!0).updateAttributes("image",{[g]:f}).focus().run()},l=()=>e.chain().focus()[o?.hasCaption?"figureToImage":"imageToFigure"]().run(),u=()=>{i(g=>!g),requestAnimationFrame(()=>t.current?.updatePosition?.())},d=g=>{c("alt",g),u()},p=g=>c("width",g),A=()=>e.chain().focus().removeImage().run(),m=F.useCallback(async()=>{if(o?.src)try{const g=await fetch(o.src);if(!g.ok)throw new Error("Failed to fetch the image.");const f=await g.blob(),h=f.type.split(/\/|\+/)[1],y=URL.createObjectURL(f),k=document.createElement("a");k.href=y,k.download=`image.${h}`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(y)}catch{}},[o]);return n?null:w.jsx(Bm,{editor:e,pluginKey:"image-bubble",shouldShow:({editor:g})=>g.isActive("imageFigure")||g.isActive("image"),updateDelay:100,appendTo:()=>a.current,getReferencedVirtualElement:s,options:{offset:15,onShow:()=>{t.current={updatePosition:()=>{}}},onDestroy:()=>t.current=null,onHide:()=>i(!1)},children:r?w.jsx(lse,{initialText:o?.alt,onApply:d,onCancel:()=>{e.commands.focus(),u()}}):w.jsxs(Pa,{children:[w.jsx(ye,{text:"Alt text",hideText:!1,tooltip:"Alternative text",onClick:u}),w.jsx(ye,{icon:"ImageCaption",tooltip:`Caption: ${o?.hasCaption?"ON":"OFF"}`,active:o?.hasCaption,onClick:l}),w.jsx(kr,{}),w.jsx(use,{value:o?.width,onChange:p}),w.jsx(kr,{}),w.jsx(ye,{icon:"Download",tooltip:"Download",onClick:m}),w.jsx(ye,{icon:"Trash",tooltip:"Delete",onClick:A})]})})},pse=t=>{let e=null,n=null;if(t instanceof pe){const a=t.$anchor;e=a.node(-1).firstChild,n=a.before(-1)+1}else t instanceof Ae&&(e=t.node,n=t.from,e.type.name==="imageFigure"&&(e=e.firstChild,n+=1));return{node:e,pos:n}},Ase=({initialUrl:t,initialText:e,isCreate:n,onApply:a,onCancel:r})=>{const[i,o]=F.useState(t||""),[s,c]=F.useState(e||""),[l,u]=F.useState(n),d=()=>{l&&a(i,s)};return F.useEffect(()=>{n||u(i&&i!==t||s!==e)},[s,i]),w.jsxs("div",{className:"rte-link__form",onSubmit:d,children:[w.jsx(pm,{className:"rte-link__label",children:"URL"}),w.jsx(Go,{value:i,onChange:p=>o(p.target.value),className:"rte-link__input",placeholder:"Paste link",type:"url",required:!0,autoFocus:!0}),w.jsx(pm,{className:"rte-link__label",children:"Display Text"}),w.jsx(Go,{value:s,onChange:p=>c(p.target.value),className:"rte-link__input",placeholder:"Enter link text"}),w.jsxs("div",{className:"rte-link__actions",children:[w.jsx(Sr,{type:"button",variant:"secondary",onClick:r,children:"Cancel"}),w.jsx(Sr,{type:"button",disabled:!l,onClick:d,children:"Apply"})]})]})},mse=({url:t,onEdit:e,onRemove:n})=>{const{copy:a,isCopied:r}=C8();return w.jsxs(Pa,{children:[w.jsx(ye,{text:"Edit link",hideText:!1,onClick:e}),w.jsx(ye,{icon:"ExternalLink",text:"Open in new tab",onClick:()=>window.open(t,"_blank")}),w.jsx(ye,{icon:r?"Check":"Clipboard",text:r?"Copied":"Copy link",onClick:()=>a(t)}),w.jsx(ye,{icon:"Unlink",text:"Remove link",onClick:n})]})},U8=()=>{const{editor:t,contentElement:e}=Me(),[n,a]=F.useState(!1),r=F.useRef(0),i=He({editor:t,selector:d=>{if(r.current=d.editor.storage.link?.mode||0,!d.editor.isActive("link"))return null;const{state:{selection:p,doc:A}}=d.editor,m=d.editor.getAttributes("link").href,g=A.textBetween(p.from,p.to);return{url:m,text:g}}}),o=F.useCallback(({editor:d,from:p,to:A})=>(a(r.current==-1),d.isActive("link")&&(r.current==-1||p!==A)),[]),s=F.useCallback((d,p)=>{t.chain().confirmEditLink({href:d,text:p||d}).run(),a(!1)},[]),c=F.useCallback(()=>{t.chain().focus().unsetLink().run()},[t]),l=F.useCallback(()=>{a(!0)},[]),u=F.useCallback(()=>{r.current==-1?t.commands.confirmEditLink():a(!1)},[t]);return w.jsx(Bm,{editor:t,pluginKey:"link-menu",updateDelay:100,shouldShow:o,appendTo:()=>e.current,options:{placement:"bottom-start",onHide:()=>a(!1)},children:n?w.jsx(Ase,{initialUrl:i?.url,initialText:i?.text,isCreate:r.current===-1,onApply:s,onCancel:u}):w.jsx(mse,{url:i?.url,onEdit:l,onRemove:c})})};F.memo(U8);var gse=Object.defineProperty,fse=(t,e)=>{for(var n in e)gse(t,n,{get:e[n],enumerable:!0})},bse="listItem",Z8="textStyle",Y8=/^\s*([-+*])\s$/,K8=Ct.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",Pe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
222
222
|
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bse,this.editor.getAttributes(Z8)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Fs({find:Y8,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Fs({find:Y8,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Z8),editor:this.editor})),[t]}}),W8=Ct.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Pe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(r=>r.type==="paragraph"))n=e.parseChildren(t.tokens);else{const r=t.tokens[0];if(r&&r.type==="text"&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(r.tokens)}],t.tokens.length>1){const o=t.tokens.slice(1),s=e.parseChildren(o);n.push(...s)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>eh(t,e,a=>a.parentType==="bulletList"?"- ":a.parentType==="orderedList"?`${a.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),hse={};fse(hse,{findListItemPos:()=>Su,getNextListDepth:()=>Ok,handleBackspace:()=>Nk,handleDelete:()=>Tk,hasListBefore:()=>J8,hasListItemAfter:()=>yse,hasListItemBefore:()=>V8,listItemHasSubList:()=>X8,nextListIsDeeper:()=>eN,nextListIsHigher:()=>tN});var Su=(t,e)=>{const{$from:n}=e.selection,a=It(t,e.schema);let r=null,i=n.depth,o=n.pos,s=null;for(;i>0&&s===null;)r=n.node(i),r.type===a?s=i:(i-=1,o-=1);return s===null?null:{$pos:e.doc.resolve(o),depth:s}},Ok=(t,e)=>{const n=Su(t,e);if(!n)return!1;const[,a]=j6(e,t,n.$pos.pos+4);return a},J8=(t,e,n)=>{const{$anchor:a}=t.selection,r=Math.max(0,a.pos-2),i=t.doc.resolve(r).node();return!(!i||!n.includes(i.type.name))},V8=(t,e)=>{var n;const{$anchor:a}=e.selection,r=e.doc.resolve(a.pos-2);return!(r.index()===0||((n=r.nodeBefore)==null?void 0:n.type.name)!==t)},X8=(t,e,n)=>{if(!n)return!1;const a=It(t,e.schema);let r=!1;return n.descendants(i=>{i.type===a&&(r=!0)}),r},Nk=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!va(t.state,e)&&J8(t.state,e,n)){const{$anchor:s}=t.state.selection,c=t.state.doc.resolve(s.before()-1),l=[];c.node().descendants((p,A)=>{p.type.name===e&&l.push({node:p,pos:A})});const u=l.at(-1);if(!u)return!1;const d=t.state.doc.resolve(c.start()+u.pos+1);return t.chain().cut({from:s.start()-1,to:s.end()+1},d.end()).joinForward().run()}if(!va(t.state,e)||!H6(t.state))return!1;const a=Su(e,t.state);if(!a)return!1;const i=t.state.doc.resolve(a.$pos.pos-2).node(a.depth),o=X8(e,t.state,i);return V8(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},eN=(t,e)=>{const n=Ok(t,e),a=Su(t,e);return!a||!n?!1:n>a.depth},tN=(t,e)=>{const n=Ok(t,e),a=Su(t,e);return!a||!n?!1:n<a.depth},Tk=(t,e)=>{if(!va(t.state,e)||!z6(t.state,e))return!1;const{selection:n}=t.state,{$from:a,$to:r}=n;return!n.empty&&a.sameParent(r)?!1:eN(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():tN(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},yse=(t,e)=>{var n;const{$anchor:a}=e.selection,r=e.doc.resolve(a.pos-a.parentOffset-2);return!(r.index()===r.parent.childCount-1||((n=r.nodeAfter)==null?void 0:n.type.name)!==t)},$k=ze.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Tk(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Tk(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:a})=>{t.state.schema.nodes[n]!==void 0&&Nk(t,n,a)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:a})=>{t.state.schema.nodes[n]!==void 0&&Nk(t,n,a)&&(e=!0)}),e}}}}),nN=/^(\s*)(\d+)\.\s+(.*)$/,wse=/^\s/;function kse(t){const e=[];let n=0,a=0;for(;n<t.length;){const r=t[n],i=r.match(nN);if(!i)break;const[,o,s,c]=i,l=o.length;let u=c,d=n+1;const p=[r];for(;d<t.length;){const A=t[d];if(A.match(nN))break;if(A.trim()==="")p.push(A),u+=`
|
|
223
223
|
`,d+=1;else if(A.match(wse))p.push(A),u+=`
|
|
224
224
|
${A.slice(l+2)}`,d+=1;else break}e.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:p.join(`
|
|
@@ -268,7 +268,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Rt=X,st=be),$e===void
|
|
|
268
268
|
`,(u?i.slice(1):i).forEach(m=>{d+=`| ${new Array(o).fill(0).map((g,f)=>c(m[f]&&m[f].text||"",s[f])).join(" | ")} |
|
|
269
269
|
`}),d}var sde=ode,gT=Ct.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Xue,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:a,tableMinWidth:r}=ede(t,this.options.cellMinWidth),i=e.style;function o(){return i||(a?`width: ${a}`:`min-width: ${r}`)}const s=["table",Pe(this.options.HTMLAttributes,e,{style:o()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},s]:s},parseMarkdown:(t,e)=>{const n=[];if(t.header){const a=[];t.header.forEach(r=>{a.push(e.createNode("tableHeader",{},[{type:"paragraph",content:e.parseInline(r.tokens)}]))}),n.push(e.createNode("tableRow",{},a))}return t.rows&&t.rows.forEach(a=>{const r=[];a.forEach(i=>{r.push(e.createNode("tableCell",{},[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},r))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>sde(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:a,dispatch:r,editor:i})=>{const o=nde(i.schema,t,e,n);if(r){const s=a.selection.from+1;a.replaceSelectionWith(o).scrollIntoView().setSelection(pe.near(a.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Boe(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Eoe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>xoe(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Ioe(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Doe(t,e),deleteRow:()=>({state:t,dispatch:e})=>Foe(t,e),deleteTable:()=>({state:t,dispatch:e})=>Roe(t,e),mergeCells:()=>({state:t,dispatch:e})=>D8(t,e),splitCell:()=>({state:t,dispatch:e})=>S8(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Du("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Du("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Loe(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>D8(t,e)?!0:S8(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:a})=>Toe(t,e)(n,a),goToNextCell:()=>({state:t,dispatch:e})=>O8(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>O8(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&v8(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const a=at.create(e.doc,t.anchorCell,t.headCell);e.setSelection(a)}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:mg,"Mod-Backspace":mg,Delete:mg,"Mod-Delete":mg}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Koe({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],ise({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Ze(fe(t,"tableRole",e))}}});ze.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(gT.configure(this.options.table)),this.options.tableCell!==!1&&t.push(uT.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(dT.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(pT.configure(this.options.tableRow)),t}});const cde=gT.extend({addExtensions(){return[pT,dT,uT]}}).configure({cellMinWidth:35,resizable:!0}),lde=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?!channel\/)(?!@)(.+)?$/;function fT(t){return t.match(lde)}function ude({url:t,nocookie:e,allowFullscreen:n,autoplay:a,controls:r}){if(!fT(t))return null;if(t.includes("/embed/"))return t;const o=/(?:v=|shorts\/)([-\w]+)/gm.exec(t);return!o||!o[1]?null:(e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/")+o[1]}const dde=Ct.create({name:"youtube",group:"block",draggable:!0,atom:!0,addOptions(){return{allowFullscreen:!0,autoplay:!1,nocookie:!1,controls:!0,HTMLAttributes:{}}},addAttributes(){return{src:{default:null},width:{default:null,parseHTML:t=>Number.parseInt(t.style.width)||null,renderHTML:t=>t.width?{style:`width: ${t.width}%`}:{}}}},parseHTML(){return[{tag:"iframe[src]"}]},renderHTML({HTMLAttributes:t}){return["iframe",Pe(this.options.HTMLAttributes,{with:200,height:120,allowfullscreen:this.options.allowFullscreen?"true":void 0,autoplay:this.options.autoplay?"true":void 0},t)]},addCommands(){return{embedYoutube:t=>({commands:e})=>{if(!fT(t.src))return!1;const n=ude({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,controls:this.options.controls,nocookie:this.options.nocookie});return n?e.insertContent({type:this.name,attrs:{...t,src:n}}):!1}}},addNodeView(){return({node:t})=>{const e=document.createElement("iframe");e.src=t.attrs.src;const n=document.createElement("div");return n.style.cursor="default",n.style.marginInline="auto",n.style.width=`${t.attrs.width}%`,n.appendChild(e),{dom:n}}}}),bT=(t,e)=>{document.documentElement.style.setProperty(t,e)};function pde(t,e){let n=null,a=null;return(...r)=>{n?a=r:(t(...r),n=setTimeout(()=>{n=null,a&&(t(...a),a=null)},e))}}const Ade=[ole.configure({horizontalRule:!1,hardBreak:!1,codeBlock:!1}),Yse.configure({includeChildren:!0,showOnlyCurrent:!0,placeholder:({editor:t,node:e})=>{const n=t.options.editorProps.placeholder;switch(e.type.name){case Ag.name:return n?.imageCaption;default:return n?.paragraph}}}),Vue,Hse,hN,sce,oce,cce.configure({types:["heading","paragraph"]}),fN,bN,ice.configure({multicolor:!0}),$k,Jue,Gu,cT,que,dde,cde],mde=()=>{const{editor:t,contentElement:e}=Me(),n=F.useCallback(({editor:u})=>u.isActive("table"),[]),a=F.useCallback(()=>{const u=hm(t,"table");return u?{getBoundingClientRect:()=>u.getBoundingClientRect()}:null},[t]),r=F.useCallback((u,d)=>{const p=`add${u}${d}`;return()=>t.chain().focus()[p]().run()},[t]),i=F.useCallback(u=>{const d=`delete${u}`;return()=>t.chain().focus()[d]().run()},[t]),o=F.useCallback(u=>{const d=`toggleHeader${u}`;return()=>t.chain().focus()[d]().run()},[t]),s=F.useCallback(()=>t.chain().focus().mergeCells().run(),[t]),c=F.useCallback(()=>t.chain().focus().splitCell().run(),[t]),l=F.useCallback(()=>t.chain().focus().deleteTable().run(),[t]);return w.jsxs(Bm,{editor:t,pluginKey:"table-bubble",shouldShow:n,updateDelay:100,appendTo:()=>e.current,getReferencedVirtualElement:a,options:{placement:"top"},children:[w.jsxs(Pa,{children:[w.jsx(ye,{icon:"RowInsertTop",tooltip:"Add row above",onClick:r("Row","Before")}),w.jsx(ye,{icon:"RowInsertBottom",tooltip:"Add row below",onClick:r("Row","After")}),w.jsx(ye,{icon:"ColInsertLeft",tooltip:"Add column before",onClick:r("Column","Before")}),w.jsx(ye,{icon:"ColInsertRight",tooltip:"Add column after",onClick:r("Column","After")}),w.jsx(ye,{icon:"SplitCell",tooltip:"Split cell",onClick:c}),w.jsx(ye,{icon:"MergeCell",tooltip:"Merge cells",onClick:s})]}),w.jsxs(Pa,{style:{justifyContent:"center"},children:[w.jsx(ye,{icon:"RowHeader",tooltip:"Toggle row header",onClick:o("Row")}),w.jsx(ye,{icon:"ColHeader",tooltip:"Toggle column header",onClick:o("Column")}),w.jsx(ye,{icon:"RowRemove",tooltip:"Delete row",onClick:i("Row")}),w.jsx(ye,{icon:"ColRemove",tooltip:"Delete column",onClick:i("Column")}),w.jsx(ye,{icon:"Trash",tooltip:"Delete table",onClick:l})]})]})},hT=F.forwardRef(({ssr:t=!1,output:e="html",readonly:n=!1,disabled:a=!1,initialContent:r,placeholder:i,hideMenuBar:o=!1,hideStatusBar:s=!1,hideBubbleMenu:c=!0,contentMinHeight:l=200,contentMaxHeight:u,onContentChange:d},p)=>{const A=!n&&!a,m=A&&c,g=F.useCallback(pde(k=>d?.(k),1500),[]),f=F.useCallback(k=>{const _=e==="html"?k.isEmpty?"":k.getHTML():k.getJSON();g(_)},[g,e]),h={ref:p,placeholder:i,extensions:Ade,content:r,editable:A,immediatelyRender:!t,shouldRerenderOnTransaction:!1,autofocus:!1,onUpdate:({editor:k})=>f(k)};F.useEffect(()=>{bT("--rte-editor-min-height",`${l}px`),bT("--rte-editor-max-height",`${u}px`)},[u,l]);const y=m&&w.jsxs(w.Fragment,{children:[w.jsx(U8,{}),w.jsx(dse,{}),w.jsx(H8,{}),w.jsx(mde,{})]});return w.jsxs(Vae,{editorOptions:h,slotBefore:!o&&w.jsx(aoe,{}),slotAfter:!s&&w.jsx(coe,{}),children:[y,w.jsx(ooe,{})]})});hT.displayName="TiptapEditor";class zu{constructor(e,n,a){this.normal=n,this.property=e,a&&(this.space=a)}}zu.prototype.normal={},zu.prototype.property={},zu.prototype.space=void 0;function yT(t,e){const n={},a={};for(const r of t)Object.assign(n,r.property),Object.assign(a,r.normal);return new zu(n,a,e)}function Hu(t){return t.toLowerCase()}class Mn{constructor(e,n){this.attribute=n,this.property=e}}Mn.prototype.attribute="",Mn.prototype.booleanish=!1,Mn.prototype.boolean=!1,Mn.prototype.commaOrSpaceSeparated=!1,Mn.prototype.commaSeparated=!1,Mn.prototype.defined=!1,Mn.prototype.mustUseProperty=!1,Mn.prototype.number=!1,Mn.prototype.overloadedBoolean=!1,Mn.prototype.property="",Mn.prototype.spaceSeparated=!1,Mn.prototype.space=void 0;let gde=0;const De=Wo(),St=Wo(),mC=Wo(),J=Wo(),ot=Wo(),Bc=Wo(),Vn=Wo();function Wo(){return 2**++gde}const gC=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:St,commaOrSpaceSeparated:Vn,commaSeparated:Bc,number:J,overloadedBoolean:mC,spaceSeparated:ot},Symbol.toStringTag,{value:"Module"})),fC=Object.keys(gC);class bC extends Mn{constructor(e,n,a,r){let i=-1;if(super(e,n),wT(this,"space",r),typeof a=="number")for(;++i<fC.length;){const o=fC[i];wT(this,fC[i],(a&gC[o])===gC[o])}}}bC.prototype.defined=!0;function wT(t,e,n){n&&(t[e]=n)}function Ec(t){const e={},n={};for(const[a,r]of Object.entries(t.properties)){const i=new bC(a,t.transform(t.attributes||{},a),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),e[a]=i,n[Hu(a)]=a,n[Hu(i.attribute)]=a}return new zu(e,n,t.space)}const kT=Ec({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:ot,ariaCurrent:null,ariaDescribedBy:ot,ariaDetails:null,ariaDisabled:St,ariaDropEffect:ot,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:ot,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ot,ariaLevel:J,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:ot,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:ot,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:St,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function CT(t,e){return e in t?t[e]:e}function _T(t,e){return CT(t,e.toLowerCase())}const fde=Ec({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bc,acceptCharset:ot,accessKey:ot,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:ot,autoFocus:De,autoPlay:De,blocking:ot,capture:null,charSet:null,checked:De,cite:null,className:ot,cols:J,colSpan:null,content:null,contentEditable:St,controls:De,controlsList:ot,coords:J|Bc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:mC,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:ot,height:J,hidden:mC,high:J,href:null,hrefLang:null,htmlFor:ot,httpEquiv:ot,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:ot,itemRef:ot,itemScope:De,itemType:ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:De,optimum:J,pattern:null,ping:ot,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:ot,required:De,reversed:De,rows:J,rowSpan:J,sandbox:ot,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:St,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ot,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:J,security:null,unselectable:null},space:"html",transform:_T}),bde=Ec({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Vn,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:ot,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bc,g2:Bc,glyphName:Bc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:CT}),BT=Ec({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),ET=Ec({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_T}),vT=Ec({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),hde={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},yde=/[A-Z]/g,xT=/-[a-z]/g,wde=/^data[-\w.:]+$/i;function gg(t,e){const n=Hu(e);let a=e,r=Mn;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wde.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(xT,Cde);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!xT.test(i)){let o=i.replace(yde,kde);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=bC}return new r(a,e)}function kde(t){return"-"+t.toLowerCase()}function Cde(t){return t.charAt(1).toUpperCase()}const Uu=yT([kT,fde,BT,ET,vT],"html"),Yi=yT([kT,bde,BT,ET,vT],"svg");function QT(t){const e=[],n=String(t||"");let a=n.indexOf(","),r=0,i=!1;for(;!i;){a===-1&&(a=n.length,i=!0);const o=n.slice(r,a).trim();(o||!i)&&e.push(o),r=a+1,a=n.indexOf(",",r)}return e}function IT(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const DT=/[#.]/g;function _de(t,e){const n=t||"",a={};let r=0,i,o;for(;r<n.length;){DT.lastIndex=r;const s=DT.exec(n),c=n.slice(r,s?s.index:n.length);c&&(i?i==="#"?a.id=c:Array.isArray(a.className)?a.className.push(c):a.className=[c]:o=c,r+=c.length),s&&(i=s[0],r++)}return{type:"element",tagName:o||e||"div",properties:a,children:[]}}function ST(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function FT(t){return t.join(" ").trim()}function OT(t,e,n){const a=n?xde(n):void 0;function r(i,o,...s){let c;if(i==null){c={type:"root",children:[]};const l=o;s.unshift(l)}else{c=_de(i,e);const l=c.tagName.toLowerCase(),u=a?a.get(l):void 0;if(c.tagName=u||l,Bde(o))s.unshift(o);else for(const[d,p]of Object.entries(o))Ede(t,c.properties,d,p)}for(const l of s)hC(c.children,l);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return r}function Bde(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const a of n){const r=e[a];if(r&&typeof r=="object"){if(!Array.isArray(r))return!0;const i=r;for(const o of i)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function Ede(t,e,n,a){const r=gg(t,n);let i;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;i=a}else typeof a=="boolean"?i=a:typeof a=="string"?r.spaceSeparated?i=ST(a):r.commaSeparated?i=QT(a):r.commaOrSpaceSeparated?i=ST(QT(a).join(" ")):i=NT(r,r.property,a):Array.isArray(a)?i=[...a]:i=r.property==="style"?vde(a):String(a);if(Array.isArray(i)){const o=[];for(const s of i)o.push(NT(r,r.property,s));i=o}r.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[r.property]=i}}function hC(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)hC(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?hC(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function NT(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Hu(n)===Hu(e)))return!0}return n}function vde(t){const e=[];for(const[n,a]of Object.entries(t))e.push([n,a].join(": "));return e.join("; ")}function xde(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const Qde=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Ide=OT(Uu,"div"),Dde=OT(Yi,"g",Qde);function Sde(t){const e=String(t),n=[];return{toOffset:r,toPoint:a};function a(i){if(typeof i=="number"&&i>-1&&i<=e.length){let o=0;for(;;){let s=n[o];if(s===void 0){const c=TT(e,n[o-1]);s=c===-1?e.length+1:c+1,n[o]=s}if(s>i)return{line:o+1,column:i-(o>0?n[o-1]:0)+1,offset:i};o++}}}function r(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const s=n[n.length-1],c=TT(e,s),l=c===-1?e.length+1:c+1;if(s===l)break;n.push(l)}const o=(i.line>1?n[i.line-2]:0)+i.column-1;if(o<n[i.line-1])return o}}}function TT(t,e){const n=t.indexOf("\r",e),a=t.indexOf(`
|
|
270
270
|
`,e);return a===-1?n:n===-1||n+1===a?a:n<a?n:a}const Fde={svg:"http://www.w3.org/2000/svg"},$T={}.hasOwnProperty,Ode=Object.prototype;function Nde(t,e){const n=e||{};return yC({file:n.file||void 0,location:!1,schema:n.space==="svg"?Yi:Uu,verbose:n.verbose||!1},t)}function yC(t,e){let n;switch(e.nodeName){case"#comment":{const a=e;return n={type:"comment",value:a.data},fg(t,a,n),n}case"#document":case"#document-fragment":{const a=e,r="mode"in a?a.mode==="quirks"||a.mode==="limited-quirks":!1;if(n={type:"root",children:LT(t,e.childNodes),data:{quirksMode:r}},t.file&&t.location){const i=String(t.file),o=Sde(i),s=o.toPoint(0),c=o.toPoint(i.length);n.position={start:s,end:c}}return n}case"#documentType":{const a=e;return n={type:"doctype"},fg(t,a,n),n}case"#text":{const a=e;return n={type:"text",value:a.value},fg(t,a,n),n}default:return n=Tde(t,e),n}}function LT(t,e){let n=-1;const a=[];for(;++n<e.length;){const r=yC(t,e[n]);a.push(r)}return a}function Tde(t,e){const n=t.schema;t.schema=e.namespaceURI===Fde.svg?Yi:Uu;let a=-1;const r={};for(;++a<e.attrs.length;){const s=e.attrs[a],c=(s.prefix?s.prefix+":":"")+s.name;$T.call(Ode,c)||(r[c]=s.value)}const o=(t.schema.space==="svg"?Dde:Ide)(e.tagName,r,LT(t,e.childNodes));if(fg(t,e,o),o.tagName==="template"){const s=e,c=s.sourceCodeLocation,l=c&&c.startTag&&vc(c.startTag),u=c&&c.endTag&&vc(c.endTag),d=yC(t,s.content);l&&u&&t.file&&(d.position={start:l.end,end:u.start}),o.content=d}return t.schema=n,o}function fg(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const a=$de(t,n,e.sourceCodeLocation);a&&(t.location=!0,n.position=a)}}function $de(t,e,n){const a=vc(n);if(e.type==="element"){const r=e.children[e.children.length-1];if(a&&!n.endTag&&r&&r.position&&r.position.end&&(a.end=Object.assign({},r.position.end)),t.verbose){const i={};let o;if(n.attrs)for(o in n.attrs)$T.call(n.attrs,o)&&(i[gg(t.schema,o).property]=vc(n.attrs[o]));n.startTag;const s=vc(n.startTag),c=n.endTag?vc(n.endTag):void 0,l={opening:s};c&&(l.closing=c),l.properties=i,e.data={position:l}}}return a}function vc(t){const e=MT({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=MT({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function MT(t){return t.line&&t.column?t:void 0}const Lde=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),At="�";var E;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(E||(E={}));const Rn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function RT(t){return t>=55296&&t<=57343}function Mde(t){return t>=56320&&t<=57343}function Rde(t,e){return(t-55296)*1024+9216+e}function PT(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function jT(t){return t>=64976&&t<=65007||Lde.has(t)}var q;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(q||(q={}));const Pde=65536;class jde{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Pde,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:a,col:r,offset:i}=this,o=r+n,s=i+n;return{code:e,startLine:a,endLine:a,startCol:o,endCol:o,startOffset:s,endOffset:s}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Mde(n))return this.pos++,this._addGap(),Rde(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,E.EOF;return this._err(q.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let a=0;a<e.length;a++)if((this.html.charCodeAt(this.pos+a)|32)!==e.charCodeAt(a))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,E.EOF;const a=this.html.charCodeAt(n);return a===E.CARRIAGE_RETURN?E.LINE_FEED:a}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,E.EOF;let e=this.html.charCodeAt(this.pos);return e===E.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,E.LINE_FEED):e===E.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,RT(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===E.LINE_FEED||e===E.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){PT(e)?this._err(q.controlCharacterInInputStream):jT(e)&&this._err(q.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var je;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(je||(je={}));function qT(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const qde=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),Gde=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function zde(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Gde.get(t))!==null&&e!==void 0?e:t}var Ut;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Ut||(Ut={}));const Hde=32;var Ki;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ki||(Ki={}));function wC(t){return t>=Ut.ZERO&&t<=Ut.NINE}function Ude(t){return t>=Ut.UPPER_A&&t<=Ut.UPPER_F||t>=Ut.LOWER_A&&t<=Ut.LOWER_F}function Zde(t){return t>=Ut.UPPER_A&&t<=Ut.UPPER_Z||t>=Ut.LOWER_A&&t<=Ut.LOWER_Z||wC(t)}function Yde(t){return t===Ut.EQUALS||Zde(t)}var Zt;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Zt||(Zt={}));var ni;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(ni||(ni={}));class Kde{constructor(e,n,a){this.decodeTree=e,this.emitCodePoint=n,this.errors=a,this.state=Zt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ni.Strict}startEntity(e){this.decodeMode=e,this.state=Zt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Zt.EntityStart:return e.charCodeAt(n)===Ut.NUM?(this.state=Zt.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Zt.NamedEntity,this.stateNamedEntity(e,n));case Zt.NumericStart:return this.stateNumericStart(e,n);case Zt.NumericDecimal:return this.stateNumericDecimal(e,n);case Zt.NumericHex:return this.stateNumericHex(e,n);case Zt.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Hde)===Ut.LOWER_X?(this.state=Zt.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Zt.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,a,r){if(n!==a){const i=a-n;this.result=this.result*Math.pow(r,i)+Number.parseInt(e.substr(n,i),r),this.consumed+=i}}stateNumericHex(e,n){const a=n;for(;n<e.length;){const r=e.charCodeAt(n);if(wC(r)||Ude(r))n+=1;else return this.addToNumericResult(e,a,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,a,n,16),-1}stateNumericDecimal(e,n){const a=n;for(;n<e.length;){const r=e.charCodeAt(n);if(wC(r))n+=1;else return this.addToNumericResult(e,a,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,a,n,10),-1}emitNumericEntity(e,n){var a;if(this.consumed<=n)return(a=this.errors)===null||a===void 0||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ut.SEMI)this.consumed+=1;else if(this.decodeMode===ni.Strict)return 0;return this.emitCodePoint(zde(this.result),this.consumed),this.errors&&(e!==Ut.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:a}=this;let r=a[this.treeIndex],i=(r&Ki.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=Wde(a,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===ni.Attribute&&(i===0||Yde(o))?0:this.emitNotTerminatedNamedEntity();if(r=a[this.treeIndex],i=(r&Ki.VALUE_LENGTH)>>14,i!==0){if(o===Ut.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ni.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:a}=this,r=(a[n]&Ki.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,a){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~Ki.VALUE_LENGTH:r[e+1],a),n===3&&this.emitCodePoint(r[e+2],a),a}end(){var e;switch(this.state){case Zt.NamedEntity:return this.result!==0&&(this.decodeMode!==ni.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Zt.NumericDecimal:return this.emitNumericEntity(0,2);case Zt.NumericHex:return this.emitNumericEntity(0,3);case Zt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Zt.EntityStart:return 0}}}function Wde(t,e,n,a){const r=(e&Ki.BRANCH_LENGTH)>>7,i=e&Ki.JUMP_TABLE;if(r===0)return i!==0&&a===i?n:-1;if(i){const c=a-i;return c<0||c>=r?-1:t[n+c]-1}let o=n,s=o+r-1;for(;o<=s;){const c=o+s>>>1,l=t[c];if(l<a)o=c+1;else if(l>a)s=c-1;else return t[c+r]}return-1}var Y;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Y||(Y={}));var Jo;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Jo||(Jo={}));var ba;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(ba||(ba={}));var N;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(N||(N={}));var b;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(b||(b={}));const Jde=new Map([[N.A,b.A],[N.ADDRESS,b.ADDRESS],[N.ANNOTATION_XML,b.ANNOTATION_XML],[N.APPLET,b.APPLET],[N.AREA,b.AREA],[N.ARTICLE,b.ARTICLE],[N.ASIDE,b.ASIDE],[N.B,b.B],[N.BASE,b.BASE],[N.BASEFONT,b.BASEFONT],[N.BGSOUND,b.BGSOUND],[N.BIG,b.BIG],[N.BLOCKQUOTE,b.BLOCKQUOTE],[N.BODY,b.BODY],[N.BR,b.BR],[N.BUTTON,b.BUTTON],[N.CAPTION,b.CAPTION],[N.CENTER,b.CENTER],[N.CODE,b.CODE],[N.COL,b.COL],[N.COLGROUP,b.COLGROUP],[N.DD,b.DD],[N.DESC,b.DESC],[N.DETAILS,b.DETAILS],[N.DIALOG,b.DIALOG],[N.DIR,b.DIR],[N.DIV,b.DIV],[N.DL,b.DL],[N.DT,b.DT],[N.EM,b.EM],[N.EMBED,b.EMBED],[N.FIELDSET,b.FIELDSET],[N.FIGCAPTION,b.FIGCAPTION],[N.FIGURE,b.FIGURE],[N.FONT,b.FONT],[N.FOOTER,b.FOOTER],[N.FOREIGN_OBJECT,b.FOREIGN_OBJECT],[N.FORM,b.FORM],[N.FRAME,b.FRAME],[N.FRAMESET,b.FRAMESET],[N.H1,b.H1],[N.H2,b.H2],[N.H3,b.H3],[N.H4,b.H4],[N.H5,b.H5],[N.H6,b.H6],[N.HEAD,b.HEAD],[N.HEADER,b.HEADER],[N.HGROUP,b.HGROUP],[N.HR,b.HR],[N.HTML,b.HTML],[N.I,b.I],[N.IMG,b.IMG],[N.IMAGE,b.IMAGE],[N.INPUT,b.INPUT],[N.IFRAME,b.IFRAME],[N.KEYGEN,b.KEYGEN],[N.LABEL,b.LABEL],[N.LI,b.LI],[N.LINK,b.LINK],[N.LISTING,b.LISTING],[N.MAIN,b.MAIN],[N.MALIGNMARK,b.MALIGNMARK],[N.MARQUEE,b.MARQUEE],[N.MATH,b.MATH],[N.MENU,b.MENU],[N.META,b.META],[N.MGLYPH,b.MGLYPH],[N.MI,b.MI],[N.MO,b.MO],[N.MN,b.MN],[N.MS,b.MS],[N.MTEXT,b.MTEXT],[N.NAV,b.NAV],[N.NOBR,b.NOBR],[N.NOFRAMES,b.NOFRAMES],[N.NOEMBED,b.NOEMBED],[N.NOSCRIPT,b.NOSCRIPT],[N.OBJECT,b.OBJECT],[N.OL,b.OL],[N.OPTGROUP,b.OPTGROUP],[N.OPTION,b.OPTION],[N.P,b.P],[N.PARAM,b.PARAM],[N.PLAINTEXT,b.PLAINTEXT],[N.PRE,b.PRE],[N.RB,b.RB],[N.RP,b.RP],[N.RT,b.RT],[N.RTC,b.RTC],[N.RUBY,b.RUBY],[N.S,b.S],[N.SCRIPT,b.SCRIPT],[N.SEARCH,b.SEARCH],[N.SECTION,b.SECTION],[N.SELECT,b.SELECT],[N.SOURCE,b.SOURCE],[N.SMALL,b.SMALL],[N.SPAN,b.SPAN],[N.STRIKE,b.STRIKE],[N.STRONG,b.STRONG],[N.STYLE,b.STYLE],[N.SUB,b.SUB],[N.SUMMARY,b.SUMMARY],[N.SUP,b.SUP],[N.TABLE,b.TABLE],[N.TBODY,b.TBODY],[N.TEMPLATE,b.TEMPLATE],[N.TEXTAREA,b.TEXTAREA],[N.TFOOT,b.TFOOT],[N.TD,b.TD],[N.TH,b.TH],[N.THEAD,b.THEAD],[N.TITLE,b.TITLE],[N.TR,b.TR],[N.TRACK,b.TRACK],[N.TT,b.TT],[N.U,b.U],[N.UL,b.UL],[N.SVG,b.SVG],[N.VAR,b.VAR],[N.WBR,b.WBR],[N.XMP,b.XMP]]);function bg(t){var e;return(e=Jde.get(t))!==null&&e!==void 0?e:b.UNKNOWN}const K=b,Vde={[Y.HTML]:new Set([K.ADDRESS,K.APPLET,K.AREA,K.ARTICLE,K.ASIDE,K.BASE,K.BASEFONT,K.BGSOUND,K.BLOCKQUOTE,K.BODY,K.BR,K.BUTTON,K.CAPTION,K.CENTER,K.COL,K.COLGROUP,K.DD,K.DETAILS,K.DIR,K.DIV,K.DL,K.DT,K.EMBED,K.FIELDSET,K.FIGCAPTION,K.FIGURE,K.FOOTER,K.FORM,K.FRAME,K.FRAMESET,K.H1,K.H2,K.H3,K.H4,K.H5,K.H6,K.HEAD,K.HEADER,K.HGROUP,K.HR,K.HTML,K.IFRAME,K.IMG,K.INPUT,K.LI,K.LINK,K.LISTING,K.MAIN,K.MARQUEE,K.MENU,K.META,K.NAV,K.NOEMBED,K.NOFRAMES,K.NOSCRIPT,K.OBJECT,K.OL,K.P,K.PARAM,K.PLAINTEXT,K.PRE,K.SCRIPT,K.SECTION,K.SELECT,K.SOURCE,K.STYLE,K.SUMMARY,K.TABLE,K.TBODY,K.TD,K.TEMPLATE,K.TEXTAREA,K.TFOOT,K.TH,K.THEAD,K.TITLE,K.TR,K.TRACK,K.UL,K.WBR,K.XMP]),[Y.MATHML]:new Set([K.MI,K.MO,K.MN,K.MS,K.MTEXT,K.ANNOTATION_XML]),[Y.SVG]:new Set([K.TITLE,K.FOREIGN_OBJECT,K.DESC]),[Y.XLINK]:new Set,[Y.XML]:new Set,[Y.XMLNS]:new Set},kC=new Set([K.H1,K.H2,K.H3,K.H4,K.H5,K.H6]);N.STYLE,N.SCRIPT,N.XMP,N.IFRAME,N.NOEMBED,N.NOFRAMES,N.PLAINTEXT;var v;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(v||(v={}));const Pn={DATA:v.DATA,RCDATA:v.RCDATA,RAWTEXT:v.RAWTEXT,SCRIPT_DATA:v.SCRIPT_DATA,PLAINTEXT:v.PLAINTEXT,CDATA_SECTION:v.CDATA_SECTION};function Xde(t){return t>=E.DIGIT_0&&t<=E.DIGIT_9}function Zu(t){return t>=E.LATIN_CAPITAL_A&&t<=E.LATIN_CAPITAL_Z}function epe(t){return t>=E.LATIN_SMALL_A&&t<=E.LATIN_SMALL_Z}function Wi(t){return epe(t)||Zu(t)}function GT(t){return Wi(t)||Xde(t)}function hg(t){return t+32}function zT(t){return t===E.SPACE||t===E.LINE_FEED||t===E.TABULATION||t===E.FORM_FEED}function HT(t){return zT(t)||t===E.SOLIDUS||t===E.GREATER_THAN_SIGN}function tpe(t){return t===E.NULL?q.nullCharacterReference:t>1114111?q.characterReferenceOutsideUnicodeRange:RT(t)?q.surrogateCharacterReference:jT(t)?q.noncharacterCharacterReference:PT(t)||t===E.CARRIAGE_RETURN?q.controlCharacterReference:null}class npe{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=v.DATA,this.returnState=v.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new jde(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Kde(qde,(a,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(a)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{const r=tpe(a);r&&this._err(r,1)}}:void 0)}_err(e,n=0){var a,r;(r=(a=this.handler).onParseError)===null||r===void 0||r.call(a,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,a){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||a?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:je.START_TAG,tagName:"",tagID:b.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:je.END_TAG,tagName:"",tagID:b.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:je.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:je.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const a=this.currentToken;if(qT(a,this.currentAttr.name)===null){if(a.attrs.push(this.currentAttr),a.location&&this.currentLocation){const r=(e=(n=a.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(q.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=bg(e.tagName),e.type===je.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(q.endTagWithAttributes),e.selfClosing&&this._err(q.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case je.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case je.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case je.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:je.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=zT(e)?je.WHITESPACE_CHARACTER:e===E.NULL?je.NULL_CHARACTER:je.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(je.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=v.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ni.Attribute:ni.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===v.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===v.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===v.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case v.DATA:{this._stateData(e);break}case v.RCDATA:{this._stateRcdata(e);break}case v.RAWTEXT:{this._stateRawtext(e);break}case v.SCRIPT_DATA:{this._stateScriptData(e);break}case v.PLAINTEXT:{this._statePlaintext(e);break}case v.TAG_OPEN:{this._stateTagOpen(e);break}case v.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case v.TAG_NAME:{this._stateTagName(e);break}case v.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case v.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case v.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case v.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case v.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case v.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case v.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case v.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case v.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case v.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case v.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case v.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case v.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case v.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case v.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case v.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case v.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case v.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case v.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case v.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case v.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case v.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case v.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case v.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case v.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case v.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case v.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case v.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case v.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case v.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case v.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case v.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case v.BOGUS_COMMENT:{this._stateBogusComment(e);break}case v.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case v.COMMENT_START:{this._stateCommentStart(e);break}case v.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case v.COMMENT:{this._stateComment(e);break}case v.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case v.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case v.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case v.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case v.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case v.COMMENT_END:{this._stateCommentEnd(e);break}case v.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case v.DOCTYPE:{this._stateDoctype(e);break}case v.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case v.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case v.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case v.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case v.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case v.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case v.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case v.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case v.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case v.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case v.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case v.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case v.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case v.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case v.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case v.CDATA_SECTION:{this._stateCdataSection(e);break}case v.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case v.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case v.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case v.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case E.LESS_THAN_SIGN:{this.state=v.TAG_OPEN;break}case E.AMPERSAND:{this._startCharacterReference();break}case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitCodePoint(e);break}case E.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case E.AMPERSAND:{this._startCharacterReference();break}case E.LESS_THAN_SIGN:{this.state=v.RCDATA_LESS_THAN_SIGN;break}case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(At);break}case E.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case E.LESS_THAN_SIGN:{this.state=v.RAWTEXT_LESS_THAN_SIGN;break}case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(At);break}case E.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_LESS_THAN_SIGN;break}case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(At);break}case E.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(At);break}case E.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Wi(e))this._createStartTagToken(),this.state=v.TAG_NAME,this._stateTagName(e);else switch(e){case E.EXCLAMATION_MARK:{this.state=v.MARKUP_DECLARATION_OPEN;break}case E.SOLIDUS:{this.state=v.END_TAG_OPEN;break}case E.QUESTION_MARK:{this._err(q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=v.BOGUS_COMMENT,this._stateBogusComment(e);break}case E.EOF:{this._err(q.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(q.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=v.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Wi(e))this._createEndTagToken(),this.state=v.TAG_NAME,this._stateTagName(e);else switch(e){case E.GREATER_THAN_SIGN:{this._err(q.missingEndTagName),this.state=v.DATA;break}case E.EOF:{this._err(q.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=v.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this.state=v.BEFORE_ATTRIBUTE_NAME;break}case E.SOLIDUS:{this.state=v.SELF_CLOSING_START_TAG;break}case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentTagToken();break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.tagName+=At;break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Zu(e)?hg(e):e)}}_stateRcdataLessThanSign(e){e===E.SOLIDUS?this.state=v.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=v.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Wi(e)?(this.state=v.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=v.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=v.BEFORE_ATTRIBUTE_NAME,!1;case E.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=v.SELF_CLOSING_START_TAG,!1;case E.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=v.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=v.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===E.SOLIDUS?this.state=v.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=v.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Wi(e)?(this.state=v.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=v.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=v.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case E.SOLIDUS:{this.state=v.SCRIPT_DATA_END_TAG_OPEN;break}case E.EXCLAMATION_MARK:{this.state=v.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=v.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Wi(e)?(this.state=v.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=v.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=v.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===E.HYPHEN_MINUS?(this.state=v.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=v.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===E.HYPHEN_MINUS?(this.state=v.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=v.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case E.HYPHEN_MINUS:{this.state=v.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(At);break}case E.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case E.HYPHEN_MINUS:{this.state=v.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.state=v.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case E.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=v.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case E.HYPHEN_MINUS:{this._emitChars("-");break}case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case E.GREATER_THAN_SIGN:{this.state=v.SCRIPT_DATA,this._emitChars(">");break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.state=v.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case E.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=v.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===E.SOLIDUS?this.state=v.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Wi(e)?(this._emitChars("<"),this.state=v.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=v.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Wi(e)?(this.state=v.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=v.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=v.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Rn.SCRIPT,!1)&&HT(this.preprocessor.peek(Rn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Rn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=v.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case E.HYPHEN_MINUS:{this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case E.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(At);break}case E.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case E.HYPHEN_MINUS:{this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case E.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case E.HYPHEN_MINUS:{this._emitChars("-");break}case E.LESS_THAN_SIGN:{this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case E.GREATER_THAN_SIGN:{this.state=v.SCRIPT_DATA,this._emitChars(">");break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case E.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===E.SOLIDUS?(this.state=v.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Rn.SCRIPT,!1)&&HT(this.preprocessor.peek(Rn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Rn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=v.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=v.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.SOLIDUS:case E.GREATER_THAN_SIGN:case E.EOF:{this.state=v.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case E.EQUALS_SIGN:{this._err(q.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=v.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=v.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:case E.SOLIDUS:case E.GREATER_THAN_SIGN:case E.EOF:{this._leaveAttrName(),this.state=v.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case E.EQUALS_SIGN:{this._leaveAttrName(),this.state=v.BEFORE_ATTRIBUTE_VALUE;break}case E.QUOTATION_MARK:case E.APOSTROPHE:case E.LESS_THAN_SIGN:{this._err(q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.name+=At;break}default:this.currentAttr.name+=String.fromCodePoint(Zu(e)?hg(e):e)}}_stateAfterAttributeName(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.SOLIDUS:{this.state=v.SELF_CLOSING_START_TAG;break}case E.EQUALS_SIGN:{this.state=v.BEFORE_ATTRIBUTE_VALUE;break}case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentTagToken();break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=v.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.QUOTATION_MARK:{this.state=v.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case E.APOSTROPHE:{this.state=v.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case E.GREATER_THAN_SIGN:{this._err(q.missingAttributeValue),this.state=v.DATA,this.emitCurrentTagToken();break}default:this.state=v.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case E.QUOTATION_MARK:{this.state=v.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case E.AMPERSAND:{this._startCharacterReference();break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=At;break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case E.APOSTROPHE:{this.state=v.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case E.AMPERSAND:{this._startCharacterReference();break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=At;break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this._leaveAttrValue(),this.state=v.BEFORE_ATTRIBUTE_NAME;break}case E.AMPERSAND:{this._startCharacterReference();break}case E.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=v.DATA,this.emitCurrentTagToken();break}case E.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=At;break}case E.QUOTATION_MARK:case E.APOSTROPHE:case E.LESS_THAN_SIGN:case E.EQUALS_SIGN:case E.GRAVE_ACCENT:{this._err(q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this._leaveAttrValue(),this.state=v.BEFORE_ATTRIBUTE_NAME;break}case E.SOLIDUS:{this._leaveAttrValue(),this.state=v.SELF_CLOSING_START_TAG;break}case E.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=v.DATA,this.emitCurrentTagToken();break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBetweenAttributes),this.state=v.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case E.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=v.DATA,this.emitCurrentTagToken();break}case E.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._err(q.unexpectedSolidusInTag),this.state=v.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentComment(n);break}case E.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.data+=At;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Rn.DASH_DASH,!0)?(this._createCommentToken(Rn.DASH_DASH.length+1),this.state=v.COMMENT_START):this._consumeSequenceIfMatch(Rn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Rn.DOCTYPE.length+1),this.state=v.DOCTYPE):this._consumeSequenceIfMatch(Rn.CDATA_START,!0)?this.inForeignNode?this.state=v.CDATA_SECTION:(this._err(q.cdataInHtmlContent),this._createCommentToken(Rn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=v.BOGUS_COMMENT):this._ensureHibernation()||(this._err(q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=v.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case E.HYPHEN_MINUS:{this.state=v.COMMENT_START_DASH;break}case E.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=v.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=v.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case E.HYPHEN_MINUS:{this.state=v.COMMENT_END;break}case E.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=v.DATA,this.emitCurrentComment(n);break}case E.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=v.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case E.HYPHEN_MINUS:{this.state=v.COMMENT_END_DASH;break}case E.LESS_THAN_SIGN:{n.data+="<",this.state=v.COMMENT_LESS_THAN_SIGN;break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.data+=At;break}case E.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case E.EXCLAMATION_MARK:{n.data+="!",this.state=v.COMMENT_LESS_THAN_SIGN_BANG;break}case E.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=v.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===E.HYPHEN_MINUS?this.state=v.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=v.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===E.HYPHEN_MINUS?this.state=v.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=v.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==E.GREATER_THAN_SIGN&&e!==E.EOF&&this._err(q.nestedComment),this.state=v.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case E.HYPHEN_MINUS:{this.state=v.COMMENT_END;break}case E.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=v.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentComment(n);break}case E.EXCLAMATION_MARK:{this.state=v.COMMENT_END_BANG;break}case E.HYPHEN_MINUS:{n.data+="-";break}case E.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=v.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case E.HYPHEN_MINUS:{n.data+="--!",this.state=v.COMMENT_END_DASH;break}case E.GREATER_THAN_SIGN:{this._err(q.incorrectlyClosedComment),this.state=v.DATA,this.emitCurrentComment(n);break}case E.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=v.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this.state=v.BEFORE_DOCTYPE_NAME;break}case E.GREATER_THAN_SIGN:{this.state=v.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case E.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBeforeDoctypeName),this.state=v.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Zu(e))this._createDoctypeToken(String.fromCharCode(hg(e))),this.state=v.DOCTYPE_NAME;else switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.NULL:{this._err(q.unexpectedNullCharacter),this._createDoctypeToken(At),this.state=v.DOCTYPE_NAME;break}case E.GREATER_THAN_SIGN:{this._err(q.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=v.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this.state=v.AFTER_DOCTYPE_NAME;break}case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.name+=At;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Zu(e)?hg(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Rn.PUBLIC,!1)?this.state=v.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Rn.SYSTEM,!1)?this.state=v.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(q.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this.state=v.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case E.QUOTATION_MARK:{this._err(q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=v.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case E.APOSTROPHE:{this._err(q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=v.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case E.GREATER_THAN_SIGN:{this._err(q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.QUOTATION_MARK:{n.publicId="",this.state=v.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case E.APOSTROPHE:{n.publicId="",this.state=v.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case E.GREATER_THAN_SIGN:{this._err(q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case E.QUOTATION_MARK:{this.state=v.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.publicId+=At;break}case E.GREATER_THAN_SIGN:{this._err(q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case E.APOSTROPHE:{this.state=v.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.publicId+=At;break}case E.GREATER_THAN_SIGN:{this._err(q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this.state=v.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case E.GREATER_THAN_SIGN:{this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.QUOTATION_MARK:{this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case E.APOSTROPHE:{this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.QUOTATION_MARK:{n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case E.APOSTROPHE:{n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:{this.state=v.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case E.QUOTATION_MARK:{this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case E.APOSTROPHE:{this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case E.GREATER_THAN_SIGN:{this._err(q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.QUOTATION_MARK:{n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case E.APOSTROPHE:{n.systemId="",this.state=v.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case E.GREATER_THAN_SIGN:{this._err(q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=v.DATA,this.emitCurrentDoctype(n);break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case E.QUOTATION_MARK:{this.state=v.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.systemId+=At;break}case E.GREATER_THAN_SIGN:{this._err(q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case E.APOSTROPHE:{this.state=v.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case E.NULL:{this._err(q.unexpectedNullCharacter),n.systemId+=At;break}case E.GREATER_THAN_SIGN:{this._err(q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case E.SPACE:case E.LINE_FEED:case E.TABULATION:case E.FORM_FEED:break;case E.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=v.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case E.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=v.DATA;break}case E.NULL:{this._err(q.unexpectedNullCharacter);break}case E.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case E.RIGHT_SQUARE_BRACKET:{this.state=v.CDATA_SECTION_BRACKET;break}case E.EOF:{this._err(q.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===E.RIGHT_SQUARE_BRACKET?this.state=v.CDATA_SECTION_END:(this._emitChars("]"),this.state=v.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case E.GREATER_THAN_SIGN:{this.state=v.DATA;break}case E.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=v.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(E.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&>(this.preprocessor.peek(1))?v.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){GT(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===E.SEMICOLON&&this._err(q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const UT=new Set([b.DD,b.DT,b.LI,b.OPTGROUP,b.OPTION,b.P,b.RB,b.RP,b.RT,b.RTC]),ZT=new Set([...UT,b.CAPTION,b.COLGROUP,b.TBODY,b.TD,b.TFOOT,b.TH,b.THEAD,b.TR]),yg=new Set([b.APPLET,b.CAPTION,b.HTML,b.MARQUEE,b.OBJECT,b.TABLE,b.TD,b.TEMPLATE,b.TH]),ape=new Set([...yg,b.OL,b.UL]),rpe=new Set([...yg,b.BUTTON]),YT=new Set([b.ANNOTATION_XML,b.MI,b.MN,b.MO,b.MS,b.MTEXT]),KT=new Set([b.DESC,b.FOREIGN_OBJECT,b.TITLE]),ipe=new Set([b.TR,b.TEMPLATE,b.HTML]),ope=new Set([b.TBODY,b.TFOOT,b.THEAD,b.TEMPLATE,b.HTML]),spe=new Set([b.TABLE,b.TEMPLATE,b.HTML]),cpe=new Set([b.TD,b.TH]);class lpe{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,a){this.treeAdapter=n,this.handler=a,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=b.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===b.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Y.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const a=this._indexOf(e);this.items[a]=n,a===this.stackTop&&(this.current=n)}insertAfter(e,n,a){const r=this._indexOf(e)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,a),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Y.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const a=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(a,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(kC,Y.HTML)}popUntilTableCellPopped(){this.popUntilPopped(cpe,Y.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let a=this.stackTop;a>=0;a--)if(e.has(this.tagIDs[a])&&this.treeAdapter.getNamespaceURI(this.items[a])===n)return a;return-1}clearBackTo(e,n){const a=this._indexOfTagNames(e,n);this.shortenToLength(a+1)}clearBackToTableContext(){this.clearBackTo(spe,Y.HTML)}clearBackToTableBodyContext(){this.clearBackTo(ope,Y.HTML)}clearBackToTableRowContext(){this.clearBackTo(ipe,Y.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===b.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===b.HTML}hasInDynamicScope(e,n){for(let a=this.stackTop;a>=0;a--){const r=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case Y.HTML:{if(r===e)return!0;if(n.has(r))return!1;break}case Y.SVG:{if(KT.has(r))return!1;break}case Y.MATHML:{if(YT.has(r))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,yg)}hasInListItemScope(e){return this.hasInDynamicScope(e,ape)}hasInButtonScope(e){return this.hasInDynamicScope(e,rpe)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Y.HTML:{if(kC.has(n))return!0;if(yg.has(n))return!1;break}case Y.SVG:{if(KT.has(n))return!1;break}case Y.MATHML:{if(YT.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Y.HTML)switch(this.tagIDs[n]){case e:return!0;case b.TABLE:case b.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Y.HTML)switch(this.tagIDs[e]){case b.TBODY:case b.THEAD:case b.TFOOT:return!0;case b.TABLE:case b.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Y.HTML)switch(this.tagIDs[n]){case e:return!0;case b.OPTION:case b.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&UT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ZT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&ZT.has(this.currentTagId);)this.pop()}}const CC=3;var mr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(mr||(mr={}));const WT={type:mr.Marker};class upe{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const a=[],r=n.length,i=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let s=0;s<this.entries.length;s++){const c=this.entries[s];if(c.type===mr.Marker)break;const{element:l}=c;if(this.treeAdapter.getTagName(l)===i&&this.treeAdapter.getNamespaceURI(l)===o){const u=this.treeAdapter.getAttrList(l);u.length===r&&a.push({idx:s,attrs:u})}}return a}_ensureNoahArkCondition(e){if(this.entries.length<CC)return;const n=this.treeAdapter.getAttrList(e),a=this._getNoahArkConditionCandidates(e,n);if(a.length<CC)return;const r=new Map(n.map(o=>[o.name,o.value]));let i=0;for(let o=0;o<a.length;o++){const s=a[o];s.attrs.every(c=>r.get(c.name)===c.value)&&(i+=1,i>=CC&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(WT)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:mr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const a=this.entries.indexOf(this.bookmark);this.entries.splice(a,0,{type:mr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(WT);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(a=>a.type===mr.Marker||this.treeAdapter.getTagName(a.element)===e);return n&&n.type===mr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===mr.Element&&n.element===e)}}const Ji={createDocument(){return{nodeName:"#document",mode:ba.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const a=t.childNodes.indexOf(n);t.childNodes.splice(a,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,a){const r=t.childNodes.find(i=>i.nodeName==="#documentType");if(r)r.name=e,r.publicId=n,r.systemId=a;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:a,parentNode:null};Ji.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Ji.isTextNode(n)){n.value+=e;return}}Ji.appendChild(t,Ji.createTextNode(e))},insertTextBefore(t,e,n){const a=t.childNodes[t.childNodes.indexOf(n)-1];a&&Ji.isTextNode(a)?a.value+=e:Ji.insertBefore(t,Ji.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(a=>a.name));for(let a=0;a<e.length;a++)n.has(e[a].name)||t.attrs.push(e[a])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},JT="html",dpe="about:legacy-compat",ppe="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",VT=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Ape=[...VT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],mpe=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),XT=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],gpe=[...XT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function e$(t,e){return e.some(n=>t.startsWith(n))}function fpe(t){return t.name===JT&&t.publicId===null&&(t.systemId===null||t.systemId===dpe)}function bpe(t){if(t.name!==JT)return ba.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===ppe)return ba.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),mpe.has(n))return ba.QUIRKS;let a=e===null?Ape:VT;if(e$(n,a))return ba.QUIRKS;if(a=e===null?XT:gpe,e$(n,a))return ba.LIMITED_QUIRKS}return ba.NO_QUIRKS}const t$={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},hpe="definitionurl",ype="definitionURL",wpe=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),kpe=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Y.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Y.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Y.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Y.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Y.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Y.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Y.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Y.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Y.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Y.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Y.XMLNS}]]),Cpe=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),_pe=new Set([b.B,b.BIG,b.BLOCKQUOTE,b.BODY,b.BR,b.CENTER,b.CODE,b.DD,b.DIV,b.DL,b.DT,b.EM,b.EMBED,b.H1,b.H2,b.H3,b.H4,b.H5,b.H6,b.HEAD,b.HR,b.I,b.IMG,b.LI,b.LISTING,b.MENU,b.META,b.NOBR,b.OL,b.P,b.PRE,b.RUBY,b.S,b.SMALL,b.SPAN,b.STRONG,b.STRIKE,b.SUB,b.SUP,b.TABLE,b.TT,b.U,b.UL,b.VAR]);function Bpe(t){const e=t.tagID;return e===b.FONT&&t.attrs.some(({name:a})=>a===Jo.COLOR||a===Jo.SIZE||a===Jo.FACE)||_pe.has(e)}function n$(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===hpe){t.attrs[e].name=ype;break}}function a$(t){for(let e=0;e<t.attrs.length;e++){const n=wpe.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function _C(t){for(let e=0;e<t.attrs.length;e++){const n=kpe.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function Epe(t){const e=Cpe.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=bg(t.tagName))}function vpe(t,e){return e===Y.MATHML&&(t===b.MI||t===b.MO||t===b.MN||t===b.MS||t===b.MTEXT)}function xpe(t,e,n){if(e===Y.MATHML&&t===b.ANNOTATION_XML){for(let a=0;a<n.length;a++)if(n[a].name===Jo.ENCODING){const r=n[a].value.toLowerCase();return r===t$.TEXT_HTML||r===t$.APPLICATION_XML}}return e===Y.SVG&&(t===b.FOREIGN_OBJECT||t===b.DESC||t===b.TITLE)}function Qpe(t,e,n,a){return(!a||a===Y.HTML)&&xpe(t,e,n)||(!a||a===Y.MATHML)&&vpe(t,e)}const Ipe="hidden",Dpe=8,Spe=3;var I;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(I||(I={}));const Fpe={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},r$=new Set([b.TABLE,b.TBODY,b.TFOOT,b.THEAD,b.TR]),i$={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ji,onParseError:null};class o${constructor(e,n,a=null,r=null){this.fragmentContext=a,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=I.INITIAL,this.originalInsertionMode=I.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...i$,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new npe(this.options,this),this.activeFormattingElements=new upe(this.treeAdapter),this.fragmentContextID=a?bg(this.treeAdapter.getTagName(a)):b.UNKNOWN,this._setContextModes(a??this.document,this.fragmentContextID),this.openElements=new lpe(this.document,this.treeAdapter,this)}static parse(e,n){const a=new this(n);return a.tokenizer.write(e,!0),a.document}static getFragmentParser(e,n){const a={...i$,...n};e??(e=a.treeAdapter.createElement(N.TEMPLATE,Y.HTML,[]));const r=a.treeAdapter.createElement("documentmock",Y.HTML,[]),i=new this(a,r,e);return i.fragmentContextID===b.TEMPLATE&&i.tmplInsertionModeStack.unshift(I.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,a){var r;if(!this.onParseError)return;const i=(r=e.location)!==null&&r!==void 0?r:Fpe,o={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:a?i.startLine:i.endLine,endCol:a?i.startCol:i.endCol,endOffset:a?i.startOffset:i.endOffset};this.onParseError(o)}onItemPush(e,n,a){var r,i;(i=(r=this.treeAdapter).onItemPush)===null||i===void 0||i.call(r,e),a&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var a,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(a=this.treeAdapter).onItemPop)===null||r===void 0||r.call(a,e,this.openElements.current),n){let i,o;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,o=this.fragmentContextID):{current:i,currentTagId:o}=this.openElements,this._setContextModes(i,o)}}_setContextModes(e,n){const a=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Y.HTML;this.currentNotInHTML=!a,this.tokenizer.inForeignNode=!a&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,Y.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=I.TEXT}switchToPlaintextParsing(){this.insertionMode=I.TEXT,this.originalInsertionMode=I.IN_BODY,this.tokenizer.state=Pn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===N.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Y.HTML))switch(this.fragmentContextID){case b.TITLE:case b.TEXTAREA:{this.tokenizer.state=Pn.RCDATA;break}case b.STYLE:case b.XMP:case b.IFRAME:case b.NOEMBED:case b.NOFRAMES:case b.NOSCRIPT:{this.tokenizer.state=Pn.RAWTEXT;break}case b.SCRIPT:{this.tokenizer.state=Pn.SCRIPT_DATA;break}case b.PLAINTEXT:{this.tokenizer.state=Pn.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",a=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,a,r),e.location){const o=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));o&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const a=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,a)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const a=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(a??this.document,e)}}_appendElement(e,n){const a=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(a,e.location)}_insertElement(e,n){const a=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(a,e.location),this.openElements.push(a,e.tagID)}_insertFakeElement(e,n){const a=this.treeAdapter.createElement(e,Y.HTML,[]);this._attachElementToTree(a,null),this.openElements.push(a,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,Y.HTML,e.attrs),a=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,a),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(N.HTML,Y.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,b.HTML)}_appendCommentNode(e,n){const a=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,a),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_insertCharacters(e){let n,a;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:a}=this._findFosterParentingLocation(),a?this.treeAdapter.insertTextBefore(n,e.chars,a):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(n),i=a?r.lastIndexOf(a):r.length,o=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:l,endOffset:u}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:l,endOffset:u})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,e.location)}_adoptNodes(e,n){for(let a=this.treeAdapter.getFirstChild(e);a;a=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(a),this.treeAdapter.appendChild(n,a)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const a=n.location,r=this.treeAdapter.getTagName(e),i=n.type===je.END_TAG&&r===n.tagName?{endTag:{...a},endLine:a.endLine,endCol:a.endCol,endOffset:a.endOffset}:{endLine:a.startLine,endCol:a.startCol,endOffset:a.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,a;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,a=this.fragmentContextID):{current:n,currentTagId:a}=this.openElements,e.tagID===b.SVG&&this.treeAdapter.getTagName(n)===N.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Y.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===b.MGLYPH||e.tagID===b.MALIGNMARK)&&a!==void 0&&!this._isIntegrationPoint(a,n,Y.HTML)}_processToken(e){switch(e.type){case je.CHARACTER:{this.onCharacter(e);break}case je.NULL_CHARACTER:{this.onNullCharacter(e);break}case je.COMMENT:{this.onComment(e);break}case je.DOCTYPE:{this.onDoctype(e);break}case je.START_TAG:{this._processStartTag(e);break}case je.END_TAG:{this.onEndTag(e);break}case je.EOF:{this.onEof(e);break}case je.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,a){const r=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return Qpe(e,r,i,a)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===mr.Marker||this.openElements.contains(r.element)),a=n===-1?e-1:n-1;for(let r=a;r>=0;r--){const i=this.activeFormattingElements.entries[r];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=I.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(b.P),this.openElements.popUntilTagNamePopped(b.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case b.TR:{this.insertionMode=I.IN_ROW;return}case b.TBODY:case b.THEAD:case b.TFOOT:{this.insertionMode=I.IN_TABLE_BODY;return}case b.CAPTION:{this.insertionMode=I.IN_CAPTION;return}case b.COLGROUP:{this.insertionMode=I.IN_COLUMN_GROUP;return}case b.TABLE:{this.insertionMode=I.IN_TABLE;return}case b.BODY:{this.insertionMode=I.IN_BODY;return}case b.FRAMESET:{this.insertionMode=I.IN_FRAMESET;return}case b.SELECT:{this._resetInsertionModeForSelect(e);return}case b.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case b.HTML:{this.insertionMode=this.headElement?I.AFTER_HEAD:I.BEFORE_HEAD;return}case b.TD:case b.TH:{if(e>0){this.insertionMode=I.IN_CELL;return}break}case b.HEAD:{if(e>0){this.insertionMode=I.IN_HEAD;return}break}}this.insertionMode=I.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const a=this.openElements.tagIDs[n];if(a===b.TEMPLATE)break;if(a===b.TABLE){this.insertionMode=I.IN_SELECT_IN_TABLE;return}}this.insertionMode=I.IN_SELECT}_isElementCausesFosterParenting(e){return r$.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case b.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Y.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case b.TABLE:{const a=this.treeAdapter.getParentNode(n);return a?{parent:a,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const a=this.treeAdapter.getNamespaceURI(e);return Vde[a].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){cme(this,e);return}switch(this.insertionMode){case I.INITIAL:{Yu(this,e);break}case I.BEFORE_HTML:{Ku(this,e);break}case I.BEFORE_HEAD:{Wu(this,e);break}case I.IN_HEAD:{Ju(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Vu(this,e);break}case I.AFTER_HEAD:{Xu(this,e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:{c$(this,e);break}case I.TEXT:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{xC(this,e);break}case I.IN_TABLE_TEXT:{f$(this,e);break}case I.IN_COLUMN_GROUP:{Cg(this,e);break}case I.AFTER_BODY:{Eg(this,e);break}case I.AFTER_AFTER_BODY:{vg(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){sme(this,e);return}switch(this.insertionMode){case I.INITIAL:{Yu(this,e);break}case I.BEFORE_HTML:{Ku(this,e);break}case I.BEFORE_HEAD:{Wu(this,e);break}case I.IN_HEAD:{Ju(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Vu(this,e);break}case I.AFTER_HEAD:{Xu(this,e);break}case I.TEXT:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{xC(this,e);break}case I.IN_COLUMN_GROUP:{Cg(this,e);break}case I.AFTER_BODY:{Eg(this,e);break}case I.AFTER_AFTER_BODY:{vg(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){EC(this,e);return}switch(this.insertionMode){case I.INITIAL:case I.BEFORE_HTML:case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_TEMPLATE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{EC(this,e);break}case I.IN_TABLE_TEXT:{nd(this,e);break}case I.AFTER_BODY:{Rpe(this,e);break}case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{Ppe(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case I.INITIAL:{jpe(this,e);break}case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:{this._err(e,q.misplacedDoctype);break}case I.IN_TABLE_TEXT:{nd(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?lme(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{Yu(this,e);break}case I.BEFORE_HTML:{qpe(this,e);break}case I.BEFORE_HEAD:{zpe(this,e);break}case I.IN_HEAD:{Ta(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Zpe(this,e);break}case I.AFTER_HEAD:{Kpe(this,e);break}case I.IN_BODY:{yn(this,e);break}case I.IN_TABLE:{xc(this,e);break}case I.IN_TABLE_TEXT:{nd(this,e);break}case I.IN_CAPTION:{HAe(this,e);break}case I.IN_COLUMN_GROUP:{QC(this,e);break}case I.IN_TABLE_BODY:{_g(this,e);break}case I.IN_ROW:{Bg(this,e);break}case I.IN_CELL:{YAe(this,e);break}case I.IN_SELECT:{y$(this,e);break}case I.IN_SELECT_IN_TABLE:{WAe(this,e);break}case I.IN_TEMPLATE:{VAe(this,e);break}case I.AFTER_BODY:{eme(this,e);break}case I.IN_FRAMESET:{tme(this,e);break}case I.AFTER_FRAMESET:{ame(this,e);break}case I.AFTER_AFTER_BODY:{ime(this,e);break}case I.AFTER_AFTER_FRAMESET:{ome(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?ume(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{Yu(this,e);break}case I.BEFORE_HTML:{Gpe(this,e);break}case I.BEFORE_HEAD:{Hpe(this,e);break}case I.IN_HEAD:{Upe(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Ype(this,e);break}case I.AFTER_HEAD:{Wpe(this,e);break}case I.IN_BODY:{kg(this,e);break}case I.TEXT:{TAe(this,e);break}case I.IN_TABLE:{ed(this,e);break}case I.IN_TABLE_TEXT:{nd(this,e);break}case I.IN_CAPTION:{UAe(this,e);break}case I.IN_COLUMN_GROUP:{ZAe(this,e);break}case I.IN_TABLE_BODY:{IC(this,e);break}case I.IN_ROW:{h$(this,e);break}case I.IN_CELL:{KAe(this,e);break}case I.IN_SELECT:{w$(this,e);break}case I.IN_SELECT_IN_TABLE:{JAe(this,e);break}case I.IN_TEMPLATE:{XAe(this,e);break}case I.AFTER_BODY:{C$(this,e);break}case I.IN_FRAMESET:{nme(this,e);break}case I.AFTER_FRAMESET:{rme(this,e);break}case I.AFTER_AFTER_BODY:{vg(this,e);break}}}onEof(e){switch(this.insertionMode){case I.INITIAL:{Yu(this,e);break}case I.BEFORE_HTML:{Ku(this,e);break}case I.BEFORE_HEAD:{Wu(this,e);break}case I.IN_HEAD:{Ju(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Vu(this,e);break}case I.AFTER_HEAD:{Xu(this,e);break}case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{m$(this,e);break}case I.TEXT:{$Ae(this,e);break}case I.IN_TABLE_TEXT:{nd(this,e);break}case I.IN_TEMPLATE:{k$(this,e);break}case I.AFTER_BODY:case I.IN_FRAMESET:case I.AFTER_FRAMESET:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{vC(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===E.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.TEXT:case I.IN_COLUMN_GROUP:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{this._insertCharacters(e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:case I.AFTER_BODY:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{s$(this,e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{xC(this,e);break}case I.IN_TABLE_TEXT:{g$(this,e);break}}}}function Ope(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):A$(t,e),n}function Npe(t,e){let n=null,a=t.openElements.stackTop;for(;a>=0;a--){const r=t.openElements.items[a];if(r===e.element)break;t._isSpecialElement(r,t.openElements.tagIDs[a])&&(n=r)}return n||(t.openElements.shortenToLength(Math.max(a,0)),t.activeFormattingElements.removeEntry(e)),n}function Tpe(t,e,n){let a=e,r=t.openElements.getCommonAncestor(e);for(let i=0,o=r;o!==n;i++,o=r){r=t.openElements.getCommonAncestor(o);const s=t.activeFormattingElements.getElementEntry(o),c=s&&i>=Spe;!s||c?(c&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=$pe(t,s),a===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(a),t.treeAdapter.appendChild(o,a),a=o)}return a}function $pe(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),a=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,a),e.element=a,a}function Lpe(t,e,n){const a=t.treeAdapter.getTagName(e),r=bg(a);if(t._isElementCausesFosterParenting(r))t._fosterParentElement(n);else{const i=t.treeAdapter.getNamespaceURI(e);r===b.TEMPLATE&&i===Y.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Mpe(t,e,n){const a=t.treeAdapter.getNamespaceURI(n.element),{token:r}=n,i=t.treeAdapter.createElement(r.tagName,a,r.attrs);t._adoptNodes(e,i),t.treeAdapter.appendChild(e,i),t.activeFormattingElements.insertElementAfterBookmark(i,r),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,i,r.tagID)}function BC(t,e){for(let n=0;n<Dpe;n++){const a=Ope(t,e);if(!a)break;const r=Npe(t,a);if(!r)break;t.activeFormattingElements.bookmark=a;const i=Tpe(t,r,a.element),o=t.openElements.getCommonAncestor(a.element);t.treeAdapter.detachNode(i),o&&Lpe(t,o,i),Mpe(t,r,a)}}function EC(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function Rpe(t,e){t._appendCommentNode(e,t.openElements.items[0])}function Ppe(t,e){t._appendCommentNode(e,t.document)}function vC(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let a=t.openElements.stackTop;a>=n;a--)t._setEndLocation(t.openElements.items[a],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const a=t.openElements.items[0],r=t.treeAdapter.getNodeSourceCodeLocation(a);if(r&&!r.endTag&&(t._setEndLocation(a,e),t.openElements.stackTop>=1)){const i=t.openElements.items[1],o=t.treeAdapter.getNodeSourceCodeLocation(i);o&&!o.endTag&&t._setEndLocation(i,e)}}}}function jpe(t,e){t._setDocumentType(e);const n=e.forceQuirks?ba.QUIRKS:bpe(e);fpe(e)||t._err(e,q.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=I.BEFORE_HTML}function Yu(t,e){t._err(e,q.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,ba.QUIRKS),t.insertionMode=I.BEFORE_HTML,t._processToken(e)}function qpe(t,e){e.tagID===b.HTML?(t._insertElement(e,Y.HTML),t.insertionMode=I.BEFORE_HEAD):Ku(t,e)}function Gpe(t,e){const n=e.tagID;(n===b.HTML||n===b.HEAD||n===b.BODY||n===b.BR)&&Ku(t,e)}function Ku(t,e){t._insertFakeRootElement(),t.insertionMode=I.BEFORE_HEAD,t._processToken(e)}function zpe(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.HEAD:{t._insertElement(e,Y.HTML),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD;break}default:Wu(t,e)}}function Hpe(t,e){const n=e.tagID;n===b.HEAD||n===b.BODY||n===b.HTML||n===b.BR?Wu(t,e):t._err(e,q.endTagWithoutMatchingOpenElement)}function Wu(t,e){t._insertFakeElement(N.HEAD,b.HEAD),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD,t._processToken(e)}function Ta(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.BASE:case b.BASEFONT:case b.BGSOUND:case b.LINK:case b.META:{t._appendElement(e,Y.HTML),e.ackSelfClosing=!0;break}case b.TITLE:{t._switchToTextParsing(e,Pn.RCDATA);break}case b.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Pn.RAWTEXT):(t._insertElement(e,Y.HTML),t.insertionMode=I.IN_HEAD_NO_SCRIPT);break}case b.NOFRAMES:case b.STYLE:{t._switchToTextParsing(e,Pn.RAWTEXT);break}case b.SCRIPT:{t._switchToTextParsing(e,Pn.SCRIPT_DATA);break}case b.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=I.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(I.IN_TEMPLATE);break}case b.HEAD:{t._err(e,q.misplacedStartTagForHeadElement);break}default:Ju(t,e)}}function Upe(t,e){switch(e.tagID){case b.HEAD:{t.openElements.pop(),t.insertionMode=I.AFTER_HEAD;break}case b.BODY:case b.BR:case b.HTML:{Ju(t,e);break}case b.TEMPLATE:{Vo(t,e);break}default:t._err(e,q.endTagWithoutMatchingOpenElement)}}function Vo(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==b.TEMPLATE&&t._err(e,q.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(b.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,q.endTagWithoutMatchingOpenElement)}function Ju(t,e){t.openElements.pop(),t.insertionMode=I.AFTER_HEAD,t._processToken(e)}function Zpe(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.BASEFONT:case b.BGSOUND:case b.HEAD:case b.LINK:case b.META:case b.NOFRAMES:case b.STYLE:{Ta(t,e);break}case b.NOSCRIPT:{t._err(e,q.nestedNoscriptInHead);break}default:Vu(t,e)}}function Ype(t,e){switch(e.tagID){case b.NOSCRIPT:{t.openElements.pop(),t.insertionMode=I.IN_HEAD;break}case b.BR:{Vu(t,e);break}default:t._err(e,q.endTagWithoutMatchingOpenElement)}}function Vu(t,e){const n=e.type===je.EOF?q.openElementsLeftAfterEof:q.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=I.IN_HEAD,t._processToken(e)}function Kpe(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.BODY:{t._insertElement(e,Y.HTML),t.framesetOk=!1,t.insertionMode=I.IN_BODY;break}case b.FRAMESET:{t._insertElement(e,Y.HTML),t.insertionMode=I.IN_FRAMESET;break}case b.BASE:case b.BASEFONT:case b.BGSOUND:case b.LINK:case b.META:case b.NOFRAMES:case b.SCRIPT:case b.STYLE:case b.TEMPLATE:case b.TITLE:{t._err(e,q.abandonedHeadElementChild),t.openElements.push(t.headElement,b.HEAD),Ta(t,e),t.openElements.remove(t.headElement);break}case b.HEAD:{t._err(e,q.misplacedStartTagForHeadElement);break}default:Xu(t,e)}}function Wpe(t,e){switch(e.tagID){case b.BODY:case b.HTML:case b.BR:{Xu(t,e);break}case b.TEMPLATE:{Vo(t,e);break}default:t._err(e,q.endTagWithoutMatchingOpenElement)}}function Xu(t,e){t._insertFakeElement(N.BODY,b.BODY),t.insertionMode=I.IN_BODY,wg(t,e)}function wg(t,e){switch(e.type){case je.CHARACTER:{c$(t,e);break}case je.WHITESPACE_CHARACTER:{s$(t,e);break}case je.COMMENT:{EC(t,e);break}case je.START_TAG:{yn(t,e);break}case je.END_TAG:{kg(t,e);break}case je.EOF:{m$(t,e);break}}}function s$(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function c$(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function Jpe(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function Vpe(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function Xpe(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Y.HTML),t.insertionMode=I.IN_FRAMESET)}function eAe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Y.HTML)}function tAe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&kC.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Y.HTML)}function nAe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Y.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function aAe(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Y.HTML),n||(t.formElement=t.openElements.current))}function rAe(t,e){t.framesetOk=!1;const n=e.tagID;for(let a=t.openElements.stackTop;a>=0;a--){const r=t.openElements.tagIDs[a];if(n===b.LI&&r===b.LI||(n===b.DD||n===b.DT)&&(r===b.DD||r===b.DT)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r);break}if(r!==b.ADDRESS&&r!==b.DIV&&r!==b.P&&t._isSpecialElement(t.openElements.items[a],r))break}t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Y.HTML)}function iAe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Y.HTML),t.tokenizer.state=Pn.PLAINTEXT}function oAe(t,e){t.openElements.hasInScope(b.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML),t.framesetOk=!1}function sAe(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(N.A);n&&(BC(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function cAe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function lAe(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(b.NOBR)&&(BC(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Y.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function uAe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function dAe(t,e){t.treeAdapter.getDocumentMode(t.document)!==ba.QUIRKS&&t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._insertElement(e,Y.HTML),t.framesetOk=!1,t.insertionMode=I.IN_TABLE}function l$(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Y.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function u$(t){const e=qT(t,Jo.TYPE);return e!=null&&e.toLowerCase()===Ipe}function pAe(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Y.HTML),u$(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function AAe(t,e){t._appendElement(e,Y.HTML),e.ackSelfClosing=!0}function mAe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._appendElement(e,Y.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function gAe(t,e){e.tagName=N.IMG,e.tagID=b.IMG,l$(t,e)}function fAe(t,e){t._insertElement(e,Y.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Pn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=I.TEXT}function bAe(t,e){t.openElements.hasInButtonScope(b.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Pn.RAWTEXT)}function hAe(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Pn.RAWTEXT)}function d$(t,e){t._switchToTextParsing(e,Pn.RAWTEXT)}function yAe(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===I.IN_TABLE||t.insertionMode===I.IN_CAPTION||t.insertionMode===I.IN_TABLE_BODY||t.insertionMode===I.IN_ROW||t.insertionMode===I.IN_CELL?I.IN_SELECT_IN_TABLE:I.IN_SELECT}function wAe(t,e){t.openElements.currentTagId===b.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML)}function kAe(t,e){t.openElements.hasInScope(b.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Y.HTML)}function CAe(t,e){t.openElements.hasInScope(b.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(b.RTC),t._insertElement(e,Y.HTML)}function _Ae(t,e){t._reconstructActiveFormattingElements(),n$(e),_C(e),e.selfClosing?t._appendElement(e,Y.MATHML):t._insertElement(e,Y.MATHML),e.ackSelfClosing=!0}function BAe(t,e){t._reconstructActiveFormattingElements(),a$(e),_C(e),e.selfClosing?t._appendElement(e,Y.SVG):t._insertElement(e,Y.SVG),e.ackSelfClosing=!0}function p$(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Y.HTML)}function yn(t,e){switch(e.tagID){case b.I:case b.S:case b.B:case b.U:case b.EM:case b.TT:case b.BIG:case b.CODE:case b.FONT:case b.SMALL:case b.STRIKE:case b.STRONG:{cAe(t,e);break}case b.A:{sAe(t,e);break}case b.H1:case b.H2:case b.H3:case b.H4:case b.H5:case b.H6:{tAe(t,e);break}case b.P:case b.DL:case b.OL:case b.UL:case b.DIV:case b.DIR:case b.NAV:case b.MAIN:case b.MENU:case b.ASIDE:case b.CENTER:case b.FIGURE:case b.FOOTER:case b.HEADER:case b.HGROUP:case b.DIALOG:case b.DETAILS:case b.ADDRESS:case b.ARTICLE:case b.SEARCH:case b.SECTION:case b.SUMMARY:case b.FIELDSET:case b.BLOCKQUOTE:case b.FIGCAPTION:{eAe(t,e);break}case b.LI:case b.DD:case b.DT:{rAe(t,e);break}case b.BR:case b.IMG:case b.WBR:case b.AREA:case b.EMBED:case b.KEYGEN:{l$(t,e);break}case b.HR:{mAe(t,e);break}case b.RB:case b.RTC:{kAe(t,e);break}case b.RT:case b.RP:{CAe(t,e);break}case b.PRE:case b.LISTING:{nAe(t,e);break}case b.XMP:{bAe(t,e);break}case b.SVG:{BAe(t,e);break}case b.HTML:{Jpe(t,e);break}case b.BASE:case b.LINK:case b.META:case b.STYLE:case b.TITLE:case b.SCRIPT:case b.BGSOUND:case b.BASEFONT:case b.TEMPLATE:{Ta(t,e);break}case b.BODY:{Vpe(t,e);break}case b.FORM:{aAe(t,e);break}case b.NOBR:{lAe(t,e);break}case b.MATH:{_Ae(t,e);break}case b.TABLE:{dAe(t,e);break}case b.INPUT:{pAe(t,e);break}case b.PARAM:case b.TRACK:case b.SOURCE:{AAe(t,e);break}case b.IMAGE:{gAe(t,e);break}case b.BUTTON:{oAe(t,e);break}case b.APPLET:case b.OBJECT:case b.MARQUEE:{uAe(t,e);break}case b.IFRAME:{hAe(t,e);break}case b.SELECT:{yAe(t,e);break}case b.OPTION:case b.OPTGROUP:{wAe(t,e);break}case b.NOEMBED:case b.NOFRAMES:{d$(t,e);break}case b.FRAMESET:{Xpe(t,e);break}case b.TEXTAREA:{fAe(t,e);break}case b.NOSCRIPT:{t.options.scriptingEnabled?d$(t,e):p$(t,e);break}case b.PLAINTEXT:{iAe(t,e);break}case b.COL:case b.TH:case b.TD:case b.TR:case b.HEAD:case b.FRAME:case b.TBODY:case b.TFOOT:case b.THEAD:case b.CAPTION:case b.COLGROUP:break;default:p$(t,e)}}function EAe(t,e){if(t.openElements.hasInScope(b.BODY)&&(t.insertionMode=I.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function vAe(t,e){t.openElements.hasInScope(b.BODY)&&(t.insertionMode=I.AFTER_BODY,C$(t,e))}function xAe(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function QAe(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(b.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(b.FORM):n&&t.openElements.remove(n))}function IAe(t){t.openElements.hasInButtonScope(b.P)||t._insertFakeElement(N.P,b.P),t._closePElement()}function DAe(t){t.openElements.hasInListItemScope(b.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(b.LI),t.openElements.popUntilTagNamePopped(b.LI))}function SAe(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function FAe(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function OAe(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function NAe(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(N.BR,b.BR),t.openElements.pop(),t.framesetOk=!1}function A$(t,e){const n=e.tagName,a=e.tagID;for(let r=t.openElements.stackTop;r>0;r--){const i=t.openElements.items[r],o=t.openElements.tagIDs[r];if(a===o&&(a!==b.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(a),t.openElements.stackTop>=r&&t.openElements.shortenToLength(r);break}if(t._isSpecialElement(i,o))break}}function kg(t,e){switch(e.tagID){case b.A:case b.B:case b.I:case b.S:case b.U:case b.EM:case b.TT:case b.BIG:case b.CODE:case b.FONT:case b.NOBR:case b.SMALL:case b.STRIKE:case b.STRONG:{BC(t,e);break}case b.P:{IAe(t);break}case b.DL:case b.UL:case b.OL:case b.DIR:case b.DIV:case b.NAV:case b.PRE:case b.MAIN:case b.MENU:case b.ASIDE:case b.BUTTON:case b.CENTER:case b.FIGURE:case b.FOOTER:case b.HEADER:case b.HGROUP:case b.DIALOG:case b.ADDRESS:case b.ARTICLE:case b.DETAILS:case b.SEARCH:case b.SECTION:case b.SUMMARY:case b.LISTING:case b.FIELDSET:case b.BLOCKQUOTE:case b.FIGCAPTION:{xAe(t,e);break}case b.LI:{DAe(t);break}case b.DD:case b.DT:{SAe(t,e);break}case b.H1:case b.H2:case b.H3:case b.H4:case b.H5:case b.H6:{FAe(t);break}case b.BR:{NAe(t);break}case b.BODY:{EAe(t,e);break}case b.HTML:{vAe(t,e);break}case b.FORM:{QAe(t);break}case b.APPLET:case b.OBJECT:case b.MARQUEE:{OAe(t,e);break}case b.TEMPLATE:{Vo(t,e);break}default:A$(t,e)}}function m$(t,e){t.tmplInsertionModeStack.length>0?k$(t,e):vC(t,e)}function TAe(t,e){var n;e.tagID===b.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function $Ae(t,e){t._err(e,q.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function xC(t,e){if(t.openElements.currentTagId!==void 0&&r$.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=I.IN_TABLE_TEXT,e.type){case je.CHARACTER:{f$(t,e);break}case je.WHITESPACE_CHARACTER:{g$(t,e);break}}else td(t,e)}function LAe(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Y.HTML),t.insertionMode=I.IN_CAPTION}function MAe(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Y.HTML),t.insertionMode=I.IN_COLUMN_GROUP}function RAe(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(N.COLGROUP,b.COLGROUP),t.insertionMode=I.IN_COLUMN_GROUP,QC(t,e)}function PAe(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Y.HTML),t.insertionMode=I.IN_TABLE_BODY}function jAe(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(N.TBODY,b.TBODY),t.insertionMode=I.IN_TABLE_BODY,_g(t,e)}function qAe(t,e){t.openElements.hasInTableScope(b.TABLE)&&(t.openElements.popUntilTagNamePopped(b.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function GAe(t,e){u$(e)?t._appendElement(e,Y.HTML):td(t,e),e.ackSelfClosing=!0}function zAe(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Y.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function xc(t,e){switch(e.tagID){case b.TD:case b.TH:case b.TR:{jAe(t,e);break}case b.STYLE:case b.SCRIPT:case b.TEMPLATE:{Ta(t,e);break}case b.COL:{RAe(t,e);break}case b.FORM:{zAe(t,e);break}case b.TABLE:{qAe(t,e);break}case b.TBODY:case b.TFOOT:case b.THEAD:{PAe(t,e);break}case b.INPUT:{GAe(t,e);break}case b.CAPTION:{LAe(t,e);break}case b.COLGROUP:{MAe(t,e);break}default:td(t,e)}}function ed(t,e){switch(e.tagID){case b.TABLE:{t.openElements.hasInTableScope(b.TABLE)&&(t.openElements.popUntilTagNamePopped(b.TABLE),t._resetInsertionMode());break}case b.TEMPLATE:{Vo(t,e);break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:case b.TBODY:case b.TD:case b.TFOOT:case b.TH:case b.THEAD:case b.TR:break;default:td(t,e)}}function td(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,wg(t,e),t.fosterParentingEnabled=n}function g$(t,e){t.pendingCharacterTokens.push(e)}function f$(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function nd(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)td(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const b$=new Set([b.CAPTION,b.COL,b.COLGROUP,b.TBODY,b.TD,b.TFOOT,b.TH,b.THEAD,b.TR]);function HAe(t,e){const n=e.tagID;b$.has(n)?t.openElements.hasInTableScope(b.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,xc(t,e)):yn(t,e)}function UAe(t,e){const n=e.tagID;switch(n){case b.CAPTION:case b.TABLE:{t.openElements.hasInTableScope(b.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(b.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,n===b.TABLE&&ed(t,e));break}case b.BODY:case b.COL:case b.COLGROUP:case b.HTML:case b.TBODY:case b.TD:case b.TFOOT:case b.TH:case b.THEAD:case b.TR:break;default:kg(t,e)}}function QC(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.COL:{t._appendElement(e,Y.HTML),e.ackSelfClosing=!0;break}case b.TEMPLATE:{Ta(t,e);break}default:Cg(t,e)}}function ZAe(t,e){switch(e.tagID){case b.COLGROUP:{t.openElements.currentTagId===b.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case b.TEMPLATE:{Vo(t,e);break}case b.COL:break;default:Cg(t,e)}}function Cg(t,e){t.openElements.currentTagId===b.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE,t._processToken(e))}function _g(t,e){switch(e.tagID){case b.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Y.HTML),t.insertionMode=I.IN_ROW;break}case b.TH:case b.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(N.TR,b.TR),t.insertionMode=I.IN_ROW,Bg(t,e);break}case b.CAPTION:case b.COL:case b.COLGROUP:case b.TBODY:case b.TFOOT:case b.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,xc(t,e));break}default:xc(t,e)}}function IC(t,e){const n=e.tagID;switch(e.tagID){case b.TBODY:case b.TFOOT:case b.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case b.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,ed(t,e));break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:case b.TD:case b.TH:case b.TR:break;default:ed(t,e)}}function Bg(t,e){switch(e.tagID){case b.TH:case b.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,Y.HTML),t.insertionMode=I.IN_CELL,t.activeFormattingElements.insertMarker();break}case b.CAPTION:case b.COL:case b.COLGROUP:case b.TBODY:case b.TFOOT:case b.THEAD:case b.TR:{t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,_g(t,e));break}default:xc(t,e)}}function h$(t,e){switch(e.tagID){case b.TR:{t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY);break}case b.TABLE:{t.openElements.hasInTableScope(b.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,IC(t,e));break}case b.TBODY:case b.TFOOT:case b.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(b.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,IC(t,e));break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:case b.TD:case b.TH:break;default:ed(t,e)}}function YAe(t,e){const n=e.tagID;b$.has(n)?(t.openElements.hasInTableScope(b.TD)||t.openElements.hasInTableScope(b.TH))&&(t._closeTableCell(),Bg(t,e)):yn(t,e)}function KAe(t,e){const n=e.tagID;switch(n){case b.TD:case b.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_ROW);break}case b.TABLE:case b.TBODY:case b.TFOOT:case b.THEAD:case b.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),h$(t,e));break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:break;default:kg(t,e)}}function y$(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.OPTION:{t.openElements.currentTagId===b.OPTION&&t.openElements.pop(),t._insertElement(e,Y.HTML);break}case b.OPTGROUP:{t.openElements.currentTagId===b.OPTION&&t.openElements.pop(),t.openElements.currentTagId===b.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Y.HTML);break}case b.HR:{t.openElements.currentTagId===b.OPTION&&t.openElements.pop(),t.openElements.currentTagId===b.OPTGROUP&&t.openElements.pop(),t._appendElement(e,Y.HTML),e.ackSelfClosing=!0;break}case b.INPUT:case b.KEYGEN:case b.TEXTAREA:case b.SELECT:{t.openElements.hasInSelectScope(b.SELECT)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),e.tagID!==b.SELECT&&t._processStartTag(e));break}case b.SCRIPT:case b.TEMPLATE:{Ta(t,e);break}}}function w$(t,e){switch(e.tagID){case b.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===b.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===b.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===b.OPTGROUP&&t.openElements.pop();break}case b.OPTION:{t.openElements.currentTagId===b.OPTION&&t.openElements.pop();break}case b.SELECT:{t.openElements.hasInSelectScope(b.SELECT)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode());break}case b.TEMPLATE:{Vo(t,e);break}}}function WAe(t,e){const n=e.tagID;n===b.CAPTION||n===b.TABLE||n===b.TBODY||n===b.TFOOT||n===b.THEAD||n===b.TR||n===b.TD||n===b.TH?(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),t._processStartTag(e)):y$(t,e)}function JAe(t,e){const n=e.tagID;n===b.CAPTION||n===b.TABLE||n===b.TBODY||n===b.TFOOT||n===b.THEAD||n===b.TR||n===b.TD||n===b.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(b.SELECT),t._resetInsertionMode(),t.onEndTag(e)):w$(t,e)}function VAe(t,e){switch(e.tagID){case b.BASE:case b.BASEFONT:case b.BGSOUND:case b.LINK:case b.META:case b.NOFRAMES:case b.SCRIPT:case b.STYLE:case b.TEMPLATE:case b.TITLE:{Ta(t,e);break}case b.CAPTION:case b.COLGROUP:case b.TBODY:case b.TFOOT:case b.THEAD:{t.tmplInsertionModeStack[0]=I.IN_TABLE,t.insertionMode=I.IN_TABLE,xc(t,e);break}case b.COL:{t.tmplInsertionModeStack[0]=I.IN_COLUMN_GROUP,t.insertionMode=I.IN_COLUMN_GROUP,QC(t,e);break}case b.TR:{t.tmplInsertionModeStack[0]=I.IN_TABLE_BODY,t.insertionMode=I.IN_TABLE_BODY,_g(t,e);break}case b.TD:case b.TH:{t.tmplInsertionModeStack[0]=I.IN_ROW,t.insertionMode=I.IN_ROW,Bg(t,e);break}default:t.tmplInsertionModeStack[0]=I.IN_BODY,t.insertionMode=I.IN_BODY,yn(t,e)}}function XAe(t,e){e.tagID===b.TEMPLATE&&Vo(t,e)}function k$(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(b.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):vC(t,e)}function eme(t,e){e.tagID===b.HTML?yn(t,e):Eg(t,e)}function C$(t,e){var n;if(e.tagID===b.HTML){if(t.fragmentContext||(t.insertionMode=I.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===b.HTML){t._setEndLocation(t.openElements.items[0],e);const a=t.openElements.items[1];a&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(a))===null||n===void 0)&&n.endTag)&&t._setEndLocation(a,e)}}else Eg(t,e)}function Eg(t,e){t.insertionMode=I.IN_BODY,wg(t,e)}function tme(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.FRAMESET:{t._insertElement(e,Y.HTML);break}case b.FRAME:{t._appendElement(e,Y.HTML),e.ackSelfClosing=!0;break}case b.NOFRAMES:{Ta(t,e);break}}}function nme(t,e){e.tagID===b.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==b.FRAMESET&&(t.insertionMode=I.AFTER_FRAMESET))}function ame(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.NOFRAMES:{Ta(t,e);break}}}function rme(t,e){e.tagID===b.HTML&&(t.insertionMode=I.AFTER_AFTER_FRAMESET)}function ime(t,e){e.tagID===b.HTML?yn(t,e):vg(t,e)}function vg(t,e){t.insertionMode=I.IN_BODY,wg(t,e)}function ome(t,e){switch(e.tagID){case b.HTML:{yn(t,e);break}case b.NOFRAMES:{Ta(t,e);break}}}function sme(t,e){e.chars=At,t._insertCharacters(e)}function cme(t,e){t._insertCharacters(e),t.framesetOk=!1}function _$(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Y.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function lme(t,e){if(Bpe(e))_$(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),a=t.treeAdapter.getNamespaceURI(n);a===Y.MATHML?n$(e):a===Y.SVG&&(Epe(e),a$(e)),_C(e),e.selfClosing?t._appendElement(e,a):t._insertElement(e,a),e.ackSelfClosing=!0}}function ume(t,e){if(e.tagID===b.P||e.tagID===b.BR){_$(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const a=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(a)===Y.HTML){t._endTagOutsideForeignContent(e);break}const r=t.treeAdapter.getTagName(a);if(r.toLowerCase()===e.tagName){e.tagName=r,t.openElements.shortenToLength(n);break}}}N.AREA,N.BASE,N.BASEFONT,N.BGSOUND,N.BR,N.COL,N.EMBED,N.FRAME,N.HR,N.IMG,N.INPUT,N.KEYGEN,N.LINK,N.META,N.PARAM,N.SOURCE,N.TRACK,N.WBR;function dme(t,e){return o$.parse(t,e)}function pme(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const a=o$.getFragmentParser(t,n);return a.tokenizer.write(e,!0),a.getFragment()}function Ame(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?B$(t.position):"start"in t||"end"in t?B$(t):"line"in t||"column"in t?DC(t):""}function DC(t){return E$(t&&t.line)+":"+E$(t&&t.column)}function B$(t){return DC(t&&t.start)+"-"+DC(t&&t.end)}function E$(t){return t&&typeof t=="number"?t:1}class on extends Error{constructor(e,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let r="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof a=="string"){const c=a.indexOf(":");c===-1?i.ruleId=a:(i.source=a.slice(0,c),i.ruleId=a.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=Ame(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const gr={basename:mme,dirname:gme,extname:fme,join:bme,sep:"/"};function mme(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ad(t);let n=0,a=-1,r=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(i){n=r+1;break}}else a<0&&(i=!0,a=r+1);return a<0?"":t.slice(n,a)}if(e===t)return"";let o=-1,s=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(i){n=r+1;break}}else o<0&&(i=!0,o=r+1),s>-1&&(t.codePointAt(r)===e.codePointAt(s--)?s<0&&(a=r):(s=-1,a=o));return n===a?a=o:a<0&&(a=t.length),t.slice(n,a)}function gme(t){if(ad(t),t.length===0)return".";let e=-1,n=t.length,a;for(;--n;)if(t.codePointAt(n)===47){if(a){e=n;break}}else a||(a=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function fme(t){ad(t);let e=t.length,n=-1,a=0,r=-1,i=0,o;for(;e--;){const s=t.codePointAt(e);if(s===47){if(o){a=e+1;break}continue}n<0&&(o=!0,n=e+1),s===46?r<0?r=e:i!==1&&(i=1):r>-1&&(i=-1)}return r<0||n<0||i===0||i===1&&r===n-1&&r===a+1?"":t.slice(r,n)}function bme(...t){let e=-1,n;for(;++e<t.length;)ad(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":hme(n)}function hme(t){ad(t);const e=t.codePointAt(0)===47;let n=yme(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function yme(t,e){let n="",a=0,r=-1,i=0,o=-1,s,c;for(;++o<=t.length;){if(o<t.length)s=t.codePointAt(o);else{if(s===47)break;s=47}if(s===47){if(!(r===o-1||i===1))if(r!==o-1&&i===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",a=0):(n=n.slice(0,c),a=n.length-1-n.lastIndexOf("/")),r=o,i=0;continue}}else if(n.length>0){n="",a=0,r=o,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+t.slice(r+1,o):n=t.slice(r+1,o),a=o-r-1;r=o,i=0}else s===46&&i>-1?i++:i=-1}return n}function ad(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const wme={cwd:kme};function kme(){return"/"}function SC(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Cme(t){if(typeof t=="string")t=new URL(t);else if(!SC(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return _me(t)}function _me(t){if(t.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const a=e.codePointAt(n+2);if(a===70||a===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const FC=["history","path","basename","stem","extname","dirname"];class OC{constructor(e){let n;e?SC(e)?n={path:e}:typeof e=="string"||Bme(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":wme.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<FC.length;){const i=FC[a];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let r;for(r in n)FC.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?gr.basename(this.path):void 0}set basename(e){TC(e,"basename"),NC(e,"basename"),this.path=gr.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?gr.dirname(this.path):void 0}set dirname(e){v$(this.basename,"dirname"),this.path=gr.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?gr.extname(this.path):void 0}set extname(e){if(NC(e,"extname"),v$(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=gr.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){SC(e)&&(e=Cme(e)),TC(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?gr.basename(this.path,this.extname):void 0}set stem(e){TC(e,"stem"),NC(e,"stem"),this.path=gr.join(this.dirname||"",e+(this.extname||""))}fail(e,n,a){const r=this.message(e,n,a);throw r.fatal=!0,r}info(e,n,a){const r=this.message(e,n,a);return r.fatal=void 0,r}message(e,n,a){const r=new on(e,n,a);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function NC(t,e){if(t&&t.includes(gr.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+gr.sep+"`")}function TC(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function v$(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Bme(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Eme={abandonedHeadElementChild:{reason:"Unexpected metadata element after head",description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:"Unexpected too big numeric character reference",description:"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)"},closingOfElementWithOpenChildElements:{reason:"Unexpected closing tag with open child elements",description:"Unexpectedly closing tag. Expected other tags to be closed first",url:!1},controlCharacterInInputStream:{reason:"Unexpected control character",description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:"Unexpected control character reference",description:"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace"},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:"Unexpected duplicate attribute",description:"Unexpectedly double attribute. Expected attributes to occur only once"},endTagWithAttributes:{reason:"Unexpected attribute on closing tag",description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:"Unexpected slash at end of closing tag",description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:"Unexpected unopened end tag",description:"Unexpected end tag. Expected no end tag or another end tag",url:!1},eofBeforeTagName:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected tag name instead"},eofInCdata:{reason:"Unexpected end of file in CDATA",description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:"Unexpected end of file in comment",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:"Unexpected end of file in doctype",description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:"Unexpected end of file in element that can only contain text",description:"Unexpected end of file. Expected text or a closing tag",url:!1},eofInScriptHtmlCommentLikeText:{reason:"Unexpected end of file in comment inside script",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:"Unexpected end of file in tag",description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:"Incorrectly closed comment",description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:"Incorrectly opened comment",description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:"Invalid sequence after doctype name",description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:"Invalid first character in tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:"Misplaced doctype",description:"Unexpected doctype. Expected doctype before head",url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:"Missing attribute value",description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:"Missing doctype before other content",description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:"Missing doctype name",description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:"Missing public identifier in doctype",description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:"Missing system identifier in doctype",description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:"Missing name in end tag",description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:"Missing quote before public identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:"Missing quote before system identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:"Missing semicolon after character reference",description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:"Missing whitespace after public identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:"Missing whitespace after system identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:"Missing whitespace before doctype name",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:"Missing whitespace between attributes",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:"Missing whitespace between public and system identifiers in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:"Unexpected nested comment",description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:"Unexpected non-conforming doctype declaration",description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:"Unexpected trailing slash on start tag of non-void element",description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:"Unexpected noncharacter code point referenced by character reference",description:"Unexpected code point. Do not use noncharacters in HTML"},noncharacterInInputStream:{reason:"Unexpected noncharacter character",description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:"Unexpected NULL character referenced by character reference",description:"Unexpected code point. Do not use NULL characters in HTML"},openElementsLeftAfterEof:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected closing tag instead",url:!1},surrogateCharacterReference:{reason:"Unexpected surrogate character referenced by character reference",description:"Unexpected code point. Do not use lone surrogate characters in HTML"},surrogateInInputStream:{reason:"Unexpected surrogate character",description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:"Invalid character after system identifier in doctype",description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:"Unexpected character in attribute name",description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:"Unexpected character in unquoted attribute value",description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:"Unexpected equals sign before attribute name",description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:"Unexpected NULL character",description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:"Unexpected question mark instead of tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:"Unexpected slash in tag",description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:"Unexpected unknown named character reference",description:"Unexpected character reference. Expected known named character references"}},vme="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-",xme=/-[a-z]/g,Qme=/%c(?:([-+])(\d+))?/g,Ime=/%x/g,Dme={2:!0,1:!1,0:null},Sme={};function Fme(t,e){const n=e||Sme,a=n.onerror,r=t instanceof OC?t:new OC(t),i=n.fragment?pme:dme,o=String(r),s=i(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?c:null,scriptingEnabled:!1});return Nde(s,{file:r,space:n.space,verbose:n.verbose});function c(l){const u=l.code,d=Ome(u),p=n[d],A=p??!0,m=typeof A=="number"?A:A?1:0;if(m){const f=Eme[d],h=new on(g(f.reason),{place:{start:{line:l.startLine,column:l.startCol,offset:l.startOffset},end:{line:l.endLine,column:l.endCol,offset:l.endOffset}},ruleId:u,source:"hast-util-from-html"});r.path&&(h.file=r.path,h.name=r.path+":"+h.name),h.fatal=Dme[m],h.note=g(f.description),h.url=f.url===!1?void 0:vme+u,a(h)}function g(f){return f.replace(Qme,h).replace(Ime,y);function h(k,_,C){const Q=(C?Number.parseInt(C,10):0)*(_==="-"?-1:1),x=o.charAt(l.startOffset+Q);return Tme(x)}function y(){return $me(o.charCodeAt(l.startOffset))}}}}function Ome(t){return t.replace(xme,Nme)}function Nme(t){return t.charAt(1).toUpperCase()}function Tme(t){return t==="`"?"` ` `":t}function $me(t){return"0x"+t.toString(16).toUpperCase()}function Lme(t){const e=this,{emitParseErrors:n,...a}={...e.data("settings"),...t};e.parser=r;function r(i,o){return Fme(i,{...a,onerror:n?function(s){o.path&&(s.name=o.path+":"+s.name,s.file=o.path),o.messages.push(s)}:void 0})}}const Mme=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rme=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pme={};function x$(t,e){return(Pme.jsx?Rme:Mme).test(t)}const jme=/[ \t\n\f\r]/g;function xg(t){return typeof t=="object"?t.type==="text"?Q$(t.value):!1:Q$(t)}function Q$(t){return t.replace(jme,"")===""}var Qc={},$C,I$;function qme(){if(I$)return $C;I$=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
|
|
271
|
-
`,l="/",u="*",d="",p="comment",A="declaration";function m(f,h){if(typeof f!="string")throw new TypeError("First argument must be a string");if(!f)return[];h=h||{};var y=1,k=1;function _(M){var G=M.match(e);G&&(y+=G.length);var Z=M.lastIndexOf(c);k=~Z?M.length-Z:k+M.length}function C(){var M={line:y,column:k};return function(G){return G.position=new Q(M),P(),G}}function Q(M){this.start=M,this.end={line:y,column:k},this.source=h.source}Q.prototype.content=f;function x(M){var G=new Error(h.source+":"+y+":"+k+": "+M);if(G.reason=M,G.filename=h.source,G.line=y,G.column=k,G.source=f,!h.silent)throw G}function S(M){var G=M.exec(f);if(G){var Z=G[0];return _(Z),f=f.slice(Z.length),G}}function P(){S(n)}function T(M){var G;for(M=M||[];G=j();)G!==!1&&M.push(G);return M}function j(){var M=C();if(!(l!=f.charAt(0)||u!=f.charAt(1))){for(var G=2;d!=f.charAt(G)&&(u!=f.charAt(G)||l!=f.charAt(G+1));)++G;if(G+=2,d===f.charAt(G-1))return x("End of comment missing");var Z=f.slice(2,G-2);return k+=2,_(Z),f=f.slice(G),k+=2,M({type:p,comment:Z})}}function U(){var M=C(),G=S(a);if(G){if(j(),!S(r))return x("property missing ':'");var Z=S(i),de=M({type:A,property:g(G[0].replace(t,d)),value:Z?g(Z[0].replace(t,d)):d});return S(o),de}}function L(){var M=[];T(M);for(var G;G=U();)G!==!1&&(M.push(G),T(M));return M}return P(),L()}function g(f){return f?f.replace(s,d):d}return $C=m,$C}var D$;function Gme(){if(D$)return Qc;D$=1;var t=Qc&&Qc.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.default=n;const e=t(qme());function n(a,r){let i=null;if(!a||typeof a!="string")return i;const o=(0,e.default)(a),s=typeof r=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:l,value:u}=c;s?r(l,u,c):u&&(i=i||{},i[l]=u)}),i}return Qc}var rd={},S$;function zme(){if(S$)return rd;S$=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,i=function(l){return!l||n.test(l)||t.test(l)},o=function(l,u){return u.toUpperCase()},s=function(l,u){return"".concat(u,"-")},c=function(l,u){return u===void 0&&(u={}),i(l)?l:(l=l.toLowerCase(),u.reactCompat?l=l.replace(r,s):l=l.replace(a,s),l.replace(e,o))};return rd.camelCase=c,rd}var id,F$;function Hme(){if(F$)return id;F$=1;var t=id&&id.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(Gme()),n=zme();function a(r,i){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(s,c){s&&c&&(o[(0,n.camelCase)(s,i)]=c)}),o}return a.default=a,id=a,id}var Ume=Hme();const Zme=Yd(Ume),Yme=Kme("start");function Kme(t){return e;function e(n){const a=n&&n.position&&n.position[t]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}const LC={}.hasOwnProperty,Wme=new Map,Jme=/[A-Z]/g,Vme=new Set(["table","tbody","thead","tfoot","tr"]),Xme=new Set(["td","th"]),O$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function N$(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let a;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=sge(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=oge(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:a,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Yi:Uu,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=T$(r,t,void 0);return i&&typeof i!="string"?i:r.create(t,r.Fragment,{children:i||void 0},void 0)}function T$(t,e,n){if(e.type==="element")return ege(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return tge(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return age(t,e,n);if(e.type==="mdxjsEsm")return nge(t,e);if(e.type==="root")return rge(t,e,n);if(e.type==="text")return ige(t,e)}function ege(t,e,n){const a=t.schema;let r=a;e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=Yi,t.schema=r),t.ancestors.push(e);const i=L$(t,e.tagName,!1),o=cge(t,e);let s=RC(t,e);return Vme.has(e.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!xg(c):!0})),$$(t,o,i,e),MC(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function tge(t,e){if(e.data&&e.data.estree&&t.evaluater){const a=e.data.estree.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}od(t,e.position)}function nge(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);od(t,e.position)}function age(t,e,n){const a=t.schema;let r=a;e.name==="svg"&&a.space==="html"&&(r=Yi,t.schema=r),t.ancestors.push(e);const i=e.name===null?t.Fragment:L$(t,e.name,!0),o=lge(t,e),s=RC(t,e);return $$(t,o,i,e),MC(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function rge(t,e,n){const a={};return MC(a,RC(t,e)),t.create(e,t.Fragment,a,n)}function ige(t,e){return e.value}function $$(t,e,n,a){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=a)}function MC(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function oge(t,e,n){return a;function a(r,i,o,s){const l=Array.isArray(o.children)?n:e;return s?l(i,o,s):l(i,o)}}function sge(t,e){return n;function n(a,r,i,o){const s=Array.isArray(i.children),c=Yme(a);return e(r,i,o,s,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function cge(t,e){const n={};let a,r;for(r in e.properties)if(r!=="children"&&LC.call(e.properties,r)){const i=uge(t,r,e.properties[r]);if(i){const[o,s]=i;t.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&Xme.has(e.tagName)?a=s:n[o]=s}}if(a){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function lge(t,e){const n={};for(const a of e.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&t.evaluater){const i=a.data.estree.body[0];i.type;const o=i.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,t.evaluater.evaluateExpression(s.argument))}else od(t,e.position);else{const r=a.name;let i;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&t.evaluater){const s=a.value.data.estree.body[0];s.type,i=t.evaluater.evaluateExpression(s.expression)}else od(t,e.position);else i=a.value===null?!0:a.value;n[r]=i}return n}function RC(t,e){const n=[];let a=-1;const r=t.passKeys?new Map:Wme;for(;++a<e.children.length;){const i=e.children[a];let o;if(t.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const l=r.get(c)||0;o=c+"-"+l,r.set(c,l+1)}}const s=T$(t,i,o);s!==void 0&&n.push(s)}return n}function uge(t,e,n){const a=gg(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?IT(n):FT(n)),a.property==="style"){let r=typeof n=="object"?n:dge(t,String(n));return t.stylePropertyNameCase==="css"&&(r=pge(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&a.space?hde[a.property]||a.property:a.attribute,n]}}function dge(t,e){try{return Zme(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const a=n,r=new on("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=O$+"#cannot-parse-style-attribute",r}}function L$(t,e,n){let a;if(!n)a={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let i=-1,o;for(;++i<r.length;){const s=x$(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}a=o}else a=x$(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(a.type==="Literal"){const r=a.value;return LC.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(a);od(t)}function od(t,e){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=O$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pge(t){const e={};let n;for(n in t)LC.call(t,n)&&(e[Age(n)]=t[n]);return e}function Age(t){let e=t.replace(Jme,mge);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function mge(t){return"-"+t.toLowerCase()}function gge(t){const e=this;e.compiler=n;function n(a,r){return N$(a,{filePath:r.path,...t})}}function M$(t){if(t)throw t}var PC,R$;function fge(){if(R$)return PC;R$=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},i=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var u=t.call(l,"constructor"),d=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!u&&!d)return!1;var p;for(p in l);return typeof p>"u"||t.call(l,p)},o=function(l,u){n&&u.name==="__proto__"?n(l,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):l[u.name]=u.newValue},s=function(l,u){if(u==="__proto__")if(t.call(l,u)){if(a)return a(l,u).value}else return;return l[u]};return PC=function c(){var l,u,d,p,A,m,g=arguments[0],f=1,h=arguments.length,y=!1;for(typeof g=="boolean"&&(y=g,g=arguments[1]||{},f=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});f<h;++f)if(l=arguments[f],l!=null)for(u in l)d=s(g,u),p=s(l,u),g!==p&&(y&&p&&(i(p)||(A=r(p)))?(A?(A=!1,m=d&&r(d)?d:[]):m=d&&i(d)?d:{},o(g,{name:u,newValue:c(y,m,p)})):typeof p<"u"&&o(g,{name:u,newValue:p}));return g},PC}var bge=fge();const jC=Yd(bge);function qC(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function hge(){const t=[],e={run:n,use:a};return e;function n(...r){let i=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...r);function s(c,...l){const u=t[++i];let d=-1;if(c){o(c);return}for(;++d<r.length;)(l[d]===null||l[d]===void 0)&&(l[d]=r[d]);r=l,u?yge(u,s)(...l):o(null,...l)}}function a(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function yge(t,e){let n;return a;function a(...o){const s=t.length>o.length;let c;s&&o.push(r);try{c=t.apply(this,o)}catch(l){const u=l;if(s&&n)throw u;return r(u)}s||(c&&c.then&&typeof c.then=="function"?c.then(i,r):c instanceof Error?r(c):i(c))}function r(o,...s){n||(n=!0,e(o,...s))}function i(o){r(null,o)}}const wge=(function(t){const a=this.constructor.prototype,r=a[t],i=function(){return r.apply(i,arguments)};return Object.setPrototypeOf(i,a),i}),kge={}.hasOwnProperty;class GC extends wge{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=hge()}copy(){const e=new GC;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];e.use(...a)}return e.data(jC(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(UC("data",this.frozen),this.namespace[e]=n,this):kge.call(this.namespace,e)&&this.namespace[e]||void 0:e?(UC("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const r=n.call(e,...a);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Qg(e),a=this.parser||this.Parser;return zC("parse",a),a(String(n),n)}process(e,n){const a=this;return this.freeze(),zC("process",this.parser||this.Parser),HC("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(i,o){const s=Qg(e),c=a.parse(s);a.run(c,s,function(u,d,p){if(u||!d||!p)return l(u);const A=d,m=a.stringify(A,p);Bge(m)?p.value=m:p.result=m,l(u,p)});function l(u,d){u||!d?o(u):i?i(d):n(void 0,d)}}}processSync(e){let n=!1,a;return this.freeze(),zC("processSync",this.parser||this.Parser),HC("processSync",this.compiler||this.Compiler),this.process(e,r),j$("processSync","process",n),a;function r(i,o){n=!0,M$(i),a=o}}run(e,n,a){P$(e),this.freeze();const r=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?i(void 0,a):new Promise(i);function i(o,s){const c=Qg(n);r.run(e,c,l);function l(u,d,p){const A=d||e;u?s(u):o?o(A):a(void 0,A,p)}}}runSync(e,n){let a=!1,r;return this.run(e,n,i),j$("runSync","run",a),r;function i(o,s){M$(o),r=s,a=!0}}stringify(e,n){this.freeze();const a=Qg(n),r=this.compiler||this.Compiler;return HC("stringify",r),P$(e),r(e,a)}use(e,...n){const a=this.attachers,r=this.namespace;if(UC("use",this.frozen),e!=null)if(typeof e=="function")c(e,n);else if(typeof e=="object")Array.isArray(e)?s(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(l){if(typeof l=="function")c(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[u,...d]=l;c(u,d)}else o(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function o(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(l.plugins),l.settings&&(r.settings=jC(!0,r.settings,l.settings))}function s(l){let u=-1;if(l!=null)if(Array.isArray(l))for(;++u<l.length;){const d=l[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function c(l,u){let d=-1,p=-1;for(;++d<a.length;)if(a[d][0]===l){p=d;break}if(p===-1)a.push([l,...u]);else if(u.length>0){let[A,...m]=u;const g=a[p][1];qC(g)&&qC(A)&&(A=jC(!0,g,A)),a[p]=[l,A,...m]}}}}const Cge=new GC().freeze();function zC(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function HC(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function UC(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P$(t){if(!qC(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function j$(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Qg(t){return _ge(t)?t:new OC(t)}function _ge(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Bge(t){return typeof t=="string"||Ege(t)}function Ege(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const q$=(function(t){if(t==null)return Ige;if(typeof t=="function")return Ig(t);if(typeof t=="object")return Array.isArray(t)?vge(t):xge(t);if(typeof t=="string")return Qge(t);throw new Error("Expected function, string, or object as test")});function vge(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=q$(t[n]);return Ig(a);function a(...r){let i=-1;for(;++i<e.length;)if(e[i].apply(this,r))return!0;return!1}}function xge(t){const e=t;return Ig(n);function n(a){const r=a;let i;for(i in t)if(r[i]!==e[i])return!1;return!0}}function Qge(t){return Ig(e);function e(n){return n&&n.type===t}}function Ig(t){return e;function e(n,a,r){return!!(Dge(n)&&t.call(this,n,typeof a=="number"?a:void 0,r||void 0))}}function Ige(){return!0}function Dge(t){return t!==null&&typeof t=="object"&&"type"in t}function uDe(t){return t}const G$=[],Sge=!0,z$=!1,Fge="skip";function Oge(t,e,n,a){let r;typeof e=="function"&&typeof n!="function"?(a=n,n=e):r=e;const i=q$(r),o=a?-1:1;s(t,void 0,[])();function s(c,l,u){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const A=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(A?"<"+A+">":""))+")"})}return p;function p(){let A=G$,m,g,f;if((!e||i(c,l,u[u.length-1]||void 0))&&(A=Nge(n(c,u)),A[0]===z$))return A;if("children"in c&&c.children){const h=c;if(h.children&&A[0]!==Fge)for(g=(a?h.children.length:-1)+o,f=u.concat(h);g>-1&&g<h.children.length;){const y=h.children[g];if(m=s(y,g,f)(),m[0]===z$)return m;g=typeof m[1]=="number"?m[1]:g+o}}return A}}}function Nge(t){return Array.isArray(t)?t:typeof t=="number"?[Sge,t]:t==null?G$:[t]}function Tge(t,e,n,a){let r,i,o;i=e,o=n,r=a,Oge(t,i,s,r);function s(c,l){const u=l[l.length-1],d=u?u.children.indexOf(c):void 0;return o(c,d,u)}}const $ge=()=>t=>(Tge(t,"element",e=>{if(["h2","h3","h4"].includes(e.tagName)){const n=e.children[0].type==="text"?e.children[0].value:"";e.properties={...e.properties,id:Lge(n)}}}),t);function Lge(t){return t.toLowerCase().normalize("NFKD").replace(/[^\w\s-]+/g,"").replace(/[-\s]+/g,"-").trim().replace(/^-+|-+$/g,"")}function H$({components:t}={}){return Cge().use(Lme,{fragment:!0}).use($ge).use(gge,{Fragment:ss.Fragment,jsx:ss.jsx,jsxs:ss.jsxs,components:t})}const Mge=({code:t})=>{const[e,n]=F.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)}catch{}};return w.jsx("button",{onClick:a,className:"invisible absolute top-2 right-2 z-20 bg-transparent p-2 group-hover:visible",children:e?w.jsx(yQ,{size:18}):w.jsx(wQ,{size:18})})},ZC=({level:t,children:e,id:n})=>{const a=`h${t}`;return w.jsx(a,{id:n,children:e})};let Ft=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Rge(t){return YC(t)}function YC(t){return Array.isArray(t)?Pge(t):t instanceof RegExp?t:typeof t=="object"?jge(t):t}function Pge(t){let e=[];for(let n=0,a=t.length;n<a;n++)e[n]=YC(t[n]);return e}function jge(t){let e={};for(let n in t)e[n]=YC(t[n]);return e}function U$(t,...e){return e.forEach(n=>{for(let a in n)t[a]=n[a]}),t}function Z$(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Z$(t.substring(0,t.length-1)):t.substr(~e+1)}var KC=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Dg=class{static hasCaptures(t){return t===null?!1:(KC.lastIndex=0,KC.test(t))}static replaceCaptures(t,e,n){return t.replace(KC,(a,r,i,o)=>{let s=n[parseInt(r||i,10)];if(s){let c=e.substring(s.start,s.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return a})}};function Y$(t,e){return t<e?-1:t>e?1:0}function K$(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,a=e.length;if(n===a){for(let r=0;r<n;r++){let i=Y$(t[r],e[r]);if(i!==0)return i}return 0}return n-a}function W$(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function J$(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var V$=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Sg=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(zge(t),e)}static createFromParsedTheme(t,e){return Uge(t,e)}_cachedMatchRoot=new V$(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,a=this._cachedMatchRoot.get(e).find(r=>qge(t.parent,r.parentScopes));return a?new X$(a.fontStyle,a.foreground,a.background):null}},WC=class lf{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const a of n)e=new lf(e,a);return e}static from(...e){let n=null;for(let a=0;a<e.length;a++)n=new lf(n,e[a]);return n}push(e){return new lf(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push(a.scopeName),a=a.parent;return a===e?n.reverse():void 0}};function qge(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let a=e[n],r=!1;if(a===">"){if(n===e.length-1)return!1;a=e[++n],r=!0}for(;t&&!Gge(t.scopeName,a);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Gge(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var X$=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function zge(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],a=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let s;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(o.scope)?s=o.scope:s=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let d=o.settings.fontStyle.split(" ");for(let p=0,A=d.length;p<A;p++)switch(d[p]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&W$(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&W$(o.settings.background)&&(u=o.settings.background);for(let d=0,p=s.length;d<p;d++){let m=s[d].trim().split(" "),g=m[m.length-1],f=null;m.length>1&&(f=m.slice(0,m.length-1),f.reverse()),n[a++]=new Hge(g,f,r,c,l,u)}}return n}var Hge=class{constructor(t,e,n,a,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},wn=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(wn||{});function Uge(t,e){t.sort((c,l)=>{let u=Y$(c.scope,l.scope);return u!==0||(u=K$(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,a="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(a=c.foreground),c.background!==null&&(r=c.background)}let i=new Zge(e),o=new X$(n,i.getId(a),i.getId(r)),s=new Kge(new JC(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];s.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Sg(i,o,s)}var Zge=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Yge=Object.freeze([]),JC=class LL{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,a,r,i){this.scopeDepth=e,this.parentScopes=n||Yge,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new LL(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let a=0,r=e.length;a<r;a++)n[a]=e[a].clone();return n}acceptOverwrite(e,n,a,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},Kge=class T_{constructor(e,n=[],a={}){this._mainRule=e,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let a=0,r=0;for(;e.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let a=e.indexOf("."),r,i;if(a===-1?(r=e,i=""):(r=e.substring(0,a),i=e.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(T_._cmpBySpecificity),n}insert(e,n,a,r,i,o){if(n===""){this._doInsertHere(e,a,r,i,o);return}let s=n.indexOf("."),c,l;s===-1?(c=n,l=""):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new T_(this._mainRule.clone(),JC.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,a,r,i,o)}_doInsertHere(e,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(e,a,r,i);return}for(let o=0,s=this._rulesWithParentScopes.length;o<s;o++){let c=this._rulesWithParentScopes[o];if(K$(c.parentScopes,n)===0){c.acceptOverwrite(e,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new JC(e,n,a,r,i))}},Ic=class ha{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=ha.getLanguageId(e),a=ha.getTokenType(e),r=ha.getFontStyle(e),i=ha.getForeground(e),o=ha.getBackground(e);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,a,r,i,o,s){let c=ha.getLanguageId(e),l=ha.getTokenType(e),u=ha.containsBalancedBrackets(e)?1:0,d=ha.getFontStyle(e),p=ha.getForeground(e),A=ha.getBackground(e);return n!==0&&(c=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(d=i),o!==0&&(p=o),s!==0&&(A=s),(c<<0|l<<8|u<<10|d<<11|p<<15|A<<24)>>>0}};function dDe(t){return t}function pDe(t){return t}function Fg(t,e){const n=[],a=Wge(t);let r=a.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=a.next();const c=s();return r===")"&&(r=a.next()),c}if(e3(r)){const c=[];do c.push(r),r=a.next();while(e3(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(d=>d(u))}function s(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=o()}return u=>c.some(d=>d(u))}}function e3(t){return!!t&&!!t.match(/[\w\.:]+/)}function Wge(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const a=n[0];return n=e.exec(t),a}}}function t3(t){typeof t.dispose=="function"&&t.dispose()}var sd=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Jge=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vge=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Xge=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new sd(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Vge;for(const n of t)efe(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof sd){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function efe(t,e,n,a){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof sd?Og({baseGrammar:i,selfGrammar:r},a):VC(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const o=n.injections(t.scopeName);if(o)for(const s of o)a.add(new sd(s))}function VC(t,e,n){if(e.repository&&e.repository[t]){const a=e.repository[t];Ng([a],e,n)}}function Og(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Ng(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Ng(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Ng(t,e,n){for(const a of t){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?U$({},e.repository,a.repository):e.repository;Array.isArray(a.patterns)&&Ng(a.patterns,{...e,repository:r},n);const i=a.include;if(!i)continue;const o=n3(i);switch(o.kind){case 0:Og({...e,selfGrammar:e.baseGrammar},n);break;case 1:Og(e,n);break;case 2:VC(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const s=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(s){const c={baseGrammar:e.baseGrammar,selfGrammar:s,repository:r};o.kind===4?VC(o.ruleName,c,n):Og(c,n)}else o.kind===4?n.add(new Jge(o.scopeName,o.ruleName)):n.add(new sd(o.scopeName));break}}}var tfe=class{kind=0},nfe=class{kind=1},afe=class{constructor(t){this.ruleName=t}kind=2},rfe=class{constructor(t){this.scopeName=t}kind=3},ife=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function n3(t){if(t==="$base")return new tfe;if(t==="$self")return new nfe;const e=t.indexOf("#");if(e===-1)return new rfe(t);if(e===0)return new afe(t.substring(1));{const n=t.substring(0,e),a=t.substring(e+1);return new ife(n,a)}}var ofe=/\\(\d+)/,a3=/\\(\d+)/g,sfe=-1,r3=-2;function ADe(t){return t}function mDe(t){return t}var cd=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,a){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Dg.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Dg.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Z$(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Dg.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Dg.replaceCaptures(this._contentName,t,e)}},cfe=class extends cd{retokenizeCapturedWithRuleId;constructor(t,e,n,a,r){super(t,e,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,a){throw new Error("Not supported!")}},lfe=class extends cd{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,null),this._match=new ld(a,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ud,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},i3=class extends cd{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ud,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},XC=class extends cd{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r,i,o,s,c,l){super(t,e,n,a),this._begin=new ld(r,this.id),this.beginCaptures=i,this._end=new ld(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,a)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ud;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Tg=class extends cd{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,a,r,i,o,s,c){super(t,e,n,a),this._begin=new ld(r,this.id),this.beginCaptures=i,this.whileCaptures=s,this._while=new ld(o,r3),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ud;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,a){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,a)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ud,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},o3=class Cn{static createCaptureRule(e,n,a,r,i){return e.registerRule(o=>new cfe(n,o,a,r,i))}static getCompiledRuleId(e,n,a){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new lfe(e.$vscodeTextmateLocation,e.id,e.name,e.match,Cn._compileCaptures(e.captures,n,a));if(typeof e.begin>"u"){e.repository&&(a=U$({},a,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new i3(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Cn._compilePatterns(i,n,a))}return e.while?new Tg(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Cn._compileCaptures(e.beginCaptures||e.captures,n,a),e.while,Cn._compileCaptures(e.whileCaptures||e.captures,n,a),Cn._compilePatterns(e.patterns,n,a)):new XC(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Cn._compileCaptures(e.beginCaptures||e.captures,n,a),e.end,Cn._compileCaptures(e.endCaptures||e.captures,n,a),e.applyEndPatternLast,Cn._compilePatterns(e.patterns,n,a))}),e.id}static _compileCaptures(e,n,a){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);s>i&&(i=s)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);let c=0;e[o].patterns&&(c=Cn.getCompiledRuleId(e[o],n,a)),r[s]=Cn.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,a){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const s=e[i];let c=-1;if(s.include){const l=n3(s.include);switch(l.kind){case 0:case 1:c=Cn.getCompiledRuleId(a[s.include],n,a);break;case 2:let u=a[l.ruleName];u&&(c=Cn.getCompiledRuleId(u,n,a));break;case 3:case 4:const d=l.scopeName,p=l.kind===4?l.ruleName:null,A=n.getExternalGrammar(d,a);if(A)if(p){let m=A.repository[p];m&&(c=Cn.getCompiledRuleId(m,n,A.repository))}else c=Cn.getCompiledRuleId(A.repository.$self,n,A.repository);break}}else c=Cn.getCompiledRuleId(s,n,a);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof i3||l instanceof XC||l instanceof Tg)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},ld=class ML{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const a=e.length;let r=0,i=[],o=!1;for(let s=0;s<a;s++)if(e.charAt(s)==="\\"&&s+1<a){const l=e.charAt(s+1);l==="z"?(i.push(e.substring(r,s)),i.push("$(?!\\n)(?<!\\n)"),r=s+2):(l==="A"||l==="G")&&(o=!0),s++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=ofe.test(this.source):this.hasBackReferences=!1}clone(){return new ML(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>e.substring(r.start,r.end));return a3.lastIndex=0,this.source.replace(a3,(r,i)=>J$(a[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],a=[],r=[],i,o,s,c;for(i=0,o=this.source.length;i<o;i++)s=this.source.charAt(i),e[i]=s,n[i]=s,a[i]=s,r[i]=s,s==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",n[i+1]="",a[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="",n[i+1]="G",a[i+1]="",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,a[i+1]=c,r[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ud=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new s3(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let a=this._items.map(r=>r.resolveAnchors(e,n));return new s3(t,a,this._items.map(r=>r.ruleId))}},s3=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
271
|
+
`,l="/",u="*",d="",p="comment",A="declaration";function m(f,h){if(typeof f!="string")throw new TypeError("First argument must be a string");if(!f)return[];h=h||{};var y=1,k=1;function _(M){var G=M.match(e);G&&(y+=G.length);var Z=M.lastIndexOf(c);k=~Z?M.length-Z:k+M.length}function C(){var M={line:y,column:k};return function(G){return G.position=new Q(M),P(),G}}function Q(M){this.start=M,this.end={line:y,column:k},this.source=h.source}Q.prototype.content=f;function x(M){var G=new Error(h.source+":"+y+":"+k+": "+M);if(G.reason=M,G.filename=h.source,G.line=y,G.column=k,G.source=f,!h.silent)throw G}function S(M){var G=M.exec(f);if(G){var Z=G[0];return _(Z),f=f.slice(Z.length),G}}function P(){S(n)}function T(M){var G;for(M=M||[];G=j();)G!==!1&&M.push(G);return M}function j(){var M=C();if(!(l!=f.charAt(0)||u!=f.charAt(1))){for(var G=2;d!=f.charAt(G)&&(u!=f.charAt(G)||l!=f.charAt(G+1));)++G;if(G+=2,d===f.charAt(G-1))return x("End of comment missing");var Z=f.slice(2,G-2);return k+=2,_(Z),f=f.slice(G),k+=2,M({type:p,comment:Z})}}function U(){var M=C(),G=S(a);if(G){if(j(),!S(r))return x("property missing ':'");var Z=S(i),de=M({type:A,property:g(G[0].replace(t,d)),value:Z?g(Z[0].replace(t,d)):d});return S(o),de}}function L(){var M=[];T(M);for(var G;G=U();)G!==!1&&(M.push(G),T(M));return M}return P(),L()}function g(f){return f?f.replace(s,d):d}return $C=m,$C}var D$;function Gme(){if(D$)return Qc;D$=1;var t=Qc&&Qc.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.default=n;const e=t(qme());function n(a,r){let i=null;if(!a||typeof a!="string")return i;const o=(0,e.default)(a),s=typeof r=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:l,value:u}=c;s?r(l,u,c):u&&(i=i||{},i[l]=u)}),i}return Qc}var rd={},S$;function zme(){if(S$)return rd;S$=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,i=function(l){return!l||n.test(l)||t.test(l)},o=function(l,u){return u.toUpperCase()},s=function(l,u){return"".concat(u,"-")},c=function(l,u){return u===void 0&&(u={}),i(l)?l:(l=l.toLowerCase(),u.reactCompat?l=l.replace(r,s):l=l.replace(a,s),l.replace(e,o))};return rd.camelCase=c,rd}var id,F$;function Hme(){if(F$)return id;F$=1;var t=id&&id.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(Gme()),n=zme();function a(r,i){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(s,c){s&&c&&(o[(0,n.camelCase)(s,i)]=c)}),o}return a.default=a,id=a,id}var Ume=Hme();const Zme=Yd(Ume),Yme=Kme("start");function Kme(t){return e;function e(n){const a=n&&n.position&&n.position[t]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}const LC={}.hasOwnProperty,Wme=new Map,Jme=/[A-Z]/g,Vme=new Set(["table","tbody","thead","tfoot","tr"]),Xme=new Set(["td","th"]),O$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function N$(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let a;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=sge(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=oge(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:a,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Yi:Uu,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=T$(r,t,void 0);return i&&typeof i!="string"?i:r.create(t,r.Fragment,{children:i||void 0},void 0)}function T$(t,e,n){if(e.type==="element")return ege(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return tge(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return age(t,e,n);if(e.type==="mdxjsEsm")return nge(t,e);if(e.type==="root")return rge(t,e,n);if(e.type==="text")return ige(t,e)}function ege(t,e,n){const a=t.schema;let r=a;e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(r=Yi,t.schema=r),t.ancestors.push(e);const i=L$(t,e.tagName,!1),o=cge(t,e);let s=RC(t,e);return Vme.has(e.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!xg(c):!0})),$$(t,o,i,e),MC(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function tge(t,e){if(e.data&&e.data.estree&&t.evaluater){const a=e.data.estree.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}od(t,e.position)}function nge(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);od(t,e.position)}function age(t,e,n){const a=t.schema;let r=a;e.name==="svg"&&a.space==="html"&&(r=Yi,t.schema=r),t.ancestors.push(e);const i=e.name===null?t.Fragment:L$(t,e.name,!0),o=lge(t,e),s=RC(t,e);return $$(t,o,i,e),MC(o,s),t.ancestors.pop(),t.schema=a,t.create(e,i,o,n)}function rge(t,e,n){const a={};return MC(a,RC(t,e)),t.create(e,t.Fragment,a,n)}function ige(t,e){return e.value}function $$(t,e,n,a){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=a)}function MC(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function oge(t,e,n){return a;function a(r,i,o,s){const l=Array.isArray(o.children)?n:e;return s?l(i,o,s):l(i,o)}}function sge(t,e){return n;function n(a,r,i,o){const s=Array.isArray(i.children),c=Yme(a);return e(r,i,o,s,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function cge(t,e){const n={};let a,r;for(r in e.properties)if(r!=="children"&&LC.call(e.properties,r)){const i=uge(t,r,e.properties[r]);if(i){const[o,s]=i;t.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&Xme.has(e.tagName)?a=s:n[o]=s}}if(a){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function lge(t,e){const n={};for(const a of e.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&t.evaluater){const i=a.data.estree.body[0];i.type;const o=i.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,t.evaluater.evaluateExpression(s.argument))}else od(t,e.position);else{const r=a.name;let i;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&t.evaluater){const s=a.value.data.estree.body[0];s.type,i=t.evaluater.evaluateExpression(s.expression)}else od(t,e.position);else i=a.value===null?!0:a.value;n[r]=i}return n}function RC(t,e){const n=[];let a=-1;const r=t.passKeys?new Map:Wme;for(;++a<e.children.length;){const i=e.children[a];let o;if(t.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const l=r.get(c)||0;o=c+"-"+l,r.set(c,l+1)}}const s=T$(t,i,o);s!==void 0&&n.push(s)}return n}function uge(t,e,n){const a=gg(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?IT(n):FT(n)),a.property==="style"){let r=typeof n=="object"?n:dge(t,String(n));return t.stylePropertyNameCase==="css"&&(r=pge(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&a.space?hde[a.property]||a.property:a.attribute,n]}}function dge(t,e){try{return Zme(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const a=n,r=new on("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=O$+"#cannot-parse-style-attribute",r}}function L$(t,e,n){let a;if(!n)a={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let i=-1,o;for(;++i<r.length;){const s=x$(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}a=o}else a=x$(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(a.type==="Literal"){const r=a.value;return LC.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(a);od(t)}function od(t,e){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=O$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pge(t){const e={};let n;for(n in t)LC.call(t,n)&&(e[Age(n)]=t[n]);return e}function Age(t){let e=t.replace(Jme,mge);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function mge(t){return"-"+t.toLowerCase()}function gge(t){const e=this;e.compiler=n;function n(a,r){return N$(a,{filePath:r.path,...t})}}function M$(t){if(t)throw t}var PC,R$;function fge(){if(R$)return PC;R$=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},i=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var u=t.call(l,"constructor"),d=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!u&&!d)return!1;var p;for(p in l);return typeof p>"u"||t.call(l,p)},o=function(l,u){n&&u.name==="__proto__"?n(l,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):l[u.name]=u.newValue},s=function(l,u){if(u==="__proto__")if(t.call(l,u)){if(a)return a(l,u).value}else return;return l[u]};return PC=function c(){var l,u,d,p,A,m,g=arguments[0],f=1,h=arguments.length,y=!1;for(typeof g=="boolean"&&(y=g,g=arguments[1]||{},f=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});f<h;++f)if(l=arguments[f],l!=null)for(u in l)d=s(g,u),p=s(l,u),g!==p&&(y&&p&&(i(p)||(A=r(p)))?(A?(A=!1,m=d&&r(d)?d:[]):m=d&&i(d)?d:{},o(g,{name:u,newValue:c(y,m,p)})):typeof p<"u"&&o(g,{name:u,newValue:p}));return g},PC}var bge=fge();const jC=Yd(bge);function qC(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function hge(){const t=[],e={run:n,use:a};return e;function n(...r){let i=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...r);function s(c,...l){const u=t[++i];let d=-1;if(c){o(c);return}for(;++d<r.length;)(l[d]===null||l[d]===void 0)&&(l[d]=r[d]);r=l,u?yge(u,s)(...l):o(null,...l)}}function a(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function yge(t,e){let n;return a;function a(...o){const s=t.length>o.length;let c;s&&o.push(r);try{c=t.apply(this,o)}catch(l){const u=l;if(s&&n)throw u;return r(u)}s||(c&&c.then&&typeof c.then=="function"?c.then(i,r):c instanceof Error?r(c):i(c))}function r(o,...s){n||(n=!0,e(o,...s))}function i(o){r(null,o)}}const wge=(function(t){const a=this.constructor.prototype,r=a[t],i=function(){return r.apply(i,arguments)};return Object.setPrototypeOf(i,a),i}),kge={}.hasOwnProperty;class GC extends wge{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=hge()}copy(){const e=new GC;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];e.use(...a)}return e.data(jC(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(UC("data",this.frozen),this.namespace[e]=n,this):kge.call(this.namespace,e)&&this.namespace[e]||void 0:e?(UC("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const r=n.call(e,...a);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Qg(e),a=this.parser||this.Parser;return zC("parse",a),a(String(n),n)}process(e,n){const a=this;return this.freeze(),zC("process",this.parser||this.Parser),HC("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(i,o){const s=Qg(e),c=a.parse(s);a.run(c,s,function(u,d,p){if(u||!d||!p)return l(u);const A=d,m=a.stringify(A,p);Bge(m)?p.value=m:p.result=m,l(u,p)});function l(u,d){u||!d?o(u):i?i(d):n(void 0,d)}}}processSync(e){let n=!1,a;return this.freeze(),zC("processSync",this.parser||this.Parser),HC("processSync",this.compiler||this.Compiler),this.process(e,r),j$("processSync","process",n),a;function r(i,o){n=!0,M$(i),a=o}}run(e,n,a){P$(e),this.freeze();const r=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?i(void 0,a):new Promise(i);function i(o,s){const c=Qg(n);r.run(e,c,l);function l(u,d,p){const A=d||e;u?s(u):o?o(A):a(void 0,A,p)}}}runSync(e,n){let a=!1,r;return this.run(e,n,i),j$("runSync","run",a),r;function i(o,s){M$(o),r=s,a=!0}}stringify(e,n){this.freeze();const a=Qg(n),r=this.compiler||this.Compiler;return HC("stringify",r),P$(e),r(e,a)}use(e,...n){const a=this.attachers,r=this.namespace;if(UC("use",this.frozen),e!=null)if(typeof e=="function")c(e,n);else if(typeof e=="object")Array.isArray(e)?s(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(l){if(typeof l=="function")c(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[u,...d]=l;c(u,d)}else o(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function o(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(l.plugins),l.settings&&(r.settings=jC(!0,r.settings,l.settings))}function s(l){let u=-1;if(l!=null)if(Array.isArray(l))for(;++u<l.length;){const d=l[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function c(l,u){let d=-1,p=-1;for(;++d<a.length;)if(a[d][0]===l){p=d;break}if(p===-1)a.push([l,...u]);else if(u.length>0){let[A,...m]=u;const g=a[p][1];qC(g)&&qC(A)&&(A=jC(!0,g,A)),a[p]=[l,A,...m]}}}}const Cge=new GC().freeze();function zC(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function HC(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function UC(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P$(t){if(!qC(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function j$(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Qg(t){return _ge(t)?t:new OC(t)}function _ge(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Bge(t){return typeof t=="string"||Ege(t)}function Ege(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const q$=(function(t){if(t==null)return Ige;if(typeof t=="function")return Ig(t);if(typeof t=="object")return Array.isArray(t)?vge(t):xge(t);if(typeof t=="string")return Qge(t);throw new Error("Expected function, string, or object as test")});function vge(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=q$(t[n]);return Ig(a);function a(...r){let i=-1;for(;++i<e.length;)if(e[i].apply(this,r))return!0;return!1}}function xge(t){const e=t;return Ig(n);function n(a){const r=a;let i;for(i in t)if(r[i]!==e[i])return!1;return!0}}function Qge(t){return Ig(e);function e(n){return n&&n.type===t}}function Ig(t){return e;function e(n,a,r){return!!(Dge(n)&&t.call(this,n,typeof a=="number"?a:void 0,r||void 0))}}function Ige(){return!0}function Dge(t){return t!==null&&typeof t=="object"&&"type"in t}function uDe(t){return t}const G$=[],Sge=!0,z$=!1,Fge="skip";function Oge(t,e,n,a){let r;typeof e=="function"&&typeof n!="function"?(a=n,n=e):r=e;const i=q$(r),o=a?-1:1;s(t,void 0,[])();function s(c,l,u){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const A=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(A?"<"+A+">":""))+")"})}return p;function p(){let A=G$,m,g,f;if((!e||i(c,l,u[u.length-1]||void 0))&&(A=Nge(n(c,u)),A[0]===z$))return A;if("children"in c&&c.children){const h=c;if(h.children&&A[0]!==Fge)for(g=(a?h.children.length:-1)+o,f=u.concat(h);g>-1&&g<h.children.length;){const y=h.children[g];if(m=s(y,g,f)(),m[0]===z$)return m;g=typeof m[1]=="number"?m[1]:g+o}}return A}}}function Nge(t){return Array.isArray(t)?t:typeof t=="number"?[Sge,t]:t==null?G$:[t]}function Tge(t,e,n,a){let r,i,o;i=e,o=n,r=a,Oge(t,i,s,r);function s(c,l){const u=l[l.length-1],d=u?u.children.indexOf(c):void 0;return o(c,d,u)}}const $ge=()=>t=>(Tge(t,"element",e=>{if(["h2","h3","h4"].includes(e.tagName)){const n=e.children[0].type==="text"?e.children[0].value:"";e.properties={...e.properties,id:Lge(n)}}}),t);function Lge(t){return t.toLowerCase().normalize("NFKD").replace(/[^\w\s-]+/g,"").replace(/[-\s]+/g,"-").trim().replace(/^-+|-+$/g,"")}function H$({components:t}={}){return Cge().use(Lme,{fragment:!0}).use($ge).use(gge,{Fragment:ss.Fragment,jsx:ss.jsx,jsxs:ss.jsxs,components:t})}const Mge=({code:t})=>{const[e,n]=F.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)}catch{}};return w.jsx("button",{type:"button",onClick:a,className:"invisible absolute top-2 right-2 z-20 bg-transparent p-2 group-hover:visible",children:e?w.jsx(yQ,{size:18}):w.jsx(wQ,{size:18})})},ZC=({level:t,children:e,id:n})=>{const a=`h${t}`;return w.jsx(a,{id:n,children:e})};let Ft=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Rge(t){return YC(t)}function YC(t){return Array.isArray(t)?Pge(t):t instanceof RegExp?t:typeof t=="object"?jge(t):t}function Pge(t){let e=[];for(let n=0,a=t.length;n<a;n++)e[n]=YC(t[n]);return e}function jge(t){let e={};for(let n in t)e[n]=YC(t[n]);return e}function U$(t,...e){return e.forEach(n=>{for(let a in n)t[a]=n[a]}),t}function Z$(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Z$(t.substring(0,t.length-1)):t.substr(~e+1)}var KC=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Dg=class{static hasCaptures(t){return t===null?!1:(KC.lastIndex=0,KC.test(t))}static replaceCaptures(t,e,n){return t.replace(KC,(a,r,i,o)=>{let s=n[parseInt(r||i,10)];if(s){let c=e.substring(s.start,s.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return a})}};function Y$(t,e){return t<e?-1:t>e?1:0}function K$(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,a=e.length;if(n===a){for(let r=0;r<n;r++){let i=Y$(t[r],e[r]);if(i!==0)return i}return 0}return n-a}function W$(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function J$(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var V$=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Sg=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(zge(t),e)}static createFromParsedTheme(t,e){return Uge(t,e)}_cachedMatchRoot=new V$(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,a=this._cachedMatchRoot.get(e).find(r=>qge(t.parent,r.parentScopes));return a?new X$(a.fontStyle,a.foreground,a.background):null}},WC=class lf{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const a of n)e=new lf(e,a);return e}static from(...e){let n=null;for(let a=0;a<e.length;a++)n=new lf(n,e[a]);return n}push(e){return new lf(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push(a.scopeName),a=a.parent;return a===e?n.reverse():void 0}};function qge(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let a=e[n],r=!1;if(a===">"){if(n===e.length-1)return!1;a=e[++n],r=!0}for(;t&&!Gge(t.scopeName,a);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Gge(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var X$=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function zge(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],a=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let s;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(o.scope)?s=o.scope:s=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let d=o.settings.fontStyle.split(" ");for(let p=0,A=d.length;p<A;p++)switch(d[p]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&W$(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&W$(o.settings.background)&&(u=o.settings.background);for(let d=0,p=s.length;d<p;d++){let m=s[d].trim().split(" "),g=m[m.length-1],f=null;m.length>1&&(f=m.slice(0,m.length-1),f.reverse()),n[a++]=new Hge(g,f,r,c,l,u)}}return n}var Hge=class{constructor(t,e,n,a,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=a,this.foreground=r,this.background=i}},wn=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(wn||{});function Uge(t,e){t.sort((c,l)=>{let u=Y$(c.scope,l.scope);return u!==0||(u=K$(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,a="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(a=c.foreground),c.background!==null&&(r=c.background)}let i=new Zge(e),o=new X$(n,i.getId(a),i.getId(r)),s=new Kge(new JC(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];s.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Sg(i,o,s)}var Zge=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Yge=Object.freeze([]),JC=class LL{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,a,r,i){this.scopeDepth=e,this.parentScopes=n||Yge,this.fontStyle=a,this.foreground=r,this.background=i}clone(){return new LL(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let a=0,r=e.length;a<r;a++)n[a]=e[a].clone();return n}acceptOverwrite(e,n,a,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),a!==0&&(this.foreground=a),r!==0&&(this.background=r)}},Kge=class T_{constructor(e,n=[],a={}){this._mainRule=e,this._children=a,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let a=0,r=0;for(;e.parentScopes[a]===">"&&a++,n.parentScopes[r]===">"&&r++,!(a>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[a].length;if(i!==0)return i;a++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let a=e.indexOf("."),r,i;if(a===-1?(r=e,i=""):(r=e.substring(0,a),i=e.substring(a+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(T_._cmpBySpecificity),n}insert(e,n,a,r,i,o){if(n===""){this._doInsertHere(e,a,r,i,o);return}let s=n.indexOf("."),c,l;s===-1?(c=n,l=""):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new T_(this._mainRule.clone(),JC.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,a,r,i,o)}_doInsertHere(e,n,a,r,i){if(n===null){this._mainRule.acceptOverwrite(e,a,r,i);return}for(let o=0,s=this._rulesWithParentScopes.length;o<s;o++){let c=this._rulesWithParentScopes[o];if(K$(c.parentScopes,n)===0){c.acceptOverwrite(e,a,r,i);return}}a===-1&&(a=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new JC(e,n,a,r,i))}},Ic=class ha{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=ha.getLanguageId(e),a=ha.getTokenType(e),r=ha.getFontStyle(e),i=ha.getForeground(e),o=ha.getBackground(e);console.log({languageId:n,tokenType:a,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,a,r,i,o,s){let c=ha.getLanguageId(e),l=ha.getTokenType(e),u=ha.containsBalancedBrackets(e)?1:0,d=ha.getFontStyle(e),p=ha.getForeground(e),A=ha.getBackground(e);return n!==0&&(c=n),a!==8&&(l=a),r!==null&&(u=r?1:0),i!==-1&&(d=i),o!==0&&(p=o),s!==0&&(A=s),(c<<0|l<<8|u<<10|d<<11|p<<15|A<<24)>>>0}};function dDe(t){return t}function pDe(t){return t}function Fg(t,e){const n=[],a=Wge(t);let r=a.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=a.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=a.next()}return n;function i(){if(r==="-"){r=a.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=a.next();const c=s();return r===")"&&(r=a.next()),c}if(e3(r)){const c=[];do c.push(r),r=a.next();while(e3(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(d=>d(u))}function s(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=a.next();while(r==="|"||r===",");l=o()}return u=>c.some(d=>d(u))}}function e3(t){return!!t&&!!t.match(/[\w\.:]+/)}function Wge(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const a=n[0];return n=e.exec(t),a}}}function t3(t){typeof t.dispose=="function"&&t.dispose()}var sd=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Jge=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vge=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Xge=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new sd(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Vge;for(const n of t)efe(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof sd){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function efe(t,e,n,a){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof sd?Og({baseGrammar:i,selfGrammar:r},a):VC(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},a);const o=n.injections(t.scopeName);if(o)for(const s of o)a.add(new sd(s))}function VC(t,e,n){if(e.repository&&e.repository[t]){const a=e.repository[t];Ng([a],e,n)}}function Og(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Ng(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Ng(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Ng(t,e,n){for(const a of t){if(n.visitedRule.has(a))continue;n.visitedRule.add(a);const r=a.repository?U$({},e.repository,a.repository):e.repository;Array.isArray(a.patterns)&&Ng(a.patterns,{...e,repository:r},n);const i=a.include;if(!i)continue;const o=n3(i);switch(o.kind){case 0:Og({...e,selfGrammar:e.baseGrammar},n);break;case 1:Og(e,n);break;case 2:VC(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const s=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(s){const c={baseGrammar:e.baseGrammar,selfGrammar:s,repository:r};o.kind===4?VC(o.ruleName,c,n):Og(c,n)}else o.kind===4?n.add(new Jge(o.scopeName,o.ruleName)):n.add(new sd(o.scopeName));break}}}var tfe=class{kind=0},nfe=class{kind=1},afe=class{constructor(t){this.ruleName=t}kind=2},rfe=class{constructor(t){this.scopeName=t}kind=3},ife=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function n3(t){if(t==="$base")return new tfe;if(t==="$self")return new nfe;const e=t.indexOf("#");if(e===-1)return new rfe(t);if(e===0)return new afe(t.substring(1));{const n=t.substring(0,e),a=t.substring(e+1);return new ife(n,a)}}var ofe=/\\(\d+)/,a3=/\\(\d+)/g,sfe=-1,r3=-2;function ADe(t){return t}function mDe(t){return t}var cd=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,a){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Dg.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Dg.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Z$(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Dg.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Dg.replaceCaptures(this._contentName,t,e)}},cfe=class extends cd{retokenizeCapturedWithRuleId;constructor(t,e,n,a,r){super(t,e,n,a),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,a){throw new Error("Not supported!")}},lfe=class extends cd{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,null),this._match=new ld(a,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ud,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},i3=class extends cd{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r){super(t,e,n,a),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ud,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},XC=class extends cd{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,a,r,i,o,s,c,l){super(t,e,n,a),this._begin=new ld(r,this.id),this.beginCaptures=i,this._end=new ld(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,a)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ud;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Tg=class extends cd{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,a,r,i,o,s,c){super(t,e,n,a),this._begin=new ld(r,this.id),this.beginCaptures=i,this.whileCaptures=s,this._while=new ld(o,r3),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,a){return this._getCachedCompiledPatterns(t).compileAG(t,n,a)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ud;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,a){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,a)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ud,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},o3=class Cn{static createCaptureRule(e,n,a,r,i){return e.registerRule(o=>new cfe(n,o,a,r,i))}static getCompiledRuleId(e,n,a){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new lfe(e.$vscodeTextmateLocation,e.id,e.name,e.match,Cn._compileCaptures(e.captures,n,a));if(typeof e.begin>"u"){e.repository&&(a=U$({},a,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new i3(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Cn._compilePatterns(i,n,a))}return e.while?new Tg(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Cn._compileCaptures(e.beginCaptures||e.captures,n,a),e.while,Cn._compileCaptures(e.whileCaptures||e.captures,n,a),Cn._compilePatterns(e.patterns,n,a)):new XC(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Cn._compileCaptures(e.beginCaptures||e.captures,n,a),e.end,Cn._compileCaptures(e.endCaptures||e.captures,n,a),e.applyEndPatternLast,Cn._compilePatterns(e.patterns,n,a))}),e.id}static _compileCaptures(e,n,a){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);s>i&&(i=s)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);let c=0;e[o].patterns&&(c=Cn.getCompiledRuleId(e[o],n,a)),r[s]=Cn.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,a){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const s=e[i];let c=-1;if(s.include){const l=n3(s.include);switch(l.kind){case 0:case 1:c=Cn.getCompiledRuleId(a[s.include],n,a);break;case 2:let u=a[l.ruleName];u&&(c=Cn.getCompiledRuleId(u,n,a));break;case 3:case 4:const d=l.scopeName,p=l.kind===4?l.ruleName:null,A=n.getExternalGrammar(d,a);if(A)if(p){let m=A.repository[p];m&&(c=Cn.getCompiledRuleId(m,n,A.repository))}else c=Cn.getCompiledRuleId(A.repository.$self,n,A.repository);break}}else c=Cn.getCompiledRuleId(s,n,a);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof i3||l instanceof XC||l instanceof Tg)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},ld=class ML{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const a=e.length;let r=0,i=[],o=!1;for(let s=0;s<a;s++)if(e.charAt(s)==="\\"&&s+1<a){const l=e.charAt(s+1);l==="z"?(i.push(e.substring(r,s)),i.push("$(?!\\n)(?<!\\n)"),r=s+2):(l==="A"||l==="G")&&(o=!0),s++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=ofe.test(this.source):this.hasBackReferences=!1}clone(){return new ML(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let a=n.map(r=>e.substring(r.start,r.end));return a3.lastIndex=0,this.source.replace(a3,(r,i)=>J$(a[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],a=[],r=[],i,o,s,c;for(i=0,o=this.source.length;i<o;i++)s=this.source.charAt(i),e[i]=s,n[i]=s,a[i]=s,r[i]=s,s==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",n[i+1]="",a[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="",n[i+1]="G",a[i+1]="",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,a[i+1]=c,r[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:a.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ud=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new s3(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let a=this._items.map(r=>r.resolveAnchors(e,n));return new s3(t,a,this._items.map(r=>r.ruleId))}},s3=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
272
272
|
`)}findNextMatchSync(t,e,n){const a=this.scanner.findNextMatchSync(t,e,n);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},e_=class{constructor(t,e){this.languageId=t,this.tokenType=e}},ufe=class $_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new e_(e,8),this._embeddedLanguagesMatcher=new dfe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?$_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new e_(0,0);_getBasicScopeAttributes=new V$(e=>{const n=this._scopeToLanguage(e),a=this._toStandardTokenType(e);return new e_(n,a)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match($_.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},dfe=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,a])=>J$(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}};typeof process<"u"&&process.env.VSCODE_TEXTMATE_DEBUG;var c3=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function l3(t,e,n,a,r,i,o,s){const c=e.content.length;let l=!1,u=-1;if(o){const A=pfe(t,e,n,a,r,i);r=A.stack,a=A.linePos,n=A.isFirstLine,u=A.anchorPosition}const d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new c3(r,!0);p()}return new c3(r,!1);function p(){const A=Afe(t,e,n,a,r,u);if(!A){i.produce(r,c),l=!0;return}const m=A.captureIndices,g=A.matchedRuleId,f=m&&m.length>0?m[0].end>a:!1;if(g===sfe){const h=r.getRule(t);i.produce(r,m[0].start),r=r.withContentNameScopesList(r.nameScopesList),dd(t,e,n,r,i,h.endCaptures,m),i.produce(r,m[0].end);const y=r;if(r=r.parent,u=y.getAnchorPos(),!f&&y.getEnterPos()===a){r=y,i.produce(r,c),l=!0;return}}else{const h=t.getRule(g);i.produce(r,m[0].start);const y=r,k=h.getName(e.content,m),_=r.contentNameScopesList.pushAttributed(k,t);if(r=r.push(g,a,u,m[0].end===c,null,_,_),h instanceof XC){const C=h;dd(t,e,n,r,i,C.beginCaptures,m),i.produce(r,m[0].end),u=m[0].end;const Q=C.getContentName(e.content,m),x=_.pushAttributed(Q,t);if(r=r.withContentNameScopesList(x),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(e.content,m))),!f&&y.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(h instanceof Tg){const C=h;dd(t,e,n,r,i,C.beginCaptures,m),i.produce(r,m[0].end),u=m[0].end;const Q=C.getContentName(e.content,m),x=_.pushAttributed(Q,t);if(r=r.withContentNameScopesList(x),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(e.content,m))),!f&&y.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(dd(t,e,n,r,i,h.captures,m),i.produce(r,m[0].end),r=r.pop(),!f){r=r.safePop(),i.produce(r,c),l=!0;return}}m[0].end>a&&(a=m[0].end,n=!1)}}function pfe(t,e,n,a,r,i){let o=r.beginRuleCapturedEOL?0:-1;const s=[];for(let c=r;c;c=c.pop()){const l=c.getRule(t);l instanceof Tg&&s.push({rule:l,stack:c})}for(let c=s.pop();c;c=s.pop()){const{ruleScanner:l,findOptions:u}=ffe(c.rule,t,c.stack.endRule,n,a===o),d=l.findNextMatchSync(e,a,u);if(d){if(d.ruleId!==r3){r=c.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(c.stack,d.captureIndices[0].start),dd(t,e,n,c.stack,i,c.rule.whileCaptures,d.captureIndices),i.produce(c.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>a&&(a=d.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:a,anchorPosition:o,isFirstLine:n}}function Afe(t,e,n,a,r,i){const o=mfe(t,e,n,a,r,i),s=t.getInjections();if(s.length===0)return o;const c=gfe(s,t,e,n,a,r,i);if(!c)return o;if(!o)return c;const l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function mfe(t,e,n,a,r,i){const o=r.getRule(t),{ruleScanner:s,findOptions:c}=u3(o,t,r.endRule,n,a===i),l=s.findNextMatchSync(e,a,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function gfe(t,e,n,a,r,i,o){let s=Number.MAX_VALUE,c=null,l,u=0;const d=i.contentNameScopesList.getScopeNames();for(let p=0,A=t.length;p<A;p++){const m=t[p];if(!m.matcher(d))continue;const g=e.getRule(m.ruleId),{ruleScanner:f,findOptions:h}=u3(g,e,null,a,r===o),y=f.findNextMatchSync(n,r,h);if(!y)continue;const k=y.captureIndices[0].start;if(!(k>=s)&&(s=k,c=y.captureIndices,l=y.ruleId,u=m.priority,s===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function u3(t,e,n,a,r){return{ruleScanner:t.compileAG(e,n,a,r),findOptions:0}}function ffe(t,e,n,a,r){return{ruleScanner:t.compileWhileAG(e,n,a,r),findOptions:0}}function dd(t,e,n,a,r,i,o){if(i.length===0)return;const s=e.content,c=Math.min(i.length,o.length),l=[],u=o[0].end;for(let d=0;d<c;d++){const p=i[d];if(p===null)continue;const A=o[d];if(A.length===0)continue;if(A.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=A.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,A.start):r.produce(a,A.start),p.retokenizeCapturedWithRuleId){const g=p.getName(s,o),f=a.contentNameScopesList.pushAttributed(g,t),h=p.getContentName(s,o),y=f.pushAttributed(h,t),k=a.push(p.retokenizeCapturedWithRuleId,A.start,-1,!1,null,f,y),_=t.createOnigString(s.substring(0,A.end));l3(t,_,n&&A.start===0,A.start,k,r,!1,0),t3(_);continue}const m=p.getName(s,o);if(m!==null){const f=(l.length>0?l[l.length-1].scopes:a.contentNameScopesList).pushAttributed(m,t);l.push(new bfe(f,A.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var bfe=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function hfe(t,e,n,a,r,i,o,s){return new wfe(t,e,n,a,r,i,o,s)}function d3(t,e,n,a,r){const i=Fg(e,$g),o=o3.getCompiledRuleId(n,a,r.repository);for(const s of i)t.push({debugSelector:e,matcher:s.matcher,ruleId:o,grammar:r,priority:s.priority})}function $g(t,e){if(e.length<t.length)return!1;let n=0;return t.every(a=>{for(let r=n;r<e.length;r++)if(yfe(e[r],a))return n=r+1,!0;return!1})}function yfe(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var wfe=class{constructor(t,e,n,a,r,i,o,s){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=s,this._basicScopeAttributesProvider=new ufe(n,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=p3(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=Fg(c,$g);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,a=t.lookup(n);if(a){const r=a.injections;if(r)for(let o in r)d3(e,o,r[o],this,a);const i=this._grammarRepository.injections(n);i&&i.forEach(o=>{const s=this.getExternalGrammar(o);if(s){const c=s.injectionSelector;c&&d3(e,c,s,this,s)}})}return e.sort((r,i)=>r.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=p3(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const a=this._tokenize(t,e,!1,n);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(t,e,n=0){const a=this._tokenize(t,e,!0,n);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(t,e,n,a){this._rootId===-1&&(this._rootId=o3.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===t_.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=Ic.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),p=this.getRule(this._rootId).getName(null,null);let A;p?A=pd.createRootAndLookUpScopeName(p,d,this):A=pd.createRoot("unknown",d),e=new t_(null,this._rootId,-1,-1,!1,null,A,A)}else r=!1,e.reset();t=t+`
|
|
273
273
|
`;const i=this.createOnigString(t),o=i.content.length,s=new Cfe(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=l3(this,i,r,0,e,s,!0,a);return t3(i),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function p3(t,e){return t=Rge(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var pd=class yr{constructor(e,n,a){this.parent=e,this.scopePath=n,this.tokenAttributes=a}static fromExtension(e,n){let a=e,r=e?.scopePath??null;for(const i of n)r=WC.push(r,i.scopeNames),a=new yr(a,r,i.encodedTokenAttributes);return a}static createRoot(e,n){return new yr(null,new WC(null,e),n)}static createRootAndLookUpScopeName(e,n,a){const r=a.getMetadataForScope(e),i=new WC(null,e),o=a.themeProvider.themeMatch(i),s=yr.mergeAttributes(n,r,o);return new yr(null,i,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return yr.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,a){let r=-1,i=0,o=0;return a!==null&&(r=a.fontStyle,i=a.foregroundId,o=a.backgroundId),Ic.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return yr._pushAttributed(this,e,n);const a=e.split(/ /g);let r=this;for(const i of a)r=yr._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,a){const r=a.getMetadataForScope(n),i=e.scopePath.push(n),o=a.themeProvider.themeMatch(i),s=yr.mergeAttributes(e.tokenAttributes,r,o);return new yr(e,i,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let a=this;for(;a&&a!==e;)n.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===e?n.reverse():void 0}},t_=class is{constructor(e,n,a,r,i,o,s,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=s,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new is(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:is._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?pd.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){is._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,a,r,i,o,s){return new is(this,e,n,a,r,i,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new is(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const a=pd.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new is(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,a,pd.fromExtension(a,n.contentNameScopesList))}},kfe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Fg(n,$g).map(a=>a.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Fg(n,$g).map(a=>a.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Cfe=class{constructor(t,e,n,a){this.balancedBracketSelectors=a,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let a=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(i)&&(a=Ic.set(a,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(a=Ic.set(a,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let a=0,r=this._binaryTokens.length;a<r;a++)n[a]=this._binaryTokens[a];return n}},_fe=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,a,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,hfe(t,i,e,n,a,r,this,this._onigLib))}return this._grammars.get(t)}},Bfe=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new _fe(Sg.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(Sg.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,a){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:a})}loadGrammarWithConfiguration(e,n,a){return this._loadGrammar(e,n,a.embeddedLanguages,a.tokenTypes,new kfe(a.balancedBracketSelectors||[],a.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,a,r,i){const o=new Xge(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(s=>this._loadSingleGrammar(s.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,a,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const a=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,a)}}addGrammar(e,n=[],a=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,a,r)}_grammarForScopeName(e,n=0,a=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,a,r,i)}},n_=t_.NULL;const Efe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],A3={}.hasOwnProperty;function vfe(t,e){const n=e||{};function a(r,...i){let o=a.invalid;const s=a.handlers;if(r&&A3.call(r,t)){const c=String(r[t]);o=A3.call(s,c)?s[c]:a.unknown}if(o)return o.call(this,r,...i)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}const xfe=/["&'<>`]/g,Qfe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ife=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Dfe=/[|\\{}()[\]^$+*?.]/g,m3=new WeakMap;function Sfe(t,e){if(t=t.replace(e.subset?Ffe(e.subset):xfe,a),e.subset||e.escapeOnly)return t;return t.replace(Qfe,n).replace(Ife,a);function n(r,i,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function a(r,i,o){return e.format(r.charCodeAt(0),o.charCodeAt(i+1),e)}}function Ffe(t){let e=m3.get(t);return e||(e=Ofe(t),m3.set(t,e)),e}function Ofe(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Dfe,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Nfe=/[\dA-Fa-f]/;function Tfe(t,e,n){const a="&#x"+t.toString(16).toUpperCase();return n&&e&&!Nfe.test(String.fromCharCode(e))?a:a+";"}const $fe=/\d/;function Lfe(t,e,n){const a="&#"+String(t);return n&&e&&!$fe.test(String.fromCharCode(e))?a:a+";"}const Mfe=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],a_={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Rfe=["cent","copy","divide","gt","lt","not","para","times"],g3={}.hasOwnProperty,r_={};let Lg;for(Lg in a_)g3.call(a_,Lg)&&(r_[a_[Lg]]=Lg);const Pfe=/[^\dA-Za-z]/;function jfe(t,e,n,a){const r=String.fromCharCode(t);if(g3.call(r_,r)){const i=r_[r],o="&"+i;return n&&Mfe.includes(i)&&!Rfe.includes(i)&&(!a||e&&e!==61&&Pfe.test(String.fromCharCode(e)))?o:o+";"}return""}function qfe(t,e,n){let a=Tfe(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=jfe(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Lfe(t,e,n.omitOptionalSemicolons);i.length<a.length&&(a=i)}return r&&(!n.useShortestReferences||r.length<a.length)?r:a}function Dc(t,e){return Sfe(t,Object.assign({format:qfe},e))}const Gfe=/^>|^->|<!--|-->|--!>|<!-$/g,zfe=[">"],Hfe=["<",">"];function Ufe(t,e,n,a){return a.settings.bogusComments?"<?"+Dc(t.value,Object.assign({},a.settings.characterReferences,{subset:zfe}))+">":"<!--"+t.value.replace(Gfe,r)+"-->";function r(i){return Dc(i,Object.assign({},a.settings.characterReferences,{subset:Hfe}))}}function Zfe(t,e,n,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}function f3(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let a=0,r=n.indexOf(e);for(;r!==-1;)a++,r=n.indexOf(e,r+e.length);return a}const Lt=h3(1),b3=h3(-1),Yfe=[];function h3(t){return e;function e(n,a,r){const i=n?n.children:Yfe;let o=(a||0)+t,s=i[o];if(!r)for(;s&&xg(s);)o+=t,s=i[o];return s}}const Kfe={}.hasOwnProperty;function y3(t){return e;function e(n,a,r){return Kfe.call(t,n.tagName)&&t[n.tagName](n,a,r)}}const i_=y3({body:Jfe,caption:o_,colgroup:o_,dd:tbe,dt:ebe,head:o_,html:Wfe,li:Xfe,optgroup:nbe,option:abe,p:Vfe,rp:w3,rt:w3,tbody:ibe,td:k3,tfoot:obe,th:k3,thead:rbe,tr:sbe});function o_(t,e,n){const a=Lt(n,e,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&xg(a.value.charAt(0)))}function Wfe(t,e,n){const a=Lt(n,e);return!a||a.type!=="comment"}function Jfe(t,e,n){const a=Lt(n,e);return!a||a.type!=="comment"}function Vfe(t,e,n){const a=Lt(n,e);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Xfe(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&a.tagName==="li"}function ebe(t,e,n){const a=Lt(n,e);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function tbe(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function w3(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function nbe(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&a.tagName==="optgroup"}function abe(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function rbe(t,e,n){const a=Lt(n,e);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function ibe(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function obe(t,e,n){return!Lt(n,e)}function sbe(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&a.tagName==="tr"}function k3(t,e,n){const a=Lt(n,e);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const cbe=y3({body:dbe,colgroup:pbe,head:ube,html:lbe,tbody:Abe});function lbe(t){const e=Lt(t,-1);return!e||e.type!=="comment"}function ube(t){const e=new Set;for(const a of t.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(e.has(a.tagName))return!1;e.add(a.tagName)}const n=t.children[0];return!n||n.type==="element"}function dbe(t){const e=Lt(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&xg(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function pbe(t,e,n){const a=b3(n,e),r=Lt(t,-1,!0);return n&&a&&a.type==="element"&&a.tagName==="colgroup"&&i_(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Abe(t,e,n){const a=b3(n,e),r=Lt(t,-1);return n&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&i_(a,n.children.indexOf(a),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const Mg={name:[[`
|
|
274
274
|
\f\r &/=>`.split(""),`
|