@rqmii_immersive/agent-react-sdk 6.1.2 → 6.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{RqmiiAgentChat-DePYH6Tm.js → RqmiiAgentChat-DclCKBut.js} +2 -2
  2. package/dist/{RqmiiAgentChat-DePYH6Tm.js.map → RqmiiAgentChat-DclCKBut.js.map} +1 -1
  3. package/dist/{RqmiiAgentChat-E1rns4hb.cjs → RqmiiAgentChat-DwItcha-.cjs} +2 -2
  4. package/dist/{RqmiiAgentChat-E1rns4hb.cjs.map → RqmiiAgentChat-DwItcha-.cjs.map} +1 -1
  5. package/dist/agent-react-sdk.css +1 -1
  6. package/dist/embed/chunks/{Orb-BlCpmOIm.js → Orb-CUO2PRaI.js} +2 -2
  7. package/dist/embed/chunks/{Orb-BlCpmOIm.js.map → Orb-CUO2PRaI.js.map} +1 -1
  8. package/dist/embed/chunks/{embed-core-BbLbqohb.js → embed-core-eP9Wge1U.js} +4 -4
  9. package/dist/embed/chunks/{embed-core-BbLbqohb.js.map → embed-core-eP9Wge1U.js.map} +1 -1
  10. package/dist/embed/chunks/{highlighted-body-JLMTFACH-BP16yo0g.js → highlighted-body-JLMTFACH-BN16E0-4.js} +3 -3
  11. package/dist/embed/chunks/{highlighted-body-JLMTFACH-BP16yo0g.js.map → highlighted-body-JLMTFACH-BN16E0-4.js.map} +1 -1
  12. package/dist/embed/chunks/{mermaid-WFAXDIZX-OtW4F01K.js → mermaid-WFAXDIZX-CH5kl7g7.js} +229 -226
  13. package/dist/embed/chunks/{mermaid-WFAXDIZX-OtW4F01K.js.map → mermaid-WFAXDIZX-CH5kl7g7.js.map} +1 -1
  14. package/dist/embed/chunks/{session-room-CFECkqBg.js → session-room-B4Z-4_lV.js} +2 -2
  15. package/dist/embed/chunks/{session-room-CFECkqBg.js.map → session-room-B4Z-4_lV.js.map} +1 -1
  16. package/dist/embed/core.js +2 -2
  17. package/dist/{highlighted-body-JLMTFACH-BmLfF80m.js → highlighted-body-JLMTFACH-DAlcAY-8.js} +2 -2
  18. package/dist/{highlighted-body-JLMTFACH-BmLfF80m.js.map → highlighted-body-JLMTFACH-DAlcAY-8.js.map} +1 -1
  19. package/dist/{highlighted-body-JLMTFACH-BgbiDd39.cjs → highlighted-body-JLMTFACH-rWYYYFTi.cjs} +2 -2
  20. package/dist/{highlighted-body-JLMTFACH-BgbiDd39.cjs.map → highlighted-body-JLMTFACH-rWYYYFTi.cjs.map} +1 -1
  21. package/dist/lazy.cjs +1 -1
  22. package/dist/lazy.js +1 -1
  23. package/dist/mermaid-WFAXDIZX-DmOW6O9q.cjs +2 -0
  24. package/dist/mermaid-WFAXDIZX-DmOW6O9q.cjs.map +1 -0
  25. package/dist/mermaid-WFAXDIZX-r3CZs5tK.js +5 -0
  26. package/dist/mermaid-WFAXDIZX-r3CZs5tK.js.map +1 -0
  27. package/dist/ui/chat/panels.d.ts.map +1 -1
  28. package/dist/{ui-C5VFxBD4.js → ui-CtiQXBti.js} +243 -240
  29. package/dist/{ui-C5VFxBD4.js.map → ui-CtiQXBti.js.map} +1 -1
  30. package/dist/{ui-BQAa9g8U.cjs → ui-qViuypFA.cjs} +14 -14
  31. package/dist/{ui-BQAa9g8U.cjs.map → ui-qViuypFA.cjs.map} +1 -1
  32. package/dist/ui.cjs +1 -1
  33. package/dist/ui.js +2 -2
  34. package/package.json +1 -1
  35. package/dist/mermaid-WFAXDIZX-CjDBEjC-.js +0 -5
  36. package/dist/mermaid-WFAXDIZX-CjDBEjC-.js.map +0 -1
  37. package/dist/mermaid-WFAXDIZX-D1q7n0BY.cjs +0 -2
  38. package/dist/mermaid-WFAXDIZX-D1q7n0BY.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const Fe=require("./RqmiiErrorBoundary-hpypheX3.cjs"),w=require("./RqmiiAgentChat-E1rns4hb.cjs"),f=require("react/jsx-runtime"),b=require("react"),Na=require("react-dom"),ze=require("./avatar-device-api-BdT_dAzl.cjs");/**
1
+ "use strict";const Fe=require("./RqmiiErrorBoundary-hpypheX3.cjs"),w=require("./RqmiiAgentChat-DwItcha-.cjs"),f=require("react/jsx-runtime"),b=require("react"),Na=require("react-dom"),ze=require("./avatar-device-api-BdT_dAzl.cjs");/**
2
2
  * @license lucide-react v1.24.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -145,7 +145,7 @@
145
145
  `,...a.current()});const d=l.charCodeAt(0);return(d===9||d===32)&&(l=p1(d)+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),u(),o(),l}nc.peek=T1;function nc(e){return e.value||""}function T1(){return"<"}rc.peek=x1;function rc(e,t,n,r){const i=za(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${a}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),l+=u.move(")"),s(),l}function x1(){return"!"}ic.peek=k1;function ic(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const l=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),s();const d=n.stack;n.stack=d.filter(function(m){return m!=="phrasing"}),s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==h?u+=o.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function k1(){return"!"}ac.peek=y1;function ac(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);if(!s.atBreak)continue;let u;for(;u=o.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function y1(){return"`"}function sc(e,t){const n=Va(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}oc.peek=A1;function oc(e,t,n,r){const i=za(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);if(sc(e,n)){const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"});const h=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),h(),n.stack=d,m}const o=n.enter("link");let u=n.enter("label"),l=s.move("[");return l+=s.move(n.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=n.enter("destinationRaw"),l+=s.move(n.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${a}`),l+=s.move(" "+i),l+=s.move(n.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),o(),l}function A1(e,t,n){return sc(e,n)?"<":"["}uc.peek=C1;function uc(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const l=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),s();const d=n.stack;n.stack=d.filter(function(m){return m!=="phrasing"}),s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==h?u+=o.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function C1(){return"["}function Ya(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _1(e){const t=Ya(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function S1(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function lc(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function N1(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?S1(n):Ya(n);const o=e.ordered?s==="."?")":".":_1(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),lc(n)===s&&d){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=o),n.bulletCurrent=s;const l=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),l}function w1(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function I1(e,t,n,r){const i=w1(n);let a=n.bulletCurrent||Ya(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,o.current()),d);return u(),l;function d(h,m,p){return m?(p?"":" ".repeat(s))+h:(p?a:a+" ".repeat(s-a.length))+h}}function L1(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}function R1(e,t,n,r){if(!e.children.some(function(o){return t1(o)}))return n.containerFlow(e,r);const a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),s}function v1(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ga.attention=O1;Ga.peek=D1;function Ga(e,t,n,r){const i=n.enter("phrasing"),a=n.containerPhrasing({type:"root",children:[e]},r);return i(),a}function O1(e,t){return{construct:"strong",markers:v1(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function D1(e,t,n){return n.options.strong||"*"}function P1(e,t,n,r){const i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function M1(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function B1(e,t,n){const r=(lc(n)+(n.options.ruleSpaces?" ":"")).repeat(M1(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cc={blockquote:n1,break:fo,code:u1,definition:c1,emphasis:$a,hardBreak:fo,heading:E1,html:nc,image:rc,imageReference:ic,inlineCode:ac,link:oc,linkReference:uc,list:N1,listItem:I1,paragraph:L1,root:R1,strong:Ga,text:P1,thematicBreak:B1},F1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mo=["pre","script","style","textarea"],go={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
146
146
  `,Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},H1={}.hasOwnProperty;function Wa(e){return H1.call(go,e)?go[e]:!1}function dc(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const j1=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function U1(e){return e.replace(j1,q1)}function q1(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return dc(n.slice(a?2:1),a?16:10)}return Wa(n)||e}function Ur(e){if(e===null||ke(e)||Zt(e))return 1;if(si(e))return 2}function z1(){return{enter:{table:$1,tableData:bo,tableHeader:bo,tableRow:Y1},exit:{codeText:G1,table:V1,tableData:wi,tableHeader:wi,tableRow:wi}}}function $1(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function V1(e){this.exit(e),this.data.inTable=void 0}function Y1(e){this.enter({type:"tableRow",children:[]},e)}function wi(e){this.exit(e)}function bo(e){this.enter({type:"tableCell",children:[]},e)}function G1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,W1));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function W1(e,t){return t==="|"?t:e}function Q1(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
147
147
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:u,tableRow:o}};function s(p,g,k,C){return l(d(p,k,C),p.align)}function o(p,g,k,C){const A=h(p,k,C),S=l([A]);return S.slice(0,S.indexOf(`
148
- `))}function u(p,g,k,C){const A=k.enter("tableCell"),S=k.enter("phrasing"),y=k.containerPhrasing(p,{...C,before:a,after:a});return S(),A(),y}function l(p,g){return Jg(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,k){const C=p.children;let A=-1;const S=[],y=g.enter("table");for(;++A<C.length;)S[A]=h(C[A],g,k);return y(),S}function h(p,g,k){const C=p.children;let A=-1;const S=[],y=g.enter("tableRow");for(;++A<C.length;)S[A]=u(C[A],p,g,k);return y(),S}function m(p,g,k){let C=cc.inlineCode(p,g,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function K1(){return{exit:{taskListCheckValueChecked:Eo,taskListCheckValueUnchecked:Eo,paragraph:Z1}}}function X1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J1}}}function Eo(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Z1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function J1(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let u=cc.listItem(e,t,n,{...r,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(d){return d+s}}function eb(){return[kg(),qg(),Yg(),z1(),K1()]}function tb(e){return{extensions:[yg(),zg(e),Gg(),Q1(e),X1()]}}function ut(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function tt(e,t){return e.length>0?(ut(e,e.length,0,t),e):t}const To={}.hasOwnProperty;function hc(e){const t={};let n=-1;for(;++n<e.length;)nb(t,e[n]);return t}function nb(e,t){let n;for(n in t){const i=(To.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){To.call(i,s)||(i[s]=[]);const o=a[s];rb(i[s],Array.isArray(o)?o:o?[o]:[])}}}function rb(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ut(e,0,0,r)}const ib={tokenize:cb,partial:!0},fc={tokenize:db,partial:!0},pc={tokenize:hb,partial:!0},mc={tokenize:fb,partial:!0},ab={tokenize:pb,partial:!0},gc={name:"wwwAutolink",tokenize:ub,previous:Ec},bc={name:"protocolAutolink",tokenize:lb,previous:Tc},Ct={name:"emailAutolink",tokenize:ob,previous:xc},Tt={};function sb(){return{text:Tt}}let qt=48;for(;qt<123;)Tt[qt]=Ct,qt++,qt===58?qt=65:qt===91&&(qt=97);Tt[43]=Ct;Tt[45]=Ct;Tt[46]=Ct;Tt[95]=Ct;Tt[72]=[Ct,bc];Tt[104]=[Ct,bc];Tt[87]=[Ct,gc];Tt[119]=[Ct,gc];function ob(e,t,n){const r=this;let i,a;return s;function s(h){return!ia(h)||!xc.call(r,r.previous)||Qa(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return ia(h)?(e.consume(h),o):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(ab,d,l)(h):h===45||h===95||He(h)?(a=!0,e.consume(h),u):d(h)}function l(h){return e.consume(h),i=!0,u}function d(h){return a&&i&&$e(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function ub(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Ec.call(r,r.previous)||Qa(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ib,e.attempt(fc,e.attempt(pc,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function lb(e,t,n){const r=this;let i="",a=!1;return s;function s(h){return(h===72||h===104)&&Tc.call(r,r.previous)&&!Qa(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if($e(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),a?l:(a=!0,u)):n(h)}function l(h){return h===null||jr(h)||ke(h)||Zt(h)||si(h)?n(h):e.attempt(fc,e.attempt(pc,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function cb(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function db(e,t,n){let r,i,a;return s;function s(l){return l===46||l===95?e.check(mc,u,o)(l):l===null||ke(l)||Zt(l)||l!==45&&si(l)?u(l):(a=!0,e.consume(l),s)}function o(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),s}function u(l){return i||r||!a?n(l):t(l)}}function hb(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(mc,t,a)(s):s===null||ke(s)||Zt(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function fb(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ke(o)||Zt(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ke(o)||Zt(o)?t(o):r(o)}function a(o){return $e(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):$e(o)?(e.consume(o),s):n(o)}}function pb(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return He(a)?n(a):t(a)}}function Ec(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ke(e)}function Tc(e){return!$e(e)}function xc(e){return!(e===47||ia(e))}function ia(e){return e===43||e===45||e===46||e===95||He(e)}function Qa(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&He(e.charCodeAt(n+1))&&He(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function oi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const aa={name:"attention",resolveAll:mb,tokenize:gb};function mb(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,s={...e[i][1].end},o={...e[n][1].start};xo(s,-a),xo(o,a);const u={type:a>1?"strongSequence":"emphasisSequence",start:s,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},d={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},h={type:a>1?"strong":"emphasis",start:{...u.start},end:{...l.end}};e[i][1].end={...u.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=tt(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=tt(r,[["enter",h,t],["enter",u,t],["exit",u,t],["enter",d,t]]),r=tt(r,oi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=tt(r,[["exit",d,t],["enter",l,t],["exit",l,t],["exit",h,t]]);let m=0;e[n][1].end.offset-e[n][1].start.offset&&(m=2,r=tt(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),ut(e,i-1,n-i+3,r),n=i+r.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function gb(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ur(r);let a;return s;function s(u){return a=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===a)return e.consume(u),o;const l=e.exit("attentionSequence"),d=Ur(u),h=!d||d===2&&i||n.includes(u)&&u!==42&&u!==95,m=!i||i===2&&d||n.includes(r)&&r!==42&&r!==95;return l._open=!!(a===42?h:h&&(i||!m)),l._close=!!(a===42?m:m&&(d||!h)),t(u)}}function xo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bb={name:"autolink",tokenize:Eb};function Eb(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return $e(p)?(e.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||He(p)?(r=1,o(p)):l(p)}function o(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||He(p))&&r++<32?(e.consume(p),o):(r=0,l(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||jr(p)?n(p):(e.consume(p),u)}function l(p){return p===64?(e.consume(p),d):fg(p)?(e.consume(p),l):n(p)}function d(p){return He(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||He(p))&&r++<63){const g=p===45?m:h;return e.consume(p),g}return n(p)}}function pe(e,t,n,r){const i=r?r-1:1/0;let a=0;return s;function s(u){return le(u)?(e.enter(n),o(u)):t(u)}function o(u){return le(u)&&a++<i?(e.consume(u),o):(e.exit(n),t(u))}}function kc(e,t,n,r,i,a){let s=0;return o;function o(d){return le(d)?(e.enter(r),u(d)):l(d)}function u(d){return le(d)&&s<a?(e.consume(d),s++,u):(e.exit(r),l(d))}function l(d){return s>=i?t(d):n(d)}}const cr={partial:!0,tokenize:Tb};function Tb(e,t,n){return r;function r(a){return le(a)?pe(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||re(a)?t(a):n(a)}}const yc={continuation:{tokenize:kb},exit:yb,name:"blockQuote",tokenize:xb};function xb(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return le(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function kb(e,t,n){const r=this;return i;function i(s){return le(s)?pe(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(yc,t,n)(s)}}function yb(e){e.exit("blockQuote")}const Ac={name:"characterEscape",tokenize:Ab};function Ab(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return mg(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Cc={name:"characterReference",tokenize:Cb};function Cb(e,t,n){const r=this;let i=0,a,s;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,s=He,d(h))}function l(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=pg,d):(e.enter("characterReferenceValue"),a=7,s=ra,d(h))}function d(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return s===He&&!Wa(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<a?(e.consume(h),d):n(h)}}const sa={partial:!0,tokenize:_b};function _b(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ko={concrete:!0,name:"codeFenced",tokenize:Sb};function Sb(e,t,n){const r=this,i={partial:!0,tokenize:M};let a=0,s=0,o;return u;function u(L){return l(L)}function l(L){const P=r.events[r.events.length-1];return a=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,o=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(L)}function d(L){return L===o?(s++,e.consume(L),d):s<3?n(L):(e.exit("codeFencedFenceSequence"),le(L)?pe(e,h,"whitespace")(L):h(L))}function h(L){return L===null||re(L)?(e.exit("codeFencedFence"),r.interrupt?t(L):e.check(sa,k,D)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(L))}function m(L){return L===null||re(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(L)):le(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pe(e,p,"whitespace")(L)):L===96&&L===o?n(L):(e.consume(L),m)}function p(L){return L===null||re(L)?h(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(L))}function g(L){return L===null||re(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(L)):L===96&&L===o?n(L):(e.consume(L),g)}function k(L){return e.attempt(i,D,C)(L)}function C(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),A}function A(L){return a>0&&le(L)?pe(e,S,"linePrefix",a+1)(L):S(L)}function S(L){return L===null||re(L)?e.check(sa,k,D)(L):(e.enter("codeFlowValue"),y(L))}function y(L){return L===null||re(L)?(e.exit("codeFlowValue"),S(L)):(e.consume(L),y)}function D(L){return e.exit("codeFenced"),t(L)}function M(L,P,O){let q=0;return I;function I(U){return L.enter("lineEnding"),L.consume(U),L.exit("lineEnding"),F}function F(U){return L.enter("codeFencedFence"),le(U)?pe(L,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):$(U)}function $(U){return U===o?(L.enter("codeFencedFenceSequence"),W(U)):O(U)}function W(U){return U===o?(q++,L.consume(U),W):q>=s?(L.exit("codeFencedFenceSequence"),le(U)?pe(L,G,"whitespace")(U):G(U)):O(U)}function G(U){return U===null||re(U)?(L.exit("codeFencedFence"),P(U)):O(U)}}}const Ii={name:"codeIndented",tokenize:wb},Nb={partial:!0,tokenize:Ib};function wb(e,t,n){return r;function r(o){return e.enter("codeIndented"),kc(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?s(o):re(o)?e.attempt(Nb,i,s)(o):(e.enter("codeFlowValue"),a(o))}function a(o){return o===null||re(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),a)}function s(o){return e.exit("codeIndented"),t(o)}}function Ib(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):re(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):kc(e,t,a,"linePrefix",4,4)(s)}function a(s){return re(s)?i(s):n(s)}}const Lb={name:"codeText",previous:vb,resolve:Rb,tokenize:Ob};function Rb(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ob(e,t,n){let r=0,i,a;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(a=e.enter("codeTextSequence"),i=0,d(h)):re(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(h))}function l(h){return h===null||h===32||h===96||re(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),l)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",l(h))}}class Db{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ln(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ln(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ln(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ln(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ln(this.left,n.reverse())}}}function Ln(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _c(e){const t={};let n=-1,r,i,a,s,o,u,l;const d=new Db(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Pb(d,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return ut(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function Pb(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,u=[],l={};let d,h,m=-1,p=n,g=0,k=0;const C=[k];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(k=m+1,C.push(k),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),m=C.length;m--;){const A=o.slice(C[m],C[m+1]),S=a.pop();u.push([S,S+A.length-1]),e.splice(S,2,A)}for(u.reverse(),m=-1;++m<u.length;)l[g+u[m][0]]=g+u[m][1],g+=u[m][1]-u[m][0]-1;return l}const Mb={resolve:Fb,tokenize:Hb},Bb={partial:!0,tokenize:jb};function Fb(e){return _c(e),e}function Hb(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):re(o)?e.check(Bb,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function jb(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),pe(e,a,"linePrefix")}function a(s){if(s===null||re(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Sc(e,t,n,r,i,a,s,o,u){const l=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(A){return A===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(A),e.exit(a),m):A===null||A===32||A===41||jr(A)?n(A):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),k(A))}function m(A){return A===62?(e.enter(a),e.consume(A),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===62?(e.exit("chunkString"),e.exit(o),m(A)):A===null||A===60||re(A)?n(A):(e.consume(A),A===92?g:p)}function g(A){return A===60||A===62||A===92?(e.consume(A),p):p(A)}function k(A){return!d&&(A===null||A===41||ke(A))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(A)):d<l&&A===40?(e.consume(A),d++,k):A===41?(e.consume(A),d--,k):A===null||A===32||A===40||jr(A)?n(A):(e.consume(A),A===92?C:k)}function C(A){return A===40||A===41||A===92?(e.consume(A),k):k(A)}}function Nc(e,t,n,r,i,a){const s=this;let o=0,u;return l;function l(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),d}function d(p){return o>999||p===null||p===91||p===93&&!u||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):re(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||re(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!le(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),o++,h):h(p)}}function wc(e,t,n,r,i,a){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),l(m))}function l(m){return m===s?(e.exit(a),u(s)):m===null?n(m):re(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),pe(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||re(m)?(e.exit("chunkString"),l(m)):(e.consume(m),m===92?h:d)}function h(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Qn(e,t){let n;return r;function r(i){return re(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):le(i)?pe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Ub={name:"definition",tokenize:zb},qb={partial:!0,tokenize:$b};function zb(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return Nc.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=ot(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return ke(p)?Qn(e,l)(p):l(p)}function l(p){return Sc(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(qb,h,h)(p)}function h(p){return le(p)?pe(e,m,"whitespace")(p):m(p)}function m(p){return p===null||re(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function $b(e,t,n){return r;function r(o){return ke(o)?Qn(e,i)(o):n(o)}function i(o){return wc(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return le(o)?pe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||re(o)?t(o):n(o)}}const Vb={name:"hardBreakEscape",tokenize:Yb};function Yb(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return re(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Gb={name:"headingAtx",resolve:Wb,tokenize:Qb};function Wb(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};ut(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])}return e}function Qb(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ke(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||re(d)?(e.exit("atxHeading"),t(d)):le(d)?pe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),l(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function l(d){return d===null||d===35||ke(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),l)}}const Kb={concrete:!0,name:"htmlFlow",resolveTo:Zb,tokenize:Jb},Xb={partial:!0,tokenize:eE};function Zb(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Jb(e,t,n){const r=this;let i,a,s,o,u;return l;function l(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),h}function h(N){return N===33?(e.consume(N),m):N===47?(e.consume(N),a=!0,k):N===63?(e.consume(N),i=3,r.interrupt?t:T):$e(N)?(e.consume(N),s=String.fromCharCode(N),C):n(N)}function m(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,o=0,g):$e(N)?(e.consume(N),i=4,r.interrupt?t:T):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:T):n(N)}function g(N){const me="CDATA[";return N===me.charCodeAt(o++)?(e.consume(N),o===me.length?r.interrupt?t:$:g):n(N)}function k(N){return $e(N)?(e.consume(N),s=String.fromCharCode(N),C):n(N)}function C(N){if(N===null||N===47||N===62||ke(N)){const me=N===47,ge=s.toLowerCase();return!me&&!a&&mo.includes(ge)?(i=1,r.interrupt?t(N):$(N)):F1.includes(s.toLowerCase())?(i=6,me?(e.consume(N),A):r.interrupt?t(N):$(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?S(N):y(N))}return N===45||He(N)?(e.consume(N),s+=String.fromCharCode(N),C):n(N)}function A(N){return N===62?(e.consume(N),r.interrupt?t:$):n(N)}function S(N){return le(N)?(e.consume(N),S):I(N)}function y(N){return N===47?(e.consume(N),I):N===58||N===95||$e(N)?(e.consume(N),D):le(N)?(e.consume(N),y):I(N)}function D(N){return N===45||N===46||N===58||N===95||He(N)?(e.consume(N),D):M(N)}function M(N){return N===61?(e.consume(N),L):le(N)?(e.consume(N),M):y(N)}function L(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,P):le(N)?(e.consume(N),L):O(N)}function P(N){return N===u?(e.consume(N),u=null,q):N===null||re(N)?n(N):(e.consume(N),P)}function O(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ke(N)?M(N):(e.consume(N),O)}function q(N){return N===47||N===62||le(N)?y(N):n(N)}function I(N){return N===62?(e.consume(N),F):n(N)}function F(N){return N===null||re(N)?$(N):le(N)?(e.consume(N),F):n(N)}function $(N){return N===45&&i===2?(e.consume(N),Q):N===60&&i===1?(e.consume(N),Z):N===62&&i===4?(e.consume(N),Ne):N===63&&i===3?(e.consume(N),T):N===93&&i===5?(e.consume(N),he):re(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Xb,_e,W)(N)):N===null||re(N)?(e.exit("htmlFlowData"),W(N)):(e.consume(N),$)}function W(N){return e.check(sa,G,_e)(N)}function G(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),U}function U(N){return N===null||re(N)?W(N):(e.enter("htmlFlowData"),$(N))}function Q(N){return N===45?(e.consume(N),T):$(N)}function Z(N){return N===47?(e.consume(N),s="",ae):$(N)}function ae(N){if(N===62){const me=s.toLowerCase();return mo.includes(me)?(e.consume(N),Ne):$(N)}return $e(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),ae):$(N)}function he(N){return N===93?(e.consume(N),T):$(N)}function T(N){return N===62?(e.consume(N),Ne):N===45&&i===2?(e.consume(N),T):$(N)}function Ne(N){return N===null||re(N)?(e.exit("htmlFlowData"),_e(N)):(e.consume(N),Ne)}function _e(N){return e.exit("htmlFlow"),t(N)}}function eE(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(cr,t,n)}}const tE={name:"htmlText",tokenize:nE};function nE(e,t,n){const r=this;let i,a,s;return o;function o(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),u}function u(T){return T===33?(e.consume(T),l):T===47?(e.consume(T),M):T===63?(e.consume(T),y):$e(T)?(e.consume(T),O):n(T)}function l(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),a=0,g):$e(T)?(e.consume(T),S):n(T)}function d(T){return T===45?(e.consume(T),p):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),m):re(T)?(s=h,Z(T)):(e.consume(T),h)}function m(T){return T===45?(e.consume(T),p):h(T)}function p(T){return T===62?Q(T):T===45?m(T):h(T)}function g(T){const Ne="CDATA[";return T===Ne.charCodeAt(a++)?(e.consume(T),a===Ne.length?k:g):n(T)}function k(T){return T===null?n(T):T===93?(e.consume(T),C):re(T)?(s=k,Z(T)):(e.consume(T),k)}function C(T){return T===93?(e.consume(T),A):k(T)}function A(T){return T===62?Q(T):T===93?(e.consume(T),A):k(T)}function S(T){return T===null||T===62?Q(T):re(T)?(s=S,Z(T)):(e.consume(T),S)}function y(T){return T===null?n(T):T===63?(e.consume(T),D):re(T)?(s=y,Z(T)):(e.consume(T),y)}function D(T){return T===62?Q(T):y(T)}function M(T){return $e(T)?(e.consume(T),L):n(T)}function L(T){return T===45||He(T)?(e.consume(T),L):P(T)}function P(T){return re(T)?(s=P,Z(T)):le(T)?(e.consume(T),P):Q(T)}function O(T){return T===45||He(T)?(e.consume(T),O):T===47||T===62||ke(T)?q(T):n(T)}function q(T){return T===47?(e.consume(T),Q):T===58||T===95||$e(T)?(e.consume(T),I):re(T)?(s=q,Z(T)):le(T)?(e.consume(T),q):Q(T)}function I(T){return T===45||T===46||T===58||T===95||He(T)?(e.consume(T),I):F(T)}function F(T){return T===61?(e.consume(T),$):re(T)?(s=F,Z(T)):le(T)?(e.consume(T),F):q(T)}function $(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,W):re(T)?(s=$,Z(T)):le(T)?(e.consume(T),$):(e.consume(T),G)}function W(T){return T===i?(e.consume(T),i=void 0,U):T===null?n(T):re(T)?(s=W,Z(T)):(e.consume(T),W)}function G(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||ke(T)?q(T):(e.consume(T),G)}function U(T){return T===47||T===62||ke(T)?q(T):n(T)}function Q(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Z(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ae}function ae(T){return le(T)?pe(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):he(T)}function he(T){return e.enter("htmlTextData"),s(T)}}const Ka={name:"labelEnd",resolveAll:sE,resolveTo:oE,tokenize:uE},rE={tokenize:lE},iE={tokenize:cE},aE={tokenize:dE};function sE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ut(e,0,e.length,n),e}function oE(e,t){let n=e.length,r=0,i,a,s;for(;n--;){const d=e[n][1];if(i){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(i=n,d.type!=="labelLink")){r=2;break}}else d.type==="labelEnd"&&(a=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},l={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",o,t],["enter",u,t]],s=tt(s,e.slice(i+1,i+r+3)),s=tt(s,[["enter",l,t]]),s=tt(s,oi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),s=tt(s,[["exit",l,t],e[a-2],e[a-1],["exit",u,t]]),s=tt(s,e.slice(a+1)),s=tt(s,[["exit",o,t]]),ut(e,i,e.length,s),e}function uE(e,t,n){const r=this,i=r._labelStarts;let a,s;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return o;function o(m){return a?a._inactive?h(m):(s=r.parser.defined.includes(ot(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(rE,d,s?d:h)(m):m===91?e.attempt(iE,d,s?l:h)(m):s?d(m):h(m)}function l(m){return e.attempt(aE,d,h)(m)}function d(m){return i.pop(),t(m)}function h(m){return a._balanced=!0,n(m)}}function lE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return ke(h)?Qn(e,a)(h):a(h)}function a(h){return h===41?d(h):Sc(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ke(h)?Qn(e,u)(h):d(h)}function o(h){return n(h)}function u(h){return h===34||h===39||h===40?wc(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function l(h){return ke(h)?Qn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function cE(e,t,n){const r=this;return i;function i(o){return Nc.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(ot(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function dE(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const hE={name:"labelStartImage",resolveAll:Ka.resolveAll,tokenize:fE};function fE(e,t,n){const r=this;let i;return a;function a(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),s}function s(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const pE={name:"labelStartLink",resolveAll:Ka.resolveAll,tokenize:mE};function mE(e,t,n){const r=this;let i;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Li={name:"lineEnding",tokenize:gE};function gE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pe(e,t,"linePrefix")}}const Or={name:"thematicBreak",tokenize:bE};function bE(e,t,n){let r=0,i;return a;function a(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,o(l)}function o(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||re(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),le(l)?pe(e,o,"whitespace")(l):o(l))}}const We={continuation:{tokenize:kE},exit:AE,name:"list",tokenize:xE},EE={partial:!0,tokenize:CE},TE={partial:!0,tokenize:yE};function xE(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:ra(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Or,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return ra(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(cr,r.interrupt?n:d,e.attempt(EE,m,h))}function d(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function h(p){return le(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function kE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(cr,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pe(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!le(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TE,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,pe(e,e.attempt(We,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function yE(e,t,n){const r=this;return pe(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function AE(e){e.exit(this.containerState.type)}function CE(e,t,n){const r=this;return pe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!le(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}let qr=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){yo(this,t,n,r,!1)}addBefore(t,n,r){yo(this,t,n,r,!0)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0,this.index.clear()}};function yo(e,t,n,r,i){if(n===0&&r.length===0)return;const a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}const s=[t,n,r];e.map.push(s),e.index.set(t,s)}const Ao={name:"setextUnderline",resolveTo:_E,tokenize:SE};function _E(e,t){const n=new qr;let r=e.length,i,a,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!s&&e[r][1].type==="definition"&&(s=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(n.add(a,0,[["enter",o,t]]),n.add(s+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[s][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function SE(e,t,n){const r=this;let i;return a;function a(l){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===i?(e.consume(l),o):(e.exit("setextHeadingLineSequence"),le(l)?pe(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||re(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const NE={tokenize:PE,partial:!0};function wE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vE,continuation:{tokenize:OE},exit:DE}},text:{91:{name:"gfmFootnoteCall",tokenize:RE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IE,resolveTo:LE}}}}function IE(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!s||!s._balanced)return n(u);const l=ot(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function LE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function RE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(h){if(a>999||h===93&&!s||h===null||h===91||ke(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(ot(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return ke(h)||(s=!0),a++,e.consume(h),h===92?d:l}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,l):l(h)}}function vE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(s>999||g===93&&!o||g===null||g===91||ke(g))return n(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=ot(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return ke(g)||(o=!0),s++,e.consume(g),g===92?h:d}function h(g){return g===91||g===92||g===93?(e.consume(g),s++,d):d(g)}function m(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(a)||i.push(a),pe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function OE(e,t,n){return e.check(cr,t,e.attempt(NE,t,n))}function DE(e){e.exit("gfmFootnoteDefinition")}function PE(e,t,n){const r=this;return pe(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function ME(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",d,o],["enter",s[l][1],o],["exit",s[l][1],o],["enter",h,o]],p=o.parser.constructs.insideSpan.null;p&&ut(m,m.length,0,oi(p,s.slice(l+1,u),o)),ut(m,m.length,0,[["exit",h,o],["enter",s[u][1],o],["exit",s[u][1],o],["exit",d,o]]),ut(s,l-1,u-l+3,m),u=l+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function a(s,o,u){const l=this.previous,d=this.events;let h=0;return m;function m(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?u(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const k=Ur(l);if(g===126)return h>1?u(g):(s.consume(g),h++,p);if(h<2&&!n)return u(g);const C=s.exit("strikethroughSequenceTemporary"),A=Ur(g);return C._open=!A||A===2&&!!k,C._close=!k||k===2&&!!A,o(g)}}}class BE{constructor(){this.map=[],this.index=new Map}add(t,n,r){FE(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0,this.index.clear()}}function FE(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}function HE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function jE(){return{flow:{null:{name:"table",tokenize:UE,resolveAll:qE}}}}function UE(e,t,n){const r=this;let i=0,a=0,s;return o;function o(I){let F=r.events.length-1;for(;F>-1;){const{type:G}=r.events[F][1];if(G==="lineEnding"||G==="linePrefix")F--;else break}const $=F>-1?r.events[F][1].type:null,W=$==="tableHead"||$==="tableRow"?L:u;return W===L&&r.parser.lazy[r.now().line]?n(I):W(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),l(I)}function l(I){return I===124||(s=!0,a+=1),d(I)}function d(I){return I===null?n(I):re(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):le(I)?pe(e,d,"whitespace")(I):(a+=1,s&&(s=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||ke(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?m:h)}function m(I){return I===92||I===124?(e.consume(I),h):h(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),s=!1,le(I)?pe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?C(I):I===124?(s=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):M(I)}function k(I){return le(I)?pe(e,C,"whitespace")(I):C(I)}function C(I){return I===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),A):I===45?(a+=1,A(I)):I===null||re(I)?D(I):M(I)}function A(I){return I===45?(e.enter("tableDelimiterFiller"),S(I)):M(I)}function S(I){return I===45?(e.consume(I),S):I===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return le(I)?pe(e,D,"whitespace")(I):D(I)}function D(I){return I===124?g(I):I===null||re(I)?!s||i!==a?M(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):M(I)}function M(I){return n(I)}function L(I){return e.enter("tableRow"),P(I)}function P(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),P):I===null||re(I)?(e.exit("tableRow"),t(I)):le(I)?pe(e,P,"whitespace")(I):(e.enter("data"),O(I))}function O(I){return I===null||I===124||ke(I)?(e.exit("data"),P(I)):(e.consume(I),I===92?q:O)}function q(I){return I===92||I===124?(e.consume(I),O):O(I)}}function qE(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,u=0,l,d,h;const m=new BE;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,u!==0&&(Co(m,t,u,l,d),d=void 0,u=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",l,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],h=Ar(m,t,a,i,void 0,h),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],h=Ar(m,t,a,i,void 0,h)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,a[1]!==0?(s[0]=s[1],h=Ar(m,t,a,i,n,h)):s[1]!==0&&(h=Ar(m,t,s,i,n,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Co(m,t,u,l,d),m.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=HE(t.events,n))}return e}function Ar(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},cn(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const u=cn(t.events,n[1]);if(a={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const l=cn(t.events,n[2]),d=cn(t.events,n[3]),h={type:o,start:Object.assign({},l),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;e.add(g,k,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},cn(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function Co(e,t,n,r,i){const a=[],s=cn(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function cn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const zE={name:"tasklistCheck",tokenize:VE};function $E(){return{text:{91:zE}}}function VE(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return ke(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return re(u)?t(u):le(u)?e.check({tokenize:YE},t,n)(u):n(u)}}function YE(e,t,n){return pe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function GE(e){return hc([sb(),wE(),ME(e),jE(),$E()])}const WE={};function QE(e){const t=this,n=e||WE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(GE(n)),a.push(eb()),s.push(tb(n))}var KE=Object.defineProperty,XE=Object.defineProperties,ZE=Object.getOwnPropertyDescriptors,_o=Object.getOwnPropertySymbols,JE=Object.prototype.hasOwnProperty,eT=Object.prototype.propertyIsEnumerable,So=(e,t,n)=>t in e?KE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ic=(e,t)=>{for(var n in t||(t={}))JE.call(t,n)&&So(e,n,t[n]);if(_o)for(var n of _o(t))eT.call(t,n)&&So(e,n,t[n]);return e},Lc=(e,t)=>XE(e,ZE(t)),ye={PROSE:0,FENCE_MARKER:1,FENCE_INFO:2,FENCE_BODY:3,CODE_SPAN:4,CODE_SPAN_OPEN:5},tT=/^(`{3,}|~{3,})(.*)$/,nT=e=>e!==void 0&&e>="0"&&e<="9",rT=(e,t)=>{let n=t;if(e[n]==="-"||e[n]==="*"||e[n]==="+")n+=1;else{for(;nT(e[n])&&n-t<9;)n+=1;if(n===t||e[n]!=="."&&e[n]!==")")return-1;n+=1}return e[n]===" "?n+1:-1},iT=(e,t,n)=>{let r=0,i=t,a=!1,s=t;for(;;){for(;s<n&&e[s]===" ";)s+=1;if(e[s]===">"){r+=1,s+=e[s+1]===" "?2:1,i=s,a=!1;continue}let o=s<n?rT(e,s):-1;if(o===-1)return{contentStart:s,listIndent:a?s-i:0,quoteDepth:r};s=o,a=!0}},aT=(e,t,n,r)=>{let i=t;for(let a=0;a<r;a+=1){for(;i<n&&e[i]===" ";)i+=1;if(e[i]!==">")return-1;i+=1,e[i]===" "&&(i+=1)}return i},sT=(e,t,n,r,i)=>{let a=t+r;e.fill(ye.FENCE_MARKER,a,a+i),e.fill(ye.FENCE_INFO,a+i,Math.min(n+1,e.length))},oT=(e,t,n,r)=>{let i=t;for(;i<n&&e[i]===" ";)i+=1;let a=0;for(;i<n&&e[i]===r.char;)i+=1,a+=1;if(a<r.length)return!1;for(;i<n;){if(e[i]!==" "&&e[i]!==" "&&e[i]!=="\r")return!1;i+=1}return!0},uT=(e,t,n,r)=>{let i=r>n&&e[r-1]==="\r"?r-1:r,a=iT(e,n,i),s=e.slice(a.contentStart,i).match(tT);if(!s)return null;let[,o,u]=s,l=o[0];return l==="`"&&u.includes("`")?null:(sT(t,n,r,a.contentStart-n,o.length),{char:l,length:o.length,listIndent:a.listIndent,quoteDepth:a.quoteDepth})},lT=(e,t,n,r)=>{let i=aT(e,t,n,r.quoteDepth);if(i===-1||r.listIndent===0)return i;let a=i;for(;a<n&&e[a]===" ";)a+=1;return a===n||e[a]==="\r"&&a+1===n||a-i>=r.listIndent?i:-1},cT=(e,t)=>{let n=e.length,r=null,i=0;for(;i<n;){let a=e.indexOf(`
148
+ `))}function u(p,g,k,C){const A=k.enter("tableCell"),S=k.enter("phrasing"),y=k.containerPhrasing(p,{...C,before:a,after:a});return S(),A(),y}function l(p,g){return Jg(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,k){const C=p.children;let A=-1;const S=[],y=g.enter("table");for(;++A<C.length;)S[A]=h(C[A],g,k);return y(),S}function h(p,g,k){const C=p.children;let A=-1;const S=[],y=g.enter("tableRow");for(;++A<C.length;)S[A]=u(C[A],p,g,k);return y(),S}function m(p,g,k){let C=cc.inlineCode(p,g,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function K1(){return{exit:{taskListCheckValueChecked:Eo,taskListCheckValueUnchecked:Eo,paragraph:Z1}}}function X1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J1}}}function Eo(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Z1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function J1(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let u=cc.listItem(e,t,n,{...r,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(d){return d+s}}function eb(){return[kg(),qg(),Yg(),z1(),K1()]}function tb(e){return{extensions:[yg(),zg(e),Gg(),Q1(e),X1()]}}function ut(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function tt(e,t){return e.length>0?(ut(e,e.length,0,t),e):t}const To={}.hasOwnProperty;function hc(e){const t={};let n=-1;for(;++n<e.length;)nb(t,e[n]);return t}function nb(e,t){let n;for(n in t){const i=(To.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){To.call(i,s)||(i[s]=[]);const o=a[s];rb(i[s],Array.isArray(o)?o:o?[o]:[])}}}function rb(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ut(e,0,0,r)}const ib={tokenize:cb,partial:!0},fc={tokenize:db,partial:!0},pc={tokenize:hb,partial:!0},mc={tokenize:fb,partial:!0},ab={tokenize:pb,partial:!0},gc={name:"wwwAutolink",tokenize:ub,previous:Ec},bc={name:"protocolAutolink",tokenize:lb,previous:Tc},Ct={name:"emailAutolink",tokenize:ob,previous:xc},Tt={};function sb(){return{text:Tt}}let qt=48;for(;qt<123;)Tt[qt]=Ct,qt++,qt===58?qt=65:qt===91&&(qt=97);Tt[43]=Ct;Tt[45]=Ct;Tt[46]=Ct;Tt[95]=Ct;Tt[72]=[Ct,bc];Tt[104]=[Ct,bc];Tt[87]=[Ct,gc];Tt[119]=[Ct,gc];function ob(e,t,n){const r=this;let i,a;return s;function s(h){return!ia(h)||!xc.call(r,r.previous)||Qa(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return ia(h)?(e.consume(h),o):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(ab,d,l)(h):h===45||h===95||He(h)?(a=!0,e.consume(h),u):d(h)}function l(h){return e.consume(h),i=!0,u}function d(h){return a&&i&&$e(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function ub(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Ec.call(r,r.previous)||Qa(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ib,e.attempt(fc,e.attempt(pc,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function lb(e,t,n){const r=this;let i="",a=!1;return s;function s(h){return(h===72||h===104)&&Tc.call(r,r.previous)&&!Qa(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if($e(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),a?l:(a=!0,u)):n(h)}function l(h){return h===null||jr(h)||ke(h)||Zt(h)||si(h)?n(h):e.attempt(fc,e.attempt(pc,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function cb(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function db(e,t,n){let r,i,a;return s;function s(l){return l===46||l===95?e.check(mc,u,o)(l):l===null||ke(l)||Zt(l)||l!==45&&si(l)?u(l):(a=!0,e.consume(l),s)}function o(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),s}function u(l){return i||r||!a?n(l):t(l)}}function hb(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(mc,t,a)(s):s===null||ke(s)||Zt(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function fb(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ke(o)||Zt(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ke(o)||Zt(o)?t(o):r(o)}function a(o){return $e(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):$e(o)?(e.consume(o),s):n(o)}}function pb(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return He(a)?n(a):t(a)}}function Ec(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ke(e)}function Tc(e){return!$e(e)}function xc(e){return!(e===47||ia(e))}function ia(e){return e===43||e===45||e===46||e===95||He(e)}function Qa(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Tn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&He(e.charCodeAt(n+1))&&He(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function oi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const aa={name:"attention",resolveAll:mb,tokenize:gb};function mb(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,s={...e[i][1].end},o={...e[n][1].start};xo(s,-a),xo(o,a);const u={type:a>1?"strongSequence":"emphasisSequence",start:s,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},d={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},h={type:a>1?"strong":"emphasis",start:{...u.start},end:{...l.end}};e[i][1].end={...u.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=tt(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=tt(r,[["enter",h,t],["enter",u,t],["exit",u,t],["enter",d,t]]),r=tt(r,oi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=tt(r,[["exit",d,t],["enter",l,t],["exit",l,t],["exit",h,t]]);let m=0;e[n][1].end.offset-e[n][1].start.offset&&(m=2,r=tt(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),ut(e,i-1,n-i+3,r),n=i+r.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function gb(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ur(r);let a;return s;function s(u){return a=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===a)return e.consume(u),o;const l=e.exit("attentionSequence"),d=Ur(u),h=!d||d===2&&i||n.includes(u)&&u!==42&&u!==95,m=!i||i===2&&d||n.includes(r)&&r!==42&&r!==95;return l._open=!!(a===42?h:h&&(i||!m)),l._close=!!(a===42?m:m&&(d||!h)),t(u)}}function xo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bb={name:"autolink",tokenize:Eb};function Eb(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return $e(p)?(e.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||He(p)?(r=1,o(p)):l(p)}function o(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||He(p))&&r++<32?(e.consume(p),o):(r=0,l(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||jr(p)?n(p):(e.consume(p),u)}function l(p){return p===64?(e.consume(p),d):fg(p)?(e.consume(p),l):n(p)}function d(p){return He(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||He(p))&&r++<63){const g=p===45?m:h;return e.consume(p),g}return n(p)}}function pe(e,t,n,r){const i=r?r-1:1/0;let a=0;return s;function s(u){return le(u)?(e.enter(n),o(u)):t(u)}function o(u){return le(u)&&a++<i?(e.consume(u),o):(e.exit(n),t(u))}}function kc(e,t,n,r,i,a){let s=0;return o;function o(d){return le(d)?(e.enter(r),u(d)):l(d)}function u(d){return le(d)&&s<a?(e.consume(d),s++,u):(e.exit(r),l(d))}function l(d){return s>=i?t(d):n(d)}}const cr={partial:!0,tokenize:Tb};function Tb(e,t,n){return r;function r(a){return le(a)?pe(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||re(a)?t(a):n(a)}}const yc={continuation:{tokenize:kb},exit:yb,name:"blockQuote",tokenize:xb};function xb(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return le(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function kb(e,t,n){const r=this;return i;function i(s){return le(s)?pe(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(yc,t,n)(s)}}function yb(e){e.exit("blockQuote")}const Ac={name:"characterEscape",tokenize:Ab};function Ab(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return mg(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Cc={name:"characterReference",tokenize:Cb};function Cb(e,t,n){const r=this;let i=0,a,s;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,s=He,d(h))}function l(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=pg,d):(e.enter("characterReferenceValue"),a=7,s=ra,d(h))}function d(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return s===He&&!Wa(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<a?(e.consume(h),d):n(h)}}const sa={partial:!0,tokenize:_b};function _b(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ko={concrete:!0,name:"codeFenced",tokenize:Sb};function Sb(e,t,n){const r=this,i={partial:!0,tokenize:M};let a=0,s=0,o;return u;function u(L){return l(L)}function l(L){const P=r.events[r.events.length-1];return a=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,o=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(L)}function d(L){return L===o?(s++,e.consume(L),d):s<3?n(L):(e.exit("codeFencedFenceSequence"),le(L)?pe(e,h,"whitespace")(L):h(L))}function h(L){return L===null||re(L)?(e.exit("codeFencedFence"),r.interrupt?t(L):e.check(sa,k,D)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(L))}function m(L){return L===null||re(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(L)):le(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pe(e,p,"whitespace")(L)):L===96&&L===o?n(L):(e.consume(L),m)}function p(L){return L===null||re(L)?h(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(L))}function g(L){return L===null||re(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(L)):L===96&&L===o?n(L):(e.consume(L),g)}function k(L){return e.attempt(i,D,C)(L)}function C(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),A}function A(L){return a>0&&le(L)?pe(e,S,"linePrefix",a+1)(L):S(L)}function S(L){return L===null||re(L)?e.check(sa,k,D)(L):(e.enter("codeFlowValue"),y(L))}function y(L){return L===null||re(L)?(e.exit("codeFlowValue"),S(L)):(e.consume(L),y)}function D(L){return e.exit("codeFenced"),t(L)}function M(L,P,O){let U=0;return I;function I(q){return L.enter("lineEnding"),L.consume(q),L.exit("lineEnding"),F}function F(q){return L.enter("codeFencedFence"),le(q)?pe(L,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):$(q)}function $(q){return q===o?(L.enter("codeFencedFenceSequence"),W(q)):O(q)}function W(q){return q===o?(U++,L.consume(q),W):U>=s?(L.exit("codeFencedFenceSequence"),le(q)?pe(L,G,"whitespace")(q):G(q)):O(q)}function G(q){return q===null||re(q)?(L.exit("codeFencedFence"),P(q)):O(q)}}}const Ii={name:"codeIndented",tokenize:wb},Nb={partial:!0,tokenize:Ib};function wb(e,t,n){return r;function r(o){return e.enter("codeIndented"),kc(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?s(o):re(o)?e.attempt(Nb,i,s)(o):(e.enter("codeFlowValue"),a(o))}function a(o){return o===null||re(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),a)}function s(o){return e.exit("codeIndented"),t(o)}}function Ib(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):re(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):kc(e,t,a,"linePrefix",4,4)(s)}function a(s){return re(s)?i(s):n(s)}}const Lb={name:"codeText",previous:vb,resolve:Rb,tokenize:Ob};function Rb(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ob(e,t,n){let r=0,i,a;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(a=e.enter("codeTextSequence"),i=0,d(h)):re(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(h))}function l(h){return h===null||h===32||h===96||re(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),l)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",l(h))}}class Db{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ln(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ln(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ln(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ln(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ln(this.left,n.reverse())}}}function Ln(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _c(e){const t={};let n=-1,r,i,a,s,o,u,l;const d=new Db(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Pb(d,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return ut(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function Pb(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,u=[],l={};let d,h,m=-1,p=n,g=0,k=0;const C=[k];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(k=m+1,C.push(k),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),m=C.length;m--;){const A=o.slice(C[m],C[m+1]),S=a.pop();u.push([S,S+A.length-1]),e.splice(S,2,A)}for(u.reverse(),m=-1;++m<u.length;)l[g+u[m][0]]=g+u[m][1],g+=u[m][1]-u[m][0]-1;return l}const Mb={resolve:Fb,tokenize:Hb},Bb={partial:!0,tokenize:jb};function Fb(e){return _c(e),e}function Hb(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):re(o)?e.check(Bb,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function jb(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),pe(e,a,"linePrefix")}function a(s){if(s===null||re(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Sc(e,t,n,r,i,a,s,o,u){const l=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(A){return A===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(A),e.exit(a),m):A===null||A===32||A===41||jr(A)?n(A):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),k(A))}function m(A){return A===62?(e.enter(a),e.consume(A),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===62?(e.exit("chunkString"),e.exit(o),m(A)):A===null||A===60||re(A)?n(A):(e.consume(A),A===92?g:p)}function g(A){return A===60||A===62||A===92?(e.consume(A),p):p(A)}function k(A){return!d&&(A===null||A===41||ke(A))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(A)):d<l&&A===40?(e.consume(A),d++,k):A===41?(e.consume(A),d--,k):A===null||A===32||A===40||jr(A)?n(A):(e.consume(A),A===92?C:k)}function C(A){return A===40||A===41||A===92?(e.consume(A),k):k(A)}}function Nc(e,t,n,r,i,a){const s=this;let o=0,u;return l;function l(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),d}function d(p){return o>999||p===null||p===91||p===93&&!u||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):re(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||re(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!le(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),o++,h):h(p)}}function wc(e,t,n,r,i,a){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),l(m))}function l(m){return m===s?(e.exit(a),u(s)):m===null?n(m):re(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),pe(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||re(m)?(e.exit("chunkString"),l(m)):(e.consume(m),m===92?h:d)}function h(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Qn(e,t){let n;return r;function r(i){return re(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):le(i)?pe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Ub={name:"definition",tokenize:zb},qb={partial:!0,tokenize:$b};function zb(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return Nc.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=ot(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return ke(p)?Qn(e,l)(p):l(p)}function l(p){return Sc(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(qb,h,h)(p)}function h(p){return le(p)?pe(e,m,"whitespace")(p):m(p)}function m(p){return p===null||re(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function $b(e,t,n){return r;function r(o){return ke(o)?Qn(e,i)(o):n(o)}function i(o){return wc(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return le(o)?pe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||re(o)?t(o):n(o)}}const Vb={name:"hardBreakEscape",tokenize:Yb};function Yb(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return re(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Gb={name:"headingAtx",resolve:Wb,tokenize:Qb};function Wb(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};ut(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])}return e}function Qb(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ke(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||re(d)?(e.exit("atxHeading"),t(d)):le(d)?pe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),l(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),o(d))}function l(d){return d===null||d===35||ke(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),l)}}const Kb={concrete:!0,name:"htmlFlow",resolveTo:Zb,tokenize:Jb},Xb={partial:!0,tokenize:eE};function Zb(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Jb(e,t,n){const r=this;let i,a,s,o,u;return l;function l(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),h}function h(N){return N===33?(e.consume(N),m):N===47?(e.consume(N),a=!0,k):N===63?(e.consume(N),i=3,r.interrupt?t:T):$e(N)?(e.consume(N),s=String.fromCharCode(N),C):n(N)}function m(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,o=0,g):$e(N)?(e.consume(N),i=4,r.interrupt?t:T):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:T):n(N)}function g(N){const me="CDATA[";return N===me.charCodeAt(o++)?(e.consume(N),o===me.length?r.interrupt?t:$:g):n(N)}function k(N){return $e(N)?(e.consume(N),s=String.fromCharCode(N),C):n(N)}function C(N){if(N===null||N===47||N===62||ke(N)){const me=N===47,ge=s.toLowerCase();return!me&&!a&&mo.includes(ge)?(i=1,r.interrupt?t(N):$(N)):F1.includes(s.toLowerCase())?(i=6,me?(e.consume(N),A):r.interrupt?t(N):$(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?S(N):y(N))}return N===45||He(N)?(e.consume(N),s+=String.fromCharCode(N),C):n(N)}function A(N){return N===62?(e.consume(N),r.interrupt?t:$):n(N)}function S(N){return le(N)?(e.consume(N),S):I(N)}function y(N){return N===47?(e.consume(N),I):N===58||N===95||$e(N)?(e.consume(N),D):le(N)?(e.consume(N),y):I(N)}function D(N){return N===45||N===46||N===58||N===95||He(N)?(e.consume(N),D):M(N)}function M(N){return N===61?(e.consume(N),L):le(N)?(e.consume(N),M):y(N)}function L(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,P):le(N)?(e.consume(N),L):O(N)}function P(N){return N===u?(e.consume(N),u=null,U):N===null||re(N)?n(N):(e.consume(N),P)}function O(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ke(N)?M(N):(e.consume(N),O)}function U(N){return N===47||N===62||le(N)?y(N):n(N)}function I(N){return N===62?(e.consume(N),F):n(N)}function F(N){return N===null||re(N)?$(N):le(N)?(e.consume(N),F):n(N)}function $(N){return N===45&&i===2?(e.consume(N),Q):N===60&&i===1?(e.consume(N),Z):N===62&&i===4?(e.consume(N),Ne):N===63&&i===3?(e.consume(N),T):N===93&&i===5?(e.consume(N),he):re(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Xb,_e,W)(N)):N===null||re(N)?(e.exit("htmlFlowData"),W(N)):(e.consume(N),$)}function W(N){return e.check(sa,G,_e)(N)}function G(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),q}function q(N){return N===null||re(N)?W(N):(e.enter("htmlFlowData"),$(N))}function Q(N){return N===45?(e.consume(N),T):$(N)}function Z(N){return N===47?(e.consume(N),s="",ae):$(N)}function ae(N){if(N===62){const me=s.toLowerCase();return mo.includes(me)?(e.consume(N),Ne):$(N)}return $e(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),ae):$(N)}function he(N){return N===93?(e.consume(N),T):$(N)}function T(N){return N===62?(e.consume(N),Ne):N===45&&i===2?(e.consume(N),T):$(N)}function Ne(N){return N===null||re(N)?(e.exit("htmlFlowData"),_e(N)):(e.consume(N),Ne)}function _e(N){return e.exit("htmlFlow"),t(N)}}function eE(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(cr,t,n)}}const tE={name:"htmlText",tokenize:nE};function nE(e,t,n){const r=this;let i,a,s;return o;function o(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),u}function u(T){return T===33?(e.consume(T),l):T===47?(e.consume(T),M):T===63?(e.consume(T),y):$e(T)?(e.consume(T),O):n(T)}function l(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),a=0,g):$e(T)?(e.consume(T),S):n(T)}function d(T){return T===45?(e.consume(T),p):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),m):re(T)?(s=h,Z(T)):(e.consume(T),h)}function m(T){return T===45?(e.consume(T),p):h(T)}function p(T){return T===62?Q(T):T===45?m(T):h(T)}function g(T){const Ne="CDATA[";return T===Ne.charCodeAt(a++)?(e.consume(T),a===Ne.length?k:g):n(T)}function k(T){return T===null?n(T):T===93?(e.consume(T),C):re(T)?(s=k,Z(T)):(e.consume(T),k)}function C(T){return T===93?(e.consume(T),A):k(T)}function A(T){return T===62?Q(T):T===93?(e.consume(T),A):k(T)}function S(T){return T===null||T===62?Q(T):re(T)?(s=S,Z(T)):(e.consume(T),S)}function y(T){return T===null?n(T):T===63?(e.consume(T),D):re(T)?(s=y,Z(T)):(e.consume(T),y)}function D(T){return T===62?Q(T):y(T)}function M(T){return $e(T)?(e.consume(T),L):n(T)}function L(T){return T===45||He(T)?(e.consume(T),L):P(T)}function P(T){return re(T)?(s=P,Z(T)):le(T)?(e.consume(T),P):Q(T)}function O(T){return T===45||He(T)?(e.consume(T),O):T===47||T===62||ke(T)?U(T):n(T)}function U(T){return T===47?(e.consume(T),Q):T===58||T===95||$e(T)?(e.consume(T),I):re(T)?(s=U,Z(T)):le(T)?(e.consume(T),U):Q(T)}function I(T){return T===45||T===46||T===58||T===95||He(T)?(e.consume(T),I):F(T)}function F(T){return T===61?(e.consume(T),$):re(T)?(s=F,Z(T)):le(T)?(e.consume(T),F):U(T)}function $(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,W):re(T)?(s=$,Z(T)):le(T)?(e.consume(T),$):(e.consume(T),G)}function W(T){return T===i?(e.consume(T),i=void 0,q):T===null?n(T):re(T)?(s=W,Z(T)):(e.consume(T),W)}function G(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||ke(T)?U(T):(e.consume(T),G)}function q(T){return T===47||T===62||ke(T)?U(T):n(T)}function Q(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Z(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ae}function ae(T){return le(T)?pe(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):he(T)}function he(T){return e.enter("htmlTextData"),s(T)}}const Ka={name:"labelEnd",resolveAll:sE,resolveTo:oE,tokenize:uE},rE={tokenize:lE},iE={tokenize:cE},aE={tokenize:dE};function sE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ut(e,0,e.length,n),e}function oE(e,t){let n=e.length,r=0,i,a,s;for(;n--;){const d=e[n][1];if(i){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(i=n,d.type!=="labelLink")){r=2;break}}else d.type==="labelEnd"&&(a=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},l={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",o,t],["enter",u,t]],s=tt(s,e.slice(i+1,i+r+3)),s=tt(s,[["enter",l,t]]),s=tt(s,oi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),s=tt(s,[["exit",l,t],e[a-2],e[a-1],["exit",u,t]]),s=tt(s,e.slice(a+1)),s=tt(s,[["exit",o,t]]),ut(e,i,e.length,s),e}function uE(e,t,n){const r=this,i=r._labelStarts;let a,s;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return o;function o(m){return a?a._inactive?h(m):(s=r.parser.defined.includes(ot(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(rE,d,s?d:h)(m):m===91?e.attempt(iE,d,s?l:h)(m):s?d(m):h(m)}function l(m){return e.attempt(aE,d,h)(m)}function d(m){return i.pop(),t(m)}function h(m){return a._balanced=!0,n(m)}}function lE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return ke(h)?Qn(e,a)(h):a(h)}function a(h){return h===41?d(h):Sc(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return ke(h)?Qn(e,u)(h):d(h)}function o(h){return n(h)}function u(h){return h===34||h===39||h===40?wc(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function l(h){return ke(h)?Qn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function cE(e,t,n){const r=this;return i;function i(o){return Nc.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(ot(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function dE(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const hE={name:"labelStartImage",resolveAll:Ka.resolveAll,tokenize:fE};function fE(e,t,n){const r=this;let i;return a;function a(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),s}function s(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const pE={name:"labelStartLink",resolveAll:Ka.resolveAll,tokenize:mE};function mE(e,t,n){const r=this;let i;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Li={name:"lineEnding",tokenize:gE};function gE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pe(e,t,"linePrefix")}}const Or={name:"thematicBreak",tokenize:bE};function bE(e,t,n){let r=0,i;return a;function a(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,o(l)}function o(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||re(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),le(l)?pe(e,o,"whitespace")(l):o(l))}}const We={continuation:{tokenize:kE},exit:AE,name:"list",tokenize:xE},EE={partial:!0,tokenize:CE},TE={partial:!0,tokenize:yE};function xE(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:ra(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Or,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return ra(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(cr,r.interrupt?n:d,e.attempt(EE,m,h))}function d(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function h(p){return le(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function kE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(cr,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pe(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!le(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TE,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,pe(e,e.attempt(We,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function yE(e,t,n){const r=this;return pe(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function AE(e){e.exit(this.containerState.type)}function CE(e,t,n){const r=this;return pe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!le(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}let qr=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){yo(this,t,n,r,!1)}addBefore(t,n,r){yo(this,t,n,r,!0)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0,this.index.clear()}};function yo(e,t,n,r,i){if(n===0&&r.length===0)return;const a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}const s=[t,n,r];e.map.push(s),e.index.set(t,s)}const Ao={name:"setextUnderline",resolveTo:_E,tokenize:SE};function _E(e,t){const n=new qr;let r=e.length,i,a,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!s&&e[r][1].type==="definition"&&(s=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(n.add(a,0,[["enter",o,t]]),n.add(s+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[s][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function SE(e,t,n){const r=this;let i;return a;function a(l){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===i?(e.consume(l),o):(e.exit("setextHeadingLineSequence"),le(l)?pe(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||re(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const NE={tokenize:PE,partial:!0};function wE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vE,continuation:{tokenize:OE},exit:DE}},text:{91:{name:"gfmFootnoteCall",tokenize:RE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IE,resolveTo:LE}}}}function IE(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!s||!s._balanced)return n(u);const l=ot(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function LE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function RE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(h){if(a>999||h===93&&!s||h===null||h===91||ke(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(ot(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return ke(h)||(s=!0),a++,e.consume(h),h===92?d:l}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,l):l(h)}}function vE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(s>999||g===93&&!o||g===null||g===91||ke(g))return n(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=ot(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return ke(g)||(o=!0),s++,e.consume(g),g===92?h:d}function h(g){return g===91||g===92||g===93?(e.consume(g),s++,d):d(g)}function m(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(a)||i.push(a),pe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function OE(e,t,n){return e.check(cr,t,e.attempt(NE,t,n))}function DE(e){e.exit("gfmFootnoteDefinition")}function PE(e,t,n){const r=this;return pe(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function ME(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",d,o],["enter",s[l][1],o],["exit",s[l][1],o],["enter",h,o]],p=o.parser.constructs.insideSpan.null;p&&ut(m,m.length,0,oi(p,s.slice(l+1,u),o)),ut(m,m.length,0,[["exit",h,o],["enter",s[u][1],o],["exit",s[u][1],o],["exit",d,o]]),ut(s,l-1,u-l+3,m),u=l+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function a(s,o,u){const l=this.previous,d=this.events;let h=0;return m;function m(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?u(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const k=Ur(l);if(g===126)return h>1?u(g):(s.consume(g),h++,p);if(h<2&&!n)return u(g);const C=s.exit("strikethroughSequenceTemporary"),A=Ur(g);return C._open=!A||A===2&&!!k,C._close=!k||k===2&&!!A,o(g)}}}class BE{constructor(){this.map=[],this.index=new Map}add(t,n,r){FE(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0,this.index.clear()}}function FE(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}function HE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function jE(){return{flow:{null:{name:"table",tokenize:UE,resolveAll:qE}}}}function UE(e,t,n){const r=this;let i=0,a=0,s;return o;function o(I){let F=r.events.length-1;for(;F>-1;){const{type:G}=r.events[F][1];if(G==="lineEnding"||G==="linePrefix")F--;else break}const $=F>-1?r.events[F][1].type:null,W=$==="tableHead"||$==="tableRow"?L:u;return W===L&&r.parser.lazy[r.now().line]?n(I):W(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),l(I)}function l(I){return I===124||(s=!0,a+=1),d(I)}function d(I){return I===null?n(I):re(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):le(I)?pe(e,d,"whitespace")(I):(a+=1,s&&(s=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||ke(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?m:h)}function m(I){return I===92||I===124?(e.consume(I),h):h(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),s=!1,le(I)?pe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?C(I):I===124?(s=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):M(I)}function k(I){return le(I)?pe(e,C,"whitespace")(I):C(I)}function C(I){return I===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),A):I===45?(a+=1,A(I)):I===null||re(I)?D(I):M(I)}function A(I){return I===45?(e.enter("tableDelimiterFiller"),S(I)):M(I)}function S(I){return I===45?(e.consume(I),S):I===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return le(I)?pe(e,D,"whitespace")(I):D(I)}function D(I){return I===124?g(I):I===null||re(I)?!s||i!==a?M(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):M(I)}function M(I){return n(I)}function L(I){return e.enter("tableRow"),P(I)}function P(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),P):I===null||re(I)?(e.exit("tableRow"),t(I)):le(I)?pe(e,P,"whitespace")(I):(e.enter("data"),O(I))}function O(I){return I===null||I===124||ke(I)?(e.exit("data"),P(I)):(e.consume(I),I===92?U:O)}function U(I){return I===92||I===124?(e.consume(I),O):O(I)}}function qE(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,u=0,l,d,h;const m=new BE;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,u!==0&&(Co(m,t,u,l,d),d=void 0,u=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",l,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],h=Ar(m,t,a,i,void 0,h),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],h=Ar(m,t,a,i,void 0,h)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,a[1]!==0?(s[0]=s[1],h=Ar(m,t,a,i,n,h)):s[1]!==0&&(h=Ar(m,t,s,i,n,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Co(m,t,u,l,d),m.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=HE(t.events,n))}return e}function Ar(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},cn(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const u=cn(t.events,n[1]);if(a={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const l=cn(t.events,n[2]),d=cn(t.events,n[3]),h={type:o,start:Object.assign({},l),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;e.add(g,k,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},cn(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function Co(e,t,n,r,i){const a=[],s=cn(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function cn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const zE={name:"tasklistCheck",tokenize:VE};function $E(){return{text:{91:zE}}}function VE(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return ke(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return re(u)?t(u):le(u)?e.check({tokenize:YE},t,n)(u):n(u)}}function YE(e,t,n){return pe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function GE(e){return hc([sb(),wE(),ME(e),jE(),$E()])}const WE={};function QE(e){const t=this,n=e||WE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(GE(n)),a.push(eb()),s.push(tb(n))}var KE=Object.defineProperty,XE=Object.defineProperties,ZE=Object.getOwnPropertyDescriptors,_o=Object.getOwnPropertySymbols,JE=Object.prototype.hasOwnProperty,eT=Object.prototype.propertyIsEnumerable,So=(e,t,n)=>t in e?KE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ic=(e,t)=>{for(var n in t||(t={}))JE.call(t,n)&&So(e,n,t[n]);if(_o)for(var n of _o(t))eT.call(t,n)&&So(e,n,t[n]);return e},Lc=(e,t)=>XE(e,ZE(t)),ye={PROSE:0,FENCE_MARKER:1,FENCE_INFO:2,FENCE_BODY:3,CODE_SPAN:4,CODE_SPAN_OPEN:5},tT=/^(`{3,}|~{3,})(.*)$/,nT=e=>e!==void 0&&e>="0"&&e<="9",rT=(e,t)=>{let n=t;if(e[n]==="-"||e[n]==="*"||e[n]==="+")n+=1;else{for(;nT(e[n])&&n-t<9;)n+=1;if(n===t||e[n]!=="."&&e[n]!==")")return-1;n+=1}return e[n]===" "?n+1:-1},iT=(e,t,n)=>{let r=0,i=t,a=!1,s=t;for(;;){for(;s<n&&e[s]===" ";)s+=1;if(e[s]===">"){r+=1,s+=e[s+1]===" "?2:1,i=s,a=!1;continue}let o=s<n?rT(e,s):-1;if(o===-1)return{contentStart:s,listIndent:a?s-i:0,quoteDepth:r};s=o,a=!0}},aT=(e,t,n,r)=>{let i=t;for(let a=0;a<r;a+=1){for(;i<n&&e[i]===" ";)i+=1;if(e[i]!==">")return-1;i+=1,e[i]===" "&&(i+=1)}return i},sT=(e,t,n,r,i)=>{let a=t+r;e.fill(ye.FENCE_MARKER,a,a+i),e.fill(ye.FENCE_INFO,a+i,Math.min(n+1,e.length))},oT=(e,t,n,r)=>{let i=t;for(;i<n&&e[i]===" ";)i+=1;let a=0;for(;i<n&&e[i]===r.char;)i+=1,a+=1;if(a<r.length)return!1;for(;i<n;){if(e[i]!==" "&&e[i]!==" "&&e[i]!=="\r")return!1;i+=1}return!0},uT=(e,t,n,r)=>{let i=r>n&&e[r-1]==="\r"?r-1:r,a=iT(e,n,i),s=e.slice(a.contentStart,i).match(tT);if(!s)return null;let[,o,u]=s,l=o[0];return l==="`"&&u.includes("`")?null:(sT(t,n,r,a.contentStart-n,o.length),{char:l,length:o.length,listIndent:a.listIndent,quoteDepth:a.quoteDepth})},lT=(e,t,n,r)=>{let i=aT(e,t,n,r.quoteDepth);if(i===-1||r.listIndent===0)return i;let a=i;for(;a<n&&e[a]===" ";)a+=1;return a===n||e[a]==="\r"&&a+1===n||a-i>=r.listIndent?i:-1},cT=(e,t)=>{let n=e.length,r=null,i=0;for(;i<n;){let a=e.indexOf(`
149
149
  `,i);a===-1&&(a=n);let s=r?lT(e,i,a,r):-1;r&&s===-1&&(r=null),r?oT(e,s,a,r)?(t.fill(ye.FENCE_MARKER,i,a),r=null):t.fill(ye.FENCE_BODY,i,Math.min(a+1,n)):r=uT(e,t,i,a),i=a+1}return r},No=(e,t)=>{let n=t+1;for(;n<e.length&&e[n]==="`";)n+=1;return n},dT=(e,t)=>{let n=t+1;for(;n<e.length&&(e[n]===" "||e[n]===" "||e[n]==="\r");)n+=1;return n<e.length&&e[n]===`
150
150
  `},hT=(e,t,n)=>{let r=n;for(;;){let i=e.indexOf("`",r);if(i===-1)return-1;let a=i>r&&e[i-1]==="\\"&&t[i-1]===ye.PROSE;if(t[i]===ye.PROSE&&!a)return i;r=i+1}},fT=(e,t)=>{let n=e.length,r=-1,i=0,a=0;for(;a<n;){if(r<0){if(a=hT(e,t,a),a===-1)break;let o=No(e,a);r=a,i=o-a,a=o;continue}if(t[a]!==ye.PROSE){t.fill(ye.CODE_SPAN_OPEN,r,a),r=-1,a+=1;continue}if(e[a]===`
151
151
  `&&dT(e,a)){r=-1,a+=1;continue}if(e[a]!=="`"){a+=1;continue}let s=No(e,a);s-a===i&&(t.fill(ye.CODE_SPAN,r,s),r=-1),a=s}return r>=0?(t.fill(ye.CODE_SPAN_OPEN,r,n),{start:r,runLength:i}):null},pT=e=>{let t=new Uint8Array(e.length),n=cT(e,t),r=fT(e,t);return{text:e,regions:t,openFence:n,openSpan:r,mathMask:null,linkUrlMask:null,htmlTagMask:null}},oa=null,Dr=null,at=e=>{if(Dr!==null&&e===oa)return Dr;let t=pT(e);return oa=e,Dr=t,t},mT=()=>{oa=null,Dr=null},gT=(e,t)=>t>=e.regions.length?e.openFence!==null||e.openSpan!==null:t<0?!1:e.regions[t]!==ye.PROSE,bT=(e,t)=>e.regions[t]===ye.CODE_SPAN,Xa=(e,t)=>{let n=at(e),r=t+t,i=0;for(let a=e.indexOf(r);a!==-1;a=e.indexOf(r,a))n.regions[a]===ye.PROSE?(i+=1,a+=2):a+=1;return i},Za=new Uint8Array(0),ET=e=>e==="inlineLatex"||e==="blockLatex",TT=(e,t)=>t==="["&&e==="none"?"blockLatex":t==="]"&&e==="blockLatex"?"none":t==="("&&e==="none"?"inlineLatex":t===")"&&e==="inlineLatex"?"none":null,xT=(e,t)=>t?e==="blockDollar"?"none":"blockDollar":e==="blockDollar"?e:e==="inlineDollar"?"none":"inlineDollar",kT=e=>e.includes("$")||e.includes("\\(")||e.includes("\\["),yT=(e,t,n)=>{let r=e[t+1];if(e[t]==="\\"){if(r==="$")return{context:n,length:2};let i=TT(n,r);return i===null?null:{context:i,length:2}}if(e[t]==="$"&&!ET(n)){let i=r==="$";return{context:xT(n,i),length:i?2:1}}return null},AT=e=>{let{text:t,regions:n}=e,r=t.length,i=new Uint8Array(r),a="none",s=0;for(;s<r;){i[s]=a==="none"?0:1;let o=n[s]===ye.PROSE?yT(t,s,a):null;if(o===null){s+=1;continue}a=o.context,o.length===2&&(i[s+1]=a==="none"?0:1),s+=o.length}return i},xn=(e,t)=>t<0||t>=e.text.length?!1:(e.mathMask===null&&(e.mathMask=kT(e.text)?AT(e):Za),e.mathMask[t]===1),CT=(e,t,n,r)=>{let{text:i,regions:a}=e,s=new Uint8Array(n-t),o=0;for(let l=n-1;l>=t;l-=1)i[l]===")"&&a[l]===ye.PROSE&&(o=1),s[l-t]=o;let u=!1;for(let l=t;l<n;l+=1)u&&s[l-t]===1&&(r[l]=1),a[l]===ye.PROSE&&(i[l]===")"?u=!1:i[l]==="("&&(u=l>0&&i[l-1]==="]"))},_T=e=>{let{text:t}=e,n=t.length,r=new Uint8Array(n),i=0;for(;i<n;){let a=t.indexOf(`
@@ -168,10 +168,10 @@
168
168
  $$`:`${e}$$`},bx=e=>px(e)%2===0?e:gx(e),Ex=e=>mx(e)%2===1?`${e}$`:e,er="streamdown:incomplete-image",Tx=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=HT(e,t);if(r===-1||Ve(e,r))return null;let i=r>0&&e[r-1]==="!",a=i?r-1:r,s=e.substring(0,a),o=e.substring(r+1,t);return i?`${s}![${o}](${er})`:n==="text-only"?`${s}${o}`:`${s}[${o}](streamdown:incomplete-link)`},Lo=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Ve(e,n)){if(n>0&&e[n-1]==="!")continue;let r=Oc(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},xx=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,i);if(r){let s=e.substring(t+1);return`${a}![${s}](${er})`}if(n==="text-only"){let s=Lo(e,t);return e.substring(0,s)+e.substring(s+1)}return`${e}](streamdown:incomplete-link)`}if(Oc(e,t)===-1){let a=e.substring(0,i);if(r){let s=e.substring(t+1);return`${a}![${s}](${er})`}if(n==="text-only"){let s=Lo(e,t);return e.substring(0,s)+e.substring(s+1)}return`${e}](streamdown:incomplete-link)`}return null},kx=(e,t)=>{let n=e.lastIndexOf("](");if(n!==-1&&!Ve(e,n)){let r=Tx(e,n,t);if(r!==null)return r}for(let r=e.lastIndexOf("[");r!==-1;r=r===0?-1:e.lastIndexOf("[",r-1))if(!Ve(e,r)){let i=xx(e,r,t);if(i!==null)return i}return e},yx=32,Mc=(e,t="protocol")=>{let n=e;for(let r=0;r<yx;r+=1){let i=kx(n,t);if(i.length>=n.length)return i;n=i}return n},Ax=/^-{1,2}$/,Cx=/^[\s]*-{1,2}[\s]+$/,_x=/^={1,2}$/,Sx=/^[\s]*={1,2}[\s]+$/,Nx=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
169
169
  `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(Ax.test(i)&&!n.match(Cx)){let a=r.split(`
170
170
  `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(_x.test(i)&&!n.match(Sx)){let a=r.split(`
171
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},wx=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,Ix=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(wx,(t,n,r)=>{let i=r+n.length;return Ve(e,i)?t:`${n}\\~`}),Ro=e=>Xa(e,"~"),Lx=e=>{let t=Mt(e,DT);if(t){let n=t[2];if(!n||nn.test(n))return e;let r=e.lastIndexOf(t[1]);if(Ve(e,r)||Pt(e,r))return e;if(Ro(e)%2===1)return`${e}~~`}else{let n=Mt(e,MT);if(n){let r=e.lastIndexOf(n[0].slice(0,2));if(Ve(e,r)||Pt(e,r))return e;if(Ro(e)%2===1)return`${e}~`}}return e},Ri=e=>e!==!1,Rx=e=>e===!0,qe={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},vx=[{handler:{name:"singleTilde",handle:Ix,priority:qe.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:wT,priority:qe.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:hx,priority:qe.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:Nx,priority:qe.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Mc,priority:qe.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")||e.endsWith(`](${er})`)},{handler:{name:"boldItalic",handle:ox,priority:qe.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:KT,priority:qe.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:ZT,priority:qe.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:tx,priority:qe.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:ix,priority:qe.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:fx,priority:qe.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Lx,priority:qe.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:bx,priority:qe.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:Ex,priority:qe.INLINE_KATEX},optionKey:"inlineKatex"}],Ox=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return vx.filter(({handler:r,optionKey:i})=>r.name==="links"?Ri(e?.links)||Ri(e?.images):r.name==="inlineKatex"?Rx(e?.inlineKatex):Ri(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:Lc(Ic({},r),{handle:a=>Mc(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},Dx=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=Ox(t),a=((n=t?.handlers)!=null?n:[]).map(o=>{var u;return{handler:Lc(Ic({},o),{priority:(u=o.priority)!=null?u:qe.DEFAULT}),earlyReturn:void 0}}),s=[...i,...a].sort((o,u)=>{var l,d;return((l=o.handler.priority)!=null?l:0)-((d=u.handler.priority)!=null?d:0)});try{for(let{handler:o,earlyReturn:u}of s)if(r=o.handle(r),u!=null&&u(r))return r;return r.endsWith(" ")&&!r.endsWith(" ")?r.slice(0,-1):r}finally{mT()}},Px=Dx;function Bc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Bc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fc(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Bc(e))&&(r&&(r+=" "),r+=t);return r}const Mx=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Bx=(e,t)=>({classGroupId:e,validator:t}),Hc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),$r="-",vo=[],Fx="arbitrary..",Hx=e=>{const t=Ux(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return jx(s);const o=s.split($r),u=o[0]===""&&o.length>1?1:0;return jc(o,u,t)},getConflictingClassGroupIds:(s,o)=>{if(o){const u=r[s],l=n[s];return u?l?Mx(l,u):u:l||vo}return n[s]||vo}}},jc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const l=jc(e,t+1,a);if(l)return l}const s=n.validators;if(s===null)return;const o=t===0?e.join($r):e.slice(t).join($r),u=s.length;for(let l=0;l<u;l++){const d=s[l];if(d.validator(o))return d.classGroupId}},jx=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Fx+r:void 0})(),Ux=e=>{const{theme:t,classGroups:n}=e;return qx(n,t)},qx=(e,t)=>{const n=Hc();for(const r in e){const i=e[r];ts(i,n,r,t)}return n},ts=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a];zx(s,t,n,r)}},zx=(e,t,n,r)=>{if(typeof e=="string"){$x(e,t,n);return}if(typeof e=="function"){Vx(e,t,n,r);return}Yx(e,t,n,r)},$x=(e,t,n)=>{const r=e===""?t:Uc(t,e);r.classGroupId=n},Vx=(e,t,n,r)=>{if(Gx(e)){ts(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Bx(n,e))},Yx=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let s=0;s<a;s++){const[o,u]=i[s];ts(u,Uc(t,o),n,r)}},Uc=(e,t)=>{let n=e;const r=t.split($r),i=r.length;for(let a=0;a<i;a++){const s=r[a];let o=n.nextPart.get(s);o||(o=Hc(),n.nextPart.set(s,o)),n=o}return n},Gx=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Wx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,s)=>{n[a]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=r[a])!==void 0)return i(a,s),s},set(a,s){a in n?n[a]=s:i(a,s)}}},ua="!",Oo=":",Qx=[],Do=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Kx=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let s=0,o=0,u=0,l;const d=i.length;for(let k=0;k<d;k++){const C=i[k];if(s===0&&o===0){if(C===Oo){a.push(i.slice(u,k)),u=k+1;continue}if(C==="/"){l=k;continue}}C==="["?s++:C==="]"?s--:C==="("?o++:C===")"&&o--}const h=a.length===0?i:i.slice(u);let m=h,p=!1;h.endsWith(ua)?(m=h.slice(0,-1),p=!0):h.startsWith(ua)&&(m=h.slice(1),p=!0);const g=l&&l>u?l-u:void 0;return Do(a,p,m,g)};if(t){const i=t+Oo,a=r;r=s=>s.startsWith(i)?a(s.slice(i.length)):Do(Qx,!1,s,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Xx=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const s=n[a],o=s[0]==="[",u=t.has(s);o||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},Zx=e=>({cache:Wx(e.cacheSize),parseClassName:Kx(e),sortModifiers:Xx(e),postfixLookupClassGroupIds:Jx(e),...Hx(e)}),Jx=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},e2=/\s+/,t2=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:s}=t,o=[],u=e.trim().split(e2);let l="";for(let d=u.length-1;d>=0;d-=1){const h=u[d],{isExternal:m,modifiers:p,hasImportantModifier:g,baseClassName:k,maybePostfixModifierPosition:C}=n(h);if(m){l=h+(l.length>0?" "+l:l);continue}let A=!!C,S;if(A){const P=k.substring(0,C);S=r(P);const O=S&&s[S]?r(k):void 0;O&&O!==S&&(S=O,A=!1)}else S=r(k);if(!S){if(!A){l=h+(l.length>0?" "+l:l);continue}if(S=r(k),!S){l=h+(l.length>0?" "+l:l);continue}A=!1}const y=p.length===0?"":p.length===1?p[0]:a(p).join(":"),D=g?y+ua:y,M=D+S;if(o.indexOf(M)>-1)continue;o.push(M);const L=i(S,A);for(let P=0;P<L.length;++P){const O=L[P];o.push(D+O)}l=h+(l.length>0?" "+l:l)}return l},n2=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=qc(n))&&(i&&(i+=" "),i+=r);return i},qc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qc(e[r]))&&(n&&(n+=" "),n+=t);return n},r2=(e,...t)=>{let n,r,i,a;const s=u=>{const l=t.reduce((d,h)=>h(d),e());return n=Zx(l),r=n.cache.get,i=n.cache.set,a=o,o(u)},o=u=>{const l=r(u);if(l)return l;const d=t2(u,n);return i(u,d),d};return a=s,(...u)=>a(n2(...u))},i2=[],Re=e=>{const t=n=>n[e]||i2;return t.isThemeGetter=!0,t.themeKey=e,t},zc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$c=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o2=/\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$/,u2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,l2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>a2.test(e),ue=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),vi=e=>e.endsWith("%")&&ue(e.slice(0,-1)),yt=e=>s2.test(e),Vc=()=>!0,d2=e=>o2.test(e)&&!u2.test(e),ns=()=>!1,h2=e=>l2.test(e),f2=e=>c2.test(e),p2=e=>!K(e)&&!X(e),m2=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),g2=e=>jt(e,Wc,ns),K=e=>zc.test(e),zt=e=>jt(e,Qc,d2),Po=e=>jt(e,C2,ue),b2=e=>jt(e,Xc,Vc),E2=e=>jt(e,Kc,ns),Mo=e=>jt(e,Yc,ns),T2=e=>jt(e,Gc,f2),Cr=e=>jt(e,Zc,h2),X=e=>$c.test(e),Rn=e=>rn(e,Qc),x2=e=>rn(e,Kc),Bo=e=>rn(e,Yc),k2=e=>rn(e,Wc),y2=e=>rn(e,Gc),_r=e=>rn(e,Zc,!0),A2=e=>rn(e,Xc,!0),jt=(e,t,n)=>{const r=zc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rn=(e,t,n=!1)=>{const r=$c.exec(e);return r?r[1]?t(r[1]):n:!1},Yc=e=>e==="position"||e==="percentage",Gc=e=>e==="image"||e==="url",Wc=e=>e==="length"||e==="size"||e==="bg-size",Qc=e=>e==="length",C2=e=>e==="number",Kc=e=>e==="family-name",Xc=e=>e==="number"||e==="weight",Zc=e=>e==="shadow",_2=()=>{const e=Re("color"),t=Re("font"),n=Re("text"),r=Re("font-weight"),i=Re("tracking"),a=Re("leading"),s=Re("breakpoint"),o=Re("container"),u=Re("spacing"),l=Re("radius"),d=Re("shadow"),h=Re("inset-shadow"),m=Re("text-shadow"),p=Re("drop-shadow"),g=Re("blur"),k=Re("perspective"),C=Re("aspect"),A=Re("ease"),S=Re("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...D(),X,K],L=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],O=()=>[X,K,u],q=()=>[St,"full","auto",...O()],I=()=>[mt,"none","subgrid",X,K],F=()=>["auto",{span:["full",mt,X,K]},mt,X,K],$=()=>[mt,"auto",X,K],W=()=>["auto","min","max","fr",X,K],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...O()],Z=()=>[St,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],ae=()=>[o,St,"screen","full","dvw","lvw","svw","min","max","fit",...O()],he=()=>[St,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],T=()=>[e,X,K],Ne=()=>[...D(),Bo,Mo,{position:[X,K]}],_e=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",k2,g2,{size:[X,K]}],me=()=>[vi,Rn,zt],ge=()=>["","none","full",l,X,K],te=()=>["",ue,Rn,zt],we=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[ue,vi,Bo,Mo],oe=()=>["","none",g,X,K],Se=()=>["none",ue,X,K],be=()=>["none",ue,X,K],Ke=()=>[ue,X,K],ft=()=>[St,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yt],breakpoint:[yt],color:[Vc],container:[yt],"drop-shadow":[yt],ease:["in","out","in-out"],font:[p2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yt],shadow:[yt],spacing:["px",ue],text:[yt],"text-shadow":[yt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",St,K,X,C]}],container:["container"],"container-type":[{"@container":["","normal","size",X,K]}],"container-named":[m2],columns:[{columns:[ue,"auto",K,X,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:M()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{"inset-s":q(),start:q()}],end:[{"inset-e":q(),end:q()}],"inset-bs":[{"inset-bs":q()}],"inset-be":[{"inset-be":q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",X,K]}],basis:[{basis:[St,"full","auto",o,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ue,St,"auto","initial","none",K]}],grow:[{grow:["",ue,X,K]}],shrink:[{shrink:["",ue,X,K]}],order:[{order:[mt,"first","last","none",X,K]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh","none",...Z()]}],"font-size":[{text:["base",n,Rn,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A2,b2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vi,K]}],"font-family":[{font:[x2,E2,t]}],"font-features":[{"font-features":[K]}],"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:[i,X,K]}],"line-clamp":[{"line-clamp":[ue,"none",X,Po]}],leading:[{leading:["none",a,...O()]}],"list-image":[{"list-image":["none",X,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",X,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[ue,"from-font","auto",X,zt]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[ue,"auto",X,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[mt,X,K]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",X,K]}],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",X,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ne()}],"bg-repeat":[{bg:_e()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,X,K],radial:["",X,K],conic:["",mt,X,K]},y2,T2]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ue,X,K]}],"outline-w":[{outline:["",ue,Rn,zt]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","inner","none",d,_r,Cr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",h,_r,Cr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[ue,zt]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",m,_r,Cr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[ue,X,K]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":[ue]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[X,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[ue]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ne()}],"mask-repeat":[{mask:_e()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",X,K]}],filter:[{filter:["","none",X,K]}],blur:[{blur:oe()}],brightness:[{brightness:[ue,X,K]}],contrast:[{contrast:[ue,X,K]}],"drop-shadow":[{"drop-shadow":["","none",p,_r,Cr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",ue,X,K]}],"hue-rotate":[{"hue-rotate":[ue,X,K]}],invert:[{invert:["",ue,X,K]}],saturate:[{saturate:[ue,X,K]}],sepia:[{sepia:["",ue,X,K]}],"backdrop-filter":[{"backdrop-filter":["","none",X,K]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[ue,X,K]}],"backdrop-contrast":[{"backdrop-contrast":[ue,X,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ue,X,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ue,X,K]}],"backdrop-invert":[{"backdrop-invert":["",ue,X,K]}],"backdrop-opacity":[{"backdrop-opacity":[ue,X,K]}],"backdrop-saturate":[{"backdrop-saturate":[ue,X,K]}],"backdrop-sepia":[{"backdrop-sepia":["",ue,X,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",X,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ue,"initial",X,K]}],ease:[{ease:["linear","initial",A,X,K]}],delay:[{delay:[ue,X,K]}],animate:[{animate:["none",S,X,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,X,K]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[X,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ft()}],"translate-x":[{"translate-x":ft()}],"translate-y":[{"translate-y":ft()}],"translate-z":[{"translate-z":ft()}],"translate-none":["translate-none"],zoom:[{zoom:[mt,X,K]}],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",X,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":T()}],"scrollbar-track-color":[{"scrollbar-track":T()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",X,K]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[ue,Rn,zt,Po]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","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-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","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-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Jc=r2(_2),S2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w2={};function Fo(e,t){return(w2.jsx?N2:S2).test(e)}const I2=/[ \t\n\f\r]/g;function L2(e){return typeof e=="object"?e.type==="text"?Ho(e.value):!1:Ho(e)}function Ho(e){return e.replace(I2,"")===""}function ed(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var on={},Oi,jo;function R2(){if(jo)return Oi;jo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
172
- `,l="/",d="*",h="",m="comment",p="declaration";function g(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var S=1,y=1;function D(G){var U=G.match(t);U&&(S+=U.length);var Q=G.lastIndexOf(u);y=~Q?G.length-Q:y+G.length}function M(){var G={line:S,column:y};return function(U){return U.position=new L(G),q(),U}}function L(G){this.start=G,this.end={line:S,column:y},this.source=A.source}L.prototype.content=C;function P(G){var U=new Error(A.source+":"+S+":"+y+": "+G);if(U.reason=G,U.filename=A.source,U.line=S,U.column=y,U.source=C,!A.silent)throw U}function O(G){var U=G.exec(C);if(U){var Q=U[0];return D(Q),C=C.slice(Q.length),U}}function q(){O(n)}function I(G){var U;for(G=G||[];U=F();)U!==!1&&G.push(U);return G}function F(){var G=M();if(!(l!=C.charAt(0)||d!=C.charAt(1))){for(var U=2;h!=C.charAt(U)&&(d!=C.charAt(U)||l!=C.charAt(U+1));)++U;if(U+=2,h===C.charAt(U-1))return P("End of comment missing");var Q=C.slice(2,U-2);return y+=2,D(Q),C=C.slice(U),y+=2,G({type:m,comment:Q})}}function $(){var G=M(),U=O(r);if(U){if(F(),!O(i))return P("property missing ':'");var Q=O(a),Z=G({type:p,property:k(U[0].replace(e,h)),value:Q?k(Q[0].replace(e,h)):h});return O(s),Z}}function W(){var G=[];I(G);for(var U;U=$();)U!==!1&&(G.push(U),I(G));return G}return q(),W()}function k(C){return C?C.replace(o,h):h}return Oi=g,Oi}var Uo;function v2(){if(Uo)return on;Uo=1;var e=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0}),on.default=n;const t=e(R2());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,t.default)(r),o=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:d}=u;o?i(l,d,u):d&&(a=a||{},a[l]=d)}),a}return on}var vn={},qo;function O2(){if(qo)return vn;qo=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(l){return!l||n.test(l)||e.test(l)},s=function(l,d){return d.toUpperCase()},o=function(l,d){return"".concat(d,"-")},u=function(l,d){return d===void 0&&(d={}),a(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,o):l=l.replace(r,o),l.replace(t,s))};return vn.camelCase=u,vn}var On,zo;function D2(){if(zo)return On;zo=1;var e=On&&On.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(v2()),n=O2();function r(i,a){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(o,u){o&&u&&(s[(0,n.camelCase)(o,a)]=u)}),s}return r.default=r,On=r,On}var P2=D2();const M2=ed(P2);function Kn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$o(e.position):"start"in e||"end"in e?$o(e):"line"in e||"column"in e?la(e):""}function la(e){return Vo(e&&e.line)+":"+Vo(e&&e.column)}function $o(e){return la(e&&e.start)+"-"+la(e&&e.end)}function Vo(e){return e&&typeof e=="number"?e:1}class Ue extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Kn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ue.prototype.file="";Ue.prototype.name="";Ue.prototype.reason="";Ue.prototype.message="";Ue.prototype.stack="";Ue.prototype.column=void 0;Ue.prototype.line=void 0;Ue.prototype.ancestors=void 0;Ue.prototype.cause=void 0;Ue.prototype.fatal=void 0;Ue.prototype.place=void 0;Ue.prototype.ruleId=void 0;Ue.prototype.source=void 0;const rs={}.hasOwnProperty,B2=new Map,F2=/[A-Z]/g,H2=new Set(["table","tbody","thead","tfoot","tr"]),j2=new Set(["td","th"]),td="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function U2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Q2(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=W2(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ft:sr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nd(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nd(e,t,n){if(t.type==="element")return q2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return z2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return V2(e,t,n);if(t.type==="mdxjsEsm")return $2(e,t);if(t.type==="root")return Y2(e,t,n);if(t.type==="text")return G2(e,t)}function q2(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ft,e.schema=i),e.ancestors.push(t);const a=id(e,t.tagName,!1),s=K2(e,t);let o=as(e,t);return H2.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!L2(u):!0})),rd(e,s,a,t),is(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function z2(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tr(e,t.position)}function $2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tr(e,t.position)}function V2(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ft,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:id(e,t.name,!0),s=X2(e,t),o=as(e,t);return rd(e,s,a,t),is(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Y2(e,t,n){const r={};return is(r,as(e,t)),e.create(t,e.Fragment,r,n)}function G2(e,t){return t.value}function rd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function is(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function W2(e,t,n){return r;function r(i,a,s,o){const l=Array.isArray(s.children)?n:t;return o?l(a,s,o):l(a,s)}}function Q2(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),u=Et(r);return t(i,a,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function K2(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&rs.call(t.properties,i)){const a=Z2(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&j2.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function X2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else tr(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else tr(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function as(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:B2;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const l=i.get(u)||0;s=u+"-"+l,i.set(u,l+1)}}const o=nd(e,a,s);o!==void 0&&n.push(o)}return n}function Z2(e,t,n){const r=ei(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ul(n):ll(n)),r.property==="style"){let i=typeof n=="object"?n:J2(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ek(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?qf[r.property]||r.property:r.attribute,n]}}function J2(e,t){try{return M2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ue("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=td+"#cannot-parse-style-attribute",i}}function id(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=Fo(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Fo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return rs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tr(e)}function tr(e,t){const n=new Ue("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=td+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ek(e){const t={};let n;for(n in e)rs.call(e,n)&&(t[tk(n)]=e[n]);return t}function tk(e){let t=e.replace(F2,nk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nk(e){return"-"+e.toLowerCase()}const Di={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rk={tokenize:ik};function ik(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),pe(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return re(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const ak={tokenize:sk},Yo={tokenize:ok};function sk(e){const t=this,n=[];let r=0,i,a,s;return o;function o(y){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,u,l)(y)}return l(y)}function u(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const D=t.events.length;let M=D,L;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){L=t.events[M][1].end;break}A(r);let P=D;for(;P<t.events.length;)t.events[P][1].end={...L},P++;const O=new qr;return O.add(M+1,0,t.events.slice(D)),O.add(D,P-D,[]),O.consume(t.events),l(y)}return o(y)}function l(y){if(r===n.length){if(!i)return m(y);if(i.currentConstruct&&i.currentConstruct.concrete)return g(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Yo,d,h)(y)}function d(y){return i&&S(),A(r),m(y)}function h(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(y)}function m(y){return t.containerState={},e.attempt(Yo,p,g)(y)}function p(y){return r++,n.push([t.currentConstruct,t.containerState]),m(y)}function g(y){if(y===null){i&&S(),A(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),k(y)}function k(y){if(y===null){C(e.exit("chunkFlow"),!0),A(0),e.consume(y);return}return re(y)?(e.consume(y),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),k)}function C(y,D){const M=t.sliceStream(y);if(D&&M.push(null),y.previous=a,a&&(a.next=y),a=y,i.defineSkip(y.start),i.write(M),t.parser.lazy[y.start.line]){let L=i.events.length;for(;L--;)if(i.events[L][1].start.offset<s&&(!i.events[L][1].end||i.events[L][1].end.offset>s))return;const P=t.events.length;let O=P,q,I;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(q){I=t.events[O][1].end;break}q=!0}for(A(r),L=P;L<t.events.length;)t.events[L][1].end={...I},L++;const F=new qr;F.add(O+1,0,t.events.slice(P)),F.add(P,L-P,[]),F.consume(t.events)}}function A(y){let D=n.length;for(;D-- >y;){const M=n[D];t.containerState=M[1],M[0].exit.call(t,e)}n.length=y}function S(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ok(e,t,n){return pe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const uk={tokenize:lk};function lk(e){const t=this,n=e.attempt(cr,r,e.attempt(this.parser.constructs.flowInitial,i,pe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Mb,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ck={resolveAll:sd()},dk=ad("string"),hk=ad("text");function ad(e){return{resolveAll:sd(e==="text"?fk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(d){return l(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return l(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function l(d){if(d===null)return!0;const h=i[d];let m=-1;if(h)for(;++m<h.length;){const p=h[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function sd(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function fk(e,t){const n=new qr;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],a=t.sliceStream(i);let s=a.length,o=-1,u=0,l;for(;s--;){const d=a[s];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(d===-2)l=!0,u++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const d={type:r===e.length||l||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):n.add(r,0,[["enter",d,t],["exit",d,t]])}r++}return n.consume(e),e}const pk={42:We,43:We,45:We,48:We,49:We,50:We,51:We,52:We,53:We,54:We,55:We,56:We,57:We,62:yc},mk={91:Ub},gk={[-2]:Ii,[-1]:Ii,32:Ii},bk={35:Gb,42:Or,45:[Ao,Or],60:Kb,61:Ao,95:Or,96:ko,126:ko},Ek={38:Cc,92:Ac},Tk={[-5]:Li,[-4]:Li,[-3]:Li,33:hE,38:Cc,42:aa,60:[bb,tE],91:pE,92:[Vb,Ac],93:Ka,95:aa,96:Lb},xk={null:[aa,ck]},kk={null:[42,95]},yk={null:[]},Ak=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kk,contentInitial:mk,disable:yk,document:pk,flow:bk,flowInitial:gk,insideSpan:xk,string:Ek,text:Tk},Symbol.toStringTag,{value:"Module"}));function Ck(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],o=[];const u={attempt:P(M),check:P(L),consume:S,enter:y,exit:D,interrupt:P(L,{interrupt:!0})},l={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:h};let d=t.tokenize.call(l,u);return t.resolveAll&&a.push(t),l;function h(F){return s=tt(s,F),C(),s[s.length-1]!==null?[]:(O(t,0),l.events=oi(a,l.events,l),l.events)}function m(F,$){return Sk(p(F),$)}function p(F){return _k(s,F)}function g(){const{_bufferIndex:F,_index:$,line:W,column:G,offset:U}=r;return{_bufferIndex:F,_index:$,line:W,column:G,offset:U}}function k(F){i[F.line]=F.column,I()}function C(){for(;r._index<s.length;){const F=s[r._index];if(typeof F=="string"){const $=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<F.length;)A(F.charCodeAt(r._bufferIndex))}else A(F)}}function A(F){d=d(F)}function S(F){re(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,I()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=F}function y(F,$){const W=$||{};return W.type=F,W.start=g(),l.events.push(["enter",W,l]),o.push(W),W}function D(F){const $=o.pop();return $.end=g(),l.events.push(["exit",$,l]),$}function M(F,$){O(F,$.from)}function L(F,$){$.restore()}function P(F,$){return W;function W(G,U,Q){let Z,ae,he,T;return Array.isArray(G)?_e(G):"tokenize"in G?_e([G]):Ne(G);function Ne(te){return we;function we(De){const Y=De!==null&&te[De],oe=De!==null&&te.null,Se=[...Array.isArray(Y)?Y:Y?[Y]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return _e(Se)(De)}}function _e(te){return Z=te,ae=0,te.length===0?Q:N(te[ae])}function N(te){return we;function we(De){return T=q(),he=te,te.partial||(l.currentConstruct=te),te.name&&l.parser.constructs.disable.null.includes(te.name)?ge():te.tokenize.call($?Object.assign(Object.create(l),$):l,u,me,ge)(De)}}function me(te){return F(he,T),U}function ge(te){return T.restore(),++ae<Z.length?N(Z[ae]):Q}}}function O(F,$){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&ut(l.events,$,l.events.length-$,F.resolve(l.events.slice($),l)),F.resolveTo&&(l.events=F.resolveTo(l.events,l))}function q(){const F=g(),$=l.previous,W=l.currentConstruct,G=l.events.length,U=Array.from(o);return{from:G,restore:Q};function Q(){r=F,l.previous=$,l.currentConstruct=W,l.events.length=G,o=U,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function _k(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function Sk(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
171
+ `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},wx=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,Ix=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(wx,(t,n,r)=>{let i=r+n.length;return Ve(e,i)?t:`${n}\\~`}),Ro=e=>Xa(e,"~"),Lx=e=>{let t=Mt(e,DT);if(t){let n=t[2];if(!n||nn.test(n))return e;let r=e.lastIndexOf(t[1]);if(Ve(e,r)||Pt(e,r))return e;if(Ro(e)%2===1)return`${e}~~`}else{let n=Mt(e,MT);if(n){let r=e.lastIndexOf(n[0].slice(0,2));if(Ve(e,r)||Pt(e,r))return e;if(Ro(e)%2===1)return`${e}~`}}return e},Ri=e=>e!==!1,Rx=e=>e===!0,qe={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},vx=[{handler:{name:"singleTilde",handle:Ix,priority:qe.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:wT,priority:qe.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:hx,priority:qe.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:Nx,priority:qe.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Mc,priority:qe.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")||e.endsWith(`](${er})`)},{handler:{name:"boldItalic",handle:ox,priority:qe.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:KT,priority:qe.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:ZT,priority:qe.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:tx,priority:qe.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:ix,priority:qe.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:fx,priority:qe.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Lx,priority:qe.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:bx,priority:qe.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:Ex,priority:qe.INLINE_KATEX},optionKey:"inlineKatex"}],Ox=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return vx.filter(({handler:r,optionKey:i})=>r.name==="links"?Ri(e?.links)||Ri(e?.images):r.name==="inlineKatex"?Rx(e?.inlineKatex):Ri(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:Lc(Ic({},r),{handle:a=>Mc(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},Dx=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=Ox(t),a=((n=t?.handlers)!=null?n:[]).map(o=>{var u;return{handler:Lc(Ic({},o),{priority:(u=o.priority)!=null?u:qe.DEFAULT}),earlyReturn:void 0}}),s=[...i,...a].sort((o,u)=>{var l,d;return((l=o.handler.priority)!=null?l:0)-((d=u.handler.priority)!=null?d:0)});try{for(let{handler:o,earlyReturn:u}of s)if(r=o.handle(r),u!=null&&u(r))return r;return r.endsWith(" ")&&!r.endsWith(" ")?r.slice(0,-1):r}finally{mT()}},Px=Dx;function Bc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Bc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fc(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Bc(e))&&(r&&(r+=" "),r+=t);return r}const Mx=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Bx=(e,t)=>({classGroupId:e,validator:t}),Hc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),$r="-",vo=[],Fx="arbitrary..",Hx=e=>{const t=Ux(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return jx(s);const o=s.split($r),u=o[0]===""&&o.length>1?1:0;return jc(o,u,t)},getConflictingClassGroupIds:(s,o)=>{if(o){const u=r[s],l=n[s];return u?l?Mx(l,u):u:l||vo}return n[s]||vo}}},jc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const l=jc(e,t+1,a);if(l)return l}const s=n.validators;if(s===null)return;const o=t===0?e.join($r):e.slice(t).join($r),u=s.length;for(let l=0;l<u;l++){const d=s[l];if(d.validator(o))return d.classGroupId}},jx=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Fx+r:void 0})(),Ux=e=>{const{theme:t,classGroups:n}=e;return qx(n,t)},qx=(e,t)=>{const n=Hc();for(const r in e){const i=e[r];ts(i,n,r,t)}return n},ts=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a];zx(s,t,n,r)}},zx=(e,t,n,r)=>{if(typeof e=="string"){$x(e,t,n);return}if(typeof e=="function"){Vx(e,t,n,r);return}Yx(e,t,n,r)},$x=(e,t,n)=>{const r=e===""?t:Uc(t,e);r.classGroupId=n},Vx=(e,t,n,r)=>{if(Gx(e)){ts(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Bx(n,e))},Yx=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let s=0;s<a;s++){const[o,u]=i[s];ts(u,Uc(t,o),n,r)}},Uc=(e,t)=>{let n=e;const r=t.split($r),i=r.length;for(let a=0;a<i;a++){const s=r[a];let o=n.nextPart.get(s);o||(o=Hc(),n.nextPart.set(s,o)),n=o}return n},Gx=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Wx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,s)=>{n[a]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=r[a])!==void 0)return i(a,s),s},set(a,s){a in n?n[a]=s:i(a,s)}}},ua="!",Oo=":",Qx=[],Do=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Kx=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let s=0,o=0,u=0,l;const d=i.length;for(let k=0;k<d;k++){const C=i[k];if(s===0&&o===0){if(C===Oo){a.push(i.slice(u,k)),u=k+1;continue}if(C==="/"){l=k;continue}}C==="["?s++:C==="]"?s--:C==="("?o++:C===")"&&o--}const h=a.length===0?i:i.slice(u);let m=h,p=!1;h.endsWith(ua)?(m=h.slice(0,-1),p=!0):h.startsWith(ua)&&(m=h.slice(1),p=!0);const g=l&&l>u?l-u:void 0;return Do(a,p,m,g)};if(t){const i=t+Oo,a=r;r=s=>s.startsWith(i)?a(s.slice(i.length)):Do(Qx,!1,s,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Xx=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const s=n[a],o=s[0]==="[",u=t.has(s);o||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},Zx=e=>({cache:Wx(e.cacheSize),parseClassName:Kx(e),sortModifiers:Xx(e),postfixLookupClassGroupIds:Jx(e),...Hx(e)}),Jx=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},e2=/\s+/,t2=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:s}=t,o=[],u=e.trim().split(e2);let l="";for(let d=u.length-1;d>=0;d-=1){const h=u[d],{isExternal:m,modifiers:p,hasImportantModifier:g,baseClassName:k,maybePostfixModifierPosition:C}=n(h);if(m){l=h+(l.length>0?" "+l:l);continue}let A=!!C,S;if(A){const P=k.substring(0,C);S=r(P);const O=S&&s[S]?r(k):void 0;O&&O!==S&&(S=O,A=!1)}else S=r(k);if(!S){if(!A){l=h+(l.length>0?" "+l:l);continue}if(S=r(k),!S){l=h+(l.length>0?" "+l:l);continue}A=!1}const y=p.length===0?"":p.length===1?p[0]:a(p).join(":"),D=g?y+ua:y,M=D+S;if(o.indexOf(M)>-1)continue;o.push(M);const L=i(S,A);for(let P=0;P<L.length;++P){const O=L[P];o.push(D+O)}l=h+(l.length>0?" "+l:l)}return l},n2=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=qc(n))&&(i&&(i+=" "),i+=r);return i},qc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qc(e[r]))&&(n&&(n+=" "),n+=t);return n},r2=(e,...t)=>{let n,r,i,a;const s=u=>{const l=t.reduce((d,h)=>h(d),e());return n=Zx(l),r=n.cache.get,i=n.cache.set,a=o,o(u)},o=u=>{const l=r(u);if(l)return l;const d=t2(u,n);return i(u,d),d};return a=s,(...u)=>a(n2(...u))},i2=[],Re=e=>{const t=n=>n[e]||i2;return t.isThemeGetter=!0,t.themeKey=e,t},zc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$c=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o2=/\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$/,u2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,l2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>a2.test(e),ue=e=>!!e&&!Number.isNaN(Number(e)),mt=e=>!!e&&Number.isInteger(Number(e)),vi=e=>e.endsWith("%")&&ue(e.slice(0,-1)),yt=e=>s2.test(e),Vc=()=>!0,d2=e=>o2.test(e)&&!u2.test(e),ns=()=>!1,h2=e=>l2.test(e),f2=e=>c2.test(e),p2=e=>!K(e)&&!X(e),m2=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),g2=e=>jt(e,Wc,ns),K=e=>zc.test(e),zt=e=>jt(e,Qc,d2),Po=e=>jt(e,C2,ue),b2=e=>jt(e,Xc,Vc),E2=e=>jt(e,Kc,ns),Mo=e=>jt(e,Yc,ns),T2=e=>jt(e,Gc,f2),Cr=e=>jt(e,Zc,h2),X=e=>$c.test(e),Rn=e=>rn(e,Qc),x2=e=>rn(e,Kc),Bo=e=>rn(e,Yc),k2=e=>rn(e,Wc),y2=e=>rn(e,Gc),_r=e=>rn(e,Zc,!0),A2=e=>rn(e,Xc,!0),jt=(e,t,n)=>{const r=zc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rn=(e,t,n=!1)=>{const r=$c.exec(e);return r?r[1]?t(r[1]):n:!1},Yc=e=>e==="position"||e==="percentage",Gc=e=>e==="image"||e==="url",Wc=e=>e==="length"||e==="size"||e==="bg-size",Qc=e=>e==="length",C2=e=>e==="number",Kc=e=>e==="family-name",Xc=e=>e==="number"||e==="weight",Zc=e=>e==="shadow",_2=()=>{const e=Re("color"),t=Re("font"),n=Re("text"),r=Re("font-weight"),i=Re("tracking"),a=Re("leading"),s=Re("breakpoint"),o=Re("container"),u=Re("spacing"),l=Re("radius"),d=Re("shadow"),h=Re("inset-shadow"),m=Re("text-shadow"),p=Re("drop-shadow"),g=Re("blur"),k=Re("perspective"),C=Re("aspect"),A=Re("ease"),S=Re("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...D(),X,K],L=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],O=()=>[X,K,u],U=()=>[St,"full","auto",...O()],I=()=>[mt,"none","subgrid",X,K],F=()=>["auto",{span:["full",mt,X,K]},mt,X,K],$=()=>[mt,"auto",X,K],W=()=>["auto","min","max","fr",X,K],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...O()],Z=()=>[St,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],ae=()=>[o,St,"screen","full","dvw","lvw","svw","min","max","fit",...O()],he=()=>[St,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],T=()=>[e,X,K],Ne=()=>[...D(),Bo,Mo,{position:[X,K]}],_e=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",k2,g2,{size:[X,K]}],me=()=>[vi,Rn,zt],ge=()=>["","none","full",l,X,K],te=()=>["",ue,Rn,zt],we=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[ue,vi,Bo,Mo],oe=()=>["","none",g,X,K],Se=()=>["none",ue,X,K],be=()=>["none",ue,X,K],Ke=()=>[ue,X,K],ft=()=>[St,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yt],breakpoint:[yt],color:[Vc],container:[yt],"drop-shadow":[yt],ease:["in","out","in-out"],font:[p2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yt],shadow:[yt],spacing:["px",ue],text:[yt],"text-shadow":[yt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",St,K,X,C]}],container:["container"],"container-type":[{"@container":["","normal","size",X,K]}],"container-named":[m2],columns:[{columns:[ue,"auto",K,X,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:M()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[mt,"auto",X,K]}],basis:[{basis:[St,"full","auto",o,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ue,St,"auto","initial","none",K]}],grow:[{grow:["",ue,X,K]}],shrink:[{shrink:["",ue,X,K]}],order:[{order:[mt,"first","last","none",X,K]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh","none",...Z()]}],"font-size":[{text:["base",n,Rn,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A2,b2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vi,K]}],"font-family":[{font:[x2,E2,t]}],"font-features":[{"font-features":[K]}],"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:[i,X,K]}],"line-clamp":[{"line-clamp":[ue,"none",X,Po]}],leading:[{leading:["none",a,...O()]}],"list-image":[{"list-image":["none",X,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",X,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[ue,"from-font","auto",X,zt]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[ue,"auto",X,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[mt,X,K]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",X,K]}],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",X,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ne()}],"bg-repeat":[{bg:_e()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mt,X,K],radial:["",X,K],conic:["",mt,X,K]},y2,T2]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ue,X,K]}],"outline-w":[{outline:["",ue,Rn,zt]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","inner","none",d,_r,Cr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",h,_r,Cr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[ue,zt]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",m,_r,Cr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[ue,X,K]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":[ue]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[X,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[ue]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ne()}],"mask-repeat":[{mask:_e()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",X,K]}],filter:[{filter:["","none",X,K]}],blur:[{blur:oe()}],brightness:[{brightness:[ue,X,K]}],contrast:[{contrast:[ue,X,K]}],"drop-shadow":[{"drop-shadow":["","none",p,_r,Cr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",ue,X,K]}],"hue-rotate":[{"hue-rotate":[ue,X,K]}],invert:[{invert:["",ue,X,K]}],saturate:[{saturate:[ue,X,K]}],sepia:[{sepia:["",ue,X,K]}],"backdrop-filter":[{"backdrop-filter":["","none",X,K]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[ue,X,K]}],"backdrop-contrast":[{"backdrop-contrast":[ue,X,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ue,X,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ue,X,K]}],"backdrop-invert":[{"backdrop-invert":["",ue,X,K]}],"backdrop-opacity":[{"backdrop-opacity":[ue,X,K]}],"backdrop-saturate":[{"backdrop-saturate":[ue,X,K]}],"backdrop-sepia":[{"backdrop-sepia":["",ue,X,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",X,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ue,"initial",X,K]}],ease:[{ease:["linear","initial",A,X,K]}],delay:[{delay:[ue,X,K]}],animate:[{animate:["none",S,X,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,X,K]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[X,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ft()}],"translate-x":[{"translate-x":ft()}],"translate-y":[{"translate-y":ft()}],"translate-z":[{"translate-z":ft()}],"translate-none":["translate-none"],zoom:[{zoom:[mt,X,K]}],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",X,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":T()}],"scrollbar-track-color":[{"scrollbar-track":T()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",X,K]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[ue,Rn,zt,Po]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","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-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","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-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Jc=r2(_2),S2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w2={};function Fo(e,t){return(w2.jsx?N2:S2).test(e)}const I2=/[ \t\n\f\r]/g;function L2(e){return typeof e=="object"?e.type==="text"?Ho(e.value):!1:Ho(e)}function Ho(e){return e.replace(I2,"")===""}function ed(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var on={},Oi,jo;function R2(){if(jo)return Oi;jo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
172
+ `,l="/",d="*",h="",m="comment",p="declaration";function g(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var S=1,y=1;function D(G){var q=G.match(t);q&&(S+=q.length);var Q=G.lastIndexOf(u);y=~Q?G.length-Q:y+G.length}function M(){var G={line:S,column:y};return function(q){return q.position=new L(G),U(),q}}function L(G){this.start=G,this.end={line:S,column:y},this.source=A.source}L.prototype.content=C;function P(G){var q=new Error(A.source+":"+S+":"+y+": "+G);if(q.reason=G,q.filename=A.source,q.line=S,q.column=y,q.source=C,!A.silent)throw q}function O(G){var q=G.exec(C);if(q){var Q=q[0];return D(Q),C=C.slice(Q.length),q}}function U(){O(n)}function I(G){var q;for(G=G||[];q=F();)q!==!1&&G.push(q);return G}function F(){var G=M();if(!(l!=C.charAt(0)||d!=C.charAt(1))){for(var q=2;h!=C.charAt(q)&&(d!=C.charAt(q)||l!=C.charAt(q+1));)++q;if(q+=2,h===C.charAt(q-1))return P("End of comment missing");var Q=C.slice(2,q-2);return y+=2,D(Q),C=C.slice(q),y+=2,G({type:m,comment:Q})}}function $(){var G=M(),q=O(r);if(q){if(F(),!O(i))return P("property missing ':'");var Q=O(a),Z=G({type:p,property:k(q[0].replace(e,h)),value:Q?k(Q[0].replace(e,h)):h});return O(s),Z}}function W(){var G=[];I(G);for(var q;q=$();)q!==!1&&(G.push(q),I(G));return G}return U(),W()}function k(C){return C?C.replace(o,h):h}return Oi=g,Oi}var Uo;function v2(){if(Uo)return on;Uo=1;var e=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0}),on.default=n;const t=e(R2());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,t.default)(r),o=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:d}=u;o?i(l,d,u):d&&(a=a||{},a[l]=d)}),a}return on}var vn={},qo;function O2(){if(qo)return vn;qo=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(l){return!l||n.test(l)||e.test(l)},s=function(l,d){return d.toUpperCase()},o=function(l,d){return"".concat(d,"-")},u=function(l,d){return d===void 0&&(d={}),a(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,o):l=l.replace(r,o),l.replace(t,s))};return vn.camelCase=u,vn}var On,zo;function D2(){if(zo)return On;zo=1;var e=On&&On.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(v2()),n=O2();function r(i,a){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(o,u){o&&u&&(s[(0,n.camelCase)(o,a)]=u)}),s}return r.default=r,On=r,On}var P2=D2();const M2=ed(P2);function Kn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$o(e.position):"start"in e||"end"in e?$o(e):"line"in e||"column"in e?la(e):""}function la(e){return Vo(e&&e.line)+":"+Vo(e&&e.column)}function $o(e){return la(e&&e.start)+"-"+la(e&&e.end)}function Vo(e){return e&&typeof e=="number"?e:1}class Ue extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Kn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ue.prototype.file="";Ue.prototype.name="";Ue.prototype.reason="";Ue.prototype.message="";Ue.prototype.stack="";Ue.prototype.column=void 0;Ue.prototype.line=void 0;Ue.prototype.ancestors=void 0;Ue.prototype.cause=void 0;Ue.prototype.fatal=void 0;Ue.prototype.place=void 0;Ue.prototype.ruleId=void 0;Ue.prototype.source=void 0;const rs={}.hasOwnProperty,B2=new Map,F2=/[A-Z]/g,H2=new Set(["table","tbody","thead","tfoot","tr"]),j2=new Set(["td","th"]),td="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function U2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Q2(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=W2(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ft:sr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nd(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nd(e,t,n){if(t.type==="element")return q2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return z2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return V2(e,t,n);if(t.type==="mdxjsEsm")return $2(e,t);if(t.type==="root")return Y2(e,t,n);if(t.type==="text")return G2(e,t)}function q2(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ft,e.schema=i),e.ancestors.push(t);const a=id(e,t.tagName,!1),s=K2(e,t);let o=as(e,t);return H2.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!L2(u):!0})),rd(e,s,a,t),is(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function z2(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tr(e,t.position)}function $2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tr(e,t.position)}function V2(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ft,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:id(e,t.name,!0),s=X2(e,t),o=as(e,t);return rd(e,s,a,t),is(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Y2(e,t,n){const r={};return is(r,as(e,t)),e.create(t,e.Fragment,r,n)}function G2(e,t){return t.value}function rd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function is(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function W2(e,t,n){return r;function r(i,a,s,o){const l=Array.isArray(s.children)?n:t;return o?l(a,s,o):l(a,s)}}function Q2(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),u=Et(r);return t(i,a,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function K2(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&rs.call(t.properties,i)){const a=Z2(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&j2.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function X2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else tr(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else tr(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function as(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:B2;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const l=i.get(u)||0;s=u+"-"+l,i.set(u,l+1)}}const o=nd(e,a,s);o!==void 0&&n.push(o)}return n}function Z2(e,t,n){const r=ei(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ul(n):ll(n)),r.property==="style"){let i=typeof n=="object"?n:J2(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ek(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?qf[r.property]||r.property:r.attribute,n]}}function J2(e,t){try{return M2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ue("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=td+"#cannot-parse-style-attribute",i}}function id(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=Fo(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Fo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return rs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tr(e)}function tr(e,t){const n=new Ue("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=td+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ek(e){const t={};let n;for(n in e)rs.call(e,n)&&(t[tk(n)]=e[n]);return t}function tk(e){let t=e.replace(F2,nk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nk(e){return"-"+e.toLowerCase()}const Di={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rk={tokenize:ik};function ik(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),pe(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return re(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const ak={tokenize:sk},Yo={tokenize:ok};function sk(e){const t=this,n=[];let r=0,i,a,s;return o;function o(y){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,u,l)(y)}return l(y)}function u(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const D=t.events.length;let M=D,L;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){L=t.events[M][1].end;break}A(r);let P=D;for(;P<t.events.length;)t.events[P][1].end={...L},P++;const O=new qr;return O.add(M+1,0,t.events.slice(D)),O.add(D,P-D,[]),O.consume(t.events),l(y)}return o(y)}function l(y){if(r===n.length){if(!i)return m(y);if(i.currentConstruct&&i.currentConstruct.concrete)return g(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Yo,d,h)(y)}function d(y){return i&&S(),A(r),m(y)}function h(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(y)}function m(y){return t.containerState={},e.attempt(Yo,p,g)(y)}function p(y){return r++,n.push([t.currentConstruct,t.containerState]),m(y)}function g(y){if(y===null){i&&S(),A(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),k(y)}function k(y){if(y===null){C(e.exit("chunkFlow"),!0),A(0),e.consume(y);return}return re(y)?(e.consume(y),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),k)}function C(y,D){const M=t.sliceStream(y);if(D&&M.push(null),y.previous=a,a&&(a.next=y),a=y,i.defineSkip(y.start),i.write(M),t.parser.lazy[y.start.line]){let L=i.events.length;for(;L--;)if(i.events[L][1].start.offset<s&&(!i.events[L][1].end||i.events[L][1].end.offset>s))return;const P=t.events.length;let O=P,U,I;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(U){I=t.events[O][1].end;break}U=!0}for(A(r),L=P;L<t.events.length;)t.events[L][1].end={...I},L++;const F=new qr;F.add(O+1,0,t.events.slice(P)),F.add(P,L-P,[]),F.consume(t.events)}}function A(y){let D=n.length;for(;D-- >y;){const M=n[D];t.containerState=M[1],M[0].exit.call(t,e)}n.length=y}function S(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ok(e,t,n){return pe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const uk={tokenize:lk};function lk(e){const t=this,n=e.attempt(cr,r,e.attempt(this.parser.constructs.flowInitial,i,pe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Mb,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ck={resolveAll:sd()},dk=ad("string"),hk=ad("text");function ad(e){return{resolveAll:sd(e==="text"?fk:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(d){return l(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return l(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function l(d){if(d===null)return!0;const h=i[d];let m=-1;if(h)for(;++m<h.length;){const p=h[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function sd(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function fk(e,t){const n=new qr;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],a=t.sliceStream(i);let s=a.length,o=-1,u=0,l;for(;s--;){const d=a[s];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(d===-2)l=!0,u++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const d={type:r===e.length||l||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):n.add(r,0,[["enter",d,t],["exit",d,t]])}r++}return n.consume(e),e}const pk={42:We,43:We,45:We,48:We,49:We,50:We,51:We,52:We,53:We,54:We,55:We,56:We,57:We,62:yc},mk={91:Ub},gk={[-2]:Ii,[-1]:Ii,32:Ii},bk={35:Gb,42:Or,45:[Ao,Or],60:Kb,61:Ao,95:Or,96:ko,126:ko},Ek={38:Cc,92:Ac},Tk={[-5]:Li,[-4]:Li,[-3]:Li,33:hE,38:Cc,42:aa,60:[bb,tE],91:pE,92:[Vb,Ac],93:Ka,95:aa,96:Lb},xk={null:[aa,ck]},kk={null:[42,95]},yk={null:[]},Ak=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kk,contentInitial:mk,disable:yk,document:pk,flow:bk,flowInitial:gk,insideSpan:xk,string:Ek,text:Tk},Symbol.toStringTag,{value:"Module"}));function Ck(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],o=[];const u={attempt:P(M),check:P(L),consume:S,enter:y,exit:D,interrupt:P(L,{interrupt:!0})},l={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:h};let d=t.tokenize.call(l,u);return t.resolveAll&&a.push(t),l;function h(F){return s=tt(s,F),C(),s[s.length-1]!==null?[]:(O(t,0),l.events=oi(a,l.events,l),l.events)}function m(F,$){return Sk(p(F),$)}function p(F){return _k(s,F)}function g(){const{_bufferIndex:F,_index:$,line:W,column:G,offset:q}=r;return{_bufferIndex:F,_index:$,line:W,column:G,offset:q}}function k(F){i[F.line]=F.column,I()}function C(){for(;r._index<s.length;){const F=s[r._index];if(typeof F=="string"){const $=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<F.length;)A(F.charCodeAt(r._bufferIndex))}else A(F)}}function A(F){d=d(F)}function S(F){re(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,I()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=F}function y(F,$){const W=$||{};return W.type=F,W.start=g(),l.events.push(["enter",W,l]),o.push(W),W}function D(F){const $=o.pop();return $.end=g(),l.events.push(["exit",$,l]),$}function M(F,$){O(F,$.from)}function L(F,$){$.restore()}function P(F,$){return W;function W(G,q,Q){let Z,ae,he,T;return Array.isArray(G)?_e(G):"tokenize"in G?_e([G]):Ne(G);function Ne(te){return we;function we(De){const Y=De!==null&&te[De],oe=De!==null&&te.null,Se=[...Array.isArray(Y)?Y:Y?[Y]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return _e(Se)(De)}}function _e(te){return Z=te,ae=0,te.length===0?Q:N(te[ae])}function N(te){return we;function we(De){return T=U(),he=te,te.partial||(l.currentConstruct=te),te.name&&l.parser.constructs.disable.null.includes(te.name)?ge():te.tokenize.call($?Object.assign(Object.create(l),$):l,u,me,ge)(De)}}function me(te){return F(he,T),q}function ge(te){return T.restore(),++ae<Z.length?N(Z[ae]):Q}}}function O(F,$){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&ut(l.events,$,l.events.length-$,F.resolve(l.events.slice($),l)),F.resolveTo&&(l.events=F.resolveTo(l.events,l))}function U(){const F=g(),$=l.previous,W=l.currentConstruct,G=l.events.length,q=Array.from(o);return{from:G,restore:Q};function Q(){r=F,l.previous=$,l.currentConstruct=W,l.events.length=G,o=q,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function _k(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function Sk(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
173
173
  `;break}case-3:{s=`\r
174
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function Nk(e){const r={constructs:hc([Ak,...(e||{}).extensions||[]]),content:i(rk),defined:[],document:i(ak),flow:i(uk),lazy:{},string:i(dk),text:i(hk)};return r;function i(a){return s;function s(o){return Ck(r,a,o)}}}function wk(e){for(;!_c(e););return e}const Go=/[\0\t\n\r]/g;function Ik(){let e=1,t="",n=!0,r;return i;function i(a,s,o){a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a));const u=[];let l=0;for(t="",n&&(a.charCodeAt(0)===65279&&l++,n=void 0);l<a.length;){Go.lastIndex=l;const d=Go.exec(a),h=d&&d.index!==void 0?d.index:a.length,m=a.charCodeAt(h);if(!d){t=a.slice(l);break}if(m===10&&l===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),l<h&&(u.push(a.slice(l,h)),e+=h-l),m){case 0:{u.push(65533),e++;break}case 9:{const p=Math.ceil(e/4)*4;for(u.push(-2);e++<p;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}l=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const od={}.hasOwnProperty;function Lk(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Rk(n)(wk(Nk(n).document().write(Ik()(e,t,!0))))}function Rk(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(_t),autolinkProtocol:I,autolinkEmail:I,atxHeading:s(Er),blockQuote:s(Se),characterEscape:I,characterReference:I,codeFenced:s(be),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(be,o),codeText:s(Ke,o),codeTextData:I,data:I,codeFlowValue:I,definition:s(ft),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(br),hardBreakEscape:s(yn),hardBreakTrailing:s(yn),htmlFlow:s(An,o),htmlFlowData:I,htmlText:s(An,o),htmlTextData:I,image:s(Tr),label:o,link:s(_t),listItem:s(mi),listItemValue:p,listOrdered:s(xr,m),listUnordered:s(xr),paragraph:s(gi),reference:me,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Er),strong:s(bi),thematicBreak:s(ne)},exit:{atxHeading:l(),atxHeadingSequence:L,autolink:l(),autolinkEmail:oe,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:we,characterReference:De,codeFenced:l(A),codeFencedFence:C,codeFencedFenceInfo:g,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:l(S),codeText:l(Q),codeTextData:F,data:F,definition:l(),definitionDestinationString:M,definitionLabelString:y,definitionTitleString:D,emphasis:l(),hardBreakEscape:l(W),hardBreakTrailing:l(W),htmlFlow:l(G),htmlFlowData:F,htmlText:l(U),htmlTextData:F,image:l(ae),label:T,labelText:he,lineEnding:$,link:l(Z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ge,resourceDestinationString:Ne,resourceTitleString:_e,resource:N,setextHeading:l(q),setextHeadingLineSequence:O,setextHeadingText:P,strong:l(),thematicBreak:l()}};ud(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(v){let j={type:"root",children:[],position:void 0};const J={stack:[j],tokenStack:[],config:t,enter:u,exit:d,buffer:o,resume:h,data:n},ee=[],Ee=[];let fe=-1;for(;++fe<v.length;)if(Ee.push(v[fe]),v[fe][1].type==="listOrdered"||v[fe][1].type==="listUnordered")if(v[fe][0]==="enter")ee.push(Ee.length-1);else{const Ye=ee.pop();a(Ee,Ye)}for(v=Ee,fe=-1;++fe<v.length;){const Ye=t[v[fe][0]];v[fe][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...J,sliceSerialize:v[fe][2].sliceSerialize},v[fe][1]),od.call(Ye,v[fe][1].type)&&Ye[v[fe][1].type].call({...J,sliceSerialize:v[fe][2].sliceSerialize},v[fe][1]),v[fe][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...J,sliceSerialize:v[fe][2].sliceSerialize},v[fe][1])}if(J.tokenStack.length>0){const Ye=J.tokenStack[J.tokenStack.length-1];(Ye[1]||Wo).call(J,void 0,Ye[0])}for(j.position={start:Nt(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:Nt(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)j=t.transforms[fe](j)||j;return j}function i(v,j,J){let ee=-1;for(;++ee<v.length;)v[ee].call(j,J)}function a(v,j){const J=v.length-1;let ee=j-1,Ee=-1,fe=!1,Ye,pt,Cn,_n;const Sn=[];for(;++ee<=J;){const Xe=v[ee];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Ee++:Ee--,_n=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ye&&!_n&&!Ee&&!Cn&&(Cn=ee),_n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_n=void 0}if(!Ee&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Ee===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ye){let sn=ee;for(pt=void 0;sn--;){const kt=v[sn];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;pt&&(v[pt][1].type="lineEndingBlank",fe=!0),kt[1].type="lineEnding",pt=sn}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}Cn&&(!pt||Cn<pt)&&(Ye._spread=!0),Ye.end=Object.assign({},pt?v[pt][1].start:Xe[1].end),Sn.push({at:pt||ee,event:["exit",Ye,Xe[2]]})}if(Xe[1].type==="listItemPrefix"){const sn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ye=sn,Sn.push({at:ee,event:["enter",sn,Xe[2]]}),Cn=void 0,_n=!0}}}const vs=v.splice(j);let Ti=0;for(ee=-1;++ee<vs.length;){for(;Ti<Sn.length&&Sn[Ti].at===j+ee;)v.push(Sn[Ti++].event);v.push(vs[ee])}v[j][1]._spread=fe}function s(v,j){return J;function J(ee){u.call(this,v(ee),ee),j&&j.call(this,ee)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(v,j,J){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([j,J||void 0]),v.position={start:Nt(j.start),end:void 0}}function l(v){return j;function j(J){v&&v.call(this,J),d.call(this,J)}}function d(v,j){const J=this.stack.pop(),ee=this.tokenStack.pop();if(!ee)throw new Error("Cannot close `"+v.type+"` ("+Kn({start:v.start,end:v.end})+"): it’s not open");ee[0].type!==v.type&&(j?j.call(this,v,ee[0]):(ee[1]||Wo).call(this,v,ee[0])),J.position.end=Nt(v.end)}function h(){return Va(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function p(v){if(this.data.expectingFirstListItemValue){const j=this.stack[this.stack.length-2];j.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function g(){const v=this.resume(),j=this.stack[this.stack.length-1];j.lang=v}function k(){const v=this.resume(),j=this.stack[this.stack.length-1];j.meta=v}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v.replace(/(\r?\n|\r)$/g,"")}function y(v){const j=this.resume(),J=this.stack[this.stack.length-1];J.label=j,J.identifier=ot(this.sliceSerialize(v)).toLowerCase()}function D(){const v=this.resume(),j=this.stack[this.stack.length-1];j.title=v}function M(){const v=this.resume(),j=this.stack[this.stack.length-1];j.url=v}function L(v){const j=this.stack[this.stack.length-1];if(!j.depth){const J=this.sliceSerialize(v).length;j.depth=J}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function O(v){const j=this.stack[this.stack.length-1];j.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function I(v){const J=this.stack[this.stack.length-1].children;let ee=J[J.length-1];(!ee||ee.type!=="text")&&(ee=Ei(),ee.position={start:Nt(v.start),end:void 0},J.push(ee)),this.stack.push(ee)}function F(v){const j=this.stack.pop();j.value+=this.sliceSerialize(v),j.position.end=Nt(v.end)}function $(v){const j=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=j.children[j.children.length-1];J.position.end=Nt(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(j.type)&&(I.call(this,v),F.call(this,v))}function W(){this.data.atHardBreak=!0}function G(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v}function U(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v}function Q(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v}function Z(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=j,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function ae(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=j,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function he(v){const j=this.sliceSerialize(v),J=this.stack[this.stack.length-2];J.label=U1(j),J.identifier=ot(j).toLowerCase()}function T(){const v=this.stack[this.stack.length-1],j=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const ee=v.children;J.children=ee}else J.alt=j}function Ne(){const v=this.resume(),j=this.stack[this.stack.length-1];j.url=v}function _e(){const v=this.resume(),j=this.stack[this.stack.length-1];j.title=v}function N(){this.data.inReference=void 0}function me(){this.data.referenceType="collapsed"}function ge(v){const j=this.resume(),J=this.stack[this.stack.length-1];J.label=j,J.identifier=ot(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function te(v){this.data.characterReferenceType=v.type}function we(v){const j=this.sliceSerialize(v),J=this.data.characterReferenceType;let ee;J?(ee=dc(j,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ee=Wa(j);const Ee=this.stack[this.stack.length-1];Ee.value+=ee}function De(v){const j=this.stack.pop();j.position.end=Nt(v.end)}function Y(v){F.call(this,v);const j=this.stack[this.stack.length-1];j.url=this.sliceSerialize(v)}function oe(v){F.call(this,v);const j=this.stack[this.stack.length-1];j.url="mailto:"+this.sliceSerialize(v)}function Se(){return{type:"blockquote",children:[],position:void 0}}function be(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ke(){return{type:"inlineCode",value:"",position:void 0}}function ft(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function br(){return{type:"emphasis",children:[],position:void 0}}function Er(){return{type:"heading",depth:0,children:[],position:void 0}}function yn(){return{type:"break",position:void 0}}function An(){return{type:"html",value:"",position:void 0}}function Tr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function _t(){return{type:"link",title:null,url:"",children:[],position:void 0}}function xr(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[],position:void 0}}function mi(v){return{type:"listItem",spread:v._spread,checked:null,children:[],position:void 0}}function gi(){return{type:"paragraph",children:[],position:void 0}}function bi(){return{type:"strong",children:[],position:void 0}}function Ei(){return{type:"text",value:"",position:void 0}}function ne(){return{type:"thematicBreak",position:void 0}}}function Nt(e){return{line:e.line,column:e.column,offset:e.offset}}function ud(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ud(e,r):vk(e,r)}}function vk(e,t){let n;for(n in t)if(od.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Wo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Kn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Kn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Kn({start:t.start,end:t.end})+") is still open")}function Ok(e){const t=this;t.parser=n;function n(r){return Lk(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Dk(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Pk(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
174
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function Nk(e){const r={constructs:hc([Ak,...(e||{}).extensions||[]]),content:i(rk),defined:[],document:i(ak),flow:i(uk),lazy:{},string:i(dk),text:i(hk)};return r;function i(a){return s;function s(o){return Ck(r,a,o)}}}function wk(e){for(;!_c(e););return e}const Go=/[\0\t\n\r]/g;function Ik(){let e=1,t="",n=!0,r;return i;function i(a,s,o){a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a));const u=[];let l=0;for(t="",n&&(a.charCodeAt(0)===65279&&l++,n=void 0);l<a.length;){Go.lastIndex=l;const d=Go.exec(a),h=d&&d.index!==void 0?d.index:a.length,m=a.charCodeAt(h);if(!d){t=a.slice(l);break}if(m===10&&l===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),l<h&&(u.push(a.slice(l,h)),e+=h-l),m){case 0:{u.push(65533),e++;break}case 9:{const p=Math.ceil(e/4)*4;for(u.push(-2);e++<p;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}l=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const od={}.hasOwnProperty;function Lk(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Rk(n)(wk(Nk(n).document().write(Ik()(e,t,!0))))}function Rk(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(_t),autolinkProtocol:I,autolinkEmail:I,atxHeading:s(Er),blockQuote:s(Se),characterEscape:I,characterReference:I,codeFenced:s(be),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(be,o),codeText:s(Ke,o),codeTextData:I,data:I,codeFlowValue:I,definition:s(ft),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(br),hardBreakEscape:s(yn),hardBreakTrailing:s(yn),htmlFlow:s(An,o),htmlFlowData:I,htmlText:s(An,o),htmlTextData:I,image:s(Tr),label:o,link:s(_t),listItem:s(mi),listItemValue:p,listOrdered:s(xr,m),listUnordered:s(xr),paragraph:s(gi),reference:me,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Er),strong:s(bi),thematicBreak:s(ne)},exit:{atxHeading:l(),atxHeadingSequence:L,autolink:l(),autolinkEmail:oe,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:we,characterReference:De,codeFenced:l(A),codeFencedFence:C,codeFencedFenceInfo:g,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:l(S),codeText:l(Q),codeTextData:F,data:F,definition:l(),definitionDestinationString:M,definitionLabelString:y,definitionTitleString:D,emphasis:l(),hardBreakEscape:l(W),hardBreakTrailing:l(W),htmlFlow:l(G),htmlFlowData:F,htmlText:l(q),htmlTextData:F,image:l(ae),label:T,labelText:he,lineEnding:$,link:l(Z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ge,resourceDestinationString:Ne,resourceTitleString:_e,resource:N,setextHeading:l(U),setextHeadingLineSequence:O,setextHeadingText:P,strong:l(),thematicBreak:l()}};ud(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(v){let j={type:"root",children:[],position:void 0};const J={stack:[j],tokenStack:[],config:t,enter:u,exit:d,buffer:o,resume:h,data:n},ee=[],Ee=[];let fe=-1;for(;++fe<v.length;)if(Ee.push(v[fe]),v[fe][1].type==="listOrdered"||v[fe][1].type==="listUnordered")if(v[fe][0]==="enter")ee.push(Ee.length-1);else{const Ye=ee.pop();a(Ee,Ye)}for(v=Ee,fe=-1;++fe<v.length;){const Ye=t[v[fe][0]];v[fe][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...J,sliceSerialize:v[fe][2].sliceSerialize},v[fe][1]),od.call(Ye,v[fe][1].type)&&Ye[v[fe][1].type].call({...J,sliceSerialize:v[fe][2].sliceSerialize},v[fe][1]),v[fe][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...J,sliceSerialize:v[fe][2].sliceSerialize},v[fe][1])}if(J.tokenStack.length>0){const Ye=J.tokenStack[J.tokenStack.length-1];(Ye[1]||Wo).call(J,void 0,Ye[0])}for(j.position={start:Nt(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:Nt(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)j=t.transforms[fe](j)||j;return j}function i(v,j,J){let ee=-1;for(;++ee<v.length;)v[ee].call(j,J)}function a(v,j){const J=v.length-1;let ee=j-1,Ee=-1,fe=!1,Ye,pt,Cn,_n;const Sn=[];for(;++ee<=J;){const Xe=v[ee];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Ee++:Ee--,_n=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ye&&!_n&&!Ee&&!Cn&&(Cn=ee),_n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_n=void 0}if(!Ee&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Ee===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ye){let sn=ee;for(pt=void 0;sn--;){const kt=v[sn];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;pt&&(v[pt][1].type="lineEndingBlank",fe=!0),kt[1].type="lineEnding",pt=sn}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}Cn&&(!pt||Cn<pt)&&(Ye._spread=!0),Ye.end=Object.assign({},pt?v[pt][1].start:Xe[1].end),Sn.push({at:pt||ee,event:["exit",Ye,Xe[2]]})}if(Xe[1].type==="listItemPrefix"){const sn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ye=sn,Sn.push({at:ee,event:["enter",sn,Xe[2]]}),Cn=void 0,_n=!0}}}const vs=v.splice(j);let Ti=0;for(ee=-1;++ee<vs.length;){for(;Ti<Sn.length&&Sn[Ti].at===j+ee;)v.push(Sn[Ti++].event);v.push(vs[ee])}v[j][1]._spread=fe}function s(v,j){return J;function J(ee){u.call(this,v(ee),ee),j&&j.call(this,ee)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(v,j,J){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([j,J||void 0]),v.position={start:Nt(j.start),end:void 0}}function l(v){return j;function j(J){v&&v.call(this,J),d.call(this,J)}}function d(v,j){const J=this.stack.pop(),ee=this.tokenStack.pop();if(!ee)throw new Error("Cannot close `"+v.type+"` ("+Kn({start:v.start,end:v.end})+"): it’s not open");ee[0].type!==v.type&&(j?j.call(this,v,ee[0]):(ee[1]||Wo).call(this,v,ee[0])),J.position.end=Nt(v.end)}function h(){return Va(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function p(v){if(this.data.expectingFirstListItemValue){const j=this.stack[this.stack.length-2];j.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function g(){const v=this.resume(),j=this.stack[this.stack.length-1];j.lang=v}function k(){const v=this.resume(),j=this.stack[this.stack.length-1];j.meta=v}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v.replace(/(\r?\n|\r)$/g,"")}function y(v){const j=this.resume(),J=this.stack[this.stack.length-1];J.label=j,J.identifier=ot(this.sliceSerialize(v)).toLowerCase()}function D(){const v=this.resume(),j=this.stack[this.stack.length-1];j.title=v}function M(){const v=this.resume(),j=this.stack[this.stack.length-1];j.url=v}function L(v){const j=this.stack[this.stack.length-1];if(!j.depth){const J=this.sliceSerialize(v).length;j.depth=J}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function O(v){const j=this.stack[this.stack.length-1];j.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function I(v){const J=this.stack[this.stack.length-1].children;let ee=J[J.length-1];(!ee||ee.type!=="text")&&(ee=Ei(),ee.position={start:Nt(v.start),end:void 0},J.push(ee)),this.stack.push(ee)}function F(v){const j=this.stack.pop();j.value+=this.sliceSerialize(v),j.position.end=Nt(v.end)}function $(v){const j=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=j.children[j.children.length-1];J.position.end=Nt(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(j.type)&&(I.call(this,v),F.call(this,v))}function W(){this.data.atHardBreak=!0}function G(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v}function q(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v}function Q(){const v=this.resume(),j=this.stack[this.stack.length-1];j.value=v}function Z(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=j,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function ae(){const v=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=j,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function he(v){const j=this.sliceSerialize(v),J=this.stack[this.stack.length-2];J.label=U1(j),J.identifier=ot(j).toLowerCase()}function T(){const v=this.stack[this.stack.length-1],j=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const ee=v.children;J.children=ee}else J.alt=j}function Ne(){const v=this.resume(),j=this.stack[this.stack.length-1];j.url=v}function _e(){const v=this.resume(),j=this.stack[this.stack.length-1];j.title=v}function N(){this.data.inReference=void 0}function me(){this.data.referenceType="collapsed"}function ge(v){const j=this.resume(),J=this.stack[this.stack.length-1];J.label=j,J.identifier=ot(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function te(v){this.data.characterReferenceType=v.type}function we(v){const j=this.sliceSerialize(v),J=this.data.characterReferenceType;let ee;J?(ee=dc(j,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ee=Wa(j);const Ee=this.stack[this.stack.length-1];Ee.value+=ee}function De(v){const j=this.stack.pop();j.position.end=Nt(v.end)}function Y(v){F.call(this,v);const j=this.stack[this.stack.length-1];j.url=this.sliceSerialize(v)}function oe(v){F.call(this,v);const j=this.stack[this.stack.length-1];j.url="mailto:"+this.sliceSerialize(v)}function Se(){return{type:"blockquote",children:[],position:void 0}}function be(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ke(){return{type:"inlineCode",value:"",position:void 0}}function ft(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function br(){return{type:"emphasis",children:[],position:void 0}}function Er(){return{type:"heading",depth:0,children:[],position:void 0}}function yn(){return{type:"break",position:void 0}}function An(){return{type:"html",value:"",position:void 0}}function Tr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function _t(){return{type:"link",title:null,url:"",children:[],position:void 0}}function xr(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[],position:void 0}}function mi(v){return{type:"listItem",spread:v._spread,checked:null,children:[],position:void 0}}function gi(){return{type:"paragraph",children:[],position:void 0}}function bi(){return{type:"strong",children:[],position:void 0}}function Ei(){return{type:"text",value:"",position:void 0}}function ne(){return{type:"thematicBreak",position:void 0}}}function Nt(e){return{line:e.line,column:e.column,offset:e.offset}}function ud(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ud(e,r):vk(e,r)}}function vk(e,t){let n;for(n in t)if(od.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Wo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Kn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Kn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Kn({start:t.start,end:t.end})+") is still open")}function Ok(e){const t=this;t.parser=n;function n(r){return Lk(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Dk(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Pk(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
175
175
  `}]}function Mk(e,t){const n=t.value?t.value+`
176
176
  `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Bk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fk(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Tn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,l),e.applyData(t,l)}function jk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ld(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function qk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ld(e,t);const i={src:Tn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function zk(e,t){const n={src:Tn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function $k(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Vk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ld(e,t);const i={href:Tn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Yk(e,t){const n={href:Tn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Gk(e,t,n){const r=e.all(t),i=n?Wk(n):cd(t),a={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
177
177
  `}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
@@ -204,8 +204,8 @@ ${y.join(`
204
204
  `),k=this.list(g);a[a.length-1]=k,r=r.substring(0,r.length-m.raw.length)+k.raw,i=i.substring(0,i.length-p.raw.length)+k.raw,n=g.substring(a.at(-1).raw.length).split(`
205
205
  `);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,s={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");let o=this.rules.other.listItemRegex(i),u=!1;for(;e;){let d=!1,h="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;let m=r();e=e.substring(t[0].length);let p=t[2].split(`
206
206
  `,1)[0],g=t[1].length,k=this.options.pedantic?zi(p,g):p.replace(this.rules.other.leadingSpaceTab,D=>zi(D,g)),C=e.split(`
207
- `,1)[0],A=!k.trim(),S=0;if(this.options.pedantic?(S=2,h=k.trimStart()):A?S=g+1:(S=k.search(this.rules.other.nonSpaceChar),S=S>4?1:S,h=k.slice(S),S+=g),A&&this.rules.other.blankLine.test(C)&&(e=e.substring(C.length+1),d=!0),!d){let D=this.rules.other.nextBulletRegex(S),M=this.rules.other.hrRegex(S),L=this.rules.other.fencesBeginRegex(S),P=this.rules.other.headingBeginRegex(S),O=this.rules.other.htmlBeginRegex(S),q=this.rules.other.blockquoteBeginRegex(S);for(;e;){let I=e.split(`
208
- `,1)[0],F;if(C=I,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),F=C):F=C.replace(this.rules.other.leadingSpaceTab,$=>zi($)),L.test(C)||P.test(C)||O.test(C)||q.test(C)||D.test(C)||M.test(C))break;if(F.search(this.rules.other.nonSpaceChar)>=S||!C.trim())h+=`
207
+ `,1)[0],A=!k.trim(),S=0;if(this.options.pedantic?(S=2,h=k.trimStart()):A?S=g+1:(S=k.search(this.rules.other.nonSpaceChar),S=S>4?1:S,h=k.slice(S),S+=g),A&&this.rules.other.blankLine.test(C)&&(e=e.substring(C.length+1),d=!0),!d){let D=this.rules.other.nextBulletRegex(S),M=this.rules.other.hrRegex(S),L=this.rules.other.fencesBeginRegex(S),P=this.rules.other.headingBeginRegex(S),O=this.rules.other.htmlBeginRegex(S),U=this.rules.other.blockquoteBeginRegex(S);for(;e;){let I=e.split(`
208
+ `,1)[0],F;if(C=I,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),F=C):F=C.replace(this.rules.other.leadingSpaceTab,$=>zi($)),L.test(C)||P.test(C)||O.test(C)||U.test(C)||D.test(C)||M.test(C))break;if(F.search(this.rules.other.nonSpaceChar)>=S||!C.trim())h+=`
209
209
  `+F.slice(S);else{if(A||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(k)||P.test(k)||M.test(k))break;h+=`
210
210
  `+C}A=!C.trim(),e=e.substring(I.length+1),k=F.slice(S)}}let y=n.slice(m,r());s.loose||(u?s.loose=!0:this.rules.other.doubleBlankLine.test(y)&&(u=!0)),s.items.push({type:"list_item",raw:y,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]})}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=n.slice(0,r()).trimEnd();for(let d of s.items)if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),!s.loose){let h=d.tokens.filter(p=>p.type==="space"),m=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=m}for(let d of s.items){let h=d.tokens[0];if(d.task&&(h?.type==="text"||h?.type==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let m=this.rules.other.listTaskCheckbox.exec(d.raw);if(m){let p={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};d.checked=p.checked,s.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}else d.task&&(d.task=!1)}if(s.loose)for(let d of s.items){d.loose=!0;for(let h of d.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=du(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&hu(t[2],"()")!==-1)return;let n=Yr(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:wt(t[0],`
211
211
  `),href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=cu(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
@@ -247,8 +247,8 @@ ${e}</tr>
247
247
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Je(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Je(n,!0):this.parser.parseInline(r),s=lu(e);if(s===null)return a;e=Je(s,i);let o='<a href="'+e+'"';return t&&(o+=' title="'+Je(t)+'"'),o+=">"+a+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=lu(e);if(i===null)return Je(n);e=i;let a=`<img src="${Je(e)}" alt="${Je(n)}"`;return t&&(a+=` title="${Je(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Je(e.text)}},ps=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},st=class ma{options;renderer;textRenderer;constructor(t){this.options=t||an,this.options.renderer=this.options.renderer||new Wr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ps}static parse(t,n){return new ma(n).parse(t)}static parseInline(t,n){return new ma(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let s=i,o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(s.type)){n+=o||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){r+=o||"";continue}}let s=a;switch(s.type){case"escape":{r+=n.text(s);break}case"html":{r+=n.html(s);break}case"link":{r+=n.link(s);break}case"image":{r+=n.image(s);break}case"checkbox":{r+=n.checkbox(s);break}case"strong":{r+=n.strong(s);break}case"em":{r+=n.em(s);break}case"codespan":{r+=n.codespan(s);break}case"br":{r+=n.br(s);break}case"del":{r+=n.del(s);break}case"text":{r+=n.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},Hn=class{options;block;constructor(e){this.options=e||an}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?nt.lex:nt.lexInline}provideParser(e=this.block){return e?st.parse:st.parseInline}};function $t(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var FA=class{defaults=os();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=st;Renderer=Wr;TextRenderer=ps;Lexer=nt;Tokenizer=Gr;Hooks=Hn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch($t(n,t.call(this,r)),r.type){case"table":{let i=r;for(let a of i.header)$t(n,this.walkTokens(a.tokens,t));for(let a of i.rows)for(let s of a)$t(n,this.walkTokens(s.tokens,t));break}case"list":{let i=r;$t(n,this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let s=i[a].flat(1/0);$t(n,this.walkTokens(s,t))}):i.tokens&&$t(n,this.walkTokens(i.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=t.renderers[i.name];a?t.renderers[i.name]=function(...s){let o=i.renderer.apply(this,s);return o===!1&&(o=a.apply(this,s)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[i.level];a?a.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new Wr(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,o=n.renderer[s],u=i[s];i[s]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Gr(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,o=n.tokenizer[s],u=i[s];i[s]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Hn;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,o=n.hooks[s],u=i[s];Hn.passThroughHooks.has(a)?i[s]=l=>{if(this.defaults.async&&Hn.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await o.call(i,l);return u.call(i,h)})();let d=o.call(i,l);return u.call(i,d)}:i[s]=(...l)=>{if(this.defaults.async)return(async()=>{let h=await o.apply(i,l);return h===!1&&(h=await u.apply(i,l)),h})();let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(s){let o=[];return o.push(a.call(this,s)),i&&$t(o,i.call(this,s)),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nt.lex(e,t??this.defaults)}parser(e,t){return st.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let s=i.hooks?await i.hooks.preprocess(t):t,o=await(i.hooks?await i.hooks.provideLexer(e):e?nt.lex:nt.lexInline)(s,i),u=i.hooks?await i.hooks.processAllTokens(o):o;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let l=await(i.hooks?await i.hooks.provideParser(e):e?st.parse:st.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(l):l})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let s=(i.hooks?i.hooks.provideLexer(e):e?nt.lex:nt.lexInline)(t,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let o=(i.hooks?i.hooks.provideParser(e):e?st.parse:st.parseInline)(s,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(s){return a(s)}}}onError(e,t){return n=>{if(n.message+=`
248
248
  Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Je(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Jt=new FA;function xe(e,t){return Jt.parse(e,t)}xe.options=xe.setOptions=function(e){return Jt.setOptions(e),xe.defaults=Jt.defaults,dd(xe.defaults),xe};xe.getDefaults=os;xe.defaults=an;function HA(...e){return Jt.use(...e),xe.defaults=Jt.defaults,dd(xe.defaults),xe}xe.use=HA;xe.walkTokens=function(e,t){return Jt.walkTokens(e,t)};xe.parseInline=Jt.parseInline;xe.Parser=st;xe.parser=st.parse;xe.Renderer=Wr;xe.TextRenderer=ps;xe.Lexer=nt;xe.lexer=nt.lex;xe.Tokenizer=Gr;xe.Hooks=Hn;xe.parse=xe;xe.options;xe.setOptions;xe.walkTokens;xe.parseInline;st.parse;nt.lex;var jA=300,UA="300px",qA=500;function zA(e={}){let{immediate:t=!1,debounceDelay:n=jA,rootMargin:r=UA,idleTimeout:i=qA}=e,[a,s]=b.useState(!1),o=b.useRef(null),u=b.useRef(null),l=b.useRef(null),d=b.useMemo(()=>p=>{let g=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-g))})},1)},[]),h=b.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(p,g)=>window.requestIdleCallback(p,g):d,[d]),m=b.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return b.useEffect(()=>{if(t){s(!0);return}let p=o.current;if(!p)return;u.current&&(clearTimeout(u.current),u.current=null),l.current&&(m(l.current),l.current=null);let g=()=>{u.current&&(clearTimeout(u.current),u.current=null),l.current&&(m(l.current),l.current=null)},k=y=>{l.current=h(D=>{D.timeRemaining()>0||D.didTimeout?(s(!0),y.disconnect()):l.current=h(()=>{s(!0),y.disconnect()},{timeout:i/2})},{timeout:i})},C=y=>{g(),u.current=window.setTimeout(()=>{var D,M;let L=y.takeRecords();(L.length===0||(M=(D=L.at(-1))==null?void 0:D.isIntersecting)!=null&&M)&&k(y)},n)},A=(y,D)=>{y.isIntersecting?C(D):g()},S=new IntersectionObserver(y=>{for(let D of y)A(D,S)},{rootMargin:r,threshold:0});return S.observe(p),()=>{u.current&&clearTimeout(u.current),l.current&&m(l.current),S.disconnect()}},[t,n,r,i,m,h]),{shouldRender:a,containerRef:o}}var $A=320,VA=4,xd=()=>typeof performance>"u"?Date.now():performance.now();function mu(e){var t,n;let r=(t=e?.now)!=null?t:xd,i=(n=e?.maxBacklogMs)!=null?n:$A,a=0,s=0;return{now:r,beginPass(o){s=Math.min(Math.max(a,o),o+i)},mark(){return s},rewind(o){s=o},take(o,u,l){if(o<=0)return{baseDelay:0,step:Math.max(0,u)};let d=Math.max(0,u),h=d===0?0:Math.min(d,VA),m=Math.max(s,l),p=l+i,g=m+Math.max(0,o-1)*d,k=d;if(g>p&&o>1)if(m<p){let A=p-m;k=Math.max(h,A/(o-1))}else k=h;let C=Math.max(0,Math.round(m-l));return s=m+o*k,{baseDelay:C,step:k}},commitPass(){a=s}}}var kd=/\s/,YA=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\u3000-\u303F\uFF00-\uFFEF]/u,ms=/^\s+$/,GA=new Set(["pre","svg","math","annotation"]),WA=new Set(["img","hr"]),mr=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",gs=e=>e.some(t=>mr(t)&&GA.has(t.tagName)),QA=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(mr(n)&&n.tagName==="li")return n}},KA=(e,t,n,r)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate-marker"]=!0;let i=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},XA=new Set(["ul","ol","li"]),yd=e=>{for(let t of e.children)if(mr(t)){if(t.tagName==="input")return t;if(XA.has(t.tagName))continue;let n=yd(t);if(n)return n}},Ad=(e,t,n,r)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate"]=!0;let i=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},ZA=(e,t,n,r)=>{let i=yd(e);i&&Ad(i,t,n,r)},JA=(e,t,n,r,i,a)=>{if(gs(t))return;let s=r.prevContentLength,o=i.count;i.count+=1;let u=s>0&&o<s,l=u?0:a.baseDelay+i.newIndex++*a.step;Ad(e,n,u?0:n.duration,l)},e3=e=>{var t;for(let n=e.length-1;n>=0;n-=1){let r=e[n];if(mr(r)){if((t=r.properties)!=null&&t["data-sd-animated"])break;r.properties={...r.properties,"data-sd-animated":!0}}}},Cd=e=>{let t=[],n="",r=!1,i=!1;for(let a of e){let s=kd.test(a),o=!s&&YA.test(a);if(!s&&n!==""&&(o||i))t.push(n),n="",r=!1;else if(s!==r&&n){if(s){n+=a,r=!0;continue}t.push(n),n=""}n+=a,r=s,i=o}return n&&t.push(n),t},_d=e=>{let t=[],n="";for(let r of e)kd.test(r)?t.length>0&&!ms.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},gu=/^[^\s;:'"\\/](?:[^;:'"\\/\r\n]*[^\s;:'"\\/])?$/,t3=(e,t,n,r)=>{let i=`sd-${t.animation}`,a=`${n?0:t.duration}ms`,s;return t.styleObjects?(s={"--sd-animation":i,"--sd-duration":a,"--sd-easing":t.easing},r&&(s["--sd-delay"]=`${Math.round(r)}ms`)):(s=`--sd-animation:${i};--sd-duration:${a};--sd-easing:${t.easing}`,r&&(s+=`;--sd-delay:${Math.round(r)}ms`)),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:s},children:[{type:"text",value:e}]}},bu=(e,t)=>!(e>0&&t<e),ga=e=>mr(e)&&WA.has(e.tagName),n3=(e,t,n)=>{let r=0,i=0;return Zr(e,a=>a.type==="text"||ga(a),(a,s)=>{if(gs(s))return Gt;if(ga(a)){bu(n,i)&&(r+=1),i+=1;return}let o=a.value;if(!o.trim()){i+=o.length;return}let u=t.sep==="char"?_d(o):Cd(o);for(let l of u){let d=i;i+=l.length,!ms.test(l)&&bu(n,d)&&(r+=1)}}),r},r3=(e,t,n,r,i,a)=>{var s;let o=t.at(-1);if(!(o&&"children"in o))return;if(gs(t))return Gt;let u=o,l=u.children.indexOf(e);if(l===-1)return;let d=e.value;if(!d.trim()){i.count+=d.length;return}let h=n.sep==="char"?_d(d):Cd(d),m=r.prevContentLength,p=!1,g=QA(t),k=!!(g&&!((s=g.properties)!=null&&s["data-sd-animate-marker"])),C=!1,A=h.map(S=>{let y=i.count;if(i.count+=S.length,ms.test(S))return{type:"text",value:S};let D=m>0&&y<m,M=D?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,g&&k&&!C){let L=D?0:n.duration;KA(g,L,M,n.easing),ZA(g,n,L,M),C=!0}return t3(S,n,D,M)});return p&&e3(t),u.children.splice(l,1,...A),l+A.length},i3=0;function a3(e){return Sd(e,!1)}var s3=e=>Sd(e,!0);function Sd(e,t){var n,r,i,a,s;let o=(n=e?.animation)!=null?n:"fadeIn",u=(r=e?.easing)!=null?r:"ease",l={animation:o,duration:(i=e?.duration)!=null?i:150,easing:u,sep:(a=e?.sep)!=null?a:"word",stagger:(s=e?.stagger)!=null?s:40,styleObjects:t&&gu.test(o)&&gu.test(u),timeline:e?.timeline},d={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},h=i3++,m=()=>p=>{var g;let k={count:0,newIndex:0};d.prevContentLength=d.committedCharCount;let C=l.timeline,A=(g=C?.now())!=null?g:xd();C&&(d.pendingMark===null?d.pendingMark=C.mark():C.rewind(d.pendingMark));let S=C?C.take(n3(p,l,d.prevContentLength),l.stagger,A):{baseDelay:0,step:l.stagger};Zr(p,y=>y.type==="text"||ga(y),(y,D)=>{if(y.type==="text")return r3(y,D,l,d,k,S);JA(y,D,l,d,k,S)}),d.lastRenderCharCount=k.count,d.prevContentLength=0};return Object.defineProperty(m,"name",{value:`rehypeAnimate$${h}`}),{name:"animate",type:"animate",rehypePlugin:m,setPrevContentLength(p){d.committedCharCount=p,d.prevContentLength=p},getLastRenderCharCount(){return d.lastRenderCharCount},commit(){d.committedCharCount=d.lastRenderCharCount,d.pendingMark=null}}}a3();var Nd=b.createContext(!1),wd=()=>b.useContext(Nd),li=(...e)=>Jc(Fc(e)),o3=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},u3=e=>e?(...t)=>o3(e,Jc(Fc(t))):li,hn=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),s=document.createElement("a");s.href=a,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(a)},ba=b.createContext(li),de=()=>b.useContext(ba),l3=8,Id=e=>{if(!(e===void 0||e===0||e===Number.POSITIVE_INFINITY)){if(typeof e=="number")return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(!(e==="0"||e==="none"||e==="Infinity"))return e}},Ld=(e,t,n)=>{let r=b.useRef(null),i=b.useRef(!0),a=b.useRef(!1),s=b.useRef(null);return b.useEffect(()=>{let o=r.current;if(!(o&&t))return;let u=()=>{let l=o.scrollHeight-o.scrollTop-o.clientHeight<l3;i.current=l};return o.addEventListener("scroll",u,{passive:!0}),()=>o.removeEventListener("scroll",u)},[t]),b.useEffect(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),b.useEffect(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]),b.useEffect(()=>{let o=r.current;!(o&&t&&e&&i.current)||s.current!==null||(s.current=requestAnimationFrame(()=>{s.current=null,i.current&&o.scrollTo({top:o.scrollHeight,behavior:"instant"})}))},[e,t,n]),r},c3=li("block"),d3=li("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),h3=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},Rd=b.memo(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:s=!0,...o})=>{let u=de(),{isAnimating:l}=b.useContext(ve),d=Id(i),h=Ld(l,!!d,t),m=b.useMemo(()=>u(d3),[u]),p=b.useMemo(()=>u(c3),[u]),g=b.useMemo(()=>{let k={};return t.bg&&(k["--sdm-bg"]=t.bg),t.fg&&(k["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(k,h3(t.rootStyle)),k},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:u(r,d?"overflow-y-auto":null,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",ref:h,style:d?{maxHeight:d}:void 0,...o,children:f.jsx("pre",{className:u(r,"bg-[var(--sdm-bg,inherit)]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]"),style:g,children:f.jsx("code",{className:s?u("[counter-increment:line_0] [counter-reset:line]"):void 0,style:s&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((k,C)=>f.jsx("span",{className:s?m:p,children:k.length===0||k.length===1&&k[0].content===""?`
249
249
  `:k.map((A,S)=>{let y={},D=!!A.bgColor;if(A.color&&(y["--sdm-c"]=A.color),A.bgColor&&(y["--sdm-tbg"]=A.bgColor),A.htmlStyle)for(let[M,L]of Object.entries(A.htmlStyle))M==="color"?y["--sdm-c"]=L:M==="background-color"?(y["--sdm-tbg"]=L,D=!0):y[M]=L;return f.jsx("span",{className:u("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",D&&"bg-[var(--sdm-tbg)]",D&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:y,...A.htmlAttrs,children:A.content},S)})},C))})})})}),f3=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=de();return f.jsx("div",{className:a("relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},vd=b.createContext({code:""}),Od=()=>b.useContext(vd),p3=({language:e})=>{let t=de();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},m3=e=>{let t=e.length;for(;t>0&&e[t-1]===`
250
- `;)t--;return e.slice(0,t)},g3=b.lazy(()=>Promise.resolve().then(()=>require("./highlighted-body-JLMTFACH-BgbiDd39.cjs")).then(e=>({default:e.HighlightedCodeBlockBody}))),b3=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:s,...o})=>{let u=de(),{codeBlockMaxHeight:l}=b.useContext(ve),d=b.useMemo(()=>m3(e),[e]),h=b.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:d.split(`
251
- `).map(m=>[{content:m,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[d]);return f.jsx(vd.Provider,{value:{code:e},children:f.jsxs(f3,{dir:"ltr",isIncomplete:i,language:t,children:[f.jsx(p3,{language:t}),r?f.jsx("div",{className:u("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:f.jsx("div",{className:u("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(b.Suspense,{fallback:f.jsx(Rd,{className:n,language:t,lineNumbers:s,maxHeight:l,result:h,startLine:a,...o}),children:f.jsx(g3,{className:n,code:d,isIncomplete:i,language:t,lineNumbers:s,maxHeight:l,raw:h,startLine:a,...o})})]})})},E3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),T3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),x3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),k3=e=>f.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),y3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),A3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),C3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),_3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),S3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),N3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),jn={CheckIcon:E3,CopyIcon:T3,DownloadIcon:x3,ExternalLinkIcon:_3,Loader2Icon:k3,Maximize2Icon:y3,RotateCcwIcon:A3,XIcon:C3,ZoomInIcon:S3,ZoomOutIcon:N3},Dd=b.createContext(jn),w3=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},Eu=({icons:e,children:t})=>{let n=b.useRef(e),r=b.useRef(e?{...jn,...e}:jn);w3(n.current,e)||(n.current=e,r.current=e?{...jn,...e}:jn);let i=r.current;return f.jsx(Dd.Provider,{value:i,children:t})},dt=()=>b.useContext(Dd),Pd={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",mermaidAriaLabel:"Mermaid chart",errorMermaid:"Failed to render Mermaid chart",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Ea=b.createContext(Pd),ht=()=>b.useContext(Ea),Ta=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...s})=>{let o=de(),[u,l]=b.useState(!1),d=b.useRef(0),{code:h}=Od(),{isAnimating:m}=b.useContext(ve),p=ht(),g=a??h,k=async()=>{var S;if(typeof window>"u"||!((S=navigator?.clipboard)!=null&&S.writeText)){t?.(new Error("Clipboard API not available"));return}try{u||(await navigator.clipboard.writeText(g),l(!0),e?.(),d.current=window.setTimeout(()=>l(!1),n))}catch(y){t?.(y)}};b.useEffect(()=>()=>{window.clearTimeout(d.current)},[]);let C=dt(),A=u?C.CheckIcon:C.CopyIcon;return f.jsxs(f.Fragment,{children:[f.jsx("button",{"aria-label":p.copyCode,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:m,onClick:k,title:p.copyCode,type:"button",...s,children:r??f.jsx(A,{"aria-hidden":"true",size:14})}),u&&f.jsx("output",{"aria-live":"polite",className:"sr-only",children:p.copied})]})},bs=(e,t,n)=>{if(typeof e=="boolean")return n;let r=e[t];if(typeof r!="object")return n;let i=r.download;return typeof i!="object"?n:i.filename||n},Tu=(e,t)=>{if(typeof e=="boolean")return{};let n=e[t];if(typeof n!="object")return{};let r=n.copy;return typeof r!="object"||r===null?{}:{onCopy:r.onCopy,onError:r.onError}},xu={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},I3=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...s})=>{let o=de(),{code:u}=Od(),{isAnimating:l,controls:d}=b.useContext(ve),h=ht(),m=dt(),p=a??u,g=n&&n in xu?xu[n]:"txt",k=`${bs(d,"code","file")}.${g}`,C="text/plain",A=()=>{try{hn(k,p,C),e?.()}catch(S){t?.(S)}};return f.jsx("button",{"aria-label":h.downloadFile,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:l,onClick:A,title:h.downloadFile,type:"button",...s,children:r??f.jsx(m.DownloadIcon,{size:14})})},ku=()=>{let{Loader2Icon:e}=dt(),t=de();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},L3=/\.[^/.]+$/,R3=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:s=!0,showDownloadControl:o=!0,...u})=>{let{DownloadIcon:l}=dt(),d=de(),h=b.useRef(null),[m,p]=b.useState(!1),[g,k]=b.useState(!1),C=ht(),A=u.width!=null||u.height!=null,S=(m||A)&&!g&&s&&o,y=g&&!A;b.useEffect(()=>{let P=h.current;if(P!=null&&P.complete){let O=P.naturalWidth>0;p(O),k(!O)}},[]);let D=b.useCallback(P=>{p(!0),k(!1),i?.(P)},[i]),M=b.useCallback(P=>{p(!1),k(!0),a?.(P)},[a]),L=async()=>{if(n)try{let P=await(await fetch(n)).blob(),O=new URL(n,window.location.origin).pathname.split("/").pop()||"",q=O.split(".").pop(),I=O.includes(".")&&q!==void 0&&q.length<=4,F="";if(I)F=O;else{let $=P.type,W="png";$.includes("jpeg")||$.includes("jpg")?W="jpg":$.includes("png")?W="png":$.includes("svg")?W="svg":$.includes("gif")?W="gif":$.includes("webp")&&(W="webp"),F=`${(r||O||"image").replace(L3,"")}.${W}`}hn(F,P,P.type)}catch{window.open(n,"_blank")}};return n?n===er?f.jsx("div",{className:d("group relative my-4 inline-block"),"data-incomplete":"true","data-streamdown":"image-wrapper",children:f.jsx("div",{className:d("h-24 w-48 animate-pulse rounded-lg bg-muted"),"data-streamdown":"image-placeholder"})}):f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",y&&"hidden",t),"data-streamdown":"image",onError:M,onLoad:D,ref:h,src:n,...u}),y&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:C.imageNotAvailable}),s&&f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),S&&f.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:L,title:C.downloadImage,type:"button",children:f.jsx(l,{size:14})})]}):null},Es=e=>{let t=typeof e=="function"?e():e;return t??document.body},Xn=0,Ts=()=>{Xn+=1,Xn===1&&(document.body.style.overflow="hidden")},xs=()=>{Xn=Math.max(0,Xn-1),Xn===0&&(document.body.style.overflow="")},v3=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:s,XIcon:o}=dt(),u=de(),[l,d]=b.useState(!1),h=ht(),{portal:m}=b.useContext(ve),p=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),d(!0),setTimeout(()=>d(!1),2e3)}catch{}},[e]),g=b.useCallback(()=>{r(),n()},[r,n]);if(b.useEffect(()=>{if(t){Ts();let C=A=>{A.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),xs()}}},[t,n]),!t||typeof document>"u")return null;let k=f.jsx("div",{className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:C=>{C.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:u("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:u("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:h.close,type:"button",children:f.jsx(o,{size:16})}),f.jsxs("div",{className:u("flex flex-col gap-2"),children:[f.jsxs("div",{className:u("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(s,{size:20}),f.jsx("span",{children:h.openExternalLink})]}),f.jsx("p",{className:u("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),f.jsx("div",{className:u("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:u("flex gap-2"),children:[f.jsx("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:p,type:"button",children:l?f.jsxs(f.Fragment,{children:[f.jsx(i,{size:14}),f.jsx("span",{children:h.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(a,{size:14}),f.jsx("span",{children:h.copyLink})]})}),f.jsxs("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:g,type:"button",children:[f.jsx(s,{size:14}),f.jsx("span",{children:h.openLink})]})]})]})});return Na.createPortal(k,Es(m))},xa=b.createContext(null),ks=()=>b.useContext(xa),O3=()=>{var e;let t=ks();return(e=t?.code)!=null?e:null},ys=()=>{var e;let t=ks();return(e=t?.mermaid)!=null?e:null},D3=e=>{var t;let n=ks();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},Md=/<svg\b[^>]*>/i,P3=/\bviewBox=(['"])(.*?)\1/i,M3=/[\s,]+/,B3=/\swidth=(['"]).*?\1/gi,F3=/\sheight=(['"]).*?\1/gi,yu=/\sstyle=(['"])(.*?)\1/i,H3=/^width\s*:/i,j3=/^height\s*:/i,U3=/^max-width\s*:/i,Au=/^<svg/i,Bd=e=>{let t=e.match(Md);if(!t)return null;let n=t[0].match(P3),r=n?.[2];if(!r)return null;let i=r.trim().split(M3).map(o=>Number.parseFloat(o));if(i.length<4||i.slice(0,4).some(Number.isNaN))return null;let a=i[2],s=i[3];return a>0&&s>0?{height:s,width:a}:null},q3=e=>{let t=e.match(Md);if(!t)return e;try{let n=t[0],r=Bd(e);if(!r)return e;let{width:i,height:a}=r,s=n.replace(B3,"").replace(F3,""),o=s.match(yu),u=`width:${i}px;height:${a}px;max-width:none;`;if(o){let l=o[1],d=o[2].split(";").map(m=>m.trim()).filter(Boolean).filter(m=>!(H3.test(m)||j3.test(m)||U3.test(m))).join(";"),h=`${u}${d?`${d};`:""}`;s=s.replace(yu,` style=${l}${h}${l}`)}else s=s.replace(Au,`<svg style="${u}"`);return s=s.replace(Au,`<svg width="${i}" height="${a}"`),e.replace(n,s)}catch{return e}},z3=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},$3=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let u=document.createElement("canvas"),l=o.width*r,d=o.height*r;u.width=l,u.height=d;let h=u.getContext("2d");if(!h){a(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(o,0,0,l,d),u.toBlob(m=>{if(!m){a(new Error("Failed to create PNG blob"));return}i(m)},"image/png")},o.onerror=()=>a(new Error("Failed to load SVG image")),o.src=s})},Fd=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let s=de(),[o,u]=b.useState(!1),l=b.useRef(null),{isAnimating:d,controls:h}=b.useContext(ve),m=dt(),p=ys(),g=ht(),k=bs(h,"mermaid","diagram"),C=async A=>{try{if(A==="mmd"){let P=`${k}.mmd`;hn(P,e,"text/plain"),u(!1),r?.(A);return}if(!p){a?.(new Error("Mermaid plugin not available"));return}let S=p.getMermaid(i),y=e.split("").reduce((P,O)=>(P<<5)-P+O.charCodeAt(0)|0,0),D=`mermaid-${Math.abs(y)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:M}=await S.render(D,e);if(!M){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}let L=z3(M);if(A==="svg"){let P=`${k}.svg`;hn(P,L,"image/svg+xml"),u(!1),r?.(A);return}if(A==="png"){let P=await $3(L);hn(`${k}.png`,P,"image/png"),r?.(A),u(!1);return}}catch(S){a?.(S)}};return b.useEffect(()=>{let A=S=>{let y=S.composedPath();l.current&&!y.includes(l.current)&&u(!1)};return document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[]),f.jsxs("div",{className:s("relative"),ref:l,children:[f.jsx("button",{"aria-label":g.downloadDiagram,className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:d,onClick:()=>u(!o),title:g.downloadDiagram,type:"button",children:t??f.jsx(m.DownloadIcon,{"aria-hidden":"true",size:14})}),o?f.jsxs("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{"aria-label":g.downloadDiagramAsSvg,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("svg"),title:g.downloadDiagramAsSvg,type:"button",children:g.mermaidFormatSvg}),f.jsx("button",{"aria-label":g.downloadDiagramAsPng,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("png"),title:g.downloadDiagramAsPng,type:"button",children:g.mermaidFormatPng}),f.jsx("button",{"aria-label":g.downloadDiagramAsMmd,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("mmd"),title:g.downloadDiagramAsMmd,type:"button",children:g.mermaidFormatMmd})]}):null]})},V3=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:s,XIcon:o}=dt(),u=de(),[l,d]=b.useState(!1),{isAnimating:h,controls:m,portal:p}=b.useContext(ve),g=ht(),k=(()=>{if(typeof m=="boolean")return m;let y=m.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.panZoom!==!1})(),C=(()=>{if(typeof m=="boolean")return m;let y=m.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.download!==!1})(),A=(()=>{if(typeof m=="boolean")return m;let y=m.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.copy!==!1})(),S=()=>{d(!l)};return b.useEffect(()=>{if(l){Ts();let y=D=>{D.key==="Escape"&&d(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),xs()}}},[l]),b.useEffect(()=>{l?n?.():r&&r()},[l,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:h,onClick:S,title:g.viewFullscreen,type:"button",...a,"aria-label":g.viewFullscreen,children:f.jsx(s,{"aria-hidden":"true",size:14})}),l?Na.createPortal(f.jsxs("div",{"aria-label":g.viewFullscreen,"aria-modal":"true",className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:S,onKeyDown:y=>{y.key==="Escape"&&S()},role:"dialog",children:[f.jsxs("div",{className:u("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:[C?f.jsx(Fd,{chart:e,config:t}):null,A?f.jsx(Ta,{code:e}):null,f.jsx("button",{"aria-label":g.exitFullscreen,className:u("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:S,title:g.exitFullscreen,type:"button",children:f.jsx(o,{"aria-hidden":"true",size:20})})]}),f.jsx("div",{className:u("flex size-full items-center justify-center p-4"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:f.jsx(Nh,{chart:e,className:u("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:k})})]}),Es(p)):null]})};function ka(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let n=e;return n.tagName==="BR"?`
250
+ `;)t--;return e.slice(0,t)},g3=b.lazy(()=>Promise.resolve().then(()=>require("./highlighted-body-JLMTFACH-rWYYYFTi.cjs")).then(e=>({default:e.HighlightedCodeBlockBody}))),b3=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:s,...o})=>{let u=de(),{codeBlockMaxHeight:l}=b.useContext(ve),d=b.useMemo(()=>m3(e),[e]),h=b.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:d.split(`
251
+ `).map(m=>[{content:m,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[d]);return f.jsx(vd.Provider,{value:{code:e},children:f.jsxs(f3,{dir:"ltr",isIncomplete:i,language:t,children:[f.jsx(p3,{language:t}),r?f.jsx("div",{className:u("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:f.jsx("div",{className:u("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(b.Suspense,{fallback:f.jsx(Rd,{className:n,language:t,lineNumbers:s,maxHeight:l,result:h,startLine:a,...o}),children:f.jsx(g3,{className:n,code:d,isIncomplete:i,language:t,lineNumbers:s,maxHeight:l,raw:h,startLine:a,...o})})]})})},E3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),T3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),x3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),k3=e=>f.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),y3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),A3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),C3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),_3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),S3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),N3=e=>f.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),jn={CheckIcon:E3,CopyIcon:T3,DownloadIcon:x3,ExternalLinkIcon:_3,Loader2Icon:k3,Maximize2Icon:y3,RotateCcwIcon:A3,XIcon:C3,ZoomInIcon:S3,ZoomOutIcon:N3},Dd=b.createContext(jn),w3=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},Eu=({icons:e,children:t})=>{let n=b.useRef(e),r=b.useRef(e?{...jn,...e}:jn);w3(n.current,e)||(n.current=e,r.current=e?{...jn,...e}:jn);let i=r.current;return f.jsx(Dd.Provider,{value:i,children:t})},dt=()=>b.useContext(Dd),Pd={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",mermaidAriaLabel:"Mermaid chart",errorMermaid:"Failed to render Mermaid chart",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Ea=b.createContext(Pd),ht=()=>b.useContext(Ea),Ta=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...s})=>{let o=de(),[u,l]=b.useState(!1),d=b.useRef(0),{code:h}=Od(),{isAnimating:m}=b.useContext(ve),p=ht(),g=a??h,k=async()=>{var S;if(typeof window>"u"||!((S=navigator?.clipboard)!=null&&S.writeText)){t?.(new Error("Clipboard API not available"));return}try{u||(await navigator.clipboard.writeText(g),l(!0),e?.(),d.current=window.setTimeout(()=>l(!1),n))}catch(y){t?.(y)}};b.useEffect(()=>()=>{window.clearTimeout(d.current)},[]);let C=dt(),A=u?C.CheckIcon:C.CopyIcon;return f.jsxs(f.Fragment,{children:[f.jsx("button",{"aria-label":p.copyCode,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:m,onClick:k,title:p.copyCode,type:"button",...s,children:r??f.jsx(A,{"aria-hidden":"true",size:14})}),u&&f.jsx("output",{"aria-live":"polite",className:"sr-only",children:p.copied})]})},bs=(e,t,n)=>{if(typeof e=="boolean")return n;let r=e[t];if(typeof r!="object")return n;let i=r.download;return typeof i!="object"?n:i.filename||n},Tu=(e,t)=>{if(typeof e=="boolean")return{};let n=e[t];if(typeof n!="object")return{};let r=n.copy;return typeof r!="object"||r===null?{}:{onCopy:r.onCopy,onError:r.onError}},xu={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},I3=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...s})=>{let o=de(),{code:u}=Od(),{isAnimating:l,controls:d}=b.useContext(ve),h=ht(),m=dt(),p=a??u,g=n&&n in xu?xu[n]:"txt",k=`${bs(d,"code","file")}.${g}`,C="text/plain",A=()=>{try{hn(k,p,C),e?.()}catch(S){t?.(S)}};return f.jsx("button",{"aria-label":h.downloadFile,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:l,onClick:A,title:h.downloadFile,type:"button",...s,children:r??f.jsx(m.DownloadIcon,{size:14})})},ku=()=>{let{Loader2Icon:e}=dt(),t=de();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},L3=/\.[^/.]+$/,R3=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:s=!0,showDownloadControl:o=!0,...u})=>{let{DownloadIcon:l}=dt(),d=de(),h=b.useRef(null),[m,p]=b.useState(!1),[g,k]=b.useState(!1),C=ht(),A=u.width!=null||u.height!=null,S=(m||A)&&!g&&s&&o,y=g&&!A;b.useEffect(()=>{let P=h.current;if(P!=null&&P.complete){let O=P.naturalWidth>0;p(O),k(!O)}},[]);let D=b.useCallback(P=>{p(!0),k(!1),i?.(P)},[i]),M=b.useCallback(P=>{p(!1),k(!0),a?.(P)},[a]),L=async()=>{if(n)try{let P=await(await fetch(n)).blob(),O=new URL(n,window.location.origin).pathname.split("/").pop()||"",U=O.split(".").pop(),I=O.includes(".")&&U!==void 0&&U.length<=4,F="";if(I)F=O;else{let $=P.type,W="png";$.includes("jpeg")||$.includes("jpg")?W="jpg":$.includes("png")?W="png":$.includes("svg")?W="svg":$.includes("gif")?W="gif":$.includes("webp")&&(W="webp"),F=`${(r||O||"image").replace(L3,"")}.${W}`}hn(F,P,P.type)}catch{window.open(n,"_blank")}};return n?n===er?f.jsx("div",{className:d("group relative my-4 inline-block"),"data-incomplete":"true","data-streamdown":"image-wrapper",children:f.jsx("div",{className:d("h-24 w-48 animate-pulse rounded-lg bg-muted"),"data-streamdown":"image-placeholder"})}):f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",y&&"hidden",t),"data-streamdown":"image",onError:M,onLoad:D,ref:h,src:n,...u}),y&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:C.imageNotAvailable}),s&&f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),S&&f.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:L,title:C.downloadImage,type:"button",children:f.jsx(l,{size:14})})]}):null},Es=e=>{let t=typeof e=="function"?e():e;return t??document.body},Xn=0,Ts=()=>{Xn+=1,Xn===1&&(document.body.style.overflow="hidden")},xs=()=>{Xn=Math.max(0,Xn-1),Xn===0&&(document.body.style.overflow="")},v3=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:s,XIcon:o}=dt(),u=de(),[l,d]=b.useState(!1),h=ht(),{portal:m}=b.useContext(ve),p=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),d(!0),setTimeout(()=>d(!1),2e3)}catch{}},[e]),g=b.useCallback(()=>{r(),n()},[r,n]);if(b.useEffect(()=>{if(t){Ts();let C=A=>{A.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),xs()}}},[t,n]),!t||typeof document>"u")return null;let k=f.jsx("div",{className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:C=>{C.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:u("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:u("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:h.close,type:"button",children:f.jsx(o,{size:16})}),f.jsxs("div",{className:u("flex flex-col gap-2"),children:[f.jsxs("div",{className:u("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(s,{size:20}),f.jsx("span",{children:h.openExternalLink})]}),f.jsx("p",{className:u("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),f.jsx("div",{className:u("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:u("flex gap-2"),children:[f.jsx("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:p,type:"button",children:l?f.jsxs(f.Fragment,{children:[f.jsx(i,{size:14}),f.jsx("span",{children:h.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(a,{size:14}),f.jsx("span",{children:h.copyLink})]})}),f.jsxs("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:g,type:"button",children:[f.jsx(s,{size:14}),f.jsx("span",{children:h.openLink})]})]})]})});return Na.createPortal(k,Es(m))},xa=b.createContext(null),ks=()=>b.useContext(xa),O3=()=>{var e;let t=ks();return(e=t?.code)!=null?e:null},ys=()=>{var e;let t=ks();return(e=t?.mermaid)!=null?e:null},D3=e=>{var t;let n=ks();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},Md=/<svg\b[^>]*>/i,P3=/\bviewBox=(['"])(.*?)\1/i,M3=/[\s,]+/,B3=/\swidth=(['"]).*?\1/gi,F3=/\sheight=(['"]).*?\1/gi,yu=/\sstyle=(['"])(.*?)\1/i,H3=/^width\s*:/i,j3=/^height\s*:/i,U3=/^max-width\s*:/i,Au=/^<svg/i,Bd=e=>{let t=e.match(Md);if(!t)return null;let n=t[0].match(P3),r=n?.[2];if(!r)return null;let i=r.trim().split(M3).map(o=>Number.parseFloat(o));if(i.length<4||i.slice(0,4).some(Number.isNaN))return null;let a=i[2],s=i[3];return a>0&&s>0?{height:s,width:a}:null},q3=e=>{let t=e.match(Md);if(!t)return e;try{let n=t[0],r=Bd(e);if(!r)return e;let{width:i,height:a}=r,s=n.replace(B3,"").replace(F3,""),o=s.match(yu),u=`width:${i}px;height:${a}px;max-width:none;`;if(o){let l=o[1],d=o[2].split(";").map(m=>m.trim()).filter(Boolean).filter(m=>!(H3.test(m)||j3.test(m)||U3.test(m))).join(";"),h=`${u}${d?`${d};`:""}`;s=s.replace(yu,` style=${l}${h}${l}`)}else s=s.replace(Au,`<svg style="${u}"`);return s=s.replace(Au,`<svg width="${i}" height="${a}"`),e.replace(n,s)}catch{return e}},z3=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},$3=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let u=document.createElement("canvas"),l=o.width*r,d=o.height*r;u.width=l,u.height=d;let h=u.getContext("2d");if(!h){a(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(o,0,0,l,d),u.toBlob(m=>{if(!m){a(new Error("Failed to create PNG blob"));return}i(m)},"image/png")},o.onerror=()=>a(new Error("Failed to load SVG image")),o.src=s})},Fd=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let s=de(),[o,u]=b.useState(!1),l=b.useRef(null),{isAnimating:d,controls:h}=b.useContext(ve),m=dt(),p=ys(),g=ht(),k=bs(h,"mermaid","diagram"),C=async A=>{try{if(A==="mmd"){let P=`${k}.mmd`;hn(P,e,"text/plain"),u(!1),r?.(A);return}if(!p){a?.(new Error("Mermaid plugin not available"));return}let S=p.getMermaid(i),y=e.split("").reduce((P,O)=>(P<<5)-P+O.charCodeAt(0)|0,0),D=`mermaid-${Math.abs(y)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:M}=await S.render(D,e);if(!M){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}let L=z3(M);if(A==="svg"){let P=`${k}.svg`;hn(P,L,"image/svg+xml"),u(!1),r?.(A);return}if(A==="png"){let P=await $3(L);hn(`${k}.png`,P,"image/png"),r?.(A),u(!1);return}}catch(S){a?.(S)}};return b.useEffect(()=>{let A=S=>{let y=S.composedPath();l.current&&!y.includes(l.current)&&u(!1)};return document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[]),f.jsxs("div",{className:s("relative"),ref:l,children:[f.jsx("button",{"aria-label":g.downloadDiagram,className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:d,onClick:()=>u(!o),title:g.downloadDiagram,type:"button",children:t??f.jsx(m.DownloadIcon,{"aria-hidden":"true",size:14})}),o?f.jsxs("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{"aria-label":g.downloadDiagramAsSvg,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("svg"),title:g.downloadDiagramAsSvg,type:"button",children:g.mermaidFormatSvg}),f.jsx("button",{"aria-label":g.downloadDiagramAsPng,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("png"),title:g.downloadDiagramAsPng,type:"button",children:g.mermaidFormatPng}),f.jsx("button",{"aria-label":g.downloadDiagramAsMmd,className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("mmd"),title:g.downloadDiagramAsMmd,type:"button",children:g.mermaidFormatMmd})]}):null]})},V3=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:s,XIcon:o}=dt(),u=de(),[l,d]=b.useState(!1),{isAnimating:h,controls:m,portal:p}=b.useContext(ve),g=ht(),k=(()=>{if(typeof m=="boolean")return m;let y=m.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.panZoom!==!1})(),C=(()=>{if(typeof m=="boolean")return m;let y=m.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.download!==!1})(),A=(()=>{if(typeof m=="boolean")return m;let y=m.mermaid;return y===!1?!1:y===!0||y===void 0?!0:y.copy!==!1})(),S=()=>{d(!l)};return b.useEffect(()=>{if(l){Ts();let y=D=>{D.key==="Escape"&&d(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),xs()}}},[l]),b.useEffect(()=>{l?n?.():r&&r()},[l,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:h,onClick:S,title:g.viewFullscreen,type:"button",...a,"aria-label":g.viewFullscreen,children:f.jsx(s,{"aria-hidden":"true",size:14})}),l?Na.createPortal(f.jsxs("div",{"aria-label":g.viewFullscreen,"aria-modal":"true",className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:S,onKeyDown:y=>{y.key==="Escape"&&S()},role:"dialog",children:[f.jsxs("div",{className:u("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:[C?f.jsx(Fd,{chart:e,config:t}):null,A?f.jsx(Ta,{code:e}):null,f.jsx("button",{"aria-label":g.exitFullscreen,className:u("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:S,title:g.exitFullscreen,type:"button",children:f.jsx(o,{"aria-hidden":"true",size:20})})]}),f.jsx("div",{className:u("flex size-full items-center justify-center p-4"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:f.jsx(Nh,{chart:e,className:u("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:k})})]}),Es(p)):null]})};function ka(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let n=e;return n.tagName==="BR"?`
252
252
  `:Array.from(n.childNodes).map(ka).join("")}var Hd=e=>{let t=[],n=[],r=e.querySelectorAll("thead th");for(let a of r)t.push(ka(a).trim());let i=e.querySelectorAll("tbody tr");for(let a of i){let s=[],o=a.querySelectorAll("td");for(let u of o)s.push(ka(u).trim());n.push(s)}return{headers:t,rows:n}},jd=e=>{var t;if(typeof e!="object")return",";let n=e.table;return typeof n!="object"?",":(t=n.csvSeparator)!=null?t:","},Ud=(e,t=",")=>{let n;t==="auto"?Intl.NumberFormat().format(1.1).includes(",")?n=";":n=",":n=t;let{headers:r,rows:i}=e,a=l=>{let d=!1;for(let h of l)if(h===n||h==='"'||h===`
253
253
  `||h==="\r"){d=!0;break}return d?`"${l.replace(/"/g,'""')}"`:l},s=r.length>0?i.length+1:i.length,o=new Array(s),u=0;r.length>0&&(o[u]=r.map(a).join(n),u+=1);for(let l of i)o[u]=l.map(a).join(n),u+=1;return o.join(`
254
254
  `)},Y3=e=>{let{headers:t,rows:n}=e,r=o=>{let u=!1;for(let d of o)if(d===" "||d===`
@@ -257,8 +257,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error
257
257
  `)},$i=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"||r===`
258
258
  `||r==="&"||r==="<"||r===">"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):r===`
259
259
  `?n.push("<br>"):r==="&"?n.push("&amp;"):r==="<"?n.push("&lt;"):r===">"?n.push("&gt;"):n.push(r);return n.join("")},qd=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(o=>$i(o));r[i]=`| ${a.join(" | ")} |`,i+=1;let s=new Array(t.length);for(let o=0;o<t.length;o+=1)s[o]="---";r[i]=`| ${s.join(" | ")} |`,i+=1;for(let o of n)if(o.length<t.length){let u=new Array(t.length);for(let l=0;l<t.length;l+=1)u[l]=l<o.length?$i(o[l]):"";r[i]=`| ${u.join(" | ")} |`,i+=1}else{let u=o.map(l=>$i(l));r[i]=`| ${u.join(" | ")} |`,i+=1}return r.join(`
260
- `)},zd=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=de(),[s,o]=b.useState(!1),[u,l]=b.useState(!1),d=b.useRef(null),h=b.useRef(0),{isAnimating:m,controls:p}=b.useContext(ve),g=ht(),k=jd(p),C=async y=>{var D,M;if(typeof window>"u"||!((D=navigator?.clipboard)!=null&&D.write)){r?.(new Error("Clipboard API not available"));return}try{let L=(M=d.current)==null?void 0:M.closest('[data-streamdown="table-wrapper"]'),P=L?.querySelector("table");if(!P){r?.(new Error("Table not found"));return}let O=Hd(P),q="";y==="csv"?q=Ud(O,k):y==="tsv"?q=Y3(O):q=qd(O);let I=new ClipboardItem({"text/plain":new Blob([q],{type:"text/plain"}),"text/html":new Blob([P.outerHTML],{type:"text/html"})});await navigator.clipboard.write([I]),l(!0),o(!1),n?.(y),h.current=window.setTimeout(()=>l(!1),i)}catch(L){r?.(L)}};b.useEffect(()=>{let y=D=>{let M=D.composedPath();d.current&&!M.includes(d.current)&&o(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y),window.clearTimeout(h.current)}},[]);let A=dt(),S=u?A.CheckIcon:A.CopyIcon;return f.jsxs("div",{className:a("relative"),ref:d,children:[f.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:()=>o(!s),title:g.copyTable,type:"button",children:e??f.jsx(S,{height:14,width:14})}),s?f.jsxs("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("md"),title:g.copyTableAsMarkdown,type:"button",children:g.tableFormatMarkdown}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("csv"),title:g.copyTableAsCsv,type:"button",children:g.tableFormatCsv}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("tsv"),title:g.copyTableAsTsv,type:"button",children:g.tableFormatTsv})]}):null]})},$d=({children:e,className:t,onDownload:n,onError:r})=>{let i=de(),[a,s]=b.useState(!1),o=b.useRef(null),{isAnimating:u,controls:l}=b.useContext(ve),d=ht(),h=dt(),m=jd(l),p=g=>{var k;try{let C=(k=o.current)==null?void 0:k.closest('[data-streamdown="table-wrapper"]'),A=C?.querySelector("table");if(!A){r?.(new Error("Table not found"));return}let S=Hd(A),y=g==="csv"?Ud(S,m):qd(S),D=g==="csv"?"csv":"md",M=`${bs(l,"table","table")}.${D}`;hn(M,y,g==="csv"?"text/csv":"text/markdown"),s(!1),n?.(g)}catch(C){r?.(C)}};return b.useEffect(()=>{let g=k=>{let C=k.composedPath();o.current&&!C.includes(o.current)&&s(!1)};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]),f.jsxs("div",{className:i("relative"),ref:o,children:[f.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>s(!a),title:d.downloadTable,type:"button",children:e??f.jsx(h.DownloadIcon,{size:14})}),a?f.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:d.downloadTableAsCsv,type:"button",children:d.tableFormatCsv}),f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:d.downloadTableAsMarkdown,type:"button",children:d.tableFormatMarkdown})]}):null]})},G3=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=dt(),s=de(),[o,u]=b.useState(!1),{isAnimating:l,portal:d}=b.useContext(ve),h=ht(),m=()=>{u(!0)},p=()=>{u(!1)};return b.useEffect(()=>{if(o){Ts();let g=k=>{k.key==="Escape"&&u(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),xs()}}},[o]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:m,title:h.viewFullscreen,type:"button",children:f.jsx(i,{size:14})}),o?Na.createPortal(f.jsx("div",{"aria-label":h.viewFullscreen,"aria-modal":"true",className:s("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:p,onKeyDown:g=>{g.key==="Escape"&&p()},role:"dialog",children:f.jsxs("div",{className:s("flex h-full flex-col"),"data-streamdown":"table-wrapper",onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:s("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(zd,{}):null,r?f.jsx($d,{}):null,f.jsx("button",{className:s("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:p,title:h.exitFullscreen,type:"button",children:f.jsx(a,{size:20})})]}),f.jsx("div",{className:s("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:s("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),Es(d)):null]})},W3=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:s=!0,...o})=>{let u=de(),{isAnimating:l}=b.useContext(ve),d=Id(n),h=Ld(l,!!d,e),m=r&&i,p=r&&a,g=r&&s,k=m||p||g;return f.jsxs("div",{className:u("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[k?f.jsxs("div",{className:u("flex items-center justify-end gap-1"),children:[m?f.jsx(zd,{}):null,p?f.jsx($d,{}):null,g?f.jsx(G3,{showCopy:m,showDownload:p,children:e}):null]}):null,f.jsx("div",{className:u("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),ref:h,style:d?{maxHeight:d}:void 0,children:f.jsx("table",{className:u("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},Q3=/startLine=(\d+)/,K3=/\bnoLineNumbers\b/,X3=b.lazy(()=>Promise.resolve().then(()=>require("./mermaid-WFAXDIZX-D1q7n0BY.cjs")).then(e=>({default:e.Mermaid}))),Z3=/language-([^\s]+)/,J3="node";function Ae(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let a of n)if(a!==J3&&!Object.is(r[a],i[a]))return!1;return!0}function eC(e,t){var n,r;return((n=e?.properties)==null?void 0:n.metastring)===((r=t?.properties)==null?void 0:r.metastring)}var Qr=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Vi=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Cu=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Ir=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},tC=(e,t)=>{if(typeof e=="boolean")return e;let n=e.image;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},As=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Ae(e,t));As.displayName="MarkdownOl";var Vd=b.memo(({children:e,className:t,node:n,...r})=>{var i;let a=de(),s=Array.isArray(e)?e.filter(u=>u!==`
261
- `&&u!==""):[e],o=s.length===1&&b.isValidElement(s[0])&&(s[0].type===Cs||((i=s[0].props.node)==null?void 0:i.tagname)==="p")?s[0].props.children:e;return f.jsx("li",{className:a("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:o})},(e,t)=>Ae(e,t));Vd.displayName="MarkdownLi";var Yd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Ae(e,t));Yd.displayName="MarkdownUl";var Gd=b.memo(({className:e,node:t,...n})=>{let r=de();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Ae(e,t));Gd.displayName="MarkdownHr";var Wd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Ae(e,t));Wd.displayName="MarkdownStrong";var nC=({children:e,className:t,href:n,node:r,...i})=>{let a=de(),{linkSafety:s}=b.useContext(ve),[o,u]=b.useState(!1),l=n==="streamdown:incomplete-link",d=b.useCallback(async g=>{if(!(!(s!=null&&s.enabled&&n)||l)){if(g.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[s,n,l]),h=b.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),m=b.useCallback(()=>{u(!1)},[]),p={url:n??"",isOpen:o,onClose:m,onConfirm:h};return s!=null&&s.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:d,type:"button",children:e}),s.renderModal?s.renderModal(p):f.jsx(v3,{...p})]}):f.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Qd=b.memo(nC,(e,t)=>Ae(e,t));Qd.displayName="MarkdownA";var Kd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Ae(e,t));Kd.displayName="MarkdownH1";var Xd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Ae(e,t));Xd.displayName="MarkdownH2";var Zd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Ae(e,t));Zd.displayName="MarkdownH3";var Jd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Ae(e,t));Jd.displayName="MarkdownH4";var eh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Ae(e,t));eh.displayName="MarkdownH5";var th=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Ae(e,t));th.displayName="MarkdownH6";var nh=b.memo(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=b.useContext(ve),s=Qr(i,"table"),o=Vi(i,"copy"),u=Vi(i,"download"),l=Vi(i,"fullscreen");return f.jsx(W3,{className:t,maxHeight:a,showControls:s,showCopy:o,showDownload:u,showFullscreen:l,...r,children:e})},(e,t)=>Ae(e,t));nh.displayName="MarkdownTable";var rh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Ae(e,t));rh.displayName="MarkdownThead";var ih=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Ae(e,t));ih.displayName="MarkdownTbody";var ah=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Ae(e,t));ah.displayName="MarkdownTr";var sh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Ae(e,t));sh.displayName="MarkdownTh";var oh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Ae(e,t));oh.displayName="MarkdownTd";var uh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Ae(e,t));uh.displayName="MarkdownBlockquote";var lh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Ae(e,t));lh.displayName="MarkdownSup";var ch=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Ae(e,t));ch.displayName="MarkdownSub";var dh=b.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var o,u;if(!b.isValidElement(s))return!1;let l=Array.isArray(s.props.children)?s.props.children:[s.props.children],d=!1,h=!1;for(let m of l)if(m){if(typeof m=="string")m.trim()!==""&&(d=!0);else if(b.isValidElement(m))if(((o=m.props)==null?void 0:o["data-footnote-backref"])!==void 0)h=!0;else{let p=Array.isArray(m.props.children)?m.props.children:[m.props.children];for(let g of p){if(typeof g=="string"&&g.trim()!==""){d=!0;break}if(b.isValidElement(g)&&((u=g.props)==null?void 0:u["data-footnote-backref"])===void 0){d=!0;break}}}}return h&&!d},a=Array.isArray(e)?e.map(s=>{if(!b.isValidElement(s))return s;if(s.type===As){let o=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(u=>!i(u));return o.length===0?null:{...s,props:{...s.props,children:o}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?f.jsx("section",{className:t,...r,children:a}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>Ae(e,t));dh.displayName="MarkdownSection";var rC=({node:e,className:t,children:n,...r})=>{var i,a;let s=de(),o=!("data-block"in r),{mermaid:u,controls:l,lineNumbers:d}=b.useContext(ve),h=ys(),m=wd(),p=t?.match(Z3),g=(i=p?.at(1))!=null?i:"",k=D3(g);if(o)return f.jsx("code",{className:s("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(a=e?.properties)==null?void 0:a.metastring,A=C?.match(Q3),S=A?Number.parseInt(A[1],10):void 0,y=S!==void 0&&S>=1?S:void 0,D=!(C&&K3.test(C))&&d!==!1,M="";if(b.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?M=n.props.children:typeof n=="string"&&(M=n),k){let F=k.component;return f.jsx(b.Suspense,{fallback:f.jsx(ku,{}),children:f.jsx(F,{code:M,isIncomplete:m,language:g,meta:C})})}if(g==="mermaid"&&h){let F=Qr(l,"mermaid"),$=Ir(l,"download"),W=Ir(l,"copy"),G=Ir(l,"fullscreen"),U=Ir(l,"panZoom"),Q=F&&($||W||G);return f.jsx(b.Suspense,{fallback:f.jsx(ku,{}),children:f.jsxs("div",{className:s("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:s("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:s("ml-1 font-mono lowercase"),children:"mermaid"})}),Q?f.jsx("div",{className:s("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:f.jsxs("div",{className:s("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[$?f.jsx(Fd,{chart:M,config:u?.config}):null,W?f.jsx(Ta,{code:M,...Tu(l,"mermaid")}):null,G?f.jsx(V3,{chart:M,config:u?.config}):null]})}):null,f.jsx("div",{className:s("overflow-hidden rounded-md border border-border bg-background"),children:f.jsx(X3,{chart:M,config:u?.config,showControls:U})})]})})}let L=Qr(l,"code"),P=Cu(l,"download"),O=Cu(l,"copy"),{"data-block":q,...I}=r;return f.jsx(b3,{className:t,code:M,isIncomplete:m,language:g,lineNumbers:D,startLine:y,...I,children:L?f.jsxs(f.Fragment,{children:[P?f.jsx(I3,{code:M,language:g}):null,O?f.jsx(Ta,{...Tu(l,"code")}):null]}):null})},hh=b.memo(rC,(e,t)=>Ae(e,t)&&eC(e.node,t.node));hh.displayName="MarkdownCode";var iC=({node:e,className:t,...n})=>{let{controls:r}=b.useContext(ve),i=Qr(r,"image"),a=i&&tC(r,"download");return f.jsx(R3,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},fh=b.memo(iC,(e,t)=>Ae(e,t));fh.displayName="MarkdownImg";var Cs=b.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&b.isValidElement(r[0])){let i=r[0].props.node,a=i?.tagName;if(a==="img")return f.jsx(f.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>Ae(e,t));Cs.displayName="MarkdownParagraph";var aC={ol:As,li:Vd,ul:Yd,hr:Gd,strong:Wd,a:Qd,h1:Kd,h2:Xd,h3:Zd,h4:Jd,h5:eh,h6:th,table:nh,thead:rh,tbody:ih,tr:ah,th:sh,td:oh,blockquote:uh,code:hh,img:fh,pre:({children:e})=>b.isValidElement(e)?b.cloneElement(e,{"data-block":"true"}):e,sup:lh,sub:ch,p:Cs,section:dh},sC=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,oC=/\p{L}/u;function ph(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,"").replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,""),n,r=0,i=0;for(let a of t){if(sC.test(a)){n!=null||(n="rtl"),i+=1;continue}oC.test(a)&&(n!=null||(n="ltr"),r+=1)}return i>r?"rtl":r>i?"ltr":n??"ltr"}var uC=/^[ \t]{0,3}(`{3,}|~{3,})/,lC=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,_u=e=>{let t=e.split(`
260
+ `)},zd=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=de(),[s,o]=b.useState(!1),[u,l]=b.useState(!1),d=b.useRef(null),h=b.useRef(0),{isAnimating:m,controls:p}=b.useContext(ve),g=ht(),k=jd(p),C=async y=>{var D,M;if(typeof window>"u"||!((D=navigator?.clipboard)!=null&&D.write)){r?.(new Error("Clipboard API not available"));return}try{let L=(M=d.current)==null?void 0:M.closest('[data-streamdown="table-wrapper"]'),P=L?.querySelector("table");if(!P){r?.(new Error("Table not found"));return}let O=Hd(P),U="";y==="csv"?U=Ud(O,k):y==="tsv"?U=Y3(O):U=qd(O);let I=new ClipboardItem({"text/plain":new Blob([U],{type:"text/plain"}),"text/html":new Blob([P.outerHTML],{type:"text/html"})});await navigator.clipboard.write([I]),l(!0),o(!1),n?.(y),h.current=window.setTimeout(()=>l(!1),i)}catch(L){r?.(L)}};b.useEffect(()=>{let y=D=>{let M=D.composedPath();d.current&&!M.includes(d.current)&&o(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y),window.clearTimeout(h.current)}},[]);let A=dt(),S=u?A.CheckIcon:A.CopyIcon;return f.jsxs("div",{className:a("relative"),ref:d,children:[f.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:()=>o(!s),title:g.copyTable,type:"button",children:e??f.jsx(S,{height:14,width:14})}),s?f.jsxs("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("md"),title:g.copyTableAsMarkdown,type:"button",children:g.tableFormatMarkdown}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("csv"),title:g.copyTableAsCsv,type:"button",children:g.tableFormatCsv}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>C("tsv"),title:g.copyTableAsTsv,type:"button",children:g.tableFormatTsv})]}):null]})},$d=({children:e,className:t,onDownload:n,onError:r})=>{let i=de(),[a,s]=b.useState(!1),o=b.useRef(null),{isAnimating:u,controls:l}=b.useContext(ve),d=ht(),h=dt(),m=jd(l),p=g=>{var k;try{let C=(k=o.current)==null?void 0:k.closest('[data-streamdown="table-wrapper"]'),A=C?.querySelector("table");if(!A){r?.(new Error("Table not found"));return}let S=Hd(A),y=g==="csv"?Ud(S,m):qd(S),D=g==="csv"?"csv":"md",M=`${bs(l,"table","table")}.${D}`;hn(M,y,g==="csv"?"text/csv":"text/markdown"),s(!1),n?.(g)}catch(C){r?.(C)}};return b.useEffect(()=>{let g=k=>{let C=k.composedPath();o.current&&!C.includes(o.current)&&s(!1)};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]),f.jsxs("div",{className:i("relative"),ref:o,children:[f.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>s(!a),title:d.downloadTable,type:"button",children:e??f.jsx(h.DownloadIcon,{size:14})}),a?f.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:d.downloadTableAsCsv,type:"button",children:d.tableFormatCsv}),f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:d.downloadTableAsMarkdown,type:"button",children:d.tableFormatMarkdown})]}):null]})},G3=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=dt(),s=de(),[o,u]=b.useState(!1),{isAnimating:l,portal:d}=b.useContext(ve),h=ht(),m=()=>{u(!0)},p=()=>{u(!1)};return b.useEffect(()=>{if(o){Ts();let g=k=>{k.key==="Escape"&&u(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),xs()}}},[o]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:m,title:h.viewFullscreen,type:"button",children:f.jsx(i,{size:14})}),o?Na.createPortal(f.jsx("div",{"aria-label":h.viewFullscreen,"aria-modal":"true",className:s("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:p,onKeyDown:g=>{g.key==="Escape"&&p()},role:"dialog",children:f.jsxs("div",{className:s("flex h-full flex-col"),"data-streamdown":"table-wrapper",onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:s("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(zd,{}):null,r?f.jsx($d,{}):null,f.jsx("button",{className:s("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:p,title:h.exitFullscreen,type:"button",children:f.jsx(a,{size:20})})]}),f.jsx("div",{className:s("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:s("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),Es(d)):null]})},W3=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:s=!0,...o})=>{let u=de(),{isAnimating:l}=b.useContext(ve),d=Id(n),h=Ld(l,!!d,e),m=r&&i,p=r&&a,g=r&&s,k=m||p||g;return f.jsxs("div",{className:u("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[k?f.jsxs("div",{className:u("flex items-center justify-end gap-1"),children:[m?f.jsx(zd,{}):null,p?f.jsx($d,{}):null,g?f.jsx(G3,{showCopy:m,showDownload:p,children:e}):null]}):null,f.jsx("div",{className:u("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),ref:h,style:d?{maxHeight:d}:void 0,children:f.jsx("table",{className:u("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},Q3=/startLine=(\d+)/,K3=/\bnoLineNumbers\b/,X3=b.lazy(()=>Promise.resolve().then(()=>require("./mermaid-WFAXDIZX-DmOW6O9q.cjs")).then(e=>({default:e.Mermaid}))),Z3=/language-([^\s]+)/,J3="node";function Ae(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let a of n)if(a!==J3&&!Object.is(r[a],i[a]))return!1;return!0}function eC(e,t){var n,r;return((n=e?.properties)==null?void 0:n.metastring)===((r=t?.properties)==null?void 0:r.metastring)}var Qr=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Vi=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Cu=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Ir=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},tC=(e,t)=>{if(typeof e=="boolean")return e;let n=e.image;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},As=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Ae(e,t));As.displayName="MarkdownOl";var Vd=b.memo(({children:e,className:t,node:n,...r})=>{var i;let a=de(),s=Array.isArray(e)?e.filter(u=>u!==`
261
+ `&&u!==""):[e],o=s.length===1&&b.isValidElement(s[0])&&(s[0].type===Cs||((i=s[0].props.node)==null?void 0:i.tagname)==="p")?s[0].props.children:e;return f.jsx("li",{className:a("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:o})},(e,t)=>Ae(e,t));Vd.displayName="MarkdownLi";var Yd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Ae(e,t));Yd.displayName="MarkdownUl";var Gd=b.memo(({className:e,node:t,...n})=>{let r=de();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Ae(e,t));Gd.displayName="MarkdownHr";var Wd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Ae(e,t));Wd.displayName="MarkdownStrong";var nC=({children:e,className:t,href:n,node:r,...i})=>{let a=de(),{linkSafety:s}=b.useContext(ve),[o,u]=b.useState(!1),l=n==="streamdown:incomplete-link",d=b.useCallback(async g=>{if(!(!(s!=null&&s.enabled&&n)||l)){if(g.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[s,n,l]),h=b.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),m=b.useCallback(()=>{u(!1)},[]),p={url:n??"",isOpen:o,onClose:m,onConfirm:h};return s!=null&&s.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:d,type:"button",children:e}),s.renderModal?s.renderModal(p):f.jsx(v3,{...p})]}):f.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Qd=b.memo(nC,(e,t)=>Ae(e,t));Qd.displayName="MarkdownA";var Kd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Ae(e,t));Kd.displayName="MarkdownH1";var Xd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Ae(e,t));Xd.displayName="MarkdownH2";var Zd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Ae(e,t));Zd.displayName="MarkdownH3";var Jd=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Ae(e,t));Jd.displayName="MarkdownH4";var eh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Ae(e,t));eh.displayName="MarkdownH5";var th=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Ae(e,t));th.displayName="MarkdownH6";var nh=b.memo(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=b.useContext(ve),s=Qr(i,"table"),o=Vi(i,"copy"),u=Vi(i,"download"),l=Vi(i,"fullscreen");return f.jsx(W3,{className:t,maxHeight:a,showControls:s,showCopy:o,showDownload:u,showFullscreen:l,...r,children:e})},(e,t)=>Ae(e,t));nh.displayName="MarkdownTable";var rh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Ae(e,t));rh.displayName="MarkdownThead";var ih=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Ae(e,t));ih.displayName="MarkdownTbody";var ah=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Ae(e,t));ah.displayName="MarkdownTr";var sh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Ae(e,t));sh.displayName="MarkdownTh";var oh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Ae(e,t));oh.displayName="MarkdownTd";var uh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Ae(e,t));uh.displayName="MarkdownBlockquote";var lh=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Ae(e,t));lh.displayName="MarkdownSup";var ch=b.memo(({children:e,className:t,node:n,...r})=>{let i=de();return f.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Ae(e,t));ch.displayName="MarkdownSub";var dh=b.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var o,u;if(!b.isValidElement(s))return!1;let l=Array.isArray(s.props.children)?s.props.children:[s.props.children],d=!1,h=!1;for(let m of l)if(m){if(typeof m=="string")m.trim()!==""&&(d=!0);else if(b.isValidElement(m))if(((o=m.props)==null?void 0:o["data-footnote-backref"])!==void 0)h=!0;else{let p=Array.isArray(m.props.children)?m.props.children:[m.props.children];for(let g of p){if(typeof g=="string"&&g.trim()!==""){d=!0;break}if(b.isValidElement(g)&&((u=g.props)==null?void 0:u["data-footnote-backref"])===void 0){d=!0;break}}}}return h&&!d},a=Array.isArray(e)?e.map(s=>{if(!b.isValidElement(s))return s;if(s.type===As){let o=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(u=>!i(u));return o.length===0?null:{...s,props:{...s.props,children:o}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?f.jsx("section",{className:t,...r,children:a}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>Ae(e,t));dh.displayName="MarkdownSection";var rC=({node:e,className:t,children:n,...r})=>{var i,a;let s=de(),o=!("data-block"in r),{mermaid:u,controls:l,lineNumbers:d}=b.useContext(ve),h=ys(),m=wd(),p=t?.match(Z3),g=(i=p?.at(1))!=null?i:"",k=D3(g);if(o)return f.jsx("code",{className:s("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(a=e?.properties)==null?void 0:a.metastring,A=C?.match(Q3),S=A?Number.parseInt(A[1],10):void 0,y=S!==void 0&&S>=1?S:void 0,D=!(C&&K3.test(C))&&d!==!1,M="";if(b.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?M=n.props.children:typeof n=="string"&&(M=n),k){let F=k.component;return f.jsx(b.Suspense,{fallback:f.jsx(ku,{}),children:f.jsx(F,{code:M,isIncomplete:m,language:g,meta:C})})}if(g==="mermaid"&&h){let F=Qr(l,"mermaid"),$=Ir(l,"download"),W=Ir(l,"copy"),G=Ir(l,"fullscreen"),q=Ir(l,"panZoom"),Q=F&&($||W||G);return f.jsx(b.Suspense,{fallback:f.jsx(ku,{}),children:f.jsxs("div",{className:s("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:s("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:s("ml-1 font-mono lowercase"),children:"mermaid"})}),Q?f.jsx("div",{className:s("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:f.jsxs("div",{className:s("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[$?f.jsx(Fd,{chart:M,config:u?.config}):null,W?f.jsx(Ta,{code:M,...Tu(l,"mermaid")}):null,G?f.jsx(V3,{chart:M,config:u?.config}):null]})}):null,f.jsx("div",{className:s("overflow-hidden rounded-md border border-border bg-background"),children:f.jsx(X3,{chart:M,config:u?.config,showControls:q})})]})})}let L=Qr(l,"code"),P=Cu(l,"download"),O=Cu(l,"copy"),{"data-block":U,...I}=r;return f.jsx(b3,{className:t,code:M,isIncomplete:m,language:g,lineNumbers:D,startLine:y,...I,children:L?f.jsxs(f.Fragment,{children:[P?f.jsx(I3,{code:M,language:g}):null,O?f.jsx(Ta,{...Tu(l,"code")}):null]}):null})},hh=b.memo(rC,(e,t)=>Ae(e,t)&&eC(e.node,t.node));hh.displayName="MarkdownCode";var iC=({node:e,className:t,...n})=>{let{controls:r}=b.useContext(ve),i=Qr(r,"image"),a=i&&tC(r,"download");return f.jsx(R3,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},fh=b.memo(iC,(e,t)=>Ae(e,t));fh.displayName="MarkdownImg";var Cs=b.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&b.isValidElement(r[0])){let i=r[0].props.node,a=i?.tagName;if(a==="img")return f.jsx(f.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>Ae(e,t));Cs.displayName="MarkdownParagraph";var aC={ol:As,li:Vd,ul:Yd,hr:Gd,strong:Wd,a:Qd,h1:Kd,h2:Xd,h3:Zd,h4:Jd,h5:eh,h6:th,table:nh,thead:rh,tbody:ih,tr:ah,th:sh,td:oh,blockquote:uh,code:hh,img:fh,pre:({children:e})=>b.isValidElement(e)?b.cloneElement(e,{"data-block":"true"}):e,sup:lh,sub:ch,p:Cs,section:dh},sC=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,oC=/\p{L}/u;function ph(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,"").replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,""),n,r=0,i=0;for(let a of t){if(sC.test(a)){n!=null||(n="rtl"),i+=1;continue}oC.test(a)&&(n!=null||(n="ltr"),r+=1)}return i>r?"rtl":r>i?"ltr":n??"ltr"}var uC=/^[ \t]{0,3}(`{3,}|~{3,})/,lC=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,_u=e=>{let t=e.split(`
262
262
  `),n=null,r=0;for(let i of t){let a=uC.exec(i);if(n===null){if(a){let s=a[1];n=s[0],r=s.length}}else if(a){let s=a[1],o=s[0],u=s.length;o===n&&u>=r&&(n=null,r=0)}}return n!==null},cC=e=>{let t=e.split(`
263
263
  `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&lC.test(r))return!0}return!1},dC=()=>e=>{it(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},Su=[],Nu={allowDangerousHtml:!0},Lr=new WeakMap,hC=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let d="default";return this.keyCache.set(e,d),d}let a=d=>{if(!d||d.length===0)return"";let h="";for(let m=0;m<d.length;m+=1){let p=d[m];if(m>0&&(h+=","),Array.isArray(p)){let[g,k]=p;if(typeof g=="function"){let C=Lr.get(g);C||(C=g.name,Lr.set(g,C)),h+=C}else h+=String(g);h+=":",h+=JSON.stringify(k)}else if(typeof p=="function"){let g=Lr.get(p);g||(g=p.name,Lr.set(p,g)),h+=g}else h+=String(p)}return h},s=a(n),o=a(r),u=i?JSON.stringify(i):"",l=`${o}::${s}::${u}`;return this.keyCache.set(e,l),l}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},wu=new hC,mh=e=>{let t=fC(e),n=e.children||"",r=t.runSync(t.parse(n),n);return xC(r,e)},fC=e=>{let t=wu.get(e);if(t)return t;let n=mC(e);return wu.set(e,n),n},pC=e=>e.some(t=>Array.isArray(t)?t[0]===na:t===na),mC=e=>{let t=e.rehypePlugins||Su,n=e.remarkPlugins||Su,r=pC(t)?n:[...n,dC],i=e.remarkRehypeOptions?{...Nu,...e.remarkRehypeOptions}:Nu;return Dy().use(Ok).use(r).use(my,i).use(t)},gC=e=>e,bC=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},EC=(e,t)=>{var n;for(let r in Di)if(Object.hasOwn(Di,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=Di[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},TC=(e,t,n,r,i,a)=>{let s=!1;return r?s=!r.includes(e.tagName):i&&(s=i.includes(e.tagName)),!s&&a&&typeof t=="number"&&(s=!a(e,t,n)),s},xC=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:s,urlTransform:o}=t;if(n||r||i||a||o){let u=o||gC;it(e,(l,d,h)=>{if(l.type==="raw"&&h&&typeof d=="number")return bC(h,d,a,l.value),d;if(l.type==="element"&&(EC(l,u),TC(l,d,h,r,i,n)&&h&&typeof d=="number"))return s&&l.children?h.children.splice(d,1,...l.children):h.children.splice(d,1),d})}return U2(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},kC=/\[\^[\w-]{1,200}\](?!:)/,yC=/\[\^[\w-]{1,200}\]:/,AC=/<([A-Za-z][\w:-]*)[\s>/]/,CC=/^ {0,3}\[[^\]]+\]:/m,_C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Iu=new Map,Lu=new Map,SC=e=>{let t=e.toLowerCase(),n=Iu.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return Iu.set(t,r),r},NC=e=>{let t=e.toLowerCase(),n=Lu.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return Lu.set(t,r),r},Ru=(e,t)=>{if(_C.has(t.toLowerCase()))return 0;let n=e.match(SC(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},vu=(e,t)=>{let n=e.match(NC(t));return n?n.length:0},wC=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},IC=/\r\n|\r/g,gh=e=>{let t=new nt({gfm:!0});return{tokens:t.blockTokens(e),hasLinkDefinitions:Object.keys(t.tokens.links).length>0}},ln=null,LC=`
264
264
 
@@ -283,7 +283,7 @@ ${m}`,i=e.length;break}if(!l.startsWith(`
283
283
  <!---->
284
284
  `);r+=`${s}
285
285
 
286
- ${h}`,i=e.length;break}return i===0?e:r+e.slice(i)},FC=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,o,u)=>MC(s,o,u)),n=BC(n,r)}return n},HC=/([\\`*_~[\]|])/g,jC=e=>e.replace(HC,"\\$1"),UC=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,o,u)=>{let l=jC(o).replace(/\n\n/g,"&#10;&#10;");return s+l+u})}return n},qC=new Set(["blockquote","dd","dt","figcaption","h1","h2","h3","h4","h5","h6","li","p","td","th"]),xh=new Set(["code","kbd","pre","samp","var"]);function kh(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"&&!xh.has(t.tagName)?kh(t):"").join("")}function zC(){return e=>{it(e,"element",t=>{if(xh.has(t.tagName)){t.properties!=null||(t.properties={}),t.properties.dir="ltr";return}qC.has(t.tagName)&&(t.properties!=null||(t.properties={}),typeof t.properties.dir!="string"&&(t.properties.dir=ph(kh(t))))})}}var yh=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(yh).join(""):"",$C=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));it(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=yh(r);r.children=i?[{type:"text",value:i}]:[]}})},VC=()=>e=>{it(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},YC=/^([a-zA-Z][a-zA-Z\d+\-.]*:)/,GC=e=>new Set(e.map(t=>t.trim().toLowerCase()).filter(t=>t.length>0).map(t=>t.endsWith(":")?t:`${t}:`));function WC(e,t,n){var r,i;let a=(i=(r=e.position)==null?void 0:r.start)==null?void 0:i.offset;if(typeof a=="number"&&n.charCodeAt(a)===91||e.children.length!==1)return!1;let[s]=e.children;if(s.type!=="text")return!1;let o=YC.exec(e.url);if(!o)return!1;let u=o[1].toLowerCase();return t.has(u)?u==="mailto:"?e.url===`mailto:${s.value}`:e.url===s.value||e.url===`${u}//${s.value}`:!1}var QC=(e=[])=>{let t=GC(e);return(n,r)=>{var i;if(t.size===0)return;let a=String((i=r.value)!=null?i:"");it(n,"link",(s,o,u)=>{if(!(!u||o===void 0)&&WC(s,t,a))return u.children.splice(o,1,...s.children),o})}},Ou="data-sd-caret-hidden",KC=()=>{},XC=()=>KC,ZC=e=>{let t=b.useRef(null),n=b.useRef(null),r=b.useSyncExternalStore(XC,()=>!0,()=>!1);return b.useLayoutEffect(()=>{var i,a;let s=e&&(a=(i=t.current)==null?void 0:i.lastElementChild)!=null?a:null,o=n.current;o!==s&&(o?.removeAttribute(Ou),s?.setAttribute(Ou,""),n.current=s)}),{containerRef:t,showCaret:r||!e}},Du=/^[a-z]/,JC=/^[ \t]*<[\w!/?-]/,e_=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,t_=e=>typeof e!="string"||e.length===0||!JC.test(e)?e:e.replace(e_,"$1"),Pu,Mu,Bu,Fu,Hu,ju,Pr={...Rt,clobberPrefix:"",protocols:{...Rt.protocols,href:[...(Mu=(Pu=Rt.protocols)==null?void 0:Pu.href)!=null?Mu:[],"tel","streamdown"],src:[...(Fu=(Bu=Rt.protocols)==null?void 0:Bu.src)!=null?Fu:[],"streamdown"]},attributes:{...Rt.attributes,code:[...(ju=(Hu=Rt.attributes)==null?void 0:Hu.code)!=null?ju:[],"metastring"]}},Aa={raw:na,sanitize:[Xl,Pr],harden:[Sf,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},n_={gfm:[QE,{}],codeMeta:VC},Uu=Object.values(Aa),r_=Object.values(n_),i_={block:" ▋",circle:" ●"},Ah=["github-light","github-dark"],Ch={enabled:!0},a_={codeBlockMaxHeight:400,shikiTheme:Ah,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Ch,portal:void 0,tableMaxHeight:300},ve=b.createContext(a_),_h=b.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:s,...o})=>{b.useLayoutEffect(()=>{s?.commit()});let u=typeof e=="string"&&n?t_(e):e,l=f.jsx(mh,{...o,children:u});return f.jsx(Nd.Provider,{value:i,children:a?f.jsx("div",{dir:a,style:{display:"contents"},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins||!!e.animatePlugin!=!!t.animatePlugin)});_h.displayName="Block";var Ca=e=>{let t={};for(let[n,r]of Object.entries(e))(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=r);return t},s_=(e,t)=>{let n=Ca(e),r=Ca(t),i=Object.keys(n);return i.length===Object.keys(r).length&&i.every(a=>Object.hasOwn(r,a)&&n[a]===r[a])},Sh=b.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:s=Uu,remarkPlugins:o=r_,className:u,shikiTheme:l,mermaid:d,codeBlockMaxHeight:h=400,controls:m=!0,isAnimating:p=!1,tableMaxHeight:g=300,animated:k,BlockComponent:C=_h,parseMarkdownIntoBlocksFn:A=OC,caret:S,plugins:y,remend:D,linkSafety:M=Ch,portal:L,lineNumbers:P=!0,allowedTags:O,fallbackComponent:q,literalTagContent:I,disableAutolinkProtocols:F,translations:$,icons:W,prefix:G,onAnimationStart:U,onAnimationEnd:Q,...Z})=>{let ae=b.useId(),he=Ca(Z),T=b.useMemo(()=>u3(G),[G]),Ne=b.useRef(null),_e=b.useRef(U),N=b.useRef(Q);_e.current=U,N.current=Q,b.useEffect(()=>{var ne,v,j;if(t==="static")return;let J=Ne.current;if(Ne.current=p,J===null){p&&((ne=_e.current)==null||ne.call(_e));return}p&&!J?(v=_e.current)==null||v.call(_e):!p&&J&&((j=N.current)==null||j.call(N))},[p,t]);let me=b.useMemo(()=>O?Object.keys(O):[],[O]),ge=b.useMemo(()=>{if(typeof e!="string")return"";let ne=t==="streaming"&&r?Px(e,D):e;return I&&I.length>0&&(ne=UC(ne,I)),me.length>0&&(ne=FC(ne,me)),ne},[e,t,r,D,me,I]),te=b.useMemo(()=>A(ge),[ge,A]),we=b.useMemo(()=>n==="auto"?te.map(ph):void 0,[te,n]),De=b.useMemo(()=>te.map((ne,v)=>`${ae}-${v}`),[te.length,ae]),Y=b.useMemo(()=>k===!0?"true":k?JSON.stringify(k):"",[k]),oe=b.useRef(null),Se=b.useRef([]),be=b.useRef([]),Ke=b.useRef(null),ft=b.useRef("");if(Y){if(ft.current!==Y){ft.current=Y;let ne=Y!=="true"?k.maxBacklogMs:void 0;oe.current=mu({maxBacklogMs:ne}),Se.current=[],be.current=[]}else oe.current||(oe.current=mu());p&&oe.current&&oe.current.beginPass(oe.current.now())}else oe.current=null,Se.current=[],be.current=[],ft.current="";b.useLayoutEffect(()=>{var ne;p&&((ne=oe.current)==null||ne.commitPass())});let br=b.useMemo(()=>{var ne,v;return{codeBlockMaxHeight:h,shikiTheme:(v=l??((ne=y?.code)==null?void 0:ne.getThemes()))!=null?v:Ah,controls:m,isAnimating:p,lineNumbers:P,mode:t,mermaid:d,linkSafety:M,portal:L,tableMaxHeight:g}},[h,l,m,p,P,t,d,M,L,y?.code,g]),Er=b.useMemo(()=>$?JSON.stringify($):"",[$]),yn=b.useMemo(()=>({...Pd,...$}),[Er]),An=b.useMemo(()=>{let{inlineCode:ne,...v}=a??{},j={...aC,...v};if(ne){let J=j.code;j.code=ee=>"data-block"in ee?J?b.createElement(J,ee):null:b.createElement(ne,ee)}if(q){if(O)for(let ee of Object.keys(O))Object.hasOwn(j,ee)||(j[ee]=q);let J={configurable:!0,enumerable:!1,value:q,writable:!1};return new Proxy(j,{getOwnPropertyDescriptor(ee,Ee){let fe=Object.getOwnPropertyDescriptor(ee,Ee);if(fe)return fe;if(typeof Ee=="string"&&Du.test(Ee))return J},get(ee,Ee,fe){return typeof Ee=="string"&&Du.test(Ee)&&!Object.hasOwn(ee,Ee)?q:Reflect.get(ee,Ee,fe)}})}return j},[a,q,O]),Tr=b.useMemo(()=>{let ne=[];return y!=null&&y.cjk&&(ne=[...ne,...y.cjk.remarkPluginsBefore]),ne=[...ne,...o],F&&F.length>0&&(ne=[...ne,[QC,F]]),y!=null&&y.cjk&&(ne=[...ne,...y.cjk.remarkPluginsAfter]),y!=null&&y.math&&(ne=[...ne,y.math.remarkPlugin]),ne},[o,y?.math,y?.cjk,F]),_t=b.useMemo(()=>{var ne;let v=s;if(O&&Object.keys(O).length>0&&s===Uu){let j={...Pr,tagNames:[...(ne=Pr.tagNames)!=null?ne:[],...Object.keys(O)],attributes:{...Pr.attributes,...O}};v=[Aa.raw,[Xl,j],Aa.harden]}return I&&I.length>0&&(v=[...v,[$C,I]]),y!=null&&y.math&&(v=[...v,y.math.rehypePlugin]),n==="auto"&&t==="static"&&(v=[...v,zC]),v},[s,y?.math,O,I,n,t]),xr=b.useMemo(()=>S&&p?{"--streamdown-caret":`"${i_[S]}"`}:void 0,[S,p]),mi=b.useMemo(()=>{if(!p||te.length===0)return!1;let ne=te.at(-1);return _u(ne)||cC(ne)},[p,te]),{containerRef:gi,showCaret:bi}=ZC(mi),Ei=ne=>{let v=null;if(oe.current&&p){if(!Se.current[ne]){let J=Y&&Y!=="true"?k:{},{maxBacklogMs:ee,...Ee}=J;Se.current[ne]=s3({...Ee,timeline:oe.current})}v=Se.current[ne]}Ke.current!==_t&&(be.current=[],Ke.current=_t),v&&!be.current[ne]&&(be.current[ne]=[..._t,v.rehypePlugin]);let j=v&&be.current[ne]?be.current[ne]:_t;return{blockAnimatePlugin:v,blockRehypePlugins:j}};return t==="static"?f.jsx(Ea.Provider,{value:yn,children:f.jsx(xa.Provider,{value:y??null,children:f.jsx(ve.Provider,{value:br,children:f.jsx(Eu,{icons:W,children:f.jsx(ba.Provider,{value:T,children:f.jsx("div",{...he,className:T("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",u),dir:n==="auto"?void 0:n,children:f.jsx(mh,{components:An,rehypePlugins:_t,remarkPlugins:Tr,...Z,children:ge})})})})})})}):f.jsx(Ea.Provider,{value:yn,children:f.jsx(xa.Provider,{value:y??null,children:f.jsx(ve.Provider,{value:br,children:f.jsx(Eu,{icons:W,children:f.jsx(ba.Provider,{value:T,children:f.jsxs("div",{...he,className:T("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",S&&bi?"[&>*:last-child:not([data-sd-caret-hidden])]:after:inline [&>*:last-child:not([data-sd-caret-hidden])]:after:align-baseline [&>*:last-child:not([data-sd-caret-hidden])]:after:content-[var(--streamdown-caret)]":null,u),ref:gi,style:xr,children:[te.length===0&&S&&p&&f.jsx("span",{}),te.map((ne,v)=>{var j;let J=v===te.length-1,ee=p&&J&&_u(ne),{blockAnimatePlugin:Ee,blockRehypePlugins:fe}=Ei(v);return f.jsx(C,{animatePlugin:Ee,components:An,content:ne,dir:(j=we?.[v])!=null?j:n!=="auto"?n:void 0,index:v,isIncomplete:ee,rehypePlugins:fe,remarkPlugins:Tr,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...Z},De[v])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&e.disableAutolinkProtocols===t.disableAutolinkProtocols&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir&&e.fallbackComponent===t.fallbackComponent&&s_(e,t));Sh.displayName="Streamdown";var Pn=e=>e>0?e:null,o_=(e,t)=>{if(e.endsWith("px"))return Pn(Number.parseFloat(e));if(e.endsWith("rem")){let n=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");return Pn(Number.parseFloat(e)*n)}if(e.endsWith("em")){let n=Number.parseFloat(getComputedStyle(t).fontSize||"16");return Pn(Number.parseFloat(e)*n)}if(e.endsWith("vh"))return Pn(Number.parseFloat(e)/100*window.innerHeight);if(e.endsWith("%")){let n=t.parentElement;return n&&n.clientHeight>0?Pn(Number.parseFloat(e)/100*n.clientHeight):null}return null},Yi=(e,t)=>{let n=t.trim().toLowerCase();return!n||n==="none"||n==="auto"?null:o_(n,e)},u_=/^min\(\s*([^,]+)\s*,\s*([^)]+)\s*\)$/i,l_=(e,t)=>{let n=Yi(e,t);if(n!=null)return n;let r=t.trim().match(u_);if(!r)return null;let i=Yi(e,r[1].trim()),a=Yi(e,r[2].trim());return i==null||a==null?null:Math.min(i,a)},c_=(e,t,n)=>{let r=t.clientWidth;if(!(r>0))return null;if(n){let d=t.clientHeight;if(!(d>0))return null;let h=Math.min(r/e.width,d/e.height,1);return!(h>0)||Number.isNaN(h)?null:{fitZoom:h,viewportHeight:null}}let i=Math.min(r/e.width,1);if(!(i>0)||Number.isNaN(i))return null;let a=e.height*i,s=null,o=t;for(;o&&s==null;){let d=getComputedStyle(o);s=l_(o,d.maxHeight),o=o.parentElement}let u=s!=null?Math.min(a,s):a,l=Math.min(i,u/e.height,1);return!(l>0)||Number.isNaN(l)?null:{fitZoom:l,viewportHeight:u}},d_=({children:e,className:t,contentSize:n,fitKey:r,minZoom:i=.5,maxZoom:a=3,zoomStep:s=.1,showControls:o=!0,initialZoom:u=1,isAutoFit:l=!1,fullscreen:d=!1})=>{let{RotateCcwIcon:h,ZoomInIcon:m,ZoomOutIcon:p}=dt(),g=de(),k=ht(),C=b.useRef(null),A=b.useRef(null),S=b.useRef(!1),[y,D]=b.useState(u),[M,L]=b.useState(i),[P,O]=b.useState(u),[q,I]=b.useState({x:0,y:0}),[F,$]=b.useState(!1),[W,G]=b.useState({x:0,y:0}),[U,Q]=b.useState({x:0,y:0}),[Z,ae]=b.useState(null),he=b.useCallback(Y=>{let oe=C.current;if(!oe)return;let Se=c_(Y,oe,d);if(!Se)return;let{fitZoom:be,viewportHeight:Ke}=Se;ae(Ke),D(be),L(Math.min(i,be)),S.current||(O(be),I({x:0,y:0}))},[d,i]),T=b.useCallback(Y=>{O(oe=>Math.max(M,Math.min(a,oe+Y))),S.current=!0},[M,a]),Ne=b.useCallback(()=>{T(s)},[T,s]),_e=b.useCallback(()=>{T(-s)},[T,s]),N=b.useCallback(()=>{O(y),I({x:0,y:0}),S.current=!1},[y]),me=b.useCallback(Y=>{Y.preventDefault();let oe=Y.deltaY>0?-s:s;T(oe)},[T,s]),ge=b.useCallback(Y=>{if(Y.button!==0||Y.isPrimary===!1)return;$(!0),S.current=!0,G({x:Y.clientX,y:Y.clientY}),Q(q);let oe=Y.currentTarget;oe instanceof HTMLElement&&oe.setPointerCapture(Y.pointerId)},[q]),te=b.useCallback(Y=>{if(!F)return;Y.preventDefault();let oe=Y.clientX-W.x,Se=Y.clientY-W.y;I({x:U.x+oe,y:U.y+Se})},[F,W,U]),we=b.useCallback(Y=>{$(!1);let oe=Y.currentTarget;oe instanceof HTMLElement&&oe.releasePointerCapture(Y.pointerId)},[]);b.useEffect(()=>{L(i),l||(D(u),O(u),ae(null))},[u,l,i]),b.useLayoutEffect(()=>{if(!(l&&n))return;he(n);let Y=C.current;if(!Y||typeof ResizeObserver>"u")return;let oe=new ResizeObserver(()=>{he(n)});return oe.observe(Y),()=>{oe.disconnect()}},[he,n,l]),b.useEffect(()=>{l&&(S.current=!1)},[r,l]),b.useEffect(()=>{let Y=C.current;if(Y)return Y.addEventListener("wheel",me,{passive:!1}),()=>{Y.removeEventListener("wheel",me)}},[me]),b.useEffect(()=>{let Y=A.current;if(Y&&F)return document.body.style.userSelect="none",Y.addEventListener("pointermove",te,{passive:!1}),Y.addEventListener("pointerup",we),Y.addEventListener("pointercancel",we),()=>{document.body.style.userSelect="",Y.removeEventListener("pointermove",te),Y.removeEventListener("pointerup",we),Y.removeEventListener("pointercancel",we)}},[F,te,we]);let De=!d&&l&&Z!=null?{height:Z}:void 0;return f.jsxs("div",{className:g("relative flex flex-col",d?"h-full w-full":"min-h-28 w-full",t),ref:C,style:{cursor:F?"grabbing":"grab",...De},children:[o?f.jsxs("div",{className:g("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",d?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{"aria-label":k.zoomIn,className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:P>=a,onClick:Ne,title:k.zoomIn,type:"button",children:f.jsx(m,{"aria-hidden":"true",size:16})}),f.jsx("button",{"aria-label":k.zoomOut,className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:P<=M,onClick:_e,title:k.zoomOut,type:"button",children:f.jsx(p,{"aria-hidden":"true",size:16})}),f.jsx("button",{"aria-label":k.resetView,className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:N,title:k.resetView,type:"button",children:f.jsx(h,{"aria-hidden":"true",size:16})})]}):null,f.jsx("div",{className:g("flex h-full w-full flex-1 origin-center items-center justify-center transition-transform duration-150 ease-out"),onPointerDown:ge,ref:A,role:"application",style:{transform:`translate(${q.x}px, ${q.y}px) scale(${P})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},h_=(e,t)=>new Promise(n=>{let r=setTimeout(n,e);t(()=>{clearTimeout(r),n()})}),f_=async(e,{chart:t,config:n},r,i)=>{try{let a=e.getMermaid(n),s=t.split("").reduce((d,h)=>(d<<5)-d+h.charCodeAt(0)|0,0),o=`mermaid-${Math.abs(s)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:u}=await a.render(o,t),l=Bd(u);return{ok:!0,svg:r?u:q3(u),size:l}}catch(a){return{ok:!1,error:a instanceof Error?a.message:i}}},Nh=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=de(),[s,o]=b.useState(null),[u,l]=b.useState(!1),[d,h]=b.useState(""),[m,p]=b.useState(null),g=ht(),[k,C]=b.useState(""),[A,S]=b.useState(0),{mermaid:y}=b.useContext(ve),D=ys(),M=y?.errorComponent,{shouldRender:L,containerRef:P}=zA({immediate:r}),O=b.useRef(null),q=b.useRef(!1),I=b.useRef(!1),F=wd(),$=b.useRef(F),W=b.useRef(null);b.useEffect(()=>(I.current=!0,()=>{var Q;I.current=!1,(Q=W.current)==null||Q.call(W)}),[]),b.useEffect(()=>{var Q;$.current=F,F||(Q=W.current)==null||Q.call(W)},[F]);let G=async Q=>{$.current&&(await h_(Q,Z=>{W.current=Z}),W.current=null)};if(b.useEffect(()=>{if(!L)return;if(!D){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}if(O.current={chart:e,config:n},q.current)return;let Q=(Z,ae)=>{ae.ok?(h(ae.svg),p(ae.size),C(ae.svg)):Z===O.current&&o(ae.error)};(async()=>{q.current=!0,o(null),l(!0);try{let Z=O.current;for(;Z;){let ae=performance.now(),he=await f_(D,Z,r,g.errorMermaid);if(!I.current||(Q(Z,he),he.ok&&await G(performance.now()-ae),!I.current||Z===O.current))return;Z=O.current}}finally{q.current=!1,I.current&&l(!1)}})()},[e,n,A,L,D]),!(L||d||k))return f.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:P});if(u&&!d&&!k)return f.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:P,children:f.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(s&&!d&&!k){let Q=()=>S(Z=>Z+1);return M?f.jsx("div",{ref:P,children:f.jsx(M,{chart:e,error:s,retry:Q})}):f.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:P,children:[f.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",s]}),f.jsxs("details",{className:a("mt-2"),children:[f.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let U=d||k;return f.jsx("div",{className:a(r?"size-full":"max-h-[min(70vh,40rem)] w-full",t),"data-streamdown":"mermaid",ref:P,children:f.jsx(d_,{className:a(r?"size-full overflow-hidden":"max-h-[min(70vh,40rem)] overflow-hidden",t),contentSize:m,fitKey:e,fullscreen:r,isAutoFit:!0,maxZoom:3,minZoom:.1,showControls:i,zoomStep:.1,children:f.jsx("div",{"aria-label":g.mermaidAriaLabel,className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:U},role:"img"})})})};function p_(e){if(!e)return"";let t=e;return t.includes("\\n")&&!t.includes(`
286
+ ${h}`,i=e.length;break}return i===0?e:r+e.slice(i)},FC=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,o,u)=>MC(s,o,u)),n=BC(n,r)}return n},HC=/([\\`*_~[\]|])/g,jC=e=>e.replace(HC,"\\$1"),UC=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,o,u)=>{let l=jC(o).replace(/\n\n/g,"&#10;&#10;");return s+l+u})}return n},qC=new Set(["blockquote","dd","dt","figcaption","h1","h2","h3","h4","h5","h6","li","p","td","th"]),xh=new Set(["code","kbd","pre","samp","var"]);function kh(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"&&!xh.has(t.tagName)?kh(t):"").join("")}function zC(){return e=>{it(e,"element",t=>{if(xh.has(t.tagName)){t.properties!=null||(t.properties={}),t.properties.dir="ltr";return}qC.has(t.tagName)&&(t.properties!=null||(t.properties={}),typeof t.properties.dir!="string"&&(t.properties.dir=ph(kh(t))))})}}var yh=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(yh).join(""):"",$C=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));it(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=yh(r);r.children=i?[{type:"text",value:i}]:[]}})},VC=()=>e=>{it(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},YC=/^([a-zA-Z][a-zA-Z\d+\-.]*:)/,GC=e=>new Set(e.map(t=>t.trim().toLowerCase()).filter(t=>t.length>0).map(t=>t.endsWith(":")?t:`${t}:`));function WC(e,t,n){var r,i;let a=(i=(r=e.position)==null?void 0:r.start)==null?void 0:i.offset;if(typeof a=="number"&&n.charCodeAt(a)===91||e.children.length!==1)return!1;let[s]=e.children;if(s.type!=="text")return!1;let o=YC.exec(e.url);if(!o)return!1;let u=o[1].toLowerCase();return t.has(u)?u==="mailto:"?e.url===`mailto:${s.value}`:e.url===s.value||e.url===`${u}//${s.value}`:!1}var QC=(e=[])=>{let t=GC(e);return(n,r)=>{var i;if(t.size===0)return;let a=String((i=r.value)!=null?i:"");it(n,"link",(s,o,u)=>{if(!(!u||o===void 0)&&WC(s,t,a))return u.children.splice(o,1,...s.children),o})}},Ou="data-sd-caret-hidden",KC=()=>{},XC=()=>KC,ZC=e=>{let t=b.useRef(null),n=b.useRef(null),r=b.useSyncExternalStore(XC,()=>!0,()=>!1);return b.useLayoutEffect(()=>{var i,a;let s=e&&(a=(i=t.current)==null?void 0:i.lastElementChild)!=null?a:null,o=n.current;o!==s&&(o?.removeAttribute(Ou),s?.setAttribute(Ou,""),n.current=s)}),{containerRef:t,showCaret:r||!e}},Du=/^[a-z]/,JC=/^[ \t]*<[\w!/?-]/,e_=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,t_=e=>typeof e!="string"||e.length===0||!JC.test(e)?e:e.replace(e_,"$1"),Pu,Mu,Bu,Fu,Hu,ju,Pr={...Rt,clobberPrefix:"",protocols:{...Rt.protocols,href:[...(Mu=(Pu=Rt.protocols)==null?void 0:Pu.href)!=null?Mu:[],"tel","streamdown"],src:[...(Fu=(Bu=Rt.protocols)==null?void 0:Bu.src)!=null?Fu:[],"streamdown"]},attributes:{...Rt.attributes,code:[...(ju=(Hu=Rt.attributes)==null?void 0:Hu.code)!=null?ju:[],"metastring"]}},Aa={raw:na,sanitize:[Xl,Pr],harden:[Sf,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},n_={gfm:[QE,{}],codeMeta:VC},Uu=Object.values(Aa),r_=Object.values(n_),i_={block:" ▋",circle:" ●"},Ah=["github-light","github-dark"],Ch={enabled:!0},a_={codeBlockMaxHeight:400,shikiTheme:Ah,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:Ch,portal:void 0,tableMaxHeight:300},ve=b.createContext(a_),_h=b.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:s,...o})=>{b.useLayoutEffect(()=>{s?.commit()});let u=typeof e=="string"&&n?t_(e):e,l=f.jsx(mh,{...o,children:u});return f.jsx(Nd.Provider,{value:i,children:a?f.jsx("div",{dir:a,style:{display:"contents"},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins||!!e.animatePlugin!=!!t.animatePlugin)});_h.displayName="Block";var Ca=e=>{let t={};for(let[n,r]of Object.entries(e))(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=r);return t},s_=(e,t)=>{let n=Ca(e),r=Ca(t),i=Object.keys(n);return i.length===Object.keys(r).length&&i.every(a=>Object.hasOwn(r,a)&&n[a]===r[a])},Sh=b.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:s=Uu,remarkPlugins:o=r_,className:u,shikiTheme:l,mermaid:d,codeBlockMaxHeight:h=400,controls:m=!0,isAnimating:p=!1,tableMaxHeight:g=300,animated:k,BlockComponent:C=_h,parseMarkdownIntoBlocksFn:A=OC,caret:S,plugins:y,remend:D,linkSafety:M=Ch,portal:L,lineNumbers:P=!0,allowedTags:O,fallbackComponent:U,literalTagContent:I,disableAutolinkProtocols:F,translations:$,icons:W,prefix:G,onAnimationStart:q,onAnimationEnd:Q,...Z})=>{let ae=b.useId(),he=Ca(Z),T=b.useMemo(()=>u3(G),[G]),Ne=b.useRef(null),_e=b.useRef(q),N=b.useRef(Q);_e.current=q,N.current=Q,b.useEffect(()=>{var ne,v,j;if(t==="static")return;let J=Ne.current;if(Ne.current=p,J===null){p&&((ne=_e.current)==null||ne.call(_e));return}p&&!J?(v=_e.current)==null||v.call(_e):!p&&J&&((j=N.current)==null||j.call(N))},[p,t]);let me=b.useMemo(()=>O?Object.keys(O):[],[O]),ge=b.useMemo(()=>{if(typeof e!="string")return"";let ne=t==="streaming"&&r?Px(e,D):e;return I&&I.length>0&&(ne=UC(ne,I)),me.length>0&&(ne=FC(ne,me)),ne},[e,t,r,D,me,I]),te=b.useMemo(()=>A(ge),[ge,A]),we=b.useMemo(()=>n==="auto"?te.map(ph):void 0,[te,n]),De=b.useMemo(()=>te.map((ne,v)=>`${ae}-${v}`),[te.length,ae]),Y=b.useMemo(()=>k===!0?"true":k?JSON.stringify(k):"",[k]),oe=b.useRef(null),Se=b.useRef([]),be=b.useRef([]),Ke=b.useRef(null),ft=b.useRef("");if(Y){if(ft.current!==Y){ft.current=Y;let ne=Y!=="true"?k.maxBacklogMs:void 0;oe.current=mu({maxBacklogMs:ne}),Se.current=[],be.current=[]}else oe.current||(oe.current=mu());p&&oe.current&&oe.current.beginPass(oe.current.now())}else oe.current=null,Se.current=[],be.current=[],ft.current="";b.useLayoutEffect(()=>{var ne;p&&((ne=oe.current)==null||ne.commitPass())});let br=b.useMemo(()=>{var ne,v;return{codeBlockMaxHeight:h,shikiTheme:(v=l??((ne=y?.code)==null?void 0:ne.getThemes()))!=null?v:Ah,controls:m,isAnimating:p,lineNumbers:P,mode:t,mermaid:d,linkSafety:M,portal:L,tableMaxHeight:g}},[h,l,m,p,P,t,d,M,L,y?.code,g]),Er=b.useMemo(()=>$?JSON.stringify($):"",[$]),yn=b.useMemo(()=>({...Pd,...$}),[Er]),An=b.useMemo(()=>{let{inlineCode:ne,...v}=a??{},j={...aC,...v};if(ne){let J=j.code;j.code=ee=>"data-block"in ee?J?b.createElement(J,ee):null:b.createElement(ne,ee)}if(U){if(O)for(let ee of Object.keys(O))Object.hasOwn(j,ee)||(j[ee]=U);let J={configurable:!0,enumerable:!1,value:U,writable:!1};return new Proxy(j,{getOwnPropertyDescriptor(ee,Ee){let fe=Object.getOwnPropertyDescriptor(ee,Ee);if(fe)return fe;if(typeof Ee=="string"&&Du.test(Ee))return J},get(ee,Ee,fe){return typeof Ee=="string"&&Du.test(Ee)&&!Object.hasOwn(ee,Ee)?U:Reflect.get(ee,Ee,fe)}})}return j},[a,U,O]),Tr=b.useMemo(()=>{let ne=[];return y!=null&&y.cjk&&(ne=[...ne,...y.cjk.remarkPluginsBefore]),ne=[...ne,...o],F&&F.length>0&&(ne=[...ne,[QC,F]]),y!=null&&y.cjk&&(ne=[...ne,...y.cjk.remarkPluginsAfter]),y!=null&&y.math&&(ne=[...ne,y.math.remarkPlugin]),ne},[o,y?.math,y?.cjk,F]),_t=b.useMemo(()=>{var ne;let v=s;if(O&&Object.keys(O).length>0&&s===Uu){let j={...Pr,tagNames:[...(ne=Pr.tagNames)!=null?ne:[],...Object.keys(O)],attributes:{...Pr.attributes,...O}};v=[Aa.raw,[Xl,j],Aa.harden]}return I&&I.length>0&&(v=[...v,[$C,I]]),y!=null&&y.math&&(v=[...v,y.math.rehypePlugin]),n==="auto"&&t==="static"&&(v=[...v,zC]),v},[s,y?.math,O,I,n,t]),xr=b.useMemo(()=>S&&p?{"--streamdown-caret":`"${i_[S]}"`}:void 0,[S,p]),mi=b.useMemo(()=>{if(!p||te.length===0)return!1;let ne=te.at(-1);return _u(ne)||cC(ne)},[p,te]),{containerRef:gi,showCaret:bi}=ZC(mi),Ei=ne=>{let v=null;if(oe.current&&p){if(!Se.current[ne]){let J=Y&&Y!=="true"?k:{},{maxBacklogMs:ee,...Ee}=J;Se.current[ne]=s3({...Ee,timeline:oe.current})}v=Se.current[ne]}Ke.current!==_t&&(be.current=[],Ke.current=_t),v&&!be.current[ne]&&(be.current[ne]=[..._t,v.rehypePlugin]);let j=v&&be.current[ne]?be.current[ne]:_t;return{blockAnimatePlugin:v,blockRehypePlugins:j}};return t==="static"?f.jsx(Ea.Provider,{value:yn,children:f.jsx(xa.Provider,{value:y??null,children:f.jsx(ve.Provider,{value:br,children:f.jsx(Eu,{icons:W,children:f.jsx(ba.Provider,{value:T,children:f.jsx("div",{...he,className:T("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",u),dir:n==="auto"?void 0:n,children:f.jsx(mh,{components:An,rehypePlugins:_t,remarkPlugins:Tr,...Z,children:ge})})})})})})}):f.jsx(Ea.Provider,{value:yn,children:f.jsx(xa.Provider,{value:y??null,children:f.jsx(ve.Provider,{value:br,children:f.jsx(Eu,{icons:W,children:f.jsx(ba.Provider,{value:T,children:f.jsxs("div",{...he,className:T("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",S&&bi?"[&>*:last-child:not([data-sd-caret-hidden])]:after:inline [&>*:last-child:not([data-sd-caret-hidden])]:after:align-baseline [&>*:last-child:not([data-sd-caret-hidden])]:after:content-[var(--streamdown-caret)]":null,u),ref:gi,style:xr,children:[te.length===0&&S&&p&&f.jsx("span",{}),te.map((ne,v)=>{var j;let J=v===te.length-1,ee=p&&J&&_u(ne),{blockAnimatePlugin:Ee,blockRehypePlugins:fe}=Ei(v);return f.jsx(C,{animatePlugin:Ee,components:An,content:ne,dir:(j=we?.[v])!=null?j:n!=="auto"?n:void 0,index:v,isIncomplete:ee,rehypePlugins:fe,remarkPlugins:Tr,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...Z},De[v])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&e.disableAutolinkProtocols===t.disableAutolinkProtocols&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir&&e.fallbackComponent===t.fallbackComponent&&s_(e,t));Sh.displayName="Streamdown";var Pn=e=>e>0?e:null,o_=(e,t)=>{if(e.endsWith("px"))return Pn(Number.parseFloat(e));if(e.endsWith("rem")){let n=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");return Pn(Number.parseFloat(e)*n)}if(e.endsWith("em")){let n=Number.parseFloat(getComputedStyle(t).fontSize||"16");return Pn(Number.parseFloat(e)*n)}if(e.endsWith("vh"))return Pn(Number.parseFloat(e)/100*window.innerHeight);if(e.endsWith("%")){let n=t.parentElement;return n&&n.clientHeight>0?Pn(Number.parseFloat(e)/100*n.clientHeight):null}return null},Yi=(e,t)=>{let n=t.trim().toLowerCase();return!n||n==="none"||n==="auto"?null:o_(n,e)},u_=/^min\(\s*([^,]+)\s*,\s*([^)]+)\s*\)$/i,l_=(e,t)=>{let n=Yi(e,t);if(n!=null)return n;let r=t.trim().match(u_);if(!r)return null;let i=Yi(e,r[1].trim()),a=Yi(e,r[2].trim());return i==null||a==null?null:Math.min(i,a)},c_=(e,t,n)=>{let r=t.clientWidth;if(!(r>0))return null;if(n){let d=t.clientHeight;if(!(d>0))return null;let h=Math.min(r/e.width,d/e.height,1);return!(h>0)||Number.isNaN(h)?null:{fitZoom:h,viewportHeight:null}}let i=Math.min(r/e.width,1);if(!(i>0)||Number.isNaN(i))return null;let a=e.height*i,s=null,o=t;for(;o&&s==null;){let d=getComputedStyle(o);s=l_(o,d.maxHeight),o=o.parentElement}let u=s!=null?Math.min(a,s):a,l=Math.min(i,u/e.height,1);return!(l>0)||Number.isNaN(l)?null:{fitZoom:l,viewportHeight:u}},d_=({children:e,className:t,contentSize:n,fitKey:r,minZoom:i=.5,maxZoom:a=3,zoomStep:s=.1,showControls:o=!0,initialZoom:u=1,isAutoFit:l=!1,fullscreen:d=!1})=>{let{RotateCcwIcon:h,ZoomInIcon:m,ZoomOutIcon:p}=dt(),g=de(),k=ht(),C=b.useRef(null),A=b.useRef(null),S=b.useRef(!1),[y,D]=b.useState(u),[M,L]=b.useState(i),[P,O]=b.useState(u),[U,I]=b.useState({x:0,y:0}),[F,$]=b.useState(!1),[W,G]=b.useState({x:0,y:0}),[q,Q]=b.useState({x:0,y:0}),[Z,ae]=b.useState(null),he=b.useCallback(Y=>{let oe=C.current;if(!oe)return;let Se=c_(Y,oe,d);if(!Se)return;let{fitZoom:be,viewportHeight:Ke}=Se;ae(Ke),D(be),L(Math.min(i,be)),S.current||(O(be),I({x:0,y:0}))},[d,i]),T=b.useCallback(Y=>{O(oe=>Math.max(M,Math.min(a,oe+Y))),S.current=!0},[M,a]),Ne=b.useCallback(()=>{T(s)},[T,s]),_e=b.useCallback(()=>{T(-s)},[T,s]),N=b.useCallback(()=>{O(y),I({x:0,y:0}),S.current=!1},[y]),me=b.useCallback(Y=>{Y.preventDefault();let oe=Y.deltaY>0?-s:s;T(oe)},[T,s]),ge=b.useCallback(Y=>{if(Y.button!==0||Y.isPrimary===!1)return;$(!0),S.current=!0,G({x:Y.clientX,y:Y.clientY}),Q(U);let oe=Y.currentTarget;oe instanceof HTMLElement&&oe.setPointerCapture(Y.pointerId)},[U]),te=b.useCallback(Y=>{if(!F)return;Y.preventDefault();let oe=Y.clientX-W.x,Se=Y.clientY-W.y;I({x:q.x+oe,y:q.y+Se})},[F,W,q]),we=b.useCallback(Y=>{$(!1);let oe=Y.currentTarget;oe instanceof HTMLElement&&oe.releasePointerCapture(Y.pointerId)},[]);b.useEffect(()=>{L(i),l||(D(u),O(u),ae(null))},[u,l,i]),b.useLayoutEffect(()=>{if(!(l&&n))return;he(n);let Y=C.current;if(!Y||typeof ResizeObserver>"u")return;let oe=new ResizeObserver(()=>{he(n)});return oe.observe(Y),()=>{oe.disconnect()}},[he,n,l]),b.useEffect(()=>{l&&(S.current=!1)},[r,l]),b.useEffect(()=>{let Y=C.current;if(Y)return Y.addEventListener("wheel",me,{passive:!1}),()=>{Y.removeEventListener("wheel",me)}},[me]),b.useEffect(()=>{let Y=A.current;if(Y&&F)return document.body.style.userSelect="none",Y.addEventListener("pointermove",te,{passive:!1}),Y.addEventListener("pointerup",we),Y.addEventListener("pointercancel",we),()=>{document.body.style.userSelect="",Y.removeEventListener("pointermove",te),Y.removeEventListener("pointerup",we),Y.removeEventListener("pointercancel",we)}},[F,te,we]);let De=!d&&l&&Z!=null?{height:Z}:void 0;return f.jsxs("div",{className:g("relative flex flex-col",d?"h-full w-full":"min-h-28 w-full",t),ref:C,style:{cursor:F?"grabbing":"grab",...De},children:[o?f.jsxs("div",{className:g("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",d?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{"aria-label":k.zoomIn,className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:P>=a,onClick:Ne,title:k.zoomIn,type:"button",children:f.jsx(m,{"aria-hidden":"true",size:16})}),f.jsx("button",{"aria-label":k.zoomOut,className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:P<=M,onClick:_e,title:k.zoomOut,type:"button",children:f.jsx(p,{"aria-hidden":"true",size:16})}),f.jsx("button",{"aria-label":k.resetView,className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:N,title:k.resetView,type:"button",children:f.jsx(h,{"aria-hidden":"true",size:16})})]}):null,f.jsx("div",{className:g("flex h-full w-full flex-1 origin-center items-center justify-center transition-transform duration-150 ease-out"),onPointerDown:ge,ref:A,role:"application",style:{transform:`translate(${U.x}px, ${U.y}px) scale(${P})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},h_=(e,t)=>new Promise(n=>{let r=setTimeout(n,e);t(()=>{clearTimeout(r),n()})}),f_=async(e,{chart:t,config:n},r,i)=>{try{let a=e.getMermaid(n),s=t.split("").reduce((d,h)=>(d<<5)-d+h.charCodeAt(0)|0,0),o=`mermaid-${Math.abs(s)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:u}=await a.render(o,t),l=Bd(u);return{ok:!0,svg:r?u:q3(u),size:l}}catch(a){return{ok:!1,error:a instanceof Error?a.message:i}}},Nh=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=de(),[s,o]=b.useState(null),[u,l]=b.useState(!1),[d,h]=b.useState(""),[m,p]=b.useState(null),g=ht(),[k,C]=b.useState(""),[A,S]=b.useState(0),{mermaid:y}=b.useContext(ve),D=ys(),M=y?.errorComponent,{shouldRender:L,containerRef:P}=zA({immediate:r}),O=b.useRef(null),U=b.useRef(!1),I=b.useRef(!1),F=wd(),$=b.useRef(F),W=b.useRef(null);b.useEffect(()=>(I.current=!0,()=>{var Q;I.current=!1,(Q=W.current)==null||Q.call(W)}),[]),b.useEffect(()=>{var Q;$.current=F,F||(Q=W.current)==null||Q.call(W)},[F]);let G=async Q=>{$.current&&(await h_(Q,Z=>{W.current=Z}),W.current=null)};if(b.useEffect(()=>{if(!L)return;if(!D){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}if(O.current={chart:e,config:n},U.current)return;let Q=(Z,ae)=>{ae.ok?(h(ae.svg),p(ae.size),C(ae.svg)):Z===O.current&&o(ae.error)};(async()=>{U.current=!0,o(null),l(!0);try{let Z=O.current;for(;Z;){let ae=performance.now(),he=await f_(D,Z,r,g.errorMermaid);if(!I.current||(Q(Z,he),he.ok&&await G(performance.now()-ae),!I.current||Z===O.current))return;Z=O.current}}finally{U.current=!1,I.current&&l(!1)}})()},[e,n,A,L,D]),!(L||d||k))return f.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:P});if(u&&!d&&!k)return f.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:P,children:f.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(s&&!d&&!k){let Q=()=>S(Z=>Z+1);return M?f.jsx("div",{ref:P,children:f.jsx(M,{chart:e,error:s,retry:Q})}):f.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:P,children:[f.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",s]}),f.jsxs("details",{className:a("mt-2"),children:[f.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let q=d||k;return f.jsx("div",{className:a(r?"size-full":"max-h-[min(70vh,40rem)] w-full",t),"data-streamdown":"mermaid",ref:P,children:f.jsx(d_,{className:a(r?"size-full overflow-hidden":"max-h-[min(70vh,40rem)] overflow-hidden",t),contentSize:m,fitKey:e,fullscreen:r,isAutoFit:!0,maxZoom:3,minZoom:.1,showControls:i,zoomStep:.1,children:f.jsx("div",{"aria-label":g.mermaidAriaLabel,className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:q},role:"img"})})})};function p_(e){if(!e)return"";let t=e;return t.includes("\\n")&&!t.includes(`
287
287
  `)&&(t=t.replace(/\\n/g,`
288
- `).replace(/\\r/g,"\r").replace(/\\t/g," ")),t=t.replace(/```([a-zA-Z0-9_-]+)[ \t]+([^\n`]+)/g,"```$1\n$2"),t}const qu={a:({href:e,children:t,target:n="_blank",rel:r="noopener noreferrer",node:i,...a})=>f.jsx("a",{href:e,target:n,rel:r,...a,children:t})};function m_({content:e,children:t,className:n="",isAnimating:r,mode:i,dir:a,lineNumbers:s=!1,codeBlockMaxHeight:o=320,animated:u=!0,controls:l={code:{copy:!0},table:{copy:!0}},linkSafety:d={enabled:!1},components:h,...m}){const p=(e!==void 0?e:t)||"";if(!p||!p.trim())return null;const g=p_(p),k=i??(r?"streaming":"static"),C=h?{...qu,...h}:qu;return f.jsx("div",{className:w.cx("rqmii-response",n),children:f.jsx(Sh,{mode:k,isAnimating:r,animated:u,dir:a,lineNumbers:s,codeBlockMaxHeight:o,controls:l,linkSafety:d,components:C,...m,children:g})})}const ci=b.memo(m_),g_=ci;function b_({role:e,from:t,variant:n="contained",dir:r,isPartial:i=!1,className:a="",children:s}){const o=t||e||"assistant",u=o==="user";return f.jsx("div",{className:w.cx("rqmii-chat-message-row","rqmii-message",u?"is-user rqmii-message--user":"rqmii-message--assistant",n==="flat"&&"rqmii-message--flat",i&&"is-partial",a),"data-role":o,dir:r,children:s})}const di=b.memo(b_),E_=di;function T_({variant:e="contained",dir:t,className:n="",children:r}){return f.jsx("div",{className:w.cx("rqmii-chat-message","rqmii-message-content",e==="flat"&&"rqmii-message-content--flat",n),dir:t,children:r})}const hi=b.memo(T_),x_=hi;function k_({agent:e,src:t,name:n,size:r="small",active:i=!1,className:a=""}){if(e)return f.jsx(w.RqmiiAgentAvatar,{agent:e,size:r,active:i,className:a});if(t)return f.jsx("div",{className:w.cx("rqmii-agent-avatar",`rqmii-agent-avatar--${r}`,i&&"is-active",a),children:f.jsx("img",{src:t,alt:n||"Avatar"})});if(n){const s=n.split(" ").map(o=>o[0]).slice(0,2).join("").toUpperCase();return f.jsx("div",{className:w.cx("rqmii-agent-avatar",`rqmii-agent-avatar--${r}`,"rqmii-avatar-fallback",a),children:f.jsx("span",{children:s})})}return null}const wh=b.memo(k_),y_=wh,_s=b.memo(function({language:t,languages:n,onChange:r}){const[i,a]=b.useState(!1),s=b.useRef(null),o=w.getChatLanguage(t),u=w.normalizeChatLanguages(n,t).map(l=>w.getChatLanguage(l)).filter(Boolean);return b.useEffect(()=>{if(!i)return;const l=d=>{const h=s.current;if(!h)return;(typeof d.composedPath=="function"?d.composedPath().includes(h):h.contains(d.target))||a(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[i]),f.jsxs("div",{className:"rqmii-chat-language",ref:s,children:[f.jsxs("button",{type:"button",className:"rqmii-chat-pill",onClick:()=>a(l=>!l),children:[f.jsx("span",{children:o?.label||t}),f.jsx(wa,{size:16})]}),i&&u.length>1&&f.jsx("div",{className:"rqmii-chat-language-menu",children:u.map(l=>f.jsx("button",{type:"button",className:w.cx("rqmii-chat-language-item",l.value===t&&"is-selected"),onClick:()=>{r(l.value),a(!1)},children:l.label},l.value))})]})}),Bt=b.memo(function({language:t="en",brand:n="rqmii",agent:r}){const i=r?.widget?.appearance,a=i?.show_branding!==!1,s=i?.footer_content?.[t],o=!!s?.trim();if(!a&&!o)return f.jsx("div",{style:{padding:11}});const u=w.getChatText(t,"poweredBy"),l=w.languageTextDirection(t),d=()=>{if(u.includes("{brand}")){const h=u.split("{brand}");return f.jsxs("p",{className:"rqmii-chat-footer-branding",dir:l,children:[h[0],f.jsx("strong",{children:n}),h[1]]})}return f.jsxs("p",{className:"rqmii-chat-footer-branding",dir:l,children:[u," ",f.jsx("strong",{children:n})]})};return f.jsxs("div",{className:"rqmii-chat-footer",dir:l,children:[a&&d(),o&&f.jsx("p",{dir:l,children:s})]})}),Ss=b.memo(function({language:t,placeholder:n,onSend:r,disabled:i=!1,variant:a="text",isVoiceEnabled:s=!1}){const[o,u]=b.useState(""),l=b.useRef(null),d=168;let h;try{h=Fe.useRqmiiAgentContext().sendActivity}catch{}const m=()=>{const g=o.trim();!g||i||(r(g),u(""),l.current&&(l.current.style.height="auto"))},p=s?w.getChatText(t,"orSendMessage"):w.getChatText(t,"sendMessage");return f.jsxs("div",{className:w.cx("rqmii-chat-input",w.languageFontClass(),a==="voice"&&"is-voice"),children:[f.jsx("textarea",{ref:l,value:o,disabled:i,rows:a==="compact"?2:3,dir:o.trim()?"auto":w.languageTextDirection(t),placeholder:n||p,onChange:g=>{u(g.target.value),h?.();const k=l.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,d)}px`)},onFocus:()=>{h?.()},onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),m())}}),f.jsx("button",{type:"button",onClick:m,disabled:!o.trim()||i,"aria-label":w.getChatText(t,"send"),children:f.jsx(Yu,{size:20})})]})});b.memo(function({text:t,streaming:n}){const r=w.useStreamingText(t,n);return f.jsx(f.Fragment,{children:r})});const _a=133,A_=_a+44,C_=767,Un=36,__=8,zu=Un+__;function S_(){return typeof window>"u"?_a:window.innerWidth<=C_?A_:_a}function N_(e){return e==="rtl"?"right":"left"}function w_(e,t,n,r){if(!e.length)return null;const i=Math.max(...e.map(s=>s.offsetTop)),a=e.filter(s=>s.offsetTop>=i-.5);return n==="right"?a.find(s=>s.offsetLeft+s.offsetWidth>t-r)||null:a.find(s=>s.offsetLeft<r)||null}function $u(e,t,n,r){for(let i=0;i<2;i++){const a=w_(e,t,n,r);if(!a)break;n==="right"?a.style.marginRight=`${r}px`:a.style.marginLeft=`${r}px`,a.style.maxWidth=`calc(100% - ${r}px)`}}const I_=b.memo(function({suggestions:t,language:n,onClick:r}){const[i,a]=b.useState(!1),[s,o]=b.useState(!1),[u,l]=b.useState(null),[d,h]=b.useState(null),m=b.useRef(null),p=b.useRef([]),g=w.languageTextDirection(n||"en"),k=N_(g),C=A=>{A.forEach(S=>{S&&(S.style.maxWidth="",S.style.marginRight="",S.style.marginLeft="")})};return b.useLayoutEffect(()=>{const A=m.current;if(!A||i)return;const S=()=>{const D=p.current;C(D);const M=A.clientWidth,L=S_(),P=()=>{for(let q=0;q<D.length;q++){const I=D[q];if(I&&I.offsetTop+I.offsetHeight>L+.5)return q}return null};let O=P();if(O!==null)for(let q=0;q<=D.length;q++){C(D);const I=D.slice(0,O).filter($=>!!$);$u(I,M,k,zu);const F=P();if(F===null||F>=O)break;O=F}if(l(O),o(O!==null),O!==null){const q=D.slice(0,O).filter(F=>!!F),I=q.length?Math.max(...q.map(F=>F.offsetTop+F.offsetHeight)):Un;h(I-Un)}else h(null)};S();const y=typeof ResizeObserver<"u"?new ResizeObserver(S):null;return y?.observe(A),()=>{y?.disconnect(),C(p.current)}},[t,i,k]),b.useLayoutEffect(()=>{const A=m.current;if(!A||!i)return;const S=p.current.filter(D=>!!D);C(p.current),$u(S,A.clientWidth,k,zu);const y=S.length?Math.max(...S.map(D=>D.offsetTop+D.offsetHeight)):Un;return h(y-Un),()=>{C(p.current)}},[i,t,k]),t.length?f.jsx("div",{className:w.cx("rqmii-suggested-messages",i&&"is-expanded",s&&"has-overflow"),dir:g,children:f.jsxs("div",{ref:m,className:w.cx("rqmii-suggested-messages-inner",i?"is-expanded":"is-collapsed"),children:[t.map((A,S)=>{const y=!i&&u!==null&&S>=u;return f.jsx("button",{ref:D=>{p.current[S]=D},type:"button",className:"rqmii-suggested-message",onClick:()=>r(A),style:y?{visibility:"hidden"}:void 0,"aria-hidden":y||void 0,tabIndex:y?-1:void 0,children:A},S)}),s&&f.jsx("button",{type:"button",className:w.cx("rqmii-suggested-messages-toggle",k==="left"&&"is-start-left"),style:d!=null?{top:d,bottom:"auto"}:void 0,onClick:()=>a(A=>(A&&m.current&&(m.current.scrollTop=0),!A)),"aria-label":i?"Show less":"Show more","aria-expanded":i,children:i?f.jsx(Xh,{size:14}):f.jsx(wa,{size:14})})]})}):null}),L_=b.memo(function({language:t}){const n=w.languageTextDirection(t||"en");return f.jsx("div",{className:"rqmii-chat-message-row",children:f.jsxs("div",{className:"rqmii-chat-message rqmii-chat-typing-indicator",dir:n,children:[f.jsx("span",{className:"rqmii-chat-typing-dot"}),f.jsx("span",{className:"rqmii-chat-typing-dot"}),f.jsx("span",{className:"rqmii-chat-typing-dot"})]})})});function R_(e){return e==="message"}const v_={name:"leadFormName",email:"leadFormEmail",phone:"leadFormPhone",message:"leadFormMessage"},O_=b.memo(function({messageId:t,form:n,language:r,textDirection:i,formSubmitted:a}){const s=Fe.useRqmiiAgentContext(),[o,u]=b.useState({}),[l,d]=b.useState(!1),[h,m]=b.useState(!!a),[p,g]=b.useState(null),k=n.title||w.getChatText(r,"leadFormTitle"),C=D=>{const M=v_[D.key?.toLowerCase()];return`${M?w.getChatText(r,M):D.label||D.key}${D.required?"*":""}`},A=(D,M)=>{u(L=>({...L,[D]:M})),s.sendActivity(),p&&g(null)},S=()=>{s.sendActivity()},y=async D=>{if(D.preventDefault(),l||h)return;if(n.fields.some(P=>P.required&&!o[P.key]?.trim())){g(w.getChatText(r,"leadFormRequiredError"));return}const L={};for(const P of n.fields){const O=o[P.key]?.trim();O&&(L[P.key]=O)}d(!0),g(null);try{await s.submitLead(L),m(!0),s.setMessages(s.messages.map(P=>P.id===t?{...P,formSubmitted:!0}:P))}catch(P){g(P instanceof Fe.LeadFormRejected?P.message:w.getChatText(r,"leadFormGenericError"))}finally{d(!1)}};return h?f.jsx("div",{className:"rqmii-chat-message-row rqmii-chat-lead-form-row",children:f.jsx("div",{className:"rqmii-chat-lead-form rqmii-chat-lead-form--done",dir:i,children:f.jsx("div",{className:"rqmii-chat-lead-form-success",children:w.getChatText(r,"leadFormSuccess")})})}):f.jsx("div",{className:"rqmii-chat-message-row rqmii-chat-lead-form-row",children:f.jsxs("form",{className:"rqmii-chat-lead-form",dir:i,onSubmit:y,children:[f.jsx("div",{className:"rqmii-chat-lead-form-title",children:k}),n.fields.map(D=>{const M=C(D),L=D.type==="email"?"email":D.type==="date"?"date":"text";return R_(D.key)?f.jsx("textarea",{className:"rqmii-chat-lead-form-input rqmii-chat-lead-form-textarea",placeholder:M,value:o[D.key]||"",onChange:P=>A(D.key,P.target.value),onFocus:S,disabled:l,rows:4},D.key):f.jsx("input",{className:"rqmii-chat-lead-form-input",type:L,placeholder:M,value:o[D.key]||"",onChange:P=>A(D.key,P.target.value),onFocus:S,disabled:l},D.key)}),p&&f.jsx("div",{className:"rqmii-chat-lead-form-error",children:p}),f.jsx("button",{type:"submit",className:"rqmii-chat-lead-form-submit",disabled:l,children:l?w.getChatText(r,"loading"):w.getChatText(r,"submit")})]})})}),D_=b.memo(function({message:t,textDirection:n,language:r}){if(t.role==="lead_form"&&t.form)return f.jsx(O_,{messageId:t.id,form:t.form,language:r,textDirection:n,formSubmitted:t.formSubmitted});const i=t.role==="user"||t.sender==="user";return f.jsx(di,{role:i?"user":t.role||"assistant",children:f.jsx(hi,{dir:"auto",children:i?t.text:f.jsx(ci,{content:t.text,isAnimating:!!t.streaming,mode:t.streaming?"streaming":"static",dir:"auto"})})})}),fi=b.memo(function({messages:t,partialTranscript:n,language:r,showTypingIndicator:i}){const a=b.useRef(null),s=w.languageTextDirection(r||"en"),o=b.useRef(t.length);return b.useEffect(()=>{if(!a.current)return;const u=t.length!==o.current;o.current=t.length,a.current.scrollIntoView({behavior:u?"smooth":"instant",block:"end"})},[t,n]),f.jsxs("div",{className:"rqmii-chat-messages",children:[t.map(u=>f.jsx(D_,{message:u,textDirection:s,language:r||"en"},u.id||`${u.role}-${u.text}`)),i&&f.jsx(L_,{language:r}),n&&f.jsx(di,{role:"user",isPartial:!0,children:f.jsx(hi,{dir:"auto",children:n})}),f.jsx("div",{ref:a})]})}),P_=b.memo(function({message:t,onRetry:n,onClose:r,language:i="en"}){return f.jsxs("div",{className:"rqmii-chat-panel rqmii-chat-panel--error",children:[r&&f.jsx("button",{type:"button",className:"rqmii-error-close",onClick:r,children:"×"}),f.jsx("p",{children:t||w.getChatText(i,"connectionFailed")}),n&&f.jsxs("button",{type:"button",className:"rqmii-chat-retry",onClick:n,children:[f.jsx(Wu,{size:16}),f.jsx("span",{children:w.getChatText(i,"retry")})]})]})}),M_=5;function Ih({rating:e,onRate:t,readonly:n,size:r=28}){const[i,a]=b.useState(0),s=i||e;return f.jsx("div",{className:"rqmii-chat-rating-stars",role:"radiogroup",children:Array.from({length:M_},(o,u)=>{const l=u+1,d=l<=s;return f.jsx("button",{type:"button",className:w.cx("rqmii-chat-star",d&&"is-filled",n&&"is-readonly"),disabled:n,"aria-label":`${l}`,"aria-checked":l===e,role:"radio",onMouseEnter:()=>!n&&a(l),onMouseLeave:()=>!n&&a(0),onClick:()=>!n&&t?.(l),children:f.jsx(pf,{size:r,fill:d?"currentColor":"none"})},l)})})}function Lh({language:e,rating:t,endedBy:n,endReason:r,sessionId:i,interactive:a,showTellUsMore:s,showRating:o=!0,showConversationId:u=!0,onRate:l,onTellUsMore:d}){const h=t>0?w.getChatText(e,"ratingThankYou"):w.getChatText(e,"ratingQuestion"),m=w.getChatText(e,w.endNoticeKey(r??(n==="user"?Fe.END_REASON.USER_ENDED:Fe.END_REASON.AGENT_ENDED)));return f.jsxs("div",{className:w.cx("rqmii-chat-rating",!o&&"rqmii-chat-rating--unrated",w.languageFontClass()),dir:w.languageTextDirection(e),children:[o&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"rqmii-chat-rating-header",children:h}),f.jsx(Ih,{rating:t,onRate:l,readonly:!a}),s&&f.jsx("button",{type:"button",className:"rqmii-chat-rating-more",onClick:d,children:w.getChatText(e,"tellUsMore")})]}),f.jsxs("div",{className:"rqmii-chat-rating-meta",children:[f.jsx("div",{children:m}),u&&i&&f.jsxs("div",{children:[w.getChatText(e,"sessionIdLabel")," ",f.jsx("span",{children:i})]})]})]})}function Ns({agent:e,language:t,rating:n,onBack:r,onMinimize:i,onSubmit:a}){const[s,o]=b.useState(""),[u,l]=b.useState(!1),d=s.trim().length>0&&!u,h=async()=>{if(d){l(!0);try{await a(s.trim())}finally{l(!1)}}},m=b.useMemo(()=>w.resolveWidgetThemeStyles(e.widget?.appearance),[e.widget?.appearance]);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--feedback",w.languageFontClass()),dir:w.languageTextDirection(t),style:m,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:r,"aria-label":"Back",children:f.jsx(Wh,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:i,"aria-label":w.getChatText(t,"minimize"),children:f.jsx(rr,{size:20})})]}),f.jsxs("div",{className:"rqmii-chat-feedback-body",children:[f.jsx(w.RqmiiAgentAvatar,{agent:e,size:"hero"}),f.jsx(Ih,{rating:n,readonly:!0}),f.jsx("div",{className:"rqmii-chat-feedback-title",children:w.getChatText(t,"ratingThankYou")}),f.jsx("div",{className:"rqmii-chat-feedback-subtitle",children:w.getChatText(t,"feedbackSubtitle")}),f.jsx("textarea",{className:"rqmii-chat-feedback-input",value:s,dir:w.languageTextDirection(t),placeholder:w.getChatText(t,"feedbackPlaceholder"),onChange:p=>o(p.target.value)}),f.jsx("div",{className:"rqmii-chat-feedback-actions",children:f.jsx("button",{type:"button",className:"rqmii-chat-feedback-submit",onClick:h,disabled:!d,children:u?f.jsx(rt,{className:"rqmii-chat-spin",size:18}):w.getChatText(t,"submit")})})]}),f.jsx(Bt,{language:t,agent:e})]})}function gr(e){if(!(e==null||typeof window>"u"||window.innerWidth>=768))return{top:`${window.innerHeight-e}px`,bottom:0}}const B_=b.memo(function({agent:t,language:n,languages:r,onLanguageChange:i,onClose:a,onSend:s,isVoiceEnabled:o=!1,isAudioPlaying:u=!1,isVoiceSetupLoading:l=!1,onStartVoice:d,visualViewportHeight:h,disabled:m=!1,connecting:p=!1,error:g,suggestions:k,onSuggestionClick:C,compact:A=!1}){const S=gr(h),[y,D]=b.useState(w.isMobileViewport);b.useEffect(()=>{const q=()=>D(w.isMobileViewport());return window.addEventListener("resize",q),()=>window.removeEventListener("resize",q)},[]);const M=A&&!y,L=M?"start":"hero",P=k&&k.length>0,O=w.languageTextDirection(n);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--start",M&&"rqmii-chat-panel--start-compact",w.languageFontClass()),style:S,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("span",{}),f.jsxs("div",{className:"rqmii-chat-topbar-actions",children:[f.jsx(_s,{language:n,languages:r,onChange:i}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:a,children:f.jsx(La,{size:20})})]})]}),f.jsxs("div",{className:"rqmii-chat-start-body",children:[o?f.jsxs("div",{className:w.cx("rqmii-chat-call-avatar-wrap",M&&"is-compact"),children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:L,active:u}),f.jsx("button",{type:"button",className:w.cx("rqmii-chat-call-button",M&&"is-compact"),onClick:d,disabled:l,"aria-label":w.getChatText(n,"startVoice"),children:l?f.jsx(rt,{className:"rqmii-chat-spin",size:M?18:24}):f.jsx(Ia,{size:M?18:24})})]}):f.jsx(w.RqmiiAgentAvatar,{agent:t,size:L}),f.jsx("div",{className:"rqmii-chat-agent-name",dir:O,children:o?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:w.getChatText(n,"call")})," ",f.jsx("bdi",{children:t.name})]}):f.jsx("bdi",{children:t.name})}),p&&!g&&!o&&f.jsx(H_,{language:n}),g&&f.jsx("div",{className:"rqmii-chat-error-text",children:g})]}),P&&f.jsx("div",{className:"rqmii-chat-start-suggestions",children:f.jsx(I_,{suggestions:k,language:n,onClick:q=>C?.(q)})}),f.jsx(Ss,{language:n,onSend:s,disabled:m,isVoiceEnabled:o}),f.jsx(Bt,{language:n,agent:t})]})}),F_=b.memo(function({agent:t,language:n,languages:r,onLanguageChange:i,onClose:a,onStartVoice:s,isVoiceSetupLoading:o=!1,isAudioPlaying:u,visualViewportHeight:l}){const d=gr(l),h=w.languageTextDirection(n);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--voice-start",w.languageFontClass()),style:d,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("span",{}),f.jsxs("div",{className:"rqmii-chat-topbar-actions",children:[f.jsx(_s,{language:n,languages:r,onChange:i}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:a,children:f.jsx(La,{size:20})})]})]}),f.jsxs("div",{className:"rqmii-chat-call-body",children:[f.jsxs("div",{className:"rqmii-chat-call-avatar-wrap",children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero",active:u}),f.jsx("button",{type:"button",className:"rqmii-chat-call-button",onClick:s,disabled:o,"aria-label":w.getChatText(n,"startVoice"),children:o?f.jsx(rt,{className:"rqmii-chat-spin",size:24}):f.jsx(Ia,{size:24})})]}),f.jsxs("div",{className:"rqmii-chat-agent-name",dir:h,children:[f.jsx("span",{children:w.getChatText(n,"call")})," ",f.jsx("bdi",{children:t.name})]})]}),f.jsx(Bt,{language:n,agent:t})]})});function H_({language:e}){return f.jsxs("div",{className:"rqmii-chat-start-status",role:"status",dir:w.languageTextDirection(e),children:[f.jsx(rt,{className:"rqmii-chat-spin",size:14}),f.jsx("span",{children:w.getChatText(e,"loading")})]})}const j_=b.memo(function({agent:t,language:n,onEndSession:r,onMinimize:i,messages:a,partialTranscript:s,onSend:o,isAudioPlaying:u,isVoiceEnabled:l,onToggleVoice:d,isListening:h,isSpeaking:m,isLoading:p,isAgentThinking:g,isAgentSpeaking:k,isFirstAgentSpeech:C,onStartVoice:A,elapsed:S,visualViewportHeight:y,waitingForResponse:D}){const M=w.canInterruptSpeech(t,n,!!C),L=Rh({canInterrupt:M,language:n,isListening:h,isLoading:p,isSpeaking:m,isAudioPlaying:u,isAgentThinking:g,isAgentSpeaking:k,persistentListening:!1}),P=pi({canInterrupt:M,isSpeaking:m,isAudioPlaying:u,isAgentSpeaking:k}),O=gr(y),q=t.widget?.appearance?.show_topbar_avatar_image!==!1;return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--conversation",w.languageFontClass()),style:O,children:[f.jsxs("div",{className:"rqmii-chat-header",children:[q&&f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"header",active:u}),l&&L&&f.jsx("div",{className:w.cx("rqmii-chat-header-status",!q&&"is-expanded"),children:f.jsx("span",{children:L})}),f.jsx("div",{className:"rqmii-chat-header-spacer"}),f.jsxs("div",{className:"rqmii-chat-header-actions",children:[i&&f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:i,"aria-label":w.getChatText(n,"minimize"),children:f.jsx(rr,{size:20})}),l&&f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button",P&&"is-active"),onClick:d,"aria-label":h?w.getChatText(n,"stopVoice"):w.getChatText(n,"startVoice"),children:h?f.jsx(Dt,{size:20}):f.jsx(nr,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button is-danger",onClick:r,"aria-label":w.getChatText(n,"endCall"),children:f.jsx(ir,{size:20})})]})]}),f.jsx(fi,{messages:a,partialTranscript:s,language:n,showTypingIndicator:D}),l&&f.jsx("div",{className:"rqmii-chat-session-counter",children:w.formatTime(S)}),f.jsx(Ss,{language:n,onSend:o,isVoiceEnabled:l}),f.jsx(Bt,{language:n,agent:t})]})}),U_=b.memo(function({agent:t,language:n,onEndSession:r,onMinimize:i,isListening:a,isLoading:s,isSpeaking:o,isAudioPlaying:u,isAgentThinking:l,isAgentSpeaking:d,isFirstAgentSpeech:h,onToggleVoice:m,elapsed:p,visualViewportHeight:g}){const k=w.canInterruptSpeech(t,n,!!h),C=Rh({canInterrupt:k,language:n,isListening:a,isLoading:s,isSpeaking:o,isAudioPlaying:u,isAgentThinking:l,isAgentSpeaking:d,persistentListening:!0}),A=pi({canInterrupt:k,isSpeaking:o,isAudioPlaying:u,isAgentSpeaking:d}),S=gr(g),y=w.languageTextDirection(n);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--voice-call",w.languageFontClass()),style:S,children:[f.jsxs("div",{className:"rqmii-chat-call-status",children:[f.jsx("span",{className:w.cx("rqmii-chat-live-dot",a&&"is-live")}),f.jsx("span",{children:w.formatTime(p)}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:i,children:f.jsx(rr,{size:20})})]}),f.jsxs("div",{className:"rqmii-chat-voice-frame",children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero",active:u}),f.jsx("div",{className:"rqmii-chat-agent-name",dir:y,children:f.jsx("bdi",{children:t.name})}),f.jsx("div",{className:w.cx("rqmii-chat-status-pill",!C&&"is-empty"),children:C||w.getChatText(n,"listening")}),f.jsxs("div",{className:"rqmii-chat-voice-actions",children:[f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button",A&&"is-active"),onClick:m,children:a?f.jsx(Dt,{size:20}):f.jsx(nr,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button is-danger",onClick:r,"aria-label":w.getChatText(n,"endCall"),children:f.jsx(ir,{size:20})})]})]}),f.jsx(Bt,{language:n,agent:t})]})});function Rh({canInterrupt:e,language:t,isListening:n,isLoading:r,isSpeaking:i,isAudioPlaying:a,isAgentThinking:s,isAgentSpeaking:o,persistentListening:u=!1}){return r?w.getChatText(t,"loading"):pi({canInterrupt:e,isSpeaking:i,isAudioPlaying:a,isAgentSpeaking:o})?w.getChatText(t,"listening"):a||o?w.getChatText(t,w.speakingTextKey(e)):s?w.getChatText(t,"processing"):n&&u?w.getChatText(t,"listening"):null}function pi({canInterrupt:e,isSpeaking:t,isAudioPlaying:n,isAgentSpeaking:r}){return t?e||!(n||r):!1}const q_=b.memo(function({agent:t,language:n,onRestore:r,onClose:i,isListening:a,isAudioPlaying:s,isSpeaking:o,isAgentSpeaking:u,isFirstAgentSpeech:l,onToggleVoice:d,elapsed:h,variant:m="voice"}){const p=m==="text",g=pi({canInterrupt:w.canInterruptSpeech(t,n,!!l),isSpeaking:o,isAudioPlaying:s,isAgentSpeaking:u});return f.jsxs("div",{className:w.cx("rqmii-chat-minimized",w.languageFontClass()),children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"minimized",active:s}),!p&&f.jsx("span",{className:"rqmii-chat-minimized-time",children:w.formatTime(h)}),f.jsxs("div",{className:"rqmii-chat-minimized-actions",children:[f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:r,"aria-label":w.getChatText(n,"maximize"),children:f.jsx(Gu,{size:20})}),!p&&f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button",g&&"is-active"),onClick:d,"aria-label":a?w.getChatText(n,"stopVoice"):w.getChatText(n,"startVoice"),children:a?f.jsx(Dt,{size:20}):f.jsx(nr,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button is-danger",onClick:i,"aria-label":w.getChatText(n,"endCall"),children:f.jsx(ir,{size:20})})]})]})}),ws=b.memo(function({agent:t,language:n,languages:r,chatKind:i,messages:a,onLanguageChange:s,onMinimize:o,onStartNewVoice:u,onStartNewText:l,isVoiceSetupLoading:d=!1,visualViewportHeight:h,rating:m,endedBy:p,endReason:g,startFailure:k,sessionId:C,ratingInteractive:A,showTellUsMore:S,onRate:y,onTellUsMore:D}){const M=gr(h),L=t.widget?.behavior?.conversation_ended_screen,P=!!L?.post_chat_rating_enabled,O=L?.show_conversation_id??!0,q=k==="busy",I=k==="unavailable",F=w.cx(q&&"is-busy",I&&"is-unavailable"),$=k?f.jsx(z_,{failure:k,language:n}):f.jsx(Lh,{language:n,rating:m,endedBy:p,endReason:g,sessionId:C,interactive:A,showTellUsMore:S,showRating:P,showConversationId:O,onRate:y,onTellUsMore:D}),W=w.isCallChatKind(i),G=W||i==="hybrid",U=i==="text"||i==="hybrid",Q=f.jsxs("div",{className:"rqmii-chat-topbar-actions rqmii-chat-topbar-actions--ended",children:[f.jsx(_s,{language:n,languages:r,onChange:s}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:o,"aria-label":w.getChatText(n,"minimize"),children:f.jsx(rr,{size:20})}),G&&f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button rqmii-chat-circle-button--call-start",I&&"is-unavailable"),onClick:u,disabled:d||I,"aria-label":w.getChatText(n,"startVoice"),children:d?f.jsx(rt,{className:"rqmii-chat-spin",size:20}):f.jsx(Ia,{size:20})})]});if(W)return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--voice-call",w.languageFontClass()),style:M,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("span",{}),Q]}),f.jsxs("div",{className:"rqmii-chat-voice-frame",children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero",className:F}),f.jsx("div",{className:w.cx("rqmii-chat-agent-name",I&&"is-muted"),dir:w.languageTextDirection(n),children:q?f.jsx($_,{name:t.name,language:n}):f.jsx("bdi",{children:t.name})}),$]}),f.jsx(Bt,{language:n,agent:t})]});const Z=t.widget?.appearance?.show_topbar_avatar_image!==!1;return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--conversation",w.languageFontClass()),style:M,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsxs("div",{className:"rqmii-chat-topbar-agent",children:[Z&&f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"header",className:F}),q&&f.jsx("span",{className:"rqmii-chat-busy-label",dir:w.languageTextDirection(n),children:w.getChatText(n,"agentBusyStatus")})]}),Q]}),k?f.jsx("div",{className:"rqmii-chat-start-failure-body",children:$}):f.jsxs(f.Fragment,{children:[f.jsx(fi,{messages:a,language:n}),$]}),U&&f.jsx(Ss,{language:n,onSend:l,disabled:I,isVoiceEnabled:i==="hybrid"}),f.jsx(Bt,{language:n,agent:t})]})});function z_({failure:e,language:t}){const n=e==="busy"?"agentBusyNotice":"agentUnavailableNotice";return f.jsx("div",{className:"rqmii-chat-start-failure",role:"status",dir:w.languageTextDirection(t),children:w.getChatText(t,n)})}function $_({name:e,language:t}){const[n,r=""]=w.getChatText(t,"agentBusyTitle").split("{name}");return f.jsxs(f.Fragment,{children:[n,f.jsx("bdi",{children:e}),r]})}function V_(e){return e.isAgentSpeaking?"speaking":e.isAgentThinking?"thinking":e.mic.isSpeaking?"listening":"idle"}const Y_={thinking:"processing",listening:"listening",idle:null},G_=10;function W_({activity:e,language:t,canInterrupt:n}){const r=e==="speaking"?w.speakingTextKey(n):Y_[e];return f.jsxs("div",{className:w.cx("rqmii-avatar-state",`is-${e}`),role:"status",children:[Array.from({length:G_},(i,a)=>f.jsx("span",{className:"rqmii-avatar-state-bar",style:{animationDelay:`${a*.1}s`}},a)),r&&f.jsx("span",{className:"rqmii-visually-hidden",dir:w.languageTextDirection(t),children:w.getChatText(t,r)})]})}function Q_({language:e}){const{isRecording:t,eventHandlers:n}=ze.useRqmiiPressToTalk();return f.jsx("button",{type:"button",className:w.cx("rqmii-avatar-mic","is-live",t&&"is-recording"),"aria-label":w.getChatText(e,"holdToTalk"),"aria-pressed":t,...n,children:f.jsx(Dt,{size:22})})}function K_({sdk:e,language:t}){if(e.pushToTalk)return f.jsx(Q_,{language:t});const n=e.mic.isListening;return f.jsx("button",{type:"button",className:w.cx("rqmii-avatar-mic",n&&"is-live",e.mic.isSpeaking&&"is-recording"),onClick:e.toggleVoice,disabled:e.mic.isLoading,"aria-label":w.getChatText(t,n?"stopVoice":"startVoice"),"aria-pressed":n,children:e.mic.isLoading?f.jsx(rt,{className:"rqmii-chat-spin",size:22}):n?f.jsx(Dt,{size:22}):f.jsx(nr,{size:22})})}function Mn({label:e,onClick:t,className:n,children:r}){return f.jsx("button",{type:"button",className:w.cx("rqmii-avatar-round",n),onClick:t,"aria-label":e,title:e,children:r})}function X_(e){return typeof e=="object"&&e&&typeof e.text=="string"?e.text:""}function Z_({sdk:e,language:t,onClose:n}){const[r,i]=b.useState(""),{sendActivity:a}=Fe.useRqmiiMessages(),s=d=>w.getChatText(t,d),o=e.isAgentThinking||e.isAgentSpeaking,u=d=>{d.preventDefault();const h=r.trim();h&&(e.sendTextMessage(h),i(""))},l=()=>{e.clearSessionHistory(),e.clearMessages()};return f.jsxs("aside",{className:"rqmii-avatar-chat","aria-label":s("chat"),children:[f.jsxs("header",{className:"rqmii-avatar-chat-header",children:[f.jsx("h2",{dir:w.languageTextDirection(t),children:s("chat")}),f.jsx("button",{type:"button",className:"rqmii-avatar-chat-icon",onClick:l,"aria-label":s("resetChat"),title:s("resetChat"),children:f.jsx(Wu,{size:18})}),f.jsx("button",{type:"button",className:"rqmii-avatar-chat-icon",onClick:n,"aria-label":s("closeChat"),title:s("closeChat"),children:f.jsx(La,{size:20})})]}),f.jsx(fi,{messages:e.messages,partialTranscript:X_(e.partialTranscript),language:t}),f.jsxs("form",{className:"rqmii-avatar-chat-input",onSubmit:u,children:[f.jsx("input",{type:"text",value:r,dir:r.trim()?"auto":w.languageTextDirection(t),placeholder:s("sendMessage"),onChange:d=>{i(d.target.value),a()}}),o?f.jsx("button",{type:"button",className:"is-interrupt",onClick:()=>e.interrupt?.(),"aria-label":s("interrupt"),title:s("interrupt"),children:f.jsx(hf,{size:16,fill:"currentColor"})}):f.jsx("button",{type:"submit",disabled:!r.trim(),"aria-label":s("send"),children:f.jsx(Yu,{size:20})})]})]})}const J_=2;function eS({track:e,onShowing:t}){const n=b.useRef(null);return b.useEffect(()=>{const r=n.current;if(!r||!e)return;const i=()=>t(!0);return r.addEventListener("loadeddata",i),e.attach(r),r.readyState>=J_&&i(),()=>{r.removeEventListener("loadeddata",i),e.detach(r),t(!1)}},[e,t]),f.jsx("video",{ref:n,className:"rqmii-avatar-video",autoPlay:!0,playsInline:!0,muted:!0})}function tS({agent:e,language:t}){return f.jsxs("div",{className:"rqmii-avatar-preparing",role:"status",children:[e.faceImage&&f.jsx("div",{className:"rqmii-avatar-preparing-backdrop",style:{backgroundImage:`url("${e.faceImage}")`}}),f.jsx(w.RqmiiAgentAvatar,{agent:e,size:"start"}),f.jsxs("span",{className:"rqmii-avatar-preparing-text",dir:w.languageTextDirection(t),children:[f.jsx(rt,{className:"rqmii-chat-spin",size:16}),w.getChatText(t,"preparingAvatar")]})]})}function nS(e,t,n){return n.some(i=>(i.role??i.sender)==="user")?[]:(e.widget?.behavior?.suggested_messages?.[t]||e.conversation?.suggested_messages?.[t]||[]).filter(i=>i.trim())}const rS=b.memo(function({agent:t,language:n,sdk:r,onEndSession:i,onMinimize:a,showMinimize:s=!1}){const{videoTrack:o}=ze.useRqmiiAvatar(),{isAudioMuted:u,setAudioMuted:l}=ze.useRqmiiVoice(),d=b.useRef(null),[h,m]=b.useState(!1),[p,g]=b.useState(!1),[k,C]=b.useState(!1);ze.useRqmiiAvatarViewport(d);const A=y=>w.getChatText(n,y),S=nS(t,n,r.messages);return f.jsxs(f.Fragment,{children:[k&&f.jsx("div",{className:"rqmii-avatar-dim",onClick:()=>C(!1),"aria-hidden":"true"}),f.jsxs("div",{className:w.cx("rqmii-avatar-call",p&&"is-chat-open",k&&"is-fullscreen",w.languageFontClass()),dir:"ltr",children:[f.jsxs("div",{ref:d,className:"rqmii-avatar-stage",children:[f.jsx(eS,{track:o,onShowing:m}),!h&&f.jsx(tS,{agent:t,language:n}),f.jsxs("div",{className:"rqmii-avatar-top",children:[f.jsx(Mn,{className:"rqmii-avatar-fullscreen",label:A(k?"exitFullScreen":"fullScreen"),onClick:()=>C(y=>!y),children:k?f.jsx(rr,{size:22}):f.jsx(Gu,{size:22})}),s&&f.jsx(Mn,{label:A("minimize"),onClick:a,children:f.jsx(wa,{size:22})}),f.jsx(Mn,{className:"is-danger",label:A("endCall"),onClick:i,children:f.jsx(ir,{size:22})})]}),S.length>0&&f.jsx("div",{className:"rqmii-avatar-suggestions",children:S.map(y=>f.jsx("button",{type:"button",dir:"auto",title:y,onClick:()=>r.sendTextMessage(y),children:y},y))}),f.jsxs("div",{className:"rqmii-avatar-bottom",children:[f.jsxs("div",{className:"rqmii-avatar-bottom-start",children:[f.jsx(Mn,{label:A(u?"unmuteSpeaker":"muteSpeaker"),onClick:()=>l(!u),children:u?f.jsx(Ef,{size:22}):f.jsx(gf,{size:22})}),f.jsxs("div",{className:"rqmii-avatar-talk",children:[f.jsx(K_,{sdk:r,language:n}),f.jsx(W_,{activity:V_(r),language:n,canInterrupt:w.canInterruptSpeech(t,n,!!r.isFirstAgentSpeech)})]})]}),f.jsx(Mn,{className:w.cx("rqmii-avatar-chat-toggle",p&&"is-open"),label:A(p?"closeChat":"openChat"),onClick:()=>g(y=>!y),children:f.jsx(tf,{size:22})})]})]}),p&&f.jsx(Z_,{sdk:r,language:n,onClose:()=>g(!1)})]})]})});function vh({content:e,children:t,className:n="",...r}){const i=(e!==void 0?e:t)||"";return!i||!i.trim()?null:f.jsx(ci,{className:`rqmii-markdown ${n}`.trim(),content:i,...r})}const Oh=b.memo(vh);function Dh({language:e,content:t,config:n,agent:r,onAccept:i,onDecline:a}){const s=t||n?.body?.[e]||w.getChatText(e,"consentBody")||"",o=n?.acceptLabel?.[e]||w.getChatText(e,"consentAccept"),u=n?.declineLabel?.[e]||w.getChatText(e,"consentDecline");return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--consent",w.languageFontClass()),dir:w.languageTextDirection(e),children:[f.jsx("div",{className:"rqmii-chat-consent-body",children:f.jsx(Oh,{content:s})}),f.jsxs("div",{className:"rqmii-chat-consent-actions",children:[f.jsx("button",{type:"button",className:"rqmii-chat-consent-button rqmii-chat-consent-button--decline",onClick:a,children:u}),f.jsx("button",{type:"button",className:"rqmii-chat-consent-button rqmii-chat-consent-button--accept",onClick:i,children:o})]})]})}function iS(e){return e?typeof e=="string"?e:typeof e=="object"&&typeof e.text=="string"?e.text:"":""}const Is=b.memo(function({agent:t,language:n,languages:r,onLanguageChange:i=w.noop,onEndSession:a=w.noop,onMinimize:s,messages:o,onSendMessage:u,isPreview:l=!1,chatKind:d,sdk:h,renderPanel:m,messagesRef:p,initialText:g,autoStartVoice:k}){const C=t.widget?.consent||t.consent,A=!!C?.enabled,S=C?.content?.[n]||C?.body?.[n]||"",y=C?.one_time!==!1,D=t.id?`rqmii_consent_${t.id}`:null,[M,L]=b.useState(()=>{if(!A||!S)return!0;if(y&&D&&typeof window<"u")try{return window.localStorage.getItem(D)==="true"}catch{return!1}return!1}),P=d||w.resolveChatKind(t),O=!l&&(!!g||!!k),q=P==="avatar"?!!h.isInRoom:h.isSessionReady,[I,F]=b.useState(()=>w.isCallChatKind(P)&&q),[$,W]=b.useState(()=>(P==="text"||P==="hybrid")&&h.isSessionReady),[G,U]=b.useState(!1),[Q,Z]=b.useState(O),[ae,he]=b.useState(null),T=w.isCallChatKind(P)&&I||P==="hybrid"&&$,Ne=w.useElapsed(T),_e=w.useVisualViewportHeight(),N=A&&!!S&&!M&&!l,{events:me}=Fe.useRqmiiConnection();b.useEffect(()=>{if(!me)return;const be=()=>{w.isMobileViewport()&&U(!0)},Ke=()=>U(!1);return me.on("minimize_chat",be),me.on("maximize_chat",Ke),()=>{me.off("minimize_chat",be),me.off("maximize_chat",Ke)}},[me]);const ge=b.useCallback(()=>{if(y&&D&&typeof window<"u")try{window.localStorage.setItem(D,"true")}catch{}L(!0)},[y,D]),te=b.useCallback(()=>{s?s():a()},[s,a]),we=be=>{i(be),l||h.changeSessionLanguage(be)},De=b.useCallback(be=>{if(he(null),Z(!0),u){u(be);return}h.sendTextMessage(be)},[u,h]);b.useEffect(()=>{p&&(p.current=h.messages)});const Y=b.useRef(!1);b.useEffect(()=>{Y.current||l||(g?(Y.current=!0,De(g)):k&&(Y.current=!0,he(null),Z(!0),h.isVoiceActive||h.startVoice()))},[]),b.useEffect(()=>{Q&&q&&(Z(!1),w.isCallChatKind(P)?F(!0):W(!0))},[Q,q,P]),b.useEffect(()=>{Q&&h.error&&(Z(!1),he(h.error))},[Q,h.error]);const oe=b.useCallback(()=>{he(null),Z(!0),h.isVoiceActive||h.startVoice()},[h]);if(h.error&&!l&&($||I))return f.jsx(P_,{message:h.error,language:n,onClose:a});if(N)return f.jsx(Dh,{language:n,content:S,config:t.consent,agent:t,onAccept:ge,onDecline:te});const Se={agent:t,language:n,languages:r,chatKind:P,sdk:h,isPreview:l,onLanguageChange:we,onClose:a,onMinimize:()=>U(!0),onRestore:()=>U(!1),onSend:De,voiceStarted:I,conversationStarted:$,isMinimized:G,elapsed:Ne,setVoiceStarted:F,setConversationStarted:W};return m?f.jsx(f.Fragment,{children:m(Se)}):f.jsx(aS,{...Se,connecting:Q,connectError:ae,visualViewportHeight:_e,onCloseWidget:s??a,initiateVoice:oe,onSendSuggestion:be=>{he(null),Z(!0),h.sendSuggestion?.(be)}})}),aS=b.memo(function({agent:t,language:n,languages:r,chatKind:i,sdk:a,onLanguageChange:s,onClose:o,onMinimize:u,onRestore:l,onSend:d,voiceStarted:h,conversationStarted:m,isMinimized:p,elapsed:g,setVoiceStarted:k,setConversationStarted:C,visualViewportHeight:A,connecting:S=!1,connectError:y=null,onCloseWidget:D,initiateVoice:M,onSendSuggestion:L}){const P=t.widget?.behavior?.typing_indicator_enabled??!0,O=i==="text"?a.waitingForResponse&&P:!1,q=a.messages;if(p)return f.jsx(q_,{agent:t,language:n,onRestore:l,onClose:o,isListening:a.isVoiceActive,isAudioPlaying:a.isAudioPlaying,isSpeaking:a.mic.isSpeaking,isAgentSpeaking:a.isAgentSpeaking,isFirstAgentSpeech:a.isFirstAgentSpeech,onToggleVoice:a.toggleVoice,elapsed:g,variant:i==="text"?"text":"voice"});if(i==="voice"&&h)return f.jsx(U_,{agent:t,language:n,onEndSession:o,onMinimize:u,isListening:a.isVoiceActive,isLoading:a.mic.isLoading,isSpeaking:a.mic.isSpeaking,isAudioPlaying:a.isAudioPlaying,isAgentThinking:a.isAgentThinking,isAgentSpeaking:a.isAgentSpeaking,isFirstAgentSpeech:a.isFirstAgentSpeech,onToggleVoice:a.toggleVoice,elapsed:g,visualViewportHeight:A});if(i==="avatar"&&h)return f.jsx(rS,{agent:t,language:n,sdk:a,onEndSession:o,onMinimize:u});if(w.isCallChatKind(i))return f.jsx(F_,{agent:t,language:n,languages:r,onLanguageChange:s,onClose:D,isAudioPlaying:a.isAudioPlaying,isVoiceSetupLoading:a.isVoiceSetupLoading||S,onStartVoice:M,visualViewportHeight:A});if(!m&&(a.messages.length===0||S)){const I=(t.widget?.behavior?.suggested_messages?.[n]||t.conversation?.suggested_messages?.[n])?.filter(W=>W.trim())||void 0,F=W=>{a.sendSuggestion?L(W):d?.(W)},$=i==="hybrid"||w.resolveChatKind(t)==="hybrid";return f.jsx(B_,{agent:t,language:n,languages:r,onLanguageChange:s,onClose:D,onSend:d,isVoiceEnabled:$,isAudioPlaying:a.isAudioPlaying,isVoiceSetupLoading:a.isVoiceSetupLoading||S,onStartVoice:M,visualViewportHeight:A,disabled:S,connecting:S,error:y||void 0,suggestions:I,onSuggestionClick:F,compact:!!I})}return f.jsx(j_,{agent:t,language:n,onEndSession:o,messages:q,partialTranscript:iS(a.partialTranscript),onSend:d,isAudioPlaying:a.isAudioPlaying,isVoiceEnabled:i==="hybrid",isListening:a.isVoiceActive,isSpeaking:a.mic.isSpeaking,isLoading:a.mic.isLoading,isAgentThinking:a.isAgentThinking,isAgentSpeaking:a.isAgentSpeaking,isFirstAgentSpeech:a.isFirstAgentSpeech,onToggleVoice:a.toggleVoice,onStartVoice:a.startVoice,onMinimize:u,elapsed:g,visualViewportHeight:A,waitingForResponse:O})}),sS={isListening:!1,isLoading:!1,isSpeaking:!1};function Ls(){const{messages:e,sendTextMessage:t,clearMessages:n}=Fe.useRqmiiMessages(),{partialTranscript:r,microphone:i,talkMode:a,isUserSpeaking:s,isAudioPlaying:o,setMicrophoneEnabled:u}=ze.useRqmiiVoice(),{changeSessionLanguage:l,clearSessionHistory:d,interrupt:h,error:m,isConnected:p,isSessionReady:g,isAgentThinking:k,isAgentSpeaking:C,isFirstAgentSpeech:A,session:S}=Fe.useRqmiiConnection(),[y,D]=b.useState([]),[M,L]=b.useState(!1),[P,O]=b.useState(!1),q=b.useRef(!1),I=b.useRef(e.length);b.useEffect(()=>{!g||y.length===0||(y.forEach(ae=>t(ae)),D([]))},[g,y,t]),b.useEffect(()=>{if(e.length>I.current){const ae=e[e.length-1];ae.role==="assistant"&&ae.streaming&&L(!1)}I.current=e.length},[e]),ze.useRqmiiEvents("message_rate_limited",b.useCallback(()=>L(!1),[]));const F=a===Fe.TALK_MODE.PUSH_TO_TALK,$=p&&S.modality==="voice";b.useEffect(()=>{!$||F||i.pending||(P&&!i.enabled&&!q.current?(q.current=!0,u(!0)):!P&&i.enabled&&u(!1))},[$,F,P,i.enabled,i.pending,u]);const W=b.useCallback(ae=>{ae&&(q.current=!1),O(ae)},[]),G=b.useCallback(ae=>{L(!0),g?t(ae):D(he=>[...he,ae])},[g,t]),U=b.useMemo(()=>y.length===0?e:[...e,...y.map((ae,he)=>({id:`pending-${he}`,role:"user",text:ae}))],[e,y]),Q=b.useCallback(()=>{D([]),n()},[n]),Z={isListening:i.enabled,isLoading:i.pending||!F&&P&&!i.enabled&&!i.error,isSpeaking:s};return{displayMessages:U,send:G,clearAll:Q,waitingForResponse:M,voiceRequested:P,setVoice:W,pushToTalk:F,mic:Z,partialTranscript:r,isAudioPlaying:o,changeSessionLanguage:l,clearSessionHistory:d,interrupt:h,error:m,isSessionReady:g,isInRoom:p,isAgentThinking:k,isAgentSpeaking:C,isFirstAgentSpeech:A}}function Ph(e){const{isPreview:t=!1,...n}=e,r=Ls(),i={sendMessage:r.send,enableVoice:w.noop,disableVoice:w.noop,language:e.language,isSessionReady:r.isSessionReady,supportsVoice:!1,isVoiceActive:!1,chatKind:"text"},a=(u,l)=>{e.onSessionStart?.(),l.sendMessage(u)},s=u=>(e.onTextSend??a)(u,i),o={messages:r.displayMessages,sendTextMessage:s,clearMessages:r.clearAll,clearSessionHistory:r.clearSessionHistory,isAudioPlaying:!1,partialTranscript:null,changeSessionLanguage:r.changeSessionLanguage,error:r.error,isAgentThinking:r.isAgentThinking,isAgentSpeaking:r.isAgentSpeaking,isFirstAgentSpeech:r.isFirstAgentSpeech,isVoiceSetupLoading:!1,isVoiceActive:!1,isSessionReady:r.isSessionReady,mic:sS,startVoice:w.noop,toggleVoice:w.noop,waitingForResponse:r.waitingForResponse,sendSuggestion:s};return f.jsx(Is,{...n,isPreview:t,chatKind:"text",sdk:o})}function Mh(e){const{isPreview:t=!1,chatKind:n,...r}=e,i=Ls(),a={sendMessage:i.send,enableVoice:()=>i.setVoice(!0),disableVoice:()=>i.setVoice(!1),language:e.language,isSessionReady:i.isSessionReady,supportsVoice:!0,isVoiceActive:i.voiceRequested,chatKind:n},s=h=>{e.onSessionStart?.(),h.enableVoice()},o=h=>{h.isVoiceActive?h.disableVoice():h.enableVoice()},u=()=>(e.onVoiceStart??s)(a),l=()=>(e.onVoiceToggle??o)(a),d={messages:i.displayMessages,sendTextMessage:n==="avatar"?i.send:w.noop,clearMessages:i.clearAll,clearSessionHistory:i.clearSessionHistory,interrupt:i.interrupt,isAudioPlaying:i.isAudioPlaying,partialTranscript:i.partialTranscript,changeSessionLanguage:i.changeSessionLanguage,error:i.error,isAgentThinking:i.isAgentThinking,isAgentSpeaking:i.isAgentSpeaking,isFirstAgentSpeech:i.isFirstAgentSpeech,isVoiceSetupLoading:i.mic.isLoading,isVoiceActive:i.voiceRequested,isSessionReady:i.isSessionReady,isInRoom:i.isInRoom,pushToTalk:i.pushToTalk,mic:i.mic,startVoice:u,toggleVoice:l};return f.jsx(Is,{...r,isPreview:t,chatKind:n,sdk:d})}function Bh(e){return f.jsx(Mh,{...e,chatKind:"voice"})}function Fh(e){const{isPreview:t=!1,...n}=e,r=Ls(),i=b.useRef(!1),a={sendMessage:r.send,enableVoice:()=>r.setVoice(!0),disableVoice:()=>r.setVoice(!1),language:e.language,isSessionReady:r.isSessionReady,supportsVoice:!0,isVoiceActive:r.voiceRequested,chatKind:"hybrid"},s=g=>{e.onSessionStart?.(),!i.current&&(i.current=!0,g==="text"?e.onStartText?.():e.onStartVoice?.())},o=(g,k)=>{s("text"),k.sendMessage(g)},u=g=>{s("voice"),g.enableVoice()},l=g=>{g.isVoiceActive?g.disableVoice():g.enableVoice()},d=g=>(e.onTextSend??o)(g,a),h=()=>(e.onVoiceStart??u)(a),m=()=>(e.onVoiceToggle??l)(a),p={messages:r.displayMessages,sendTextMessage:d,clearMessages:r.clearAll,clearSessionHistory:r.clearSessionHistory,isAudioPlaying:r.isAudioPlaying,partialTranscript:r.partialTranscript,changeSessionLanguage:r.changeSessionLanguage,error:r.error,isAgentThinking:r.isAgentThinking,isAgentSpeaking:r.isAgentSpeaking,isFirstAgentSpeech:r.isFirstAgentSpeech,isVoiceSetupLoading:r.mic.isLoading,isVoiceActive:r.voiceRequested,isSessionReady:r.isSessionReady,mic:r.mic,startVoice:h,toggleVoice:m,waitingForResponse:r.waitingForResponse,sendSuggestion:g=>{s("voice"),r.setVoice(!0),r.send(g)}};return f.jsx(Is,{...n,isPreview:t,chatKind:e.textOnly?"text":"hybrid",sdk:p})}function Hh(e){return f.jsx(Mh,{...e,chatKind:"avatar"})}function Rs({agent:e,language:t,languages:n,onLanguageChange:r,onEndSession:i,onMinimize:a,onStartText:s,onStartVoice:o,textOnly:u,messages:l,onSendMessage:d,isPreview:h,onSessionStart:m,initialText:p,autoStartVoice:g}){const k=w.resolveChatKind(e),C={agent:e,language:t,languages:n,onLanguageChange:r,onEndSession:i,onMinimize:a,messages:l,onSendMessage:d,isPreview:h,onSessionStart:m,initialText:p,autoStartVoice:g};switch(k){case"voice":return f.jsx(Bh,{...C});case"avatar":return f.jsx(Hh,{...C});case"hybrid":return f.jsx(Fh,{...C,onStartText:s,onStartVoice:o,textOnly:u});case"text":default:return f.jsx(Ph,{...C})}}function oS(e){switch(e.view){case"feedback":return f.jsx(Ns,{...e.feedback});case"ended":return f.jsx(ws,{...e.ended});case"chat":default:return f.jsx(Rs,{...e.chat})}}const uS=Object.freeze(Object.defineProperty({__proto__:null,ChatBoxDispatcher:Rs,EndedChatPanel:ws,FeedbackPanel:Ns,OpenChatView:oS},Symbol.toStringTag,{value:"Module"}));function lS(e){const{agent:t,language:n,open:r=!0,className:i="",messages:a,onSendMessage:s,onClose:o}=e,u=b.useMemo(()=>w.normalizePublicAgent(t),[t]),[l,d]=b.useState(r),[h,m]=b.useState(n||u.defaultLanguage),p=b.useMemo(()=>w.normalizeChatLanguages(u.languages,u.defaultLanguage),[u.defaultLanguage,u.languages]),g=u.widget?.appearance?.theme?.mode==="light"?"light":"dark",k=b.useMemo(()=>w.resolveWidgetThemeStyles(u.widget?.appearance),[u.widget?.appearance]);return b.useEffect(()=>{n&&m(n)},[n]),b.useEffect(()=>{d(r)},[r]),b.useEffect(()=>{w.ensureGoogleFontLoaded(u.widget?.appearance?.font)},[u.widget?.appearance?.font]),f.jsx(Fe.RqmiiAgentProvider,{restUrl:"",enableAudio:!1,children:f.jsx("div",{className:w.cx("rqmii-chat-surface is-preview",`rqmii-theme-${g}`,u.widget?.appearance?.position==="left"&&"rqmii-position-left",i),"data-theme":g,style:k,dir:"ltr",children:l?f.jsx(Rs,{agent:u,language:h,languages:p,onLanguageChange:m,onEndSession:()=>{d(!1),o?.()},onMinimize:()=>{d(!1),o?.()},messages:a,onSendMessage:s,isPreview:!0}):null})})}const cS=5e3,dS=4e3,hS="rqmii_avatar_device_key",fS="pair";function Gi(e){return e?.code}function pS(e){const t=e?.status;return typeof t=="number"&&t>=400&&t<500&&t!==429}class mS{constructor(t){this.deps=t;const n=t.link.token()?"pairing":t.keys.get()?"idle":"not_paired";this.current={phase:n,agentName:null,screenOnline:null,tabletAllowed:!0,talkMode:null,notice:null,session:null}}current;listeners=new Set;pollTimer=null;endedTimer=null;disposed=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getState=()=>this.current;async start(){const t=this.deps.link.token();if(t){this.set({phase:"pairing",notice:null});try{const n=await this.deps.api.claimTablet(t,this.deps.tabletName);this.deps.keys.set(n.key),this.deps.link.clear()}catch(n){if(pS(n)&&this.deps.link.clear(),this.disposed)return;if(!this.deps.keys.get()){const r=Gi(n)===ze.AVATAR_DEVICE_ERROR.PAIRING_NOT_FOUND?"pairing_expired":"error";this.set({phase:"not_paired",notice:r});return}}}await this.refresh()}async talk(){const t=this.deps.keys.get();if(!(!t||this.current.phase!=="idle")){this.set({phase:"starting",notice:null});try{const n=await this.deps.api.startSession(t);if(this.disposed)return;this.set({phase:"in_conversation",session:n,screenOnline:!0})}catch(n){if(this.disposed)return;switch(Gi(n)){case ze.AVATAR_DEVICE_ERROR.NOT_PAIRED:this.forget();return;case ze.AVATAR_DEVICE_ERROR.SCREEN_OFFLINE:this.set({phase:"idle",screenOnline:!1});break;case ze.AVATAR_DEVICE_ERROR.BUSY:this.set({phase:"idle",notice:"busy"});break;case ze.AVATAR_DEVICE_ERROR.CONTROL_BUILT_IN:this.set({phase:"idle",tabletAllowed:!1});break;default:this.set({phase:"idle",notice:"error"})}this.schedulePoll()}}}sessionEnded(){this.current.phase==="in_conversation"&&(this.set({phase:"ended",session:null}),this.endedTimer=setTimeout(()=>{this.endedTimer=null,this.set({phase:"idle"}),this.refresh()},this.deps.endedMs??dS))}joinFailed(){this.current.phase==="in_conversation"&&(this.set({phase:"idle",session:null,notice:"error"}),this.refresh())}dispose(){this.disposed=!0,this.clearPoll(),this.endedTimer&&clearTimeout(this.endedTimer),this.endedTimer=null,this.listeners.clear()}async refresh(){const t=this.deps.keys.get();if(!t){this.set({phase:"not_paired"});return}try{const n=await this.deps.api.me(t);if(this.disposed)return;this.set({agentName:n.agent?.name??null,screenOnline:n.desktop?.online??!1,tabletAllowed:n.settings?.control!==Fe.AVATAR_CONTROL.BUILT_IN,talkMode:Fe.parseTalkMode(n.settings?.talk_mode),...this.current.phase==="pairing"?{phase:"idle"}:{},...this.current.notice==="error"?{notice:null}:{}})}catch(n){if(this.disposed)return;if(Gi(n)===ze.AVATAR_DEVICE_ERROR.NOT_PAIRED){this.forget();return}this.current.phase==="pairing"&&this.set({phase:"idle"})}this.schedulePoll()}forget(){this.deps.keys.clear(),this.set({phase:"not_paired",agentName:null,screenOnline:null,tabletAllowed:!0,talkMode:null,notice:null,session:null})}schedulePoll(){this.clearPoll(),!(this.disposed||this.current.phase!=="idle")&&(this.pollTimer=setTimeout(()=>{this.pollTimer=null,this.refresh()},this.deps.pollMs??cS))}clearPoll(){this.pollTimer&&clearTimeout(this.pollTimer),this.pollTimer=null}set(t){if(!this.disposed){this.current={...this.current,...t},this.current.phase!=="idle"&&this.clearPoll();for(const n of this.listeners)n()}}}function gS(e=hS){return{get(){try{return window.localStorage.getItem(e)}catch{return null}},set(t){try{window.localStorage.setItem(e,t)}catch{}},clear(){try{window.localStorage.removeItem(e)}catch{}}}}function bS(e=fS){return{token(){try{return new URL(window.location.href).searchParams.get(e)||null}catch{return null}},clear(){try{const t=new URL(window.location.href);t.searchParams.delete(e),window.history.replaceState(window.history.state,"",t.toString())}catch{}}}}function ES(e,t){const n=t.trim();if(n)return{role:"user",text:n};for(let r=e.length-1;r>=0;r-=1){const i=e[r].role??e[r].sender,a=e[r].text.trim();if((i==="user"||i==="assistant")&&a)return{role:i,text:a}}return null}function TS({restUrl:e=Fe.DEFAULT_REST_URL,language:t="en",tabletName:n="Tablet",theme:r="dark",className:i,debug:a=!1}){return f.jsx(Fe.RqmiiAgentProvider,{restUrl:e,enableAudio:!1,debug:a,children:f.jsx("div",{className:w.cx("rqmii-chat-surface",`rqmii-theme-${r}`,"rqmii-remote",i),"data-theme":r,dir:w.languageTextDirection(t),children:f.jsx(kS,{restUrl:e,language:t,tabletName:n})})})}function xS(e,t){const[n,r]=b.useState(null);return b.useEffect(()=>{const i=new mS({api:ze.createAvatarDeviceApi(e),keys:gS(),link:bS(),tabletName:t}),a=()=>r({controller:i,state:i.getState()});a();const s=i.subscribe(a);return i.start(),()=>{s(),i.dispose()}},[e,t]),n}function kS({restUrl:e,language:t,tabletName:n}){const r=xS(e,n),i=o=>w.getChatText(t,o);if(!r)return f.jsx(qn,{icon:f.jsx(rt,{className:"rqmii-chat-spin",size:28}),text:i("loading")});const{controller:a,state:s}=r;switch(s.phase){case"not_paired":return f.jsx(qn,{icon:f.jsx(lf,{size:40}),text:i(s.notice==="pairing_expired"?"remotePairingExpired":"remoteNotPaired"),detail:s.notice==="error"?i("sessionError"):void 0});case"pairing":return f.jsx(qn,{icon:f.jsx(rt,{className:"rqmii-chat-spin",size:28}),text:i("remotePairing")});case"in_conversation":return f.jsxs(f.Fragment,{children:[f.jsx(Sa,{name:s.agentName}),f.jsx(AS,{session:s.session,language:t,settingsTalkMode:s.talkMode,onEnded:()=>a.sessionEnded(),onFailed:()=>a.joinFailed()})]});case"ended":return f.jsxs(f.Fragment,{children:[f.jsx(Sa,{name:s.agentName}),f.jsx(qn,{text:i("remoteEnded")})]});default:return f.jsx(yS,{state:s,language:t,onTalk:()=>void a.talk()})}}function Sa({name:e,children:t}){return f.jsxs("header",{className:"rqmii-remote-header",children:[f.jsx("h1",{className:"rqmii-remote-agent",children:f.jsx("bdi",{children:e??""})}),t]})}function qn({icon:e,text:t,detail:n}){return f.jsxs("div",{className:"rqmii-remote-status",role:"status",children:[e,f.jsx("p",{children:t}),n&&f.jsx("p",{className:"rqmii-remote-detail",children:n})]})}function yS({state:e,language:t,onTalk:n}){const r=o=>w.getChatText(t,o),i=e.phase==="starting",a=e.screenOnline===!1,s=e.tabletAllowed?e.notice==="busy"?r("remoteBusy"):e.notice==="error"?r("sessionError"):null:r("remoteControlBuiltIn");return e.agentName===null&&!s?f.jsx(qn,{icon:f.jsx(rt,{className:"rqmii-chat-spin",size:28}),text:r("loading")}):f.jsxs(f.Fragment,{children:[f.jsx(Sa,{name:e.agentName,children:e.screenOnline!==null&&f.jsxs("span",{className:w.cx("rqmii-remote-screen",!a&&"is-online"),children:[f.jsx("span",{className:"rqmii-remote-dot"}),r(a?"remoteScreenOffline":"remoteScreenOnline")]})}),f.jsxs("button",{type:"button",className:"rqmii-remote-talk",onClick:n,disabled:i||a||!e.tabletAllowed,children:[i?f.jsx(rt,{className:"rqmii-chat-spin",size:44}):f.jsx(Dt,{size:48}),f.jsx("span",{children:r(i?"loading":"remoteTapToTalk")})]}),s&&f.jsx("p",{className:"rqmii-remote-notice",role:"alert",children:s})]})}function AS({session:e,language:t,settingsTalkMode:n,onEnded:r,onFailed:i}){const a=L=>w.getChatText(t,L),{joinSession:s,endSession:o,disconnect:u,isConnected:l,connectionState:d,sessionEnd:h}=Fe.useRqmiiConnection(),{microphone:m,setMicrophoneEnabled:p,partialTranscript:g,talkMode:k}=ze.useRqmiiVoice(),C=(k??n)===Fe.TALK_MODE.PUSH_TO_TALK,{messages:A}=Fe.useRqmiiMessages(),S=ze.useRqmiiPressToTalk(),y=b.useRef({onEnded:r,onFailed:i,joinSession:s,disconnect:u});y.current={onEnded:r,onFailed:i,joinSession:s,disconnect:u};const D=b.useRef(!1);b.useEffect(()=>{let L=!0;return y.current.joinSession(e).catch(()=>{L&&y.current.onFailed()}),()=>{L=!1,y.current.disconnect()}},[e]),b.useEffect(()=>{h?y.current.onEnded():d==="failed"&&y.current.onFailed()},[h,d]),b.useEffect(()=>{C||!l||D.current||(D.current=!0,p(!0))},[C,l,p]);const M=ES(A,typeof g?.text=="string"?g.text:"");return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"rqmii-remote-caption","aria-live":"polite",children:[M?f.jsx("span",{dir:"auto",className:w.cx(M.role==="user"&&"is-user"),children:M.text}):null,!l&&f.jsx(rt,{className:"rqmii-chat-spin",size:28})]}),f.jsxs("div",{className:"rqmii-remote-controls",children:[C?f.jsxs("button",{type:"button",className:w.cx("rqmii-remote-talk","is-hold",S.isRecording&&"is-recording"),disabled:!l,...S.eventHandlers,children:[f.jsx(Dt,{size:44}),f.jsx("span",{children:a("holdToTalk")})]}):f.jsxs("button",{type:"button",className:w.cx("rqmii-remote-round",!m.enabled&&"is-muted"),disabled:!l||m.pending,onClick:()=>void p(!m.enabled),children:[m.enabled?f.jsx(Dt,{size:28}):f.jsx(nr,{size:28}),f.jsx("span",{children:a(m.enabled?"remoteMute":"remoteUnmute")})]}),f.jsxs("button",{type:"button",className:"rqmii-remote-round is-danger",onClick:o,children:[f.jsx(ir,{size:28}),f.jsx("span",{children:a("endCall")})]})]})]})}function CS({agent:e,defaultOpen:t,className:n="",preview:r=!1,ChatBoxComponent:i}){const a=t!==void 0?t:e.widget?.behavior?.default_open??!1,[s,o]=b.useState(a),[u,l]=b.useState(e.defaultLanguage),d=b.useMemo(()=>w.normalizeChatLanguages(e.languages,e.defaultLanguage),[e.defaultLanguage,e.languages]);b.useEffect(()=>{l(e.defaultLanguage)},[e.defaultLanguage]),b.useEffect(()=>{o(a)},[a]);const h=e.widget?.appearance?.theme?.mode==="light"?"light":"dark",m=b.useMemo(()=>w.resolveWidgetThemeStyles(e.widget?.appearance),[e.widget?.appearance]);return f.jsxs("div",{className:w.cx("rqmii-chat-surface",`rqmii-theme-${h}`,r&&"is-preview",n),"data-theme":h,style:m,children:[!s&&f.jsx(w.RqmiiChatOpenButton,{agent:e,onClick:()=>o(!0),position:r?"static":"fixed"}),s&&f.jsx(i,{agent:e,language:u,languages:d,onLanguageChange:l,onClose:()=>o(!1),isPreview:r})]})}exports.ChatPanels=uS;exports.ConsentDialog=Dh;exports.EndedChatPanel=ws;exports.FeedbackPanel=Ns;exports.In=Rd;exports.Message=E_;exports.MessageAvatar=y_;exports.MessageContent=x_;exports.MessageList=fi;exports.R=ve;exports.RatingBar=Lh;exports.Response=g_;exports.RqmiiAgentChatPreview=lS;exports.RqmiiAvatarChatBox=Hh;exports.RqmiiAvatarRemote=TS;exports.RqmiiChatFooter=Bt;exports.RqmiiChatSurface=CS;exports.RqmiiHybridChatBox=Fh;exports.RqmiiMarkdown=Oh;exports.RqmiiMarkdownComponent=vh;exports.RqmiiMessage=di;exports.RqmiiMessageAvatar=wh;exports.RqmiiMessageContent=hi;exports.RqmiiResponse=ci;exports.RqmiiTextChatBox=Ph;exports.RqmiiVoiceChatBox=Bh;exports.Wc=O3;exports.co=Nh;
289
- //# sourceMappingURL=ui-BQAa9g8U.cjs.map
288
+ `).replace(/\\r/g,"\r").replace(/\\t/g," ")),t=t.replace(/```([a-zA-Z0-9_-]+)[ \t]+([^\n`]+)/g,"```$1\n$2"),t}const qu={a:({href:e,children:t,target:n="_blank",rel:r="noopener noreferrer",node:i,...a})=>f.jsx("a",{href:e,target:n,rel:r,...a,children:t})};function m_({content:e,children:t,className:n="",isAnimating:r,mode:i,dir:a,lineNumbers:s=!1,codeBlockMaxHeight:o=320,animated:u=!0,controls:l={code:{copy:!0},table:{copy:!0}},linkSafety:d={enabled:!1},components:h,...m}){const p=(e!==void 0?e:t)||"";if(!p||!p.trim())return null;const g=p_(p),k=i??(r?"streaming":"static"),C=h?{...qu,...h}:qu;return f.jsx("div",{className:w.cx("rqmii-response",n),children:f.jsx(Sh,{mode:k,isAnimating:r,animated:u,dir:a,lineNumbers:s,codeBlockMaxHeight:o,controls:l,linkSafety:d,components:C,...m,children:g})})}const ci=b.memo(m_),g_=ci;function b_({role:e,from:t,variant:n="contained",dir:r,isPartial:i=!1,className:a="",children:s}){const o=t||e||"assistant",u=o==="user";return f.jsx("div",{className:w.cx("rqmii-chat-message-row","rqmii-message",u?"is-user rqmii-message--user":"rqmii-message--assistant",n==="flat"&&"rqmii-message--flat",i&&"is-partial",a),"data-role":o,dir:r,children:s})}const di=b.memo(b_),E_=di;function T_({variant:e="contained",dir:t,className:n="",children:r}){return f.jsx("div",{className:w.cx("rqmii-chat-message","rqmii-message-content",e==="flat"&&"rqmii-message-content--flat",n),dir:t,children:r})}const hi=b.memo(T_),x_=hi;function k_({agent:e,src:t,name:n,size:r="small",active:i=!1,className:a=""}){if(e)return f.jsx(w.RqmiiAgentAvatar,{agent:e,size:r,active:i,className:a});if(t)return f.jsx("div",{className:w.cx("rqmii-agent-avatar",`rqmii-agent-avatar--${r}`,i&&"is-active",a),children:f.jsx("img",{src:t,alt:n||"Avatar"})});if(n){const s=n.split(" ").map(o=>o[0]).slice(0,2).join("").toUpperCase();return f.jsx("div",{className:w.cx("rqmii-agent-avatar",`rqmii-agent-avatar--${r}`,"rqmii-avatar-fallback",a),children:f.jsx("span",{children:s})})}return null}const wh=b.memo(k_),y_=wh,_s=b.memo(function({language:t,languages:n,onChange:r}){const[i,a]=b.useState(!1),s=b.useRef(null),o=w.getChatLanguage(t),u=w.normalizeChatLanguages(n,t).map(l=>w.getChatLanguage(l)).filter(Boolean);return b.useEffect(()=>{if(!i)return;const l=d=>{const h=s.current;if(!h)return;(typeof d.composedPath=="function"?d.composedPath().includes(h):h.contains(d.target))||a(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[i]),f.jsxs("div",{className:"rqmii-chat-language",ref:s,children:[f.jsxs("button",{type:"button",className:"rqmii-chat-pill",onClick:()=>a(l=>!l),children:[f.jsx("span",{children:o?.label||t}),f.jsx(wa,{size:16})]}),i&&u.length>1&&f.jsx("div",{className:"rqmii-chat-language-menu",children:u.map(l=>f.jsx("button",{type:"button",className:w.cx("rqmii-chat-language-item",l.value===t&&"is-selected"),onClick:()=>{r(l.value),a(!1)},children:l.label},l.value))})]})}),Bt=b.memo(function({language:t="en",brand:n="rqmii",agent:r}){const i=r?.widget?.appearance,a=i?.show_branding!==!1,s=i?.footer_content?.[t],o=!!s?.trim();if(!a&&!o)return f.jsx("div",{style:{padding:11}});const u=w.getChatText(t,"poweredBy"),l=w.languageTextDirection(t),d=()=>{if(u.includes("{brand}")){const h=u.split("{brand}");return f.jsxs("p",{className:"rqmii-chat-footer-branding",dir:l,children:[h[0],f.jsx("strong",{children:n}),h[1]]})}return f.jsxs("p",{className:"rqmii-chat-footer-branding",dir:l,children:[u," ",f.jsx("strong",{children:n})]})};return f.jsxs("div",{className:"rqmii-chat-footer",dir:l,children:[a&&d(),o&&f.jsx("p",{dir:l,children:s})]})}),Ss=b.memo(function({language:t,placeholder:n,onSend:r,disabled:i=!1,variant:a="text",isVoiceEnabled:s=!1}){const[o,u]=b.useState(""),l=b.useRef(null),d=168;let h;try{h=Fe.useRqmiiAgentContext().sendActivity}catch{}const m=()=>{const g=o.trim();!g||i||(r(g),u(""),l.current&&(l.current.style.height="auto"))},p=s?w.getChatText(t,"orSendMessage"):w.getChatText(t,"sendMessage");return f.jsxs("div",{className:w.cx("rqmii-chat-input",w.languageFontClass(),a==="voice"&&"is-voice"),children:[f.jsx("textarea",{ref:l,value:o,disabled:i,rows:a==="compact"?2:3,dir:o.trim()?"auto":w.languageTextDirection(t),placeholder:n||p,onChange:g=>{u(g.target.value),h?.();const k=l.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,d)}px`)},onFocus:()=>{h?.()},onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),m())}}),f.jsx("button",{type:"button",onClick:m,disabled:!o.trim()||i,"aria-label":w.getChatText(t,"send"),children:f.jsx(Yu,{size:20})})]})});b.memo(function({text:t,streaming:n}){const r=w.useStreamingText(t,n);return f.jsx(f.Fragment,{children:r})});const _a=133,A_=_a+44,C_=767,Un=36,__=8,zu=Un+__;function S_(){return typeof window>"u"?_a:window.innerWidth<=C_?A_:_a}function N_(e){return e==="rtl"?"right":"left"}function w_(e,t,n,r){if(!e.length)return null;const i=Math.max(...e.map(s=>s.offsetTop)),a=e.filter(s=>s.offsetTop>=i-.5);return n==="right"?a.find(s=>s.offsetLeft+s.offsetWidth>t-r)||null:a.find(s=>s.offsetLeft<r)||null}function $u(e,t,n,r){for(let i=0;i<2;i++){const a=w_(e,t,n,r);if(!a)break;n==="right"?a.style.marginRight=`${r}px`:a.style.marginLeft=`${r}px`,a.style.maxWidth=`calc(100% - ${r}px)`}}const I_=b.memo(function({suggestions:t,language:n,onClick:r}){const[i,a]=b.useState(!1),[s,o]=b.useState(!1),[u,l]=b.useState(null),[d,h]=b.useState(null),m=b.useRef(null),p=b.useRef([]),g=w.languageTextDirection(n||"en"),k=N_(g),C=A=>{A.forEach(S=>{S&&(S.style.maxWidth="",S.style.marginRight="",S.style.marginLeft="")})};return b.useLayoutEffect(()=>{const A=m.current;if(!A||i)return;const S=()=>{const D=p.current;C(D);const M=A.clientWidth,L=S_(),P=()=>{for(let U=0;U<D.length;U++){const I=D[U];if(I&&I.offsetTop+I.offsetHeight>L+.5)return U}return null};let O=P();if(O!==null)for(let U=0;U<=D.length;U++){C(D);const I=D.slice(0,O).filter($=>!!$);$u(I,M,k,zu);const F=P();if(F===null||F>=O)break;O=F}if(l(O),o(O!==null),O!==null){const U=D.slice(0,O).filter(F=>!!F),I=U.length?Math.max(...U.map(F=>F.offsetTop+F.offsetHeight)):Un;h(I-Un)}else h(null)};S();const y=typeof ResizeObserver<"u"?new ResizeObserver(S):null;return y?.observe(A),()=>{y?.disconnect(),C(p.current)}},[t,i,k]),b.useLayoutEffect(()=>{const A=m.current;if(!A||!i)return;const S=p.current.filter(D=>!!D);C(p.current),$u(S,A.clientWidth,k,zu);const y=S.length?Math.max(...S.map(D=>D.offsetTop+D.offsetHeight)):Un;return h(y-Un),()=>{C(p.current)}},[i,t,k]),t.length?f.jsx("div",{className:w.cx("rqmii-suggested-messages",i&&"is-expanded",s&&"has-overflow"),dir:g,children:f.jsxs("div",{ref:m,className:w.cx("rqmii-suggested-messages-inner",i?"is-expanded":"is-collapsed"),children:[t.map((A,S)=>{const y=!i&&u!==null&&S>=u;return f.jsx("button",{ref:D=>{p.current[S]=D},type:"button",className:"rqmii-suggested-message",onClick:()=>r(A),style:y?{visibility:"hidden"}:void 0,"aria-hidden":y||void 0,tabIndex:y?-1:void 0,children:A},S)}),s&&f.jsx("button",{type:"button",className:w.cx("rqmii-suggested-messages-toggle",k==="left"&&"is-start-left"),style:d!=null?{top:d,bottom:"auto"}:void 0,onClick:()=>a(A=>(A&&m.current&&(m.current.scrollTop=0),!A)),"aria-label":i?"Show less":"Show more","aria-expanded":i,children:i?f.jsx(Xh,{size:14}):f.jsx(wa,{size:14})})]})}):null}),L_=b.memo(function({language:t}){const n=w.languageTextDirection(t||"en");return f.jsx("div",{className:"rqmii-chat-message-row",children:f.jsxs("div",{className:"rqmii-chat-message rqmii-chat-typing-indicator",dir:n,children:[f.jsx("span",{className:"rqmii-chat-typing-dot"}),f.jsx("span",{className:"rqmii-chat-typing-dot"}),f.jsx("span",{className:"rqmii-chat-typing-dot"})]})})});function R_(e){return e==="message"}const v_={name:"leadFormName",email:"leadFormEmail",phone:"leadFormPhone",message:"leadFormMessage"},O_=b.memo(function({messageId:t,form:n,language:r,textDirection:i,formSubmitted:a}){const s=Fe.useRqmiiAgentContext(),[o,u]=b.useState({}),[l,d]=b.useState(!1),[h,m]=b.useState(!!a),[p,g]=b.useState(null),k=n.title||w.getChatText(r,"leadFormTitle"),C=D=>{const M=v_[D.key?.toLowerCase()];return`${M?w.getChatText(r,M):D.label||D.key}${D.required?"*":""}`},A=(D,M)=>{u(L=>({...L,[D]:M})),s.sendActivity(),p&&g(null)},S=()=>{s.sendActivity()},y=async D=>{if(D.preventDefault(),l||h)return;if(n.fields.some(P=>P.required&&!o[P.key]?.trim())){g(w.getChatText(r,"leadFormRequiredError"));return}const L={};for(const P of n.fields){const O=o[P.key]?.trim();O&&(L[P.key]=O)}d(!0),g(null);try{await s.submitLead(L),m(!0),s.setMessages(s.messages.map(P=>P.id===t?{...P,formSubmitted:!0}:P))}catch(P){g(P instanceof Fe.LeadFormRejected?P.message:w.getChatText(r,"leadFormGenericError"))}finally{d(!1)}};return h?f.jsx("div",{className:"rqmii-chat-message-row rqmii-chat-lead-form-row",children:f.jsx("div",{className:"rqmii-chat-lead-form rqmii-chat-lead-form--done",dir:i,children:f.jsx("div",{className:"rqmii-chat-lead-form-success",children:w.getChatText(r,"leadFormSuccess")})})}):f.jsx("div",{className:"rqmii-chat-message-row rqmii-chat-lead-form-row",children:f.jsxs("form",{className:"rqmii-chat-lead-form",dir:i,onSubmit:y,children:[f.jsx("div",{className:"rqmii-chat-lead-form-title",children:k}),n.fields.map(D=>{const M=C(D),L=D.type==="email"?"email":D.type==="date"?"date":"text";return R_(D.key)?f.jsx("textarea",{className:"rqmii-chat-lead-form-input rqmii-chat-lead-form-textarea",placeholder:M,value:o[D.key]||"",onChange:P=>A(D.key,P.target.value),onFocus:S,disabled:l,rows:4},D.key):f.jsx("input",{className:"rqmii-chat-lead-form-input",type:L,placeholder:M,value:o[D.key]||"",onChange:P=>A(D.key,P.target.value),onFocus:S,disabled:l},D.key)}),p&&f.jsx("div",{className:"rqmii-chat-lead-form-error",children:p}),f.jsx("button",{type:"submit",className:"rqmii-chat-lead-form-submit",disabled:l,children:l?w.getChatText(r,"loading"):w.getChatText(r,"submit")})]})})}),D_=b.memo(function({message:t,textDirection:n,language:r}){if(t.role==="lead_form"&&t.form)return f.jsx(O_,{messageId:t.id,form:t.form,language:r,textDirection:n,formSubmitted:t.formSubmitted});const i=t.role==="user"||t.sender==="user";return f.jsx(di,{role:i?"user":t.role||"assistant",children:f.jsx(hi,{dir:"auto",children:i?t.text:f.jsx(ci,{content:t.text,isAnimating:!!t.streaming,mode:t.streaming?"streaming":"static",dir:"auto"})})})}),fi=b.memo(function({messages:t,partialTranscript:n,language:r,showTypingIndicator:i}){const a=b.useRef(null),s=w.languageTextDirection(r||"en"),o=b.useRef(t.length);return b.useEffect(()=>{if(!a.current)return;const u=t.length!==o.current;o.current=t.length,a.current.scrollIntoView({behavior:u?"smooth":"instant",block:"end"})},[t,n]),f.jsxs("div",{className:"rqmii-chat-messages",children:[t.map(u=>f.jsx(D_,{message:u,textDirection:s,language:r||"en"},u.id||`${u.role}-${u.text}`)),i&&f.jsx(L_,{language:r}),n&&f.jsx(di,{role:"user",isPartial:!0,children:f.jsx(hi,{dir:"auto",children:n})}),f.jsx("div",{ref:a})]})}),P_=b.memo(function({message:t,onRetry:n,onClose:r,language:i="en"}){return f.jsxs("div",{className:"rqmii-chat-panel rqmii-chat-panel--error",children:[r&&f.jsx("button",{type:"button",className:"rqmii-error-close",onClick:r,children:"×"}),f.jsx("p",{children:t||w.getChatText(i,"connectionFailed")}),n&&f.jsxs("button",{type:"button",className:"rqmii-chat-retry",onClick:n,children:[f.jsx(Wu,{size:16}),f.jsx("span",{children:w.getChatText(i,"retry")})]})]})}),M_=5;function Ih({rating:e,onRate:t,readonly:n,size:r=28}){const[i,a]=b.useState(0),s=i||e;return f.jsx("div",{className:"rqmii-chat-rating-stars",role:"radiogroup",children:Array.from({length:M_},(o,u)=>{const l=u+1,d=l<=s;return f.jsx("button",{type:"button",className:w.cx("rqmii-chat-star",d&&"is-filled",n&&"is-readonly"),disabled:n,"aria-label":`${l}`,"aria-checked":l===e,role:"radio",onMouseEnter:()=>!n&&a(l),onMouseLeave:()=>!n&&a(0),onClick:()=>!n&&t?.(l),children:f.jsx(pf,{size:r,fill:d?"currentColor":"none"})},l)})})}function Lh({language:e,rating:t,endedBy:n,endReason:r,sessionId:i,interactive:a,showTellUsMore:s,showRating:o=!0,showConversationId:u=!0,onRate:l,onTellUsMore:d}){const h=t>0?w.getChatText(e,"ratingThankYou"):w.getChatText(e,"ratingQuestion"),m=w.getChatText(e,w.endNoticeKey(r??(n==="user"?Fe.END_REASON.USER_ENDED:Fe.END_REASON.AGENT_ENDED)));return f.jsxs("div",{className:w.cx("rqmii-chat-rating",!o&&"rqmii-chat-rating--unrated",w.languageFontClass()),dir:w.languageTextDirection(e),children:[o&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"rqmii-chat-rating-header",children:h}),f.jsx(Ih,{rating:t,onRate:l,readonly:!a}),s&&f.jsx("button",{type:"button",className:"rqmii-chat-rating-more",onClick:d,children:w.getChatText(e,"tellUsMore")})]}),f.jsxs("div",{className:"rqmii-chat-rating-meta",children:[f.jsx("div",{children:m}),u&&i&&f.jsxs("div",{children:[w.getChatText(e,"sessionIdLabel")," ",f.jsx("span",{children:i})]})]})]})}function Ns({agent:e,language:t,rating:n,onBack:r,onMinimize:i,onSubmit:a}){const[s,o]=b.useState(""),[u,l]=b.useState(!1),d=s.trim().length>0&&!u,h=async()=>{if(d){l(!0);try{await a(s.trim())}finally{l(!1)}}},m=b.useMemo(()=>w.resolveWidgetThemeStyles(e.widget?.appearance),[e.widget?.appearance]);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--feedback",w.languageFontClass()),dir:w.languageTextDirection(t),style:m,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:r,"aria-label":"Back",children:f.jsx(Wh,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:i,"aria-label":w.getChatText(t,"minimize"),children:f.jsx(rr,{size:20})})]}),f.jsxs("div",{className:"rqmii-chat-feedback-body",children:[f.jsx(w.RqmiiAgentAvatar,{agent:e,size:"hero"}),f.jsx(Ih,{rating:n,readonly:!0}),f.jsx("div",{className:"rqmii-chat-feedback-title",children:w.getChatText(t,"ratingThankYou")}),f.jsx("div",{className:"rqmii-chat-feedback-subtitle",children:w.getChatText(t,"feedbackSubtitle")}),f.jsx("textarea",{className:"rqmii-chat-feedback-input",value:s,dir:w.languageTextDirection(t),placeholder:w.getChatText(t,"feedbackPlaceholder"),onChange:p=>o(p.target.value)}),f.jsx("div",{className:"rqmii-chat-feedback-actions",children:f.jsx("button",{type:"button",className:"rqmii-chat-feedback-submit",onClick:h,disabled:!d,children:u?f.jsx(rt,{className:"rqmii-chat-spin",size:18}):w.getChatText(t,"submit")})})]}),f.jsx(Bt,{language:t,agent:e})]})}function gr(e){if(!(e==null||typeof window>"u"||window.innerWidth>=768))return{top:`${window.innerHeight-e}px`,bottom:0}}const B_=b.memo(function({agent:t,language:n,languages:r,onLanguageChange:i,onClose:a,onSend:s,isVoiceEnabled:o=!1,isAudioPlaying:u=!1,isVoiceSetupLoading:l=!1,onStartVoice:d,visualViewportHeight:h,disabled:m=!1,connecting:p=!1,error:g,suggestions:k,onSuggestionClick:C,compact:A=!1}){const S=gr(h),[y,D]=b.useState(w.isMobileViewport);b.useEffect(()=>{const U=()=>D(w.isMobileViewport());return window.addEventListener("resize",U),()=>window.removeEventListener("resize",U)},[]);const M=A&&!y,L=M?"start":"hero",P=k&&k.length>0,O=w.languageTextDirection(n);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--start",M&&"rqmii-chat-panel--start-compact",w.languageFontClass()),style:S,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("span",{}),f.jsxs("div",{className:"rqmii-chat-topbar-actions",children:[f.jsx(_s,{language:n,languages:r,onChange:i}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:a,children:f.jsx(La,{size:20})})]})]}),f.jsxs("div",{className:"rqmii-chat-start-body",children:[o?f.jsxs("div",{className:w.cx("rqmii-chat-call-avatar-wrap",M&&"is-compact"),children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:L,active:u}),f.jsx("button",{type:"button",className:w.cx("rqmii-chat-call-button",M&&"is-compact"),onClick:d,disabled:l,"aria-label":w.getChatText(n,"startVoice"),children:l?f.jsx(rt,{className:"rqmii-chat-spin",size:M?18:24}):f.jsx(Ia,{size:M?18:24})})]}):f.jsx(w.RqmiiAgentAvatar,{agent:t,size:L}),f.jsx("div",{className:"rqmii-chat-agent-name",dir:O,children:o?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:w.getChatText(n,"call")})," ",f.jsx("bdi",{children:t.name})]}):f.jsx("bdi",{children:t.name})}),p&&!g&&!o&&f.jsx(H_,{language:n}),g&&f.jsx("div",{className:"rqmii-chat-error-text",children:g})]}),P&&f.jsx("div",{className:"rqmii-chat-start-suggestions",children:f.jsx(I_,{suggestions:k,language:n,onClick:U=>C?.(U)})}),f.jsx(Ss,{language:n,onSend:s,disabled:m,isVoiceEnabled:o}),f.jsx(Bt,{language:n,agent:t})]})}),F_=b.memo(function({agent:t,language:n,languages:r,onLanguageChange:i,onClose:a,onStartVoice:s,isVoiceSetupLoading:o=!1,isAudioPlaying:u,visualViewportHeight:l}){const d=gr(l),h=w.languageTextDirection(n);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--voice-start",w.languageFontClass()),style:d,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("span",{}),f.jsxs("div",{className:"rqmii-chat-topbar-actions",children:[f.jsx(_s,{language:n,languages:r,onChange:i}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:a,children:f.jsx(La,{size:20})})]})]}),f.jsxs("div",{className:"rqmii-chat-call-body",children:[f.jsxs("div",{className:"rqmii-chat-call-avatar-wrap",children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero",active:u}),f.jsx("button",{type:"button",className:"rqmii-chat-call-button",onClick:s,disabled:o,"aria-label":w.getChatText(n,"startVoice"),children:o?f.jsx(rt,{className:"rqmii-chat-spin",size:24}):f.jsx(Ia,{size:24})})]}),f.jsxs("div",{className:"rqmii-chat-agent-name",dir:h,children:[f.jsx("span",{children:w.getChatText(n,"call")})," ",f.jsx("bdi",{children:t.name})]})]}),f.jsx(Bt,{language:n,agent:t})]})});function H_({language:e}){return f.jsxs("div",{className:"rqmii-chat-start-status",role:"status",dir:w.languageTextDirection(e),children:[f.jsx(rt,{className:"rqmii-chat-spin",size:14}),f.jsx("span",{children:w.getChatText(e,"loading")})]})}const j_=b.memo(function({agent:t,language:n,onEndSession:r,onMinimize:i,messages:a,partialTranscript:s,onSend:o,isAudioPlaying:u,isVoiceEnabled:l,onToggleVoice:d,isListening:h,isSpeaking:m,isLoading:p,isAgentThinking:g,isAgentSpeaking:k,isFirstAgentSpeech:C,onStartVoice:A,elapsed:S,visualViewportHeight:y,waitingForResponse:D}){const M=w.canInterruptSpeech(t,n,!!C),L=Rh({canInterrupt:M,language:n,isListening:h,isLoading:p,isSpeaking:m,isAudioPlaying:u,isAgentThinking:g,isAgentSpeaking:k,persistentListening:!1}),P=pi({canInterrupt:M,isSpeaking:m,isAudioPlaying:u,isAgentSpeaking:k}),O=gr(y),U=t.widget?.appearance?.show_topbar_avatar_image!==!1;return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--conversation",w.languageFontClass()),style:O,children:[f.jsxs("div",{className:"rqmii-chat-header",children:[U&&f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"header",active:u}),l&&L&&f.jsx("div",{className:w.cx("rqmii-chat-header-status",!U&&"is-expanded"),children:f.jsx("span",{children:L})}),f.jsx("div",{className:"rqmii-chat-header-spacer"}),f.jsxs("div",{className:"rqmii-chat-header-actions",children:[i&&f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:i,"aria-label":w.getChatText(n,"minimize"),children:f.jsx(rr,{size:20})}),l&&f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button",P&&"is-active"),onClick:d,"aria-label":h?w.getChatText(n,"stopVoice"):w.getChatText(n,"startVoice"),children:h?f.jsx(Dt,{size:20}):f.jsx(nr,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button is-danger",onClick:r,"aria-label":w.getChatText(n,"endCall"),children:f.jsx(ir,{size:20})})]})]}),f.jsx(fi,{messages:a,partialTranscript:s,language:n,showTypingIndicator:D}),l&&f.jsx("div",{className:"rqmii-chat-session-counter",children:w.formatTime(S)}),f.jsx(Ss,{language:n,onSend:o,isVoiceEnabled:l}),f.jsx(Bt,{language:n,agent:t})]})}),U_=b.memo(function({agent:t,language:n,onEndSession:r,onMinimize:i,isListening:a,isLoading:s,isSpeaking:o,isAudioPlaying:u,isAgentThinking:l,isAgentSpeaking:d,isFirstAgentSpeech:h,onToggleVoice:m,elapsed:p,visualViewportHeight:g}){const k=w.canInterruptSpeech(t,n,!!h),C=Rh({canInterrupt:k,language:n,isListening:a,isLoading:s,isSpeaking:o,isAudioPlaying:u,isAgentThinking:l,isAgentSpeaking:d,persistentListening:!0}),A=pi({canInterrupt:k,isSpeaking:o,isAudioPlaying:u,isAgentSpeaking:d}),S=gr(g),y=w.languageTextDirection(n);return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--voice-call",w.languageFontClass()),style:S,children:[f.jsxs("div",{className:"rqmii-chat-call-status",children:[f.jsx("span",{className:w.cx("rqmii-chat-live-dot",a&&"is-live")}),f.jsx("span",{children:w.formatTime(p)}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:i,children:f.jsx(rr,{size:20})})]}),f.jsxs("div",{className:"rqmii-chat-voice-frame",children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero",active:u}),f.jsx("div",{className:"rqmii-chat-agent-name",dir:y,children:f.jsx("bdi",{children:t.name})}),f.jsx("div",{className:w.cx("rqmii-chat-status-pill",!C&&"is-empty"),children:C||w.getChatText(n,"listening")}),f.jsxs("div",{className:"rqmii-chat-voice-actions",children:[f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button",A&&"is-active"),onClick:m,children:a?f.jsx(Dt,{size:20}):f.jsx(nr,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button is-danger",onClick:r,"aria-label":w.getChatText(n,"endCall"),children:f.jsx(ir,{size:20})})]})]}),f.jsx(Bt,{language:n,agent:t})]})});function Rh({canInterrupt:e,language:t,isListening:n,isLoading:r,isSpeaking:i,isAudioPlaying:a,isAgentThinking:s,isAgentSpeaking:o,persistentListening:u=!1}){return r?w.getChatText(t,"loading"):pi({canInterrupt:e,isSpeaking:i,isAudioPlaying:a,isAgentSpeaking:o})?w.getChatText(t,"listening"):a||o?w.getChatText(t,w.speakingTextKey(e)):s?w.getChatText(t,"processing"):n&&u?w.getChatText(t,"listening"):null}function pi({canInterrupt:e,isSpeaking:t,isAudioPlaying:n,isAgentSpeaking:r}){return t?e||!(n||r):!1}const q_=b.memo(function({agent:t,language:n,onRestore:r,onClose:i,isListening:a,isAudioPlaying:s,isSpeaking:o,isAgentSpeaking:u,isFirstAgentSpeech:l,onToggleVoice:d,elapsed:h,variant:m="voice"}){const p=m==="text",g=pi({canInterrupt:w.canInterruptSpeech(t,n,!!l),isSpeaking:o,isAudioPlaying:s,isAgentSpeaking:u});return f.jsxs("div",{className:w.cx("rqmii-chat-minimized",w.languageFontClass()),children:[f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"minimized",active:s}),!p&&f.jsx("span",{className:"rqmii-chat-minimized-time",children:w.formatTime(h)}),f.jsxs("div",{className:"rqmii-chat-minimized-actions",children:[f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:r,"aria-label":w.getChatText(n,"maximize"),children:f.jsx(Gu,{size:20})}),!p&&f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button",g&&"is-active"),onClick:d,"aria-label":a?w.getChatText(n,"stopVoice"):w.getChatText(n,"startVoice"),children:a?f.jsx(Dt,{size:20}):f.jsx(nr,{size:20})}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button is-danger",onClick:i,"aria-label":w.getChatText(n,"endCall"),children:f.jsx(ir,{size:20})})]})]})}),ws=b.memo(function({agent:t,language:n,languages:r,chatKind:i,messages:a,onLanguageChange:s,onMinimize:o,onStartNewVoice:u,onStartNewText:l,isVoiceSetupLoading:d=!1,visualViewportHeight:h,rating:m,endedBy:p,endReason:g,startFailure:k,sessionId:C,ratingInteractive:A,showTellUsMore:S,onRate:y,onTellUsMore:D}){const M=gr(h),L=t.widget?.behavior?.conversation_ended_screen,P=!!L?.post_chat_rating_enabled,O=L?.show_conversation_id??!0,U=k==="busy",I=k==="unavailable",F=w.cx(U&&"is-busy",I&&"is-unavailable"),$=k?f.jsx(z_,{failure:k,language:n}):f.jsx(Lh,{language:n,rating:m,endedBy:p,endReason:g,sessionId:C,interactive:A,showTellUsMore:S,showRating:P,showConversationId:O,onRate:y,onTellUsMore:D}),W=w.isCallChatKind(i),G=W||i==="hybrid",q=i==="text"||i==="hybrid",Q=f.jsxs("div",{className:"rqmii-chat-topbar-actions rqmii-chat-topbar-actions--ended",children:[f.jsx(_s,{language:n,languages:r,onChange:s}),f.jsx("button",{type:"button",className:"rqmii-chat-circle-button",onClick:o,"aria-label":w.getChatText(n,"minimize"),children:f.jsx(rr,{size:20})}),G&&f.jsx("button",{type:"button",className:w.cx("rqmii-chat-circle-button rqmii-chat-circle-button--call-start",I&&"is-unavailable"),onClick:u,disabled:d||I,"aria-label":w.getChatText(n,"startVoice"),children:d?f.jsx(rt,{className:"rqmii-chat-spin",size:20}):f.jsx(Ia,{size:20})})]});if(W)return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--voice-call",w.languageFontClass()),style:M,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsx("span",{}),Q]}),f.jsxs("div",{className:"rqmii-chat-voice-frame",children:[U?f.jsx("span",{className:"rqmii-chat-busy-ring",children:f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero"})}):f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"hero",className:F}),f.jsx("div",{className:w.cx("rqmii-chat-agent-name",I&&"is-muted"),dir:w.languageTextDirection(n),children:U?f.jsx($_,{name:t.name,language:n}):f.jsx("bdi",{children:t.name})}),$]}),f.jsx(Bt,{language:n,agent:t})]});const Z=t.widget?.appearance?.show_topbar_avatar_image!==!1;return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--conversation",w.languageFontClass()),style:M,children:[f.jsxs("div",{className:"rqmii-chat-topbar",children:[f.jsxs("div",{className:"rqmii-chat-topbar-agent",children:[Z&&f.jsx(w.RqmiiAgentAvatar,{agent:t,size:"header",className:F}),U&&f.jsx("span",{className:"rqmii-chat-busy-label",dir:w.languageTextDirection(n),children:w.getChatText(n,"agentBusyStatus")})]}),Q]}),k?f.jsx("div",{className:"rqmii-chat-start-failure-body",children:$}):f.jsxs(f.Fragment,{children:[f.jsx(fi,{messages:a,language:n}),$]}),q&&f.jsx(Ss,{language:n,onSend:l,disabled:I,isVoiceEnabled:i==="hybrid"}),f.jsx(Bt,{language:n,agent:t})]})});function z_({failure:e,language:t}){const n=e==="busy"?"agentBusyNotice":"agentUnavailableNotice";return f.jsx("div",{className:"rqmii-chat-start-failure",role:"status",dir:w.languageTextDirection(t),children:w.getChatText(t,n)})}function $_({name:e,language:t}){const[n,r=""]=w.getChatText(t,"agentBusyTitle").split("{name}");return f.jsxs(f.Fragment,{children:[n,f.jsx("bdi",{children:e}),r]})}function V_(e){return e.isAgentSpeaking?"speaking":e.isAgentThinking?"thinking":e.mic.isSpeaking?"listening":"idle"}const Y_={thinking:"processing",listening:"listening",idle:null},G_=10;function W_({activity:e,language:t,canInterrupt:n}){const r=e==="speaking"?w.speakingTextKey(n):Y_[e];return f.jsxs("div",{className:w.cx("rqmii-avatar-state",`is-${e}`),role:"status",children:[Array.from({length:G_},(i,a)=>f.jsx("span",{className:"rqmii-avatar-state-bar",style:{animationDelay:`${a*.1}s`}},a)),r&&f.jsx("span",{className:"rqmii-visually-hidden",dir:w.languageTextDirection(t),children:w.getChatText(t,r)})]})}function Q_({language:e}){const{isRecording:t,eventHandlers:n}=ze.useRqmiiPressToTalk();return f.jsx("button",{type:"button",className:w.cx("rqmii-avatar-mic","is-live",t&&"is-recording"),"aria-label":w.getChatText(e,"holdToTalk"),"aria-pressed":t,...n,children:f.jsx(Dt,{size:22})})}function K_({sdk:e,language:t}){if(e.pushToTalk)return f.jsx(Q_,{language:t});const n=e.mic.isListening;return f.jsx("button",{type:"button",className:w.cx("rqmii-avatar-mic",n&&"is-live",e.mic.isSpeaking&&"is-recording"),onClick:e.toggleVoice,disabled:e.mic.isLoading,"aria-label":w.getChatText(t,n?"stopVoice":"startVoice"),"aria-pressed":n,children:e.mic.isLoading?f.jsx(rt,{className:"rqmii-chat-spin",size:22}):n?f.jsx(Dt,{size:22}):f.jsx(nr,{size:22})})}function Mn({label:e,onClick:t,className:n,children:r}){return f.jsx("button",{type:"button",className:w.cx("rqmii-avatar-round",n),onClick:t,"aria-label":e,title:e,children:r})}function X_(e){return typeof e=="object"&&e&&typeof e.text=="string"?e.text:""}function Z_({sdk:e,language:t,onClose:n}){const[r,i]=b.useState(""),{sendActivity:a}=Fe.useRqmiiMessages(),s=d=>w.getChatText(t,d),o=e.isAgentThinking||e.isAgentSpeaking,u=d=>{d.preventDefault();const h=r.trim();h&&(e.sendTextMessage(h),i(""))},l=()=>{e.clearSessionHistory(),e.clearMessages()};return f.jsxs("aside",{className:"rqmii-avatar-chat","aria-label":s("chat"),children:[f.jsxs("header",{className:"rqmii-avatar-chat-header",children:[f.jsx("h2",{dir:w.languageTextDirection(t),children:s("chat")}),f.jsx("button",{type:"button",className:"rqmii-avatar-chat-icon",onClick:l,"aria-label":s("resetChat"),title:s("resetChat"),children:f.jsx(Wu,{size:18})}),f.jsx("button",{type:"button",className:"rqmii-avatar-chat-icon",onClick:n,"aria-label":s("closeChat"),title:s("closeChat"),children:f.jsx(La,{size:20})})]}),f.jsx(fi,{messages:e.messages,partialTranscript:X_(e.partialTranscript),language:t}),f.jsxs("form",{className:"rqmii-avatar-chat-input",onSubmit:u,children:[f.jsx("input",{type:"text",value:r,dir:r.trim()?"auto":w.languageTextDirection(t),placeholder:s("sendMessage"),onChange:d=>{i(d.target.value),a()}}),o?f.jsx("button",{type:"button",className:"is-interrupt",onClick:()=>e.interrupt?.(),"aria-label":s("interrupt"),title:s("interrupt"),children:f.jsx(hf,{size:16,fill:"currentColor"})}):f.jsx("button",{type:"submit",disabled:!r.trim(),"aria-label":s("send"),children:f.jsx(Yu,{size:20})})]})]})}const J_=2;function eS({track:e,onShowing:t}){const n=b.useRef(null);return b.useEffect(()=>{const r=n.current;if(!r||!e)return;const i=()=>t(!0);return r.addEventListener("loadeddata",i),e.attach(r),r.readyState>=J_&&i(),()=>{r.removeEventListener("loadeddata",i),e.detach(r),t(!1)}},[e,t]),f.jsx("video",{ref:n,className:"rqmii-avatar-video",autoPlay:!0,playsInline:!0,muted:!0})}function tS({agent:e,language:t}){return f.jsxs("div",{className:"rqmii-avatar-preparing",role:"status",children:[e.faceImage&&f.jsx("div",{className:"rqmii-avatar-preparing-backdrop",style:{backgroundImage:`url("${e.faceImage}")`}}),f.jsx(w.RqmiiAgentAvatar,{agent:e,size:"start"}),f.jsxs("span",{className:"rqmii-avatar-preparing-text",dir:w.languageTextDirection(t),children:[f.jsx(rt,{className:"rqmii-chat-spin",size:16}),w.getChatText(t,"preparingAvatar")]})]})}function nS(e,t,n){return n.some(i=>(i.role??i.sender)==="user")?[]:(e.widget?.behavior?.suggested_messages?.[t]||e.conversation?.suggested_messages?.[t]||[]).filter(i=>i.trim())}const rS=b.memo(function({agent:t,language:n,sdk:r,onEndSession:i,onMinimize:a,showMinimize:s=!1}){const{videoTrack:o}=ze.useRqmiiAvatar(),{isAudioMuted:u,setAudioMuted:l}=ze.useRqmiiVoice(),d=b.useRef(null),[h,m]=b.useState(!1),[p,g]=b.useState(!1),[k,C]=b.useState(!1);ze.useRqmiiAvatarViewport(d);const A=y=>w.getChatText(n,y),S=nS(t,n,r.messages);return f.jsxs(f.Fragment,{children:[k&&f.jsx("div",{className:"rqmii-avatar-dim",onClick:()=>C(!1),"aria-hidden":"true"}),f.jsxs("div",{className:w.cx("rqmii-avatar-call",p&&"is-chat-open",k&&"is-fullscreen",w.languageFontClass()),dir:"ltr",children:[f.jsxs("div",{ref:d,className:"rqmii-avatar-stage",children:[f.jsx(eS,{track:o,onShowing:m}),!h&&f.jsx(tS,{agent:t,language:n}),f.jsxs("div",{className:"rqmii-avatar-top",children:[f.jsx(Mn,{className:"rqmii-avatar-fullscreen",label:A(k?"exitFullScreen":"fullScreen"),onClick:()=>C(y=>!y),children:k?f.jsx(rr,{size:22}):f.jsx(Gu,{size:22})}),s&&f.jsx(Mn,{label:A("minimize"),onClick:a,children:f.jsx(wa,{size:22})}),f.jsx(Mn,{className:"is-danger",label:A("endCall"),onClick:i,children:f.jsx(ir,{size:22})})]}),S.length>0&&f.jsx("div",{className:"rqmii-avatar-suggestions",children:S.map(y=>f.jsx("button",{type:"button",dir:"auto",title:y,onClick:()=>r.sendTextMessage(y),children:y},y))}),f.jsxs("div",{className:"rqmii-avatar-bottom",children:[f.jsxs("div",{className:"rqmii-avatar-bottom-start",children:[f.jsx(Mn,{label:A(u?"unmuteSpeaker":"muteSpeaker"),onClick:()=>l(!u),children:u?f.jsx(Ef,{size:22}):f.jsx(gf,{size:22})}),f.jsxs("div",{className:"rqmii-avatar-talk",children:[f.jsx(K_,{sdk:r,language:n}),f.jsx(W_,{activity:V_(r),language:n,canInterrupt:w.canInterruptSpeech(t,n,!!r.isFirstAgentSpeech)})]})]}),f.jsx(Mn,{className:w.cx("rqmii-avatar-chat-toggle",p&&"is-open"),label:A(p?"closeChat":"openChat"),onClick:()=>g(y=>!y),children:f.jsx(tf,{size:22})})]})]}),p&&f.jsx(Z_,{sdk:r,language:n,onClose:()=>g(!1)})]})]})});function vh({content:e,children:t,className:n="",...r}){const i=(e!==void 0?e:t)||"";return!i||!i.trim()?null:f.jsx(ci,{className:`rqmii-markdown ${n}`.trim(),content:i,...r})}const Oh=b.memo(vh);function Dh({language:e,content:t,config:n,agent:r,onAccept:i,onDecline:a}){const s=t||n?.body?.[e]||w.getChatText(e,"consentBody")||"",o=n?.acceptLabel?.[e]||w.getChatText(e,"consentAccept"),u=n?.declineLabel?.[e]||w.getChatText(e,"consentDecline");return f.jsxs("div",{className:w.cx("rqmii-chat-panel rqmii-chat-panel--consent",w.languageFontClass()),dir:w.languageTextDirection(e),children:[f.jsx("div",{className:"rqmii-chat-consent-body",children:f.jsx(Oh,{content:s})}),f.jsxs("div",{className:"rqmii-chat-consent-actions",children:[f.jsx("button",{type:"button",className:"rqmii-chat-consent-button rqmii-chat-consent-button--decline",onClick:a,children:u}),f.jsx("button",{type:"button",className:"rqmii-chat-consent-button rqmii-chat-consent-button--accept",onClick:i,children:o})]})]})}function iS(e){return e?typeof e=="string"?e:typeof e=="object"&&typeof e.text=="string"?e.text:"":""}const Is=b.memo(function({agent:t,language:n,languages:r,onLanguageChange:i=w.noop,onEndSession:a=w.noop,onMinimize:s,messages:o,onSendMessage:u,isPreview:l=!1,chatKind:d,sdk:h,renderPanel:m,messagesRef:p,initialText:g,autoStartVoice:k}){const C=t.widget?.consent||t.consent,A=!!C?.enabled,S=C?.content?.[n]||C?.body?.[n]||"",y=C?.one_time!==!1,D=t.id?`rqmii_consent_${t.id}`:null,[M,L]=b.useState(()=>{if(!A||!S)return!0;if(y&&D&&typeof window<"u")try{return window.localStorage.getItem(D)==="true"}catch{return!1}return!1}),P=d||w.resolveChatKind(t),O=!l&&(!!g||!!k),U=P==="avatar"?!!h.isInRoom:h.isSessionReady,[I,F]=b.useState(()=>w.isCallChatKind(P)&&U),[$,W]=b.useState(()=>(P==="text"||P==="hybrid")&&h.isSessionReady),[G,q]=b.useState(!1),[Q,Z]=b.useState(O),[ae,he]=b.useState(null),T=w.isCallChatKind(P)&&I||P==="hybrid"&&$,Ne=w.useElapsed(T),_e=w.useVisualViewportHeight(),N=A&&!!S&&!M&&!l,{events:me}=Fe.useRqmiiConnection();b.useEffect(()=>{if(!me)return;const be=()=>{w.isMobileViewport()&&q(!0)},Ke=()=>q(!1);return me.on("minimize_chat",be),me.on("maximize_chat",Ke),()=>{me.off("minimize_chat",be),me.off("maximize_chat",Ke)}},[me]);const ge=b.useCallback(()=>{if(y&&D&&typeof window<"u")try{window.localStorage.setItem(D,"true")}catch{}L(!0)},[y,D]),te=b.useCallback(()=>{s?s():a()},[s,a]),we=be=>{i(be),l||h.changeSessionLanguage(be)},De=b.useCallback(be=>{if(he(null),Z(!0),u){u(be);return}h.sendTextMessage(be)},[u,h]);b.useEffect(()=>{p&&(p.current=h.messages)});const Y=b.useRef(!1);b.useEffect(()=>{Y.current||l||(g?(Y.current=!0,De(g)):k&&(Y.current=!0,he(null),Z(!0),h.isVoiceActive||h.startVoice()))},[]),b.useEffect(()=>{Q&&U&&(Z(!1),w.isCallChatKind(P)?F(!0):W(!0))},[Q,U,P]),b.useEffect(()=>{Q&&h.error&&(Z(!1),he(h.error))},[Q,h.error]);const oe=b.useCallback(()=>{he(null),Z(!0),h.isVoiceActive||h.startVoice()},[h]);if(h.error&&!l&&($||I))return f.jsx(P_,{message:h.error,language:n,onClose:a});if(N)return f.jsx(Dh,{language:n,content:S,config:t.consent,agent:t,onAccept:ge,onDecline:te});const Se={agent:t,language:n,languages:r,chatKind:P,sdk:h,isPreview:l,onLanguageChange:we,onClose:a,onMinimize:()=>q(!0),onRestore:()=>q(!1),onSend:De,voiceStarted:I,conversationStarted:$,isMinimized:G,elapsed:Ne,setVoiceStarted:F,setConversationStarted:W};return m?f.jsx(f.Fragment,{children:m(Se)}):f.jsx(aS,{...Se,connecting:Q,connectError:ae,visualViewportHeight:_e,onCloseWidget:s??a,initiateVoice:oe,onSendSuggestion:be=>{he(null),Z(!0),h.sendSuggestion?.(be)}})}),aS=b.memo(function({agent:t,language:n,languages:r,chatKind:i,sdk:a,onLanguageChange:s,onClose:o,onMinimize:u,onRestore:l,onSend:d,voiceStarted:h,conversationStarted:m,isMinimized:p,elapsed:g,setVoiceStarted:k,setConversationStarted:C,visualViewportHeight:A,connecting:S=!1,connectError:y=null,onCloseWidget:D,initiateVoice:M,onSendSuggestion:L}){const P=t.widget?.behavior?.typing_indicator_enabled??!0,O=i==="text"?a.waitingForResponse&&P:!1,U=a.messages;if(p)return f.jsx(q_,{agent:t,language:n,onRestore:l,onClose:o,isListening:a.isVoiceActive,isAudioPlaying:a.isAudioPlaying,isSpeaking:a.mic.isSpeaking,isAgentSpeaking:a.isAgentSpeaking,isFirstAgentSpeech:a.isFirstAgentSpeech,onToggleVoice:a.toggleVoice,elapsed:g,variant:i==="text"?"text":"voice"});if(i==="voice"&&h)return f.jsx(U_,{agent:t,language:n,onEndSession:o,onMinimize:u,isListening:a.isVoiceActive,isLoading:a.mic.isLoading,isSpeaking:a.mic.isSpeaking,isAudioPlaying:a.isAudioPlaying,isAgentThinking:a.isAgentThinking,isAgentSpeaking:a.isAgentSpeaking,isFirstAgentSpeech:a.isFirstAgentSpeech,onToggleVoice:a.toggleVoice,elapsed:g,visualViewportHeight:A});if(i==="avatar"&&h)return f.jsx(rS,{agent:t,language:n,sdk:a,onEndSession:o,onMinimize:u});if(w.isCallChatKind(i))return f.jsx(F_,{agent:t,language:n,languages:r,onLanguageChange:s,onClose:D,isAudioPlaying:a.isAudioPlaying,isVoiceSetupLoading:a.isVoiceSetupLoading||S,onStartVoice:M,visualViewportHeight:A});if(!m&&(a.messages.length===0||S)){const I=(t.widget?.behavior?.suggested_messages?.[n]||t.conversation?.suggested_messages?.[n])?.filter(W=>W.trim())||void 0,F=W=>{a.sendSuggestion?L(W):d?.(W)},$=i==="hybrid"||w.resolveChatKind(t)==="hybrid";return f.jsx(B_,{agent:t,language:n,languages:r,onLanguageChange:s,onClose:D,onSend:d,isVoiceEnabled:$,isAudioPlaying:a.isAudioPlaying,isVoiceSetupLoading:a.isVoiceSetupLoading||S,onStartVoice:M,visualViewportHeight:A,disabled:S,connecting:S,error:y||void 0,suggestions:I,onSuggestionClick:F,compact:!!I})}return f.jsx(j_,{agent:t,language:n,onEndSession:o,messages:U,partialTranscript:iS(a.partialTranscript),onSend:d,isAudioPlaying:a.isAudioPlaying,isVoiceEnabled:i==="hybrid",isListening:a.isVoiceActive,isSpeaking:a.mic.isSpeaking,isLoading:a.mic.isLoading,isAgentThinking:a.isAgentThinking,isAgentSpeaking:a.isAgentSpeaking,isFirstAgentSpeech:a.isFirstAgentSpeech,onToggleVoice:a.toggleVoice,onStartVoice:a.startVoice,onMinimize:u,elapsed:g,visualViewportHeight:A,waitingForResponse:O})}),sS={isListening:!1,isLoading:!1,isSpeaking:!1};function Ls(){const{messages:e,sendTextMessage:t,clearMessages:n}=Fe.useRqmiiMessages(),{partialTranscript:r,microphone:i,talkMode:a,isUserSpeaking:s,isAudioPlaying:o,setMicrophoneEnabled:u}=ze.useRqmiiVoice(),{changeSessionLanguage:l,clearSessionHistory:d,interrupt:h,error:m,isConnected:p,isSessionReady:g,isAgentThinking:k,isAgentSpeaking:C,isFirstAgentSpeech:A,session:S}=Fe.useRqmiiConnection(),[y,D]=b.useState([]),[M,L]=b.useState(!1),[P,O]=b.useState(!1),U=b.useRef(!1),I=b.useRef(e.length);b.useEffect(()=>{!g||y.length===0||(y.forEach(ae=>t(ae)),D([]))},[g,y,t]),b.useEffect(()=>{if(e.length>I.current){const ae=e[e.length-1];ae.role==="assistant"&&ae.streaming&&L(!1)}I.current=e.length},[e]),ze.useRqmiiEvents("message_rate_limited",b.useCallback(()=>L(!1),[]));const F=a===Fe.TALK_MODE.PUSH_TO_TALK,$=p&&S.modality==="voice";b.useEffect(()=>{!$||F||i.pending||(P&&!i.enabled&&!U.current?(U.current=!0,u(!0)):!P&&i.enabled&&u(!1))},[$,F,P,i.enabled,i.pending,u]);const W=b.useCallback(ae=>{ae&&(U.current=!1),O(ae)},[]),G=b.useCallback(ae=>{L(!0),g?t(ae):D(he=>[...he,ae])},[g,t]),q=b.useMemo(()=>y.length===0?e:[...e,...y.map((ae,he)=>({id:`pending-${he}`,role:"user",text:ae}))],[e,y]),Q=b.useCallback(()=>{D([]),n()},[n]),Z={isListening:i.enabled,isLoading:i.pending||!F&&P&&!i.enabled&&!i.error,isSpeaking:s};return{displayMessages:q,send:G,clearAll:Q,waitingForResponse:M,voiceRequested:P,setVoice:W,pushToTalk:F,mic:Z,partialTranscript:r,isAudioPlaying:o,changeSessionLanguage:l,clearSessionHistory:d,interrupt:h,error:m,isSessionReady:g,isInRoom:p,isAgentThinking:k,isAgentSpeaking:C,isFirstAgentSpeech:A}}function Ph(e){const{isPreview:t=!1,...n}=e,r=Ls(),i={sendMessage:r.send,enableVoice:w.noop,disableVoice:w.noop,language:e.language,isSessionReady:r.isSessionReady,supportsVoice:!1,isVoiceActive:!1,chatKind:"text"},a=(u,l)=>{e.onSessionStart?.(),l.sendMessage(u)},s=u=>(e.onTextSend??a)(u,i),o={messages:r.displayMessages,sendTextMessage:s,clearMessages:r.clearAll,clearSessionHistory:r.clearSessionHistory,isAudioPlaying:!1,partialTranscript:null,changeSessionLanguage:r.changeSessionLanguage,error:r.error,isAgentThinking:r.isAgentThinking,isAgentSpeaking:r.isAgentSpeaking,isFirstAgentSpeech:r.isFirstAgentSpeech,isVoiceSetupLoading:!1,isVoiceActive:!1,isSessionReady:r.isSessionReady,mic:sS,startVoice:w.noop,toggleVoice:w.noop,waitingForResponse:r.waitingForResponse,sendSuggestion:s};return f.jsx(Is,{...n,isPreview:t,chatKind:"text",sdk:o})}function Mh(e){const{isPreview:t=!1,chatKind:n,...r}=e,i=Ls(),a={sendMessage:i.send,enableVoice:()=>i.setVoice(!0),disableVoice:()=>i.setVoice(!1),language:e.language,isSessionReady:i.isSessionReady,supportsVoice:!0,isVoiceActive:i.voiceRequested,chatKind:n},s=h=>{e.onSessionStart?.(),h.enableVoice()},o=h=>{h.isVoiceActive?h.disableVoice():h.enableVoice()},u=()=>(e.onVoiceStart??s)(a),l=()=>(e.onVoiceToggle??o)(a),d={messages:i.displayMessages,sendTextMessage:n==="avatar"?i.send:w.noop,clearMessages:i.clearAll,clearSessionHistory:i.clearSessionHistory,interrupt:i.interrupt,isAudioPlaying:i.isAudioPlaying,partialTranscript:i.partialTranscript,changeSessionLanguage:i.changeSessionLanguage,error:i.error,isAgentThinking:i.isAgentThinking,isAgentSpeaking:i.isAgentSpeaking,isFirstAgentSpeech:i.isFirstAgentSpeech,isVoiceSetupLoading:i.mic.isLoading,isVoiceActive:i.voiceRequested,isSessionReady:i.isSessionReady,isInRoom:i.isInRoom,pushToTalk:i.pushToTalk,mic:i.mic,startVoice:u,toggleVoice:l};return f.jsx(Is,{...r,isPreview:t,chatKind:n,sdk:d})}function Bh(e){return f.jsx(Mh,{...e,chatKind:"voice"})}function Fh(e){const{isPreview:t=!1,...n}=e,r=Ls(),i=b.useRef(!1),a={sendMessage:r.send,enableVoice:()=>r.setVoice(!0),disableVoice:()=>r.setVoice(!1),language:e.language,isSessionReady:r.isSessionReady,supportsVoice:!0,isVoiceActive:r.voiceRequested,chatKind:"hybrid"},s=g=>{e.onSessionStart?.(),!i.current&&(i.current=!0,g==="text"?e.onStartText?.():e.onStartVoice?.())},o=(g,k)=>{s("text"),k.sendMessage(g)},u=g=>{s("voice"),g.enableVoice()},l=g=>{g.isVoiceActive?g.disableVoice():g.enableVoice()},d=g=>(e.onTextSend??o)(g,a),h=()=>(e.onVoiceStart??u)(a),m=()=>(e.onVoiceToggle??l)(a),p={messages:r.displayMessages,sendTextMessage:d,clearMessages:r.clearAll,clearSessionHistory:r.clearSessionHistory,isAudioPlaying:r.isAudioPlaying,partialTranscript:r.partialTranscript,changeSessionLanguage:r.changeSessionLanguage,error:r.error,isAgentThinking:r.isAgentThinking,isAgentSpeaking:r.isAgentSpeaking,isFirstAgentSpeech:r.isFirstAgentSpeech,isVoiceSetupLoading:r.mic.isLoading,isVoiceActive:r.voiceRequested,isSessionReady:r.isSessionReady,mic:r.mic,startVoice:h,toggleVoice:m,waitingForResponse:r.waitingForResponse,sendSuggestion:g=>{s("voice"),r.setVoice(!0),r.send(g)}};return f.jsx(Is,{...n,isPreview:t,chatKind:e.textOnly?"text":"hybrid",sdk:p})}function Hh(e){return f.jsx(Mh,{...e,chatKind:"avatar"})}function Rs({agent:e,language:t,languages:n,onLanguageChange:r,onEndSession:i,onMinimize:a,onStartText:s,onStartVoice:o,textOnly:u,messages:l,onSendMessage:d,isPreview:h,onSessionStart:m,initialText:p,autoStartVoice:g}){const k=w.resolveChatKind(e),C={agent:e,language:t,languages:n,onLanguageChange:r,onEndSession:i,onMinimize:a,messages:l,onSendMessage:d,isPreview:h,onSessionStart:m,initialText:p,autoStartVoice:g};switch(k){case"voice":return f.jsx(Bh,{...C});case"avatar":return f.jsx(Hh,{...C});case"hybrid":return f.jsx(Fh,{...C,onStartText:s,onStartVoice:o,textOnly:u});case"text":default:return f.jsx(Ph,{...C})}}function oS(e){switch(e.view){case"feedback":return f.jsx(Ns,{...e.feedback});case"ended":return f.jsx(ws,{...e.ended});case"chat":default:return f.jsx(Rs,{...e.chat})}}const uS=Object.freeze(Object.defineProperty({__proto__:null,ChatBoxDispatcher:Rs,EndedChatPanel:ws,FeedbackPanel:Ns,OpenChatView:oS},Symbol.toStringTag,{value:"Module"}));function lS(e){const{agent:t,language:n,open:r=!0,className:i="",messages:a,onSendMessage:s,onClose:o}=e,u=b.useMemo(()=>w.normalizePublicAgent(t),[t]),[l,d]=b.useState(r),[h,m]=b.useState(n||u.defaultLanguage),p=b.useMemo(()=>w.normalizeChatLanguages(u.languages,u.defaultLanguage),[u.defaultLanguage,u.languages]),g=u.widget?.appearance?.theme?.mode==="light"?"light":"dark",k=b.useMemo(()=>w.resolveWidgetThemeStyles(u.widget?.appearance),[u.widget?.appearance]);return b.useEffect(()=>{n&&m(n)},[n]),b.useEffect(()=>{d(r)},[r]),b.useEffect(()=>{w.ensureGoogleFontLoaded(u.widget?.appearance?.font)},[u.widget?.appearance?.font]),f.jsx(Fe.RqmiiAgentProvider,{restUrl:"",enableAudio:!1,children:f.jsx("div",{className:w.cx("rqmii-chat-surface is-preview",`rqmii-theme-${g}`,u.widget?.appearance?.position==="left"&&"rqmii-position-left",i),"data-theme":g,style:k,dir:"ltr",children:l?f.jsx(Rs,{agent:u,language:h,languages:p,onLanguageChange:m,onEndSession:()=>{d(!1),o?.()},onMinimize:()=>{d(!1),o?.()},messages:a,onSendMessage:s,isPreview:!0}):null})})}const cS=5e3,dS=4e3,hS="rqmii_avatar_device_key",fS="pair";function Gi(e){return e?.code}function pS(e){const t=e?.status;return typeof t=="number"&&t>=400&&t<500&&t!==429}class mS{constructor(t){this.deps=t;const n=t.link.token()?"pairing":t.keys.get()?"idle":"not_paired";this.current={phase:n,agentName:null,screenOnline:null,tabletAllowed:!0,talkMode:null,notice:null,session:null}}current;listeners=new Set;pollTimer=null;endedTimer=null;disposed=!1;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));getState=()=>this.current;async start(){const t=this.deps.link.token();if(t){this.set({phase:"pairing",notice:null});try{const n=await this.deps.api.claimTablet(t,this.deps.tabletName);this.deps.keys.set(n.key),this.deps.link.clear()}catch(n){if(pS(n)&&this.deps.link.clear(),this.disposed)return;if(!this.deps.keys.get()){const r=Gi(n)===ze.AVATAR_DEVICE_ERROR.PAIRING_NOT_FOUND?"pairing_expired":"error";this.set({phase:"not_paired",notice:r});return}}}await this.refresh()}async talk(){const t=this.deps.keys.get();if(!(!t||this.current.phase!=="idle")){this.set({phase:"starting",notice:null});try{const n=await this.deps.api.startSession(t);if(this.disposed)return;this.set({phase:"in_conversation",session:n,screenOnline:!0})}catch(n){if(this.disposed)return;switch(Gi(n)){case ze.AVATAR_DEVICE_ERROR.NOT_PAIRED:this.forget();return;case ze.AVATAR_DEVICE_ERROR.SCREEN_OFFLINE:this.set({phase:"idle",screenOnline:!1});break;case ze.AVATAR_DEVICE_ERROR.BUSY:this.set({phase:"idle",notice:"busy"});break;case ze.AVATAR_DEVICE_ERROR.CONTROL_BUILT_IN:this.set({phase:"idle",tabletAllowed:!1});break;default:this.set({phase:"idle",notice:"error"})}this.schedulePoll()}}}sessionEnded(){this.current.phase==="in_conversation"&&(this.set({phase:"ended",session:null}),this.endedTimer=setTimeout(()=>{this.endedTimer=null,this.set({phase:"idle"}),this.refresh()},this.deps.endedMs??dS))}joinFailed(){this.current.phase==="in_conversation"&&(this.set({phase:"idle",session:null,notice:"error"}),this.refresh())}dispose(){this.disposed=!0,this.clearPoll(),this.endedTimer&&clearTimeout(this.endedTimer),this.endedTimer=null,this.listeners.clear()}async refresh(){const t=this.deps.keys.get();if(!t){this.set({phase:"not_paired"});return}try{const n=await this.deps.api.me(t);if(this.disposed)return;this.set({agentName:n.agent?.name??null,screenOnline:n.desktop?.online??!1,tabletAllowed:n.settings?.control!==Fe.AVATAR_CONTROL.BUILT_IN,talkMode:Fe.parseTalkMode(n.settings?.talk_mode),...this.current.phase==="pairing"?{phase:"idle"}:{},...this.current.notice==="error"?{notice:null}:{}})}catch(n){if(this.disposed)return;if(Gi(n)===ze.AVATAR_DEVICE_ERROR.NOT_PAIRED){this.forget();return}this.current.phase==="pairing"&&this.set({phase:"idle"})}this.schedulePoll()}forget(){this.deps.keys.clear(),this.set({phase:"not_paired",agentName:null,screenOnline:null,tabletAllowed:!0,talkMode:null,notice:null,session:null})}schedulePoll(){this.clearPoll(),!(this.disposed||this.current.phase!=="idle")&&(this.pollTimer=setTimeout(()=>{this.pollTimer=null,this.refresh()},this.deps.pollMs??cS))}clearPoll(){this.pollTimer&&clearTimeout(this.pollTimer),this.pollTimer=null}set(t){if(!this.disposed){this.current={...this.current,...t},this.current.phase!=="idle"&&this.clearPoll();for(const n of this.listeners)n()}}}function gS(e=hS){return{get(){try{return window.localStorage.getItem(e)}catch{return null}},set(t){try{window.localStorage.setItem(e,t)}catch{}},clear(){try{window.localStorage.removeItem(e)}catch{}}}}function bS(e=fS){return{token(){try{return new URL(window.location.href).searchParams.get(e)||null}catch{return null}},clear(){try{const t=new URL(window.location.href);t.searchParams.delete(e),window.history.replaceState(window.history.state,"",t.toString())}catch{}}}}function ES(e,t){const n=t.trim();if(n)return{role:"user",text:n};for(let r=e.length-1;r>=0;r-=1){const i=e[r].role??e[r].sender,a=e[r].text.trim();if((i==="user"||i==="assistant")&&a)return{role:i,text:a}}return null}function TS({restUrl:e=Fe.DEFAULT_REST_URL,language:t="en",tabletName:n="Tablet",theme:r="dark",className:i,debug:a=!1}){return f.jsx(Fe.RqmiiAgentProvider,{restUrl:e,enableAudio:!1,debug:a,children:f.jsx("div",{className:w.cx("rqmii-chat-surface",`rqmii-theme-${r}`,"rqmii-remote",i),"data-theme":r,dir:w.languageTextDirection(t),children:f.jsx(kS,{restUrl:e,language:t,tabletName:n})})})}function xS(e,t){const[n,r]=b.useState(null);return b.useEffect(()=>{const i=new mS({api:ze.createAvatarDeviceApi(e),keys:gS(),link:bS(),tabletName:t}),a=()=>r({controller:i,state:i.getState()});a();const s=i.subscribe(a);return i.start(),()=>{s(),i.dispose()}},[e,t]),n}function kS({restUrl:e,language:t,tabletName:n}){const r=xS(e,n),i=o=>w.getChatText(t,o);if(!r)return f.jsx(qn,{icon:f.jsx(rt,{className:"rqmii-chat-spin",size:28}),text:i("loading")});const{controller:a,state:s}=r;switch(s.phase){case"not_paired":return f.jsx(qn,{icon:f.jsx(lf,{size:40}),text:i(s.notice==="pairing_expired"?"remotePairingExpired":"remoteNotPaired"),detail:s.notice==="error"?i("sessionError"):void 0});case"pairing":return f.jsx(qn,{icon:f.jsx(rt,{className:"rqmii-chat-spin",size:28}),text:i("remotePairing")});case"in_conversation":return f.jsxs(f.Fragment,{children:[f.jsx(Sa,{name:s.agentName}),f.jsx(AS,{session:s.session,language:t,settingsTalkMode:s.talkMode,onEnded:()=>a.sessionEnded(),onFailed:()=>a.joinFailed()})]});case"ended":return f.jsxs(f.Fragment,{children:[f.jsx(Sa,{name:s.agentName}),f.jsx(qn,{text:i("remoteEnded")})]});default:return f.jsx(yS,{state:s,language:t,onTalk:()=>void a.talk()})}}function Sa({name:e,children:t}){return f.jsxs("header",{className:"rqmii-remote-header",children:[f.jsx("h1",{className:"rqmii-remote-agent",children:f.jsx("bdi",{children:e??""})}),t]})}function qn({icon:e,text:t,detail:n}){return f.jsxs("div",{className:"rqmii-remote-status",role:"status",children:[e,f.jsx("p",{children:t}),n&&f.jsx("p",{className:"rqmii-remote-detail",children:n})]})}function yS({state:e,language:t,onTalk:n}){const r=o=>w.getChatText(t,o),i=e.phase==="starting",a=e.screenOnline===!1,s=e.tabletAllowed?e.notice==="busy"?r("remoteBusy"):e.notice==="error"?r("sessionError"):null:r("remoteControlBuiltIn");return e.agentName===null&&!s?f.jsx(qn,{icon:f.jsx(rt,{className:"rqmii-chat-spin",size:28}),text:r("loading")}):f.jsxs(f.Fragment,{children:[f.jsx(Sa,{name:e.agentName,children:e.screenOnline!==null&&f.jsxs("span",{className:w.cx("rqmii-remote-screen",!a&&"is-online"),children:[f.jsx("span",{className:"rqmii-remote-dot"}),r(a?"remoteScreenOffline":"remoteScreenOnline")]})}),f.jsxs("button",{type:"button",className:"rqmii-remote-talk",onClick:n,disabled:i||a||!e.tabletAllowed,children:[i?f.jsx(rt,{className:"rqmii-chat-spin",size:44}):f.jsx(Dt,{size:48}),f.jsx("span",{children:r(i?"loading":"remoteTapToTalk")})]}),s&&f.jsx("p",{className:"rqmii-remote-notice",role:"alert",children:s})]})}function AS({session:e,language:t,settingsTalkMode:n,onEnded:r,onFailed:i}){const a=L=>w.getChatText(t,L),{joinSession:s,endSession:o,disconnect:u,isConnected:l,connectionState:d,sessionEnd:h}=Fe.useRqmiiConnection(),{microphone:m,setMicrophoneEnabled:p,partialTranscript:g,talkMode:k}=ze.useRqmiiVoice(),C=(k??n)===Fe.TALK_MODE.PUSH_TO_TALK,{messages:A}=Fe.useRqmiiMessages(),S=ze.useRqmiiPressToTalk(),y=b.useRef({onEnded:r,onFailed:i,joinSession:s,disconnect:u});y.current={onEnded:r,onFailed:i,joinSession:s,disconnect:u};const D=b.useRef(!1);b.useEffect(()=>{let L=!0;return y.current.joinSession(e).catch(()=>{L&&y.current.onFailed()}),()=>{L=!1,y.current.disconnect()}},[e]),b.useEffect(()=>{h?y.current.onEnded():d==="failed"&&y.current.onFailed()},[h,d]),b.useEffect(()=>{C||!l||D.current||(D.current=!0,p(!0))},[C,l,p]);const M=ES(A,typeof g?.text=="string"?g.text:"");return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"rqmii-remote-caption","aria-live":"polite",children:[M?f.jsx("span",{dir:"auto",className:w.cx(M.role==="user"&&"is-user"),children:M.text}):null,!l&&f.jsx(rt,{className:"rqmii-chat-spin",size:28})]}),f.jsxs("div",{className:"rqmii-remote-controls",children:[C?f.jsxs("button",{type:"button",className:w.cx("rqmii-remote-talk","is-hold",S.isRecording&&"is-recording"),disabled:!l,...S.eventHandlers,children:[f.jsx(Dt,{size:44}),f.jsx("span",{children:a("holdToTalk")})]}):f.jsxs("button",{type:"button",className:w.cx("rqmii-remote-round",!m.enabled&&"is-muted"),disabled:!l||m.pending,onClick:()=>void p(!m.enabled),children:[m.enabled?f.jsx(Dt,{size:28}):f.jsx(nr,{size:28}),f.jsx("span",{children:a(m.enabled?"remoteMute":"remoteUnmute")})]}),f.jsxs("button",{type:"button",className:"rqmii-remote-round is-danger",onClick:o,children:[f.jsx(ir,{size:28}),f.jsx("span",{children:a("endCall")})]})]})]})}function CS({agent:e,defaultOpen:t,className:n="",preview:r=!1,ChatBoxComponent:i}){const a=t!==void 0?t:e.widget?.behavior?.default_open??!1,[s,o]=b.useState(a),[u,l]=b.useState(e.defaultLanguage),d=b.useMemo(()=>w.normalizeChatLanguages(e.languages,e.defaultLanguage),[e.defaultLanguage,e.languages]);b.useEffect(()=>{l(e.defaultLanguage)},[e.defaultLanguage]),b.useEffect(()=>{o(a)},[a]);const h=e.widget?.appearance?.theme?.mode==="light"?"light":"dark",m=b.useMemo(()=>w.resolveWidgetThemeStyles(e.widget?.appearance),[e.widget?.appearance]);return f.jsxs("div",{className:w.cx("rqmii-chat-surface",`rqmii-theme-${h}`,r&&"is-preview",n),"data-theme":h,style:m,children:[!s&&f.jsx(w.RqmiiChatOpenButton,{agent:e,onClick:()=>o(!0),position:r?"static":"fixed"}),s&&f.jsx(i,{agent:e,language:u,languages:d,onLanguageChange:l,onClose:()=>o(!1),isPreview:r})]})}exports.ChatPanels=uS;exports.ConsentDialog=Dh;exports.EndedChatPanel=ws;exports.FeedbackPanel=Ns;exports.In=Rd;exports.Message=E_;exports.MessageAvatar=y_;exports.MessageContent=x_;exports.MessageList=fi;exports.R=ve;exports.RatingBar=Lh;exports.Response=g_;exports.RqmiiAgentChatPreview=lS;exports.RqmiiAvatarChatBox=Hh;exports.RqmiiAvatarRemote=TS;exports.RqmiiChatFooter=Bt;exports.RqmiiChatSurface=CS;exports.RqmiiHybridChatBox=Fh;exports.RqmiiMarkdown=Oh;exports.RqmiiMarkdownComponent=vh;exports.RqmiiMessage=di;exports.RqmiiMessageAvatar=wh;exports.RqmiiMessageContent=hi;exports.RqmiiResponse=ci;exports.RqmiiTextChatBox=Ph;exports.RqmiiVoiceChatBox=Bh;exports.Wc=O3;exports.co=Nh;
289
+ //# sourceMappingURL=ui-qViuypFA.cjs.map