fumapress 0.1.19 → 0.1.21

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 (77) hide show
  1. package/dist/lib/cli/index.mjs +1 -1
  2. package/dist/waku/public/assets/Icon-C79MpmBL.js +1 -0
  3. package/dist/waku/public/assets/{Icon-COiEluKG.js → Icon-D30p-2dq.js} +1 -1
  4. package/dist/waku/public/assets/{_root-B_HBMvxm.js → _root-BWh8XBln.js} +2 -2
  5. package/dist/waku/public/assets/_root-CzUOgPm2.css +1 -0
  6. package/dist/waku/public/assets/{algolia-B3g3v3EV.js → algolia-B1uhfuD6.js} +1 -1
  7. package/dist/waku/public/assets/{chevron-right-BKmSaGje.js → chevron-right-DmP6Xa1g.js} +1 -1
  8. package/dist/waku/public/assets/client-BSFjekJY.js +3 -0
  9. package/dist/waku/public/assets/{collapsible-lnBmMjCH.js → collapsible-B2rvGry7.js} +1 -1
  10. package/dist/waku/public/assets/{core-Skfz1hTb.js → core-C4jOG9I2.js} +1 -1
  11. package/dist/waku/public/assets/{i18n-CfTR60fN.js → i18n-V4QzeUbV.js} +1 -1
  12. package/dist/waku/public/assets/{index-DQN2bJK2.js → index-2HLUYgxN.js} +4 -4
  13. package/dist/waku/public/assets/{index-BLdweJQi.js → index-B-5ouVG_.js} +1 -1
  14. package/dist/waku/public/assets/{index-Bv3Sshd_.js → index-B65N5043.js} +1 -1
  15. package/dist/waku/public/assets/index-B7lX48CB.js +1 -0
  16. package/dist/waku/public/assets/{index-CQFhgOU6.js → index-BQZmdbam.js} +1 -1
  17. package/dist/waku/public/assets/{index-C4ekDDoc.js → index-Bojr-xLv.js} +1 -1
  18. package/dist/waku/public/assets/{index-ClhcZbgA.js → index-Bonlu0LX.js} +1 -1
  19. package/dist/waku/public/assets/{index-B4yKXNqP.js → index-CBSxJfFU.js} +1 -1
  20. package/dist/waku/public/assets/{index-C4FVOzMP.js → index-CYJW3hzB.js} +1 -1
  21. package/dist/waku/public/assets/{index-CLBYRJc0.js → index-DHENdpwd.js} +1 -1
  22. package/dist/waku/public/assets/{index-qvXn3qJl.js → index-DW9Fo86a.js} +1 -1
  23. package/dist/waku/public/assets/{index-pZ5n5tBM.js → index-NB9D4S1v.js} +1 -1
  24. package/dist/waku/public/assets/{index-DAcpNNU5.js → index-OFfnl8sH.js} +2 -2
  25. package/dist/waku/public/assets/{index-DPwGee8S.js → index-xXa72sZS.js} +1 -1
  26. package/dist/waku/public/assets/link-item-BlYkot48.js +1 -0
  27. package/dist/waku/public/assets/{merge-refs-DGylEIna.js → merge-refs-BIez66Kl.js} +1 -1
  28. package/dist/waku/public/assets/{orama-cloud-BbAUhDdL.js → orama-cloud-CazpSeQ0.js} +1 -1
  29. package/dist/waku/public/assets/{orama-cloud-legacy-EAn6qWjt.js → orama-cloud-legacy-CINWERV2.js} +1 -1
  30. package/dist/waku/public/assets/{orama-static-DFFiYi8s.js → orama-static-DwfVMMmc.js} +1 -1
  31. package/dist/waku/public/assets/{page-actions-CbGyuI_l.js → page-actions--VStSULV.js} +1 -1
  32. package/dist/waku/public/assets/{proxy-BN25oqgy.js → proxy-CWSxKwWP.js} +1 -1
  33. package/dist/waku/public/assets/{search-CM3hxxjx.js → search-D1WUBd3N.js} +1 -1
  34. package/dist/waku/public/assets/{search-default-wm73Z3ib.js → search-default-B2jTK1EC.js} +3 -3
  35. package/dist/waku/public/assets/{use-copy-button-U0RnQ-Sq.js → use-copy-button-BO3GBlwZ.js} +1 -1
  36. package/dist/waku/public/assets/{x-CXuLKQxc.js → x-CB1cQ-bo.js} +1 -1
  37. package/dist/waku/server/__vite_rsc_assets_manifest.js +152 -152
  38. package/dist/waku/server/assets/{_...slugs_-FFECnkNd.js → _...slugs_-8lFegkVB.js} +15 -15
  39. package/dist/waku/server/assets/{_root-7LFxiNtQ.js → _root-B7AMftRI.js} +1 -1
  40. package/dist/waku/server/assets/_root-CzUOgPm2.css +1 -0
  41. package/dist/waku/server/assets/{ai-BlOyHJkC.js → ai-C1Bf8DXZ.js} +2 -2
  42. package/dist/waku/server/assets/{chat-B4sNpxhQ.js → chat-CN1qUeN-.js} +117 -6
  43. package/dist/waku/server/assets/{image.webp-CG_cOBoV.js → image.webp-PNGidV2r.js} +1 -1
  44. package/dist/waku/server/assets/{img-C6_iV7ll.js → img-C2Ne7ke5.js} +1 -1
  45. package/dist/waku/server/assets/{index-R-tQK0RE.js → index-6LQQnOj9.js} +1 -1
  46. package/dist/waku/server/assets/{index-iVWLhMMp.js → index-AIo6cWfN.js} +1 -1
  47. package/dist/waku/server/assets/{index-CN2o9kRC.js → index-BtnFj3IN.js} +1 -1
  48. package/dist/waku/server/assets/{index-BxaQBzTs.js → index-CtEJq0xW.js} +5 -5
  49. package/dist/waku/server/assets/{index-DIk9wD7V.js → index-D6orYQqE.js} +1 -1
  50. package/dist/waku/server/assets/{index-Dc8WLZZv.js → index-DFPuXyRR.js} +1 -1
  51. package/dist/waku/server/assets/{index-DG1vZc9k.js → index-QgPg52ej.js} +1 -1
  52. package/dist/waku/server/assets/{index-D4WDA54B.js → index-dpJ5KyUl.js} +1 -1
  53. package/dist/waku/server/assets/{search-I4q0k5Tn.js → search-BuYfcIgW.js} +2 -2
  54. package/dist/waku/server/assets/{server-entry-inner-D30Qu7bL.js → server-entry-inner-DrYrCg3c.js} +3296 -3282
  55. package/dist/waku/server/assets/{token-7prp37ID.js → token-BJQ71htz.js} +3 -3
  56. package/dist/waku/server/assets/{token-util-DkI_npK8.js → token-util-BdUbceAe.js} +1 -1
  57. package/dist/waku/server/assets/{token-util-BdED7JFc.js → token-util-WrcienE5.js} +2 -2
  58. package/dist/waku/server/build.js +1 -1
  59. package/dist/waku/server/index.js +1 -1
  60. package/dist/waku/server/ssr/__vite_rsc_assets_manifest.js +152 -152
  61. package/dist/waku/server/ssr/assets/{Icon-CuJYBNMX.js → Icon-BkWS2wcn.js} +2 -2
  62. package/dist/waku/server/ssr/assets/{client-BbeQtVWa.js → client-g1PmfWL7.js} +26 -18
  63. package/dist/waku/server/ssr/assets/{collapsible-DxfK8fMb.js → collapsible-Bn5wjTEq.js} +3 -3
  64. package/dist/waku/server/ssr/assets/{index-BuDTCd5w.js → index-BytwN1tT.js} +2 -2
  65. package/dist/waku/server/ssr/assets/{index-D0NctJh1.js → index-CQ75Yqg7.js} +3 -3
  66. package/dist/waku/server/ssr/assets/{index-B6RnbBOa.js → index-Dv24Pwdo.js} +2 -2
  67. package/dist/waku/server/ssr/assets/{index-0siDROv6.js → index-QxYTPkdt.js} +4 -4
  68. package/dist/waku/server/ssr/assets/{link-item-DrU5_9Qt.js → link-item-Biy2LJnp.js} +9 -12
  69. package/dist/waku/server/ssr/assets/{page-actions-dtHZSwdX.js → page-actions-9aIaS5BH.js} +1 -1
  70. package/dist/waku/server/ssr/index.js +9 -9
  71. package/package.json +10 -10
  72. package/dist/waku/public/assets/Icon-DEaqaWE3.js +0 -1
  73. package/dist/waku/public/assets/_root-RXKKoIMN.css +0 -1
  74. package/dist/waku/public/assets/client-C6ia0d9t.js +0 -3
  75. package/dist/waku/public/assets/index-Udz7H4td.js +0 -1
  76. package/dist/waku/public/assets/link-item-zYGCmQHf.js +0 -1
  77. package/dist/waku/server/assets/_root-RXKKoIMN.css +0 -1
@@ -1,4 +1,4 @@
1
- import{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,d as Dt,z as Wt,h as Ft}from"./index-Bv3Sshd_.js";import{c as Me}from"./index-DQN2bJK2.js";import"./index-DAcpNNU5.js";import"./index-BLdweJQi.js";import"./merge-refs-DGylEIna.js";import"./index-C4ekDDoc.js";import"./Icon-COiEluKG.js";import"./schemas-BzqjMV9-.js";import"./use-copy-button-U0RnQ-Sq.js";import"./index-CLBYRJc0.js";import"./x-CXuLKQxc.js";import"./search-CM3hxxjx.js";var S=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qt(t){return Le(t)}function Le(t){return Array.isArray(t)?zt(t):t instanceof RegExp?t:typeof t=="object"?Ht(t):t}function zt(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Le(t[n]);return e}function Ht(t){let e={};for(let n in t)e[n]=Le(t[n]);return e}function st(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function rt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?rt(t.substring(0,t.length-1)):t.substr(~e+1)}var de=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,H=class{static hasCaptures(t){return t===null?!1:(de.lastIndex=0,de.test(t))}static replaceCaptures(t,e,n){return t.replace(de,(s,r,i,o)=>{let a=n[parseInt(r||i,10)];if(a){let c=e.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function it(t,e){return t<e?-1:t>e?1:0}function ot(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=it(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function je(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function at(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Yt(t),e)}static createFromParsedTheme(t,e){return Vt(t,e)}_cachedMatchRoot=new ct(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,s=this._cachedMatchRoot.get(e).find(r=>Ut(t.parent,r.parentScopes));return s?new lt(s.fontStyle,s.foreground,s.background):null}},ge=class Y{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new Y(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new Y(n,e[s]);return n}push(e){return new Y(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ut(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Kt(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Kt(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var lt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Yt(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&je(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&je(o.settings.background)&&(u=o.settings.background);for(let h=0,f=a.length;h<f;h++){let g=a[h].trim().split(" "),b=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[s++]=new Jt(b,_,r,c,l,u)}}return n}var Jt=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},k=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(k||{});function Vt(t,e){t.sort((c,l)=>{let u=it(c.scope,l.scope);return u!==0||(u=ot(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(r=c.background)}let i=new Qt(e),o=new lt(n,i.getId(s),i.getId(r)),a=new Zt(new be(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,o,a)}var Qt=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Xt=Object.freeze([]),be=class ut{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||Xt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new ut(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},Zt=class Se{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Se._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let a=n.indexOf("."),c,l;a===-1?(c=n,l=""):(c=n.substring(0,a),l=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Se(this._mainRule.clone(),be.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,s,r,i,o)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(ot(c.parentScopes,n)===0){c.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new be(e,n,s,r,i))}},$=class A{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=A.getLanguageId(e),s=A.getTokenType(e),r=A.getFontStyle(e),i=A.getForeground(e),o=A.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,s,r,i,o,a){let c=A.getLanguageId(e),l=A.getTokenType(e),u=A.containsBalancedBrackets(e)?1:0,h=A.getFontStyle(e),f=A.getForeground(e),d=A.getBackground(e);return n!==0&&(c=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(f=o),a!==0&&(d=a),(c<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function Q(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=s.next();const c=a();return r===")"&&(r=s.next()),c}if(De(r)){const c=[];do c.push(r),r=s.next();while(De(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(h=>h(u))}function a(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>c.some(h=>h(u))}}function De(t){return!!t&&!!t.match(/[\w\.:]+/)}function en(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function ht(t){typeof t.dispose=="function"&&t.dispose()}var D=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},tn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},nn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},sn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new nn;for(const n of t)rn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof D){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function rn(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof D?J({baseGrammar:i,selfGrammar:r},s):Ce(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const a of o)s.add(new D(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];X([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&X(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&X(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function X(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?st({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&X(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Ce(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?Ce(o.ruleName,c,n):J(c,n)}else o.kind===4?n.add(new tn(o.scopeName,o.ruleName)):n.add(new D(o.scopeName));break}}}var on=class{kind=0},an=class{kind=1},cn=class{constructor(t){this.ruleName=t}kind=2},ln=class{constructor(t){this.scopeName=t}kind=3},un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function ft(t){if(t==="$base")return new on;if(t==="$self")return new an;const e=t.indexOf("#");if(e===-1)return new ln(t);if(e===0)return new cn(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new un(n,s)}}var hn=/\\(\d+)/,We=/\\(\d+)/g,fn=-1,dt=-2;var z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=H.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=H.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${rt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:H.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:H.replaceCaptures(this._contentName,t,e)}},dn=class extends z{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},gn=class extends z{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new W(s,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fe=class extends z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},we=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,a,c,l){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this._end=new W(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Z=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,a,c){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new W(o,dt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new F,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},gt=class N{static createCaptureRule(e,n,s,r,i){return e.registerRule(o=>new dn(n,o,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new gn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=st({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new Z(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,N._compileCaptures(e.whileCaptures||e.captures,n,s),N._compilePatterns(e.patterns,n,s)):new we(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,N._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,N._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let c=0;e[o].patterns&&(c=N.getCompiledRuleId(e[o],n,s)),r[a]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const a=e[i];let c=-1;if(a.include){const l=ft(a.include);switch(l.kind){case 0:case 1:c=N.getCompiledRuleId(s[a.include],n,s);break;case 2:let u=s[l.ruleName];u&&(c=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,f=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(f){let g=d.repository[f];g&&(c=N.getCompiledRuleId(g,n,d.repository))}else c=N.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=N.getCompiledRuleId(a,n,s);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Fe||l instanceof we||l instanceof Z)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class mt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],o=!1;for(let a=0;a<s;a++)if(e.charAt(a)==="\\"&&a+1<s){const l=e.charAt(a+1);l==="z"?(i.push(e.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(l==="A"||l==="G")&&(o=!0),a++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=hn.test(this.source):this.hasBackReferences=!1}clone(){return new mt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(r=>e.substring(r.start,r.end));return We.lastIndex=0,this.source.replace(We,(r,i)=>at(s[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],s=[],r=[],i,o,a,c;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,s[i]=a,r[i]=a,a==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="￿",n[i+1]="￿",s[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="￿",n[i+1]="G",s[i+1]="￿",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,s[i+1]=c,r[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},F=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new qe(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let s=this._items.map(r=>r.resolveAnchors(e,n));return new qe(t,s,this._items.map(r=>r.ruleId))}},qe=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
1
+ import{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,d as Dt,z as Wt,h as Ft}from"./index-B65N5043.js";import{c as Me}from"./index-2HLUYgxN.js";import"./index-OFfnl8sH.js";import"./index-B-5ouVG_.js";import"./merge-refs-BIez66Kl.js";import"./index-Bojr-xLv.js";import"./Icon-D30p-2dq.js";import"./schemas-BzqjMV9-.js";import"./use-copy-button-BO3GBlwZ.js";import"./index-DHENdpwd.js";import"./x-CB1cQ-bo.js";import"./search-D1WUBd3N.js";var S=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qt(t){return Le(t)}function Le(t){return Array.isArray(t)?zt(t):t instanceof RegExp?t:typeof t=="object"?Ht(t):t}function zt(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Le(t[n]);return e}function Ht(t){let e={};for(let n in t)e[n]=Le(t[n]);return e}function st(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function rt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?rt(t.substring(0,t.length-1)):t.substr(~e+1)}var de=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,H=class{static hasCaptures(t){return t===null?!1:(de.lastIndex=0,de.test(t))}static replaceCaptures(t,e,n){return t.replace(de,(s,r,i,o)=>{let a=n[parseInt(r||i,10)];if(a){let c=e.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function it(t,e){return t<e?-1:t>e?1:0}function ot(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=it(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function je(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function at(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Yt(t),e)}static createFromParsedTheme(t,e){return Vt(t,e)}_cachedMatchRoot=new ct(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,s=this._cachedMatchRoot.get(e).find(r=>Ut(t.parent,r.parentScopes));return s?new lt(s.fontStyle,s.foreground,s.background):null}},ge=class Y{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new Y(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new Y(n,e[s]);return n}push(e){return new Y(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ut(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Kt(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Kt(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var lt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Yt(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&je(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&je(o.settings.background)&&(u=o.settings.background);for(let h=0,f=a.length;h<f;h++){let g=a[h].trim().split(" "),b=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[s++]=new Jt(b,_,r,c,l,u)}}return n}var Jt=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},k=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(k||{});function Vt(t,e){t.sort((c,l)=>{let u=it(c.scope,l.scope);return u!==0||(u=ot(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(r=c.background)}let i=new Qt(e),o=new lt(n,i.getId(s),i.getId(r)),a=new Zt(new be(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,o,a)}var Qt=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Xt=Object.freeze([]),be=class ut{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||Xt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new ut(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},Zt=class Se{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Se._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let a=n.indexOf("."),c,l;a===-1?(c=n,l=""):(c=n.substring(0,a),l=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Se(this._mainRule.clone(),be.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,s,r,i,o)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(ot(c.parentScopes,n)===0){c.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new be(e,n,s,r,i))}},$=class A{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=A.getLanguageId(e),s=A.getTokenType(e),r=A.getFontStyle(e),i=A.getForeground(e),o=A.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,s,r,i,o,a){let c=A.getLanguageId(e),l=A.getTokenType(e),u=A.containsBalancedBrackets(e)?1:0,h=A.getFontStyle(e),f=A.getForeground(e),d=A.getBackground(e);return n!==0&&(c=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(f=o),a!==0&&(d=a),(c<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function Q(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=s.next();const c=a();return r===")"&&(r=s.next()),c}if(De(r)){const c=[];do c.push(r),r=s.next();while(De(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(h=>h(u))}function a(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>c.some(h=>h(u))}}function De(t){return!!t&&!!t.match(/[\w\.:]+/)}function en(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function ht(t){typeof t.dispose=="function"&&t.dispose()}var D=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},tn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},nn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},sn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new nn;for(const n of t)rn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof D){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function rn(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof D?J({baseGrammar:i,selfGrammar:r},s):Ce(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const a of o)s.add(new D(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];X([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&X(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&X(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function X(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?st({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&X(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Ce(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?Ce(o.ruleName,c,n):J(c,n)}else o.kind===4?n.add(new tn(o.scopeName,o.ruleName)):n.add(new D(o.scopeName));break}}}var on=class{kind=0},an=class{kind=1},cn=class{constructor(t){this.ruleName=t}kind=2},ln=class{constructor(t){this.scopeName=t}kind=3},un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function ft(t){if(t==="$base")return new on;if(t==="$self")return new an;const e=t.indexOf("#");if(e===-1)return new ln(t);if(e===0)return new cn(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new un(n,s)}}var hn=/\\(\d+)/,We=/\\(\d+)/g,fn=-1,dt=-2;var z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=H.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=H.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${rt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:H.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:H.replaceCaptures(this._contentName,t,e)}},dn=class extends z{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},gn=class extends z{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new W(s,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fe=class extends z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},we=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,a,c,l){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this._end=new W(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Z=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,a,c){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new W(o,dt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new F,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},gt=class N{static createCaptureRule(e,n,s,r,i){return e.registerRule(o=>new dn(n,o,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new gn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=st({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new Z(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,N._compileCaptures(e.whileCaptures||e.captures,n,s),N._compilePatterns(e.patterns,n,s)):new we(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,N._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,N._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let c=0;e[o].patterns&&(c=N.getCompiledRuleId(e[o],n,s)),r[a]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const a=e[i];let c=-1;if(a.include){const l=ft(a.include);switch(l.kind){case 0:case 1:c=N.getCompiledRuleId(s[a.include],n,s);break;case 2:let u=s[l.ruleName];u&&(c=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,f=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(f){let g=d.repository[f];g&&(c=N.getCompiledRuleId(g,n,d.repository))}else c=N.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=N.getCompiledRuleId(a,n,s);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Fe||l instanceof we||l instanceof Z)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class mt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],o=!1;for(let a=0;a<s;a++)if(e.charAt(a)==="\\"&&a+1<s){const l=e.charAt(a+1);l==="z"?(i.push(e.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(l==="A"||l==="G")&&(o=!0),a++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=hn.test(this.source):this.hasBackReferences=!1}clone(){return new mt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(r=>e.substring(r.start,r.end));return We.lastIndex=0,this.source.replace(We,(r,i)=>at(s[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],s=[],r=[],i,o,a,c;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,s[i]=a,r[i]=a,a==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="￿",n[i+1]="￿",s[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="￿",n[i+1]="G",s[i+1]="￿",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,s[i+1]=c,r[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},F=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new qe(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let s=this._items.map(r=>r.resolveAnchors(e,n));return new qe(t,s,this._items.map(r=>r.ruleId))}},qe=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
2
2
  `)}findNextMatchSync(t,e,n){const s=this.scanner.findNextMatchSync(t,e,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},me=class{constructor(t,e){this.languageId=t,this.tokenType=e}},mn=class Re{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new me(e,8),this._embeddedLanguagesMatcher=new pn(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Re._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new me(0,0);_getBasicScopeAttributes=new ct(e=>{const n=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new me(n,s)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Re.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},pn=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,s])=>at(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},ze=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function pt(t,e,n,s,r,i,o,a){const c=e.content.length;let l=!1,u=-1;if(o){const d=_n(t,e,n,s,r,i);r=d.stack,s=d.linePos,n=d.isFirstLine,u=d.anchorPosition}const h=Date.now();for(;!l;){if(a!==0&&Date.now()-h>a)return new ze(r,!0);f()}return new ze(r,!1);function f(){const d=yn(t,e,n,s,r,u);if(!d){i.produce(r,c),l=!0;return}const g=d.captureIndices,b=d.matchedRuleId,_=g&&g.length>0?g[0].end>s:!1;if(b===fn){const p=r.getRule(t);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),M(t,e,n,r,i,p.endCaptures,g),i.produce(r,g[0].end);const m=r;if(r=r.parent,u=m.getAnchorPos(),!_&&m.getEnterPos()===s){r=m,i.produce(r,c),l=!0;return}}else{const p=t.getRule(b);i.produce(r,g[0].start);const m=r,y=p.getName(e.content,g),R=r.contentNameScopesList.pushAttributed(y,t);if(r=r.push(b,s,u,g[0].end===c,null,R,R),p instanceof we){const C=p;M(t,e,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const v=C.getContentName(e.content,g),x=R.pushAttributed(v,t);if(r=r.withContentNameScopesList(x),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(e.content,g))),!_&&m.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(p instanceof Z){const C=p;M(t,e,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const v=C.getContentName(e.content,g),x=R.pushAttributed(v,t);if(r=r.withContentNameScopesList(x),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(e.content,g))),!_&&m.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(M(t,e,n,r,i,p.captures,g),i.produce(r,g[0].end),r=r.pop(),!_){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>s&&(s=g[0].end,n=!1)}}function _n(t,e,n,s,r,i){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let c=r;c;c=c.pop()){const l=c.getRule(t);l instanceof Z&&a.push({rule:l,stack:c})}for(let c=a.pop();c;c=a.pop()){const{ruleScanner:l,findOptions:u}=Cn(c.rule,t,c.stack.endRule,n,s===o),h=l.findNextMatchSync(e,s,u);if(h){if(h.ruleId!==dt){r=c.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(i.produce(c.stack,h.captureIndices[0].start),M(t,e,n,c.stack,i,c.rule.whileCaptures,h.captureIndices),i.produce(c.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>s&&(s=h.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:s,anchorPosition:o,isFirstLine:n}}function yn(t,e,n,s,r,i){const o=bn(t,e,n,s,r,i),a=t.getInjections();if(a.length===0)return o;const c=Sn(a,t,e,n,s,r,i);if(!c)return o;if(!o)return c;const l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function bn(t,e,n,s,r,i){const o=r.getRule(t),{ruleScanner:a,findOptions:c}=_t(o,t,r.endRule,n,s===i),l=a.findNextMatchSync(e,s,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function Sn(t,e,n,s,r,i,o){let a=Number.MAX_VALUE,c=null,l,u=0;const h=i.contentNameScopesList.getScopeNames();for(let f=0,d=t.length;f<d;f++){const g=t[f];if(!g.matcher(h))continue;const b=e.getRule(g.ruleId),{ruleScanner:_,findOptions:p}=_t(b,e,null,s,r===o),m=_.findNextMatchSync(n,r,p);if(!m)continue;const y=m.captureIndices[0].start;if(!(y>=a)&&(a=y,c=m.captureIndices,l=m.ruleId,u=g.priority,a===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function _t(t,e,n,s,r){return{ruleScanner:t.compileAG(e,n,s,r),findOptions:0}}function Cn(t,e,n,s,r){return{ruleScanner:t.compileWhileAG(e,n,s,r),findOptions:0}}function M(t,e,n,s,r,i,o){if(i.length===0)return;const a=e.content,c=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<c;h++){const f=i[h];if(f===null)continue;const d=o[h];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,d.start):r.produce(s,d.start),f.retokenizeCapturedWithRuleId){const b=f.getName(a,o),_=s.contentNameScopesList.pushAttributed(b,t),p=f.getContentName(a,o),m=_.pushAttributed(p,t),y=s.push(f.retokenizeCapturedWithRuleId,d.start,-1,!1,null,_,m),R=t.createOnigString(a.substring(0,d.end));pt(t,R,n&&d.start===0,d.start,y,r,!1,0),ht(R);continue}const g=f.getName(a,o);if(g!==null){const _=(l.length>0?l[l.length-1].scopes:s.contentNameScopesList).pushAttributed(g,t);l.push(new wn(_,d.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var wn=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function Rn(t,e,n,s,r,i,o,a){return new kn(t,e,n,s,r,i,o,a)}function He(t,e,n,s,r){const i=Q(e,ee),o=gt.getCompiledRuleId(n,s,r.repository);for(const a of i)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:r,priority:a.priority})}function ee(t,e){if(e.length<t.length)return!1;let n=0;return t.every(s=>{for(let r=n;r<e.length;r++)if(Nn(e[r],s))return n=r+1,!0;return!1})}function Nn(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var kn=class{constructor(t,e,n,s,r,i,o,a){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new mn(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ue(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=Q(c,ee);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,s=t.lookup(n);if(s){const r=s.injections;if(r)for(let o in r)He(e,o,r[o],this,s);const i=this._grammarRepository.injections(n);i&&i.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const c=a.injectionSelector;c&&He(e,c,a,this,a)}})}return e.sort((r,i)=>r.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Ue(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const s=this._tokenize(t,e,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(t,e,n=0){const s=this._tokenize(t,e,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(t,e,n,s){this._rootId===-1&&(this._rootId=gt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===Ne.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=$.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let d;f?d=j.createRootAndLookUpScopeName(f,h,this):d=j.createRoot("unknown",h),e=new Ne(null,this._rootId,-1,-1,!1,null,d,d)}else r=!1,e.reset();t=t+`
3
3
  `;const i=this.createOnigString(t),o=i.content.length,a=new vn(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=pt(this,i,r,0,e,a,!0,s);return ht(i),{lineLength:o,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ue(t,e){return t=qt(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var j=class T{constructor(e,n,s){this.parent=e,this.scopePath=n,this.tokenAttributes=s}static fromExtension(e,n){let s=e,r=e?.scopePath??null;for(const i of n)r=ge.push(r,i.scopeNames),s=new T(s,r,i.encodedTokenAttributes);return s}static createRoot(e,n){return new T(null,new ge(null,e),n)}static createRootAndLookUpScopeName(e,n,s){const r=s.getMetadataForScope(e),i=new ge(null,e),o=s.themeProvider.themeMatch(i),a=T.mergeAttributes(n,r,o);return new T(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return T.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,s){let r=-1,i=0,o=0;return s!==null&&(r=s.fontStyle,i=s.foregroundId,o=s.backgroundId),$.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return T._pushAttributed(this,e,n);const s=e.split(/ /g);let r=this;for(const i of s)r=T._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,s){const r=s.getMetadataForScope(n),i=e.scopePath.push(n),o=s.themeProvider.themeMatch(i),a=T.mergeAttributes(e.tokenAttributes,r,o);return new T(e,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===e?n.reverse():void 0}},Ne=class E{constructor(e,n,s,r,i,o,a,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new E(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:E._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?j.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){E._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,s,r,i,o,a){return new E(this,e,n,s,r,i,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new E(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const s=j.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new E(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,j.fromExtension(s,n.contentNameScopesList))}},An=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Q(n,ee).map(s=>s.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Q(n,ee).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},vn=class{constructor(t,e,n,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(i)&&(s=$.set(s,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(s=$.set(s,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,r=this._binaryTokens.length;s<r;s++)n[s]=this._binaryTokens[s];return n}},Tn=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,s,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,Rn(t,i,e,n,s,r,this,this._onigLib))}return this._grammars.get(t)}},In=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Tn(V.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(V.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,s){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(e,n,s){return this._loadGrammar(e,n,s.embeddedLanguages,s.tokenTypes,new An(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,s,r,i){const o=new sn(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,s,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(e,n=[],s=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,s,r)}_grammarForScopeName(e,n=0,s=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,s,r,i)}},ke=Ne.NULL;function te(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},s=typeof t=="string"?t:t.name;for(const[r,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===s&&Object.assign(n,i);return n}function L(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Ln(t){return Array.isArray(t)?t:[t]}async function yt(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function oe(t){return!t||["plaintext","txt","text","plain"].includes(t)}function bt(t){return t==="ansi"||oe(t)}function ae(t){return t==="none"}function St(t){return ae(t)}function ce(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let s=0;const r=[];for(let i=0;i<n.length;i+=2){const o=e?n[i]+(n[i+1]||""):n[i];r.push([o,s]),s+=n[i].length,s+=n[i+1]?.length||0}return r}const Ke={light:"#333333",dark:"#bbbbbb"},Ye={light:"#fffffe",dark:"#1e1e1e"},Je="__shiki_resolved";function xe(t){if(t?.[Je])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:s}=e;if(!n||!s){const a=e.settings?e.settings.find(c=>!c.name&&!c.scope):void 0;a?.settings?.foreground&&(s=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!s&&e?.colors?.["editor.foreground"]&&(s=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),s||(s=e.type==="light"?Ke.light:Ke.dark),n||(n=e.type==="light"?Ye.light:Ye.dark),e.fg=s,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let r=0;const i=new Map;function o(a){if(i.has(a))return i.get(a);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${c}`]?o(a):(i.set(a,c),c)}e.settings=e.settings.map(a=>{const c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),l=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!l)return a;const u={...a,settings:{...a.settings}};if(c){const h=o(a.settings.foreground);e.colorReplacements[h]=a.settings.foreground,u.settings.foreground=h}if(l){const h=o(a.settings.background);e.colorReplacements[h]=a.settings.background,u.settings.background=h}return u});for(const a of Object.keys(e.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!e.colors[a]?.startsWith("#")){const c=o(e.colors[a]);e.colorReplacements[c]=e.colors[a],e.colors[a]=c}return Object.defineProperty(e,Je,{enumerable:!1,writable:!1,value:!0}),e}async function Ct(t){return Array.from(new Set((await Promise.all(t.filter(e=>!bt(e)).map(async e=>await yt(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function wt(t){return(await Promise.all(t.map(async e=>St(e)?null:xe(await yt(e))))).filter(e=>!!e)}function Rt(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new S(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}var xn=class extends In{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(t,e,n,s={}){super(t),this._resolver=t,this._themes=e,this._langs=n,this._alias=s,this._themes.map(r=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const e=xe(t);return e.name&&(this._resolvedThemes.set(e.name,e),this._loadedThemesCache=null),e}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let e=this._textmateThemeCache.get(t);e||(e=V.createFromRawTheme(t),this._textmateThemeCache.set(t,e)),this._syncRegistry.setTheme(e)}getGrammar(t){return t=Rt(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const e=new Set([...this._langMap.values()].filter(r=>r.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const s=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(s.name=t.name,this._resolvedGrammars.set(t.name,s),t.aliases&&t.aliases.forEach(r=>{this._alias[r]=t.name}),this._loadedLanguagesCache=null,e.size)for(const r of e)this._resolvedGrammars.delete(r.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(r.scopeName),this._syncRegistry?._grammars?.delete(r.scopeName),this.loadLanguage(this._langMap.get(r.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const s of t)this.resolveEmbeddedLanguages(s);const e=Array.from(this._langGraph.entries()),n=e.filter(([s,r])=>!r);if(n.length){const s=e.filter(([r,i])=>i?(i.embeddedLanguages||i.embeddedLangs)?.some(o=>n.map(([a])=>a).includes(o)):!1).filter(r=>!n.includes(r));throw new S(`Missing languages ${n.map(([r])=>`\`${r}\``).join(", ")}, required by ${s.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[s,r]of e)this._resolver.addLanguage(r);for(const[s,r]of e)this.loadLanguage(r)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const e=t.embeddedLanguages??t.embeddedLangs;if(e)for(const n of e)this._langGraph.set(n,this._langMap.get(n))}},En=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,e){this._onigLib={createOnigScanner:n=>t.createScanner(n),createOnigString:n=>t.createString(n)},e.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(e=>{this._langs.set(e,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(t.scopeName)})}getInjections(t){const e=t.split(".");let n=[];for(let s=1;s<=e.length;s++){const r=e.slice(0,s).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let B=0;function Pn(t){B+=1,t.warnings!==!1&&B>=10&&B%10===0&&console.warn(`[Shiki] ${B} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new S("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),s=(t.themes||[]).flat(1).map(xe),r=new xn(new En(t.engine,n),s,n,t.langAlias);let i;function o(m){return Rt(m,t.langAlias)}function a(m){_();const y=r.getGrammar(typeof m=="string"?m:m.name);if(!y)throw new S(`Language \`${m}\` not found, you may need to load it first`);return y}function c(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const y=r.getTheme(m);if(!y)throw new S(`Theme \`${m}\` not found, you may need to load it first`);return y}function l(m){_();const y=c(m);return i!==m&&(r.setTheme(y),i=m),{theme:y,colorMap:r.getColorMap()}}function u(){return _(),r.getLoadedThemes()}function h(){return _(),r.getLoadedLanguages()}function f(...m){_(),r.loadLanguages(m.flat(1))}async function d(...m){return f(await Ct(m))}function g(...m){_();for(const y of m.flat(1))r.loadTheme(y)}async function b(...m){return _(),g(await wt(m))}function _(){if(e)throw new S("Shiki instance has been disposed")}function p(){e||(e=!0,r.dispose(),B-=1)}return{setTheme:l,getTheme:c,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:o,loadLanguage:d,loadLanguageSync:f,loadTheme:b,loadThemeSync:g,dispose:p,[Symbol.dispose]:p}}async function Gn(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,s]=await Promise.all([wt(t.themes||[]),Ct(t.langs||[]),t.engine]);return Pn({...t,themes:e,langs:n,engine:s})}const Nt=new WeakMap;function le(t,e){Nt.set(t,e)}function q(t){return Nt.get(t)}var ue=class kt{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new kt(Object.fromEntries(Ln(n).map(s=>[s,ke])),e)}constructor(...e){if(e.length===2){const[n,s]=e;this.lang=s,this._stacks=n}else{const[n,s,r]=e;this.lang=s,this._stacks={[r]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return On(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function On(t){const e=[],n=new Set;function s(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&e.push(i),r.parent&&s(r.parent)}return s(t),e}function $n(t,e){if(!(t instanceof ue))throw new S("Invalid grammar state");return t.getInternalStack(e)}function At(t,e,n={}){const{theme:s=t.getLoadedThemes()[0]}=n;if(oe(t.resolveLangAlias(n.lang||"text"))||ae(s))return ce(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:i}=t.setTheme(s),o=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(r.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return Mn(e,o,r,i,n)}function Bn(...t){if(t.length===2)return q(t[1]);const[e,n,s={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=s;if(oe(r)||ae(i))throw new S("Plain language does not have grammar state");if(r==="ansi")throw new S("ANSI language does not have grammar state");const{theme:o,colorMap:a}=e.setTheme(i),c=e.getLanguage(r);return new ue(Ee(n,c,o,a,s).stateStack,c.name,o.name)}function Mn(t,e,n,s,r){const i=Ee(t,e,n,s,r),o=new ue(i.stateStack,e.name,n.name);return le(i.tokens,o),i.tokens}function Ee(t,e,n,s,r){const i=te(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,c=ce(t);let l=r.grammarState?$n(r.grammarState,n.name)??ke:r.grammarContextCode!=null?Ee(r.grammarContextCode,e,n,s,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:ke,u=[];const h=[];for(let f=0,d=c.length;f<d;f++){const[g,b]=c[f];if(g===""){u=[],h.push([]);continue}if(o>0&&g.length>=o){u=[],h.push([{content:g,offset:b,color:"",fontStyle:0}]);continue}let _,p,m;r.includeExplanation&&(_=e.tokenizeLine(g,l,a),p=_.tokens,m=0);const y=e.tokenizeLine2(g,l,a),R=y.tokens.length/2;for(let C=0;C<R;C++){const v=y.tokens[2*C],x=C+1<R?y.tokens[2*C+2]:g.length;if(v===x)continue;const Oe=y.tokens[2*C+1],Ot=L(s[$.getForeground(Oe)],i),$t=$.getFontStyle(Oe),he={content:g.substring(v,x),offset:b+v,color:Ot,fontStyle:$t};if(r.includeExplanation){const $e=[];if(r.includeExplanation!=="scopeName")for(const I of n.settings){let G;switch(typeof I.scope){case"string":G=I.scope.split(/,/).map(fe=>fe.trim());break;case"object":G=I.scope;break;default:continue}$e.push({settings:I,selectors:G.map(fe=>fe.split(/ /))})}he.explanation=[];let Be=0;for(;v+Be<x;){const I=p[m],G=g.substring(I.startIndex,I.endIndex);Be+=G.length,he.explanation.push({content:G,scopes:r.includeExplanation==="scopeName"?jn(I.scopes):Dn($e,I.scopes)}),m+=1}}u.push(he)}h.push(u),u=[],l=y.ruleStack}return{tokens:h,stateStack:l}}function jn(t){return t.map(e=>({scopeName:e}))}function Dn(t,e){const n=[];for(let s=0,r=e.length;s<r;s++){const i=e[s];n[s]={scopeName:i,themeMatches:Fn(t,i,e.slice(0,s))}}return n}function Ve(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Wn(t,e,n){if(!Ve(t[t.length-1],e))return!1;let s=t.length-2,r=n.length-1;for(;s>=0&&r>=0;)Ve(t[s],n[r])&&(s-=1),r-=1;return s===-1}function Fn(t,e,n){const s=[];for(const{selectors:r,settings:i}of t)for(const o of r)if(Wn(o,e,n)){s.push(i);break}return s}function vt(t,e,n,s=At){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const u=s(t,e,{...n,theme:l.theme});return{tokens:u,state:q(u),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),o=qn(...i.map(l=>l.tokens)),a=o[0].map((l,u)=>l.map((h,f)=>{const d={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=h.explanation),o.forEach((g,b)=>{const{content:_,explanation:p,offset:m,...y}=g[u][f];d.variants[r[b].color]=y}),d})),c=i[0].state?new ue(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return c&&le(a,c),a}function qn(...t){const e=t.map(()=>[]),n=t.length;for(let s=0;s<t[0].length;s++){const r=t.map(c=>c[s]),i=e.map(()=>[]);e.forEach((c,l)=>c.push(i[l]));const o=r.map(()=>0),a=r.map(c=>c[0]);for(;a.every(c=>c);){const c=Math.min(...a.map(l=>l.content.length));for(let l=0;l<n;l++){const u=a[l];u.content.length===c?(i[l].push(u),o[l]+=1,a[l]=r[l][o[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),a[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return e}const zn=/["&'<>`]/g,Hn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Un=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Kn=/[|\\{}()[\]^$+*?.]/g,Qe=new WeakMap;function Yn(t,e){if(t=t.replace(e.subset?Jn(e.subset):zn,s),e.subset||e.escapeOnly)return t;return t.replace(Hn,n).replace(Un,s);function n(r,i,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function s(r,i,o){return e.format(r.charCodeAt(0),o.charCodeAt(i+1),e)}}function Jn(t){let e=Qe.get(t);return e||(e=Vn(t),Qe.set(t,e)),e}function Vn(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Kn,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Qn=/[\dA-Fa-f]/;function Xn(t,e,n){const s="&#x"+t.toString(16).toUpperCase();return n&&e&&!Qn.test(String.fromCharCode(e))?s:s+";"}const Zn=/\d/;function es(t,e,n){const s="&#"+String(t);return n&&e&&!Zn.test(String.fromCharCode(e))?s:s+";"}const ts=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],pe={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},ns=["cent","copy","divide","gt","lt","not","para","times"],Tt={}.hasOwnProperty,Ae={};let U;for(U in pe)Tt.call(pe,U)&&(Ae[pe[U]]=U);const ss=/[^\dA-Za-z]/;function rs(t,e,n,s){const r=String.fromCharCode(t);if(Tt.call(Ae,r)){const i=Ae[r],o="&"+i;return n&&ts.includes(i)&&!ns.includes(i)&&(!s||e&&e!==61&&ss.test(String.fromCharCode(e)))?o:o+";"}return""}function is(t,e,n){let s=Xn(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=rs(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=es(t,e,n.omitOptionalSemicolons);i.length<s.length&&(s=i)}return r&&(!n.useShortestReferences||r.length<s.length)?r:s}function O(t,e){return Yn(t,Object.assign({format:is},e))}const os=/^>|^->|<!--|-->|--!>|<!-$/g,as=[">"],cs=["<",">"];function ls(t,e,n,s){return s.settings.bogusComments?"<?"+O(t.value,Object.assign({},s.settings.characterReferences,{subset:as}))+">":"<!--"+t.value.replace(os,r)+"-->";function r(i){return O(i,Object.assign({},s.settings.characterReferences,{subset:cs}))}}function us(t,e,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}const w=Lt(1),It=Lt(-1),hs=[];function Lt(t){return e;function e(n,s,r){const i=n?n.children:hs;let o=(s||0)+t,a=i[o];if(!r)for(;a&&Ie(a);)o+=t,a=i[o];return a}}const fs={}.hasOwnProperty;function xt(t){return e;function e(n,s,r){return fs.call(t,n.tagName)&&t[n.tagName](n,s,r)}}const Pe=xt({body:gs,caption:_e,colgroup:_e,dd:ys,dt:_s,head:_e,html:ds,li:ps,optgroup:bs,option:Ss,p:ms,rp:Xe,rt:Xe,tbody:ws,td:Ze,tfoot:Rs,th:Ze,thead:Cs,tr:Ns});function _e(t,e,n){const s=w(n,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Ie(s.value.charAt(0)))}function ds(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function gs(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function ms(t,e,n){const s=w(n,e);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ps(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="li"}function _s(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function ys(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Xe(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function bs(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function Ss(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Cs(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function ws(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Rs(t,e,n){return!w(n,e)}function Ns(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="tr"}function Ze(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const ks=xt({body:Ts,colgroup:Is,head:vs,html:As,tbody:Ls});function As(t){const e=w(t,-1);return!e||e.type!=="comment"}function vs(t){const e=new Set;for(const s of t.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(e.has(s.tagName))return!1;e.add(s.tagName)}const n=t.children[0];return!n||n.type==="element"}function Ts(t){const e=w(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ie(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Is(t,e,n){const s=It(n,e),r=w(t,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Pe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Ls(t,e,n){const s=It(n,e),r=w(t,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Pe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const K={name:[[`
4
4
  \f\r &/=>`.split(""),`
@@ -1 +1 @@
1
- import{r as s,j as m}from"./index-DAcpNNU5.js";import{u as d,a as P}from"./index-BLdweJQi.js";const c={search:"Search",searchNoResult:"No results found",toc:"On this page",tocNoHeadings:"No Headings",lastUpdate:"Last updated on",chooseLanguage:"Choose a language",nextPage:"Next Page",previousPage:"Previous Page",chooseTheme:"Theme",editOnGithub:"Edit on GitHub"},h=s.createContext({text:{...c}});function R(t){return C().text[t.label]}function C(){return s.useContext(h)}function b({locales:t=[],locale:o,onLocaleChange:a,children:g,translations:r}){const f=d(),x=P(),u=e=>{if(a)return a(e);const n=x.split("/").filter(p=>p.length>0);n[0]!==o?n.unshift(e):n[0]=e,f.push(`/${n.join("/")}`)},i=s.useRef(u);return i.current=u,m.jsx(h,{value:s.useMemo(()=>({locale:o,locales:t,text:{...c,...r},onChange:e=>i.current(e)}),[o,t,r]),children:g})}export{R as I,b as a,C as u};
1
+ import{r as s,j as m}from"./index-OFfnl8sH.js";import{u as d,a as P}from"./index-B-5ouVG_.js";const c={search:"Search",searchNoResult:"No results found",toc:"On this page",tocNoHeadings:"No Headings",lastUpdate:"Last updated on",chooseLanguage:"Choose a language",nextPage:"Next Page",previousPage:"Previous Page",chooseTheme:"Theme",editOnGithub:"Edit on GitHub"},h=s.createContext({text:{...c}});function R(t){return C().text[t.label]}function C(){return s.useContext(h)}function b({locales:t=[],locale:o,onLocaleChange:a,children:g,translations:r}){const f=d(),x=P(),u=e=>{if(a)return a(e);const n=x.split("/").filter(p=>p.length>0);n[0]!==o?n.unshift(e):n[0]=e,f.push(`/${n.join("/")}`)},i=s.useRef(u);return i.current=u,m.jsx(h,{value:s.useMemo(()=>({locale:o,locales:t,text:{...c,...r},onChange:e=>i.current(e)}),[o,t,r]),children:g})}export{R as I,b as a,C as u};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-Skfz1hTb.js","assets/index-CkdplsNl.js","assets/index-Bv3Sshd_.js","assets/index-DAcpNNU5.js","assets/index-BLdweJQi.js","assets/merge-refs-DGylEIna.js","assets/index-C4ekDDoc.js","assets/Icon-COiEluKG.js","assets/schemas-BzqjMV9-.js","assets/use-copy-button-U0RnQ-Sq.js","assets/index-CLBYRJc0.js","assets/x-CXuLKQxc.js","assets/search-CM3hxxjx.js","assets/index-C4FVOzMP.js"])))=>i.map(i=>d[i]);
2
- import{I as nr}from"./index-BLdweJQi.js";import{m as sr,C as Ia,L as vt}from"./merge-refs-DGylEIna.js";import{g as _a,r as I,c as se,j as f,_ as yt,J as Ea}from"./index-DAcpNNU5.js";import{c as W,e as bt,u as it,k as Rt,j as ir,P as be,h as Q,i as or,f as Ca,d as ot,t as M,b as ge}from"./index-C4ekDDoc.js";import{a as Sa,t as Ta,u as z,s as w,_ as Ze,c as lr,b as Aa,r as Ee,o as D,l as E,e as L,d as Ra,f as Re,g as Na,n as Ma,h as X,i as O,j as ja}from"./schemas-BzqjMV9-.js";import{j as Da,k as Oa,o as xe,u as ve,l as xt,m as Ne,q as ur,w as wt,x as Ce,y as $,A as Pa,B as Fa,C as re,D as Ge,E as La,F as Nt,G as we,H as pe,I as za,t as cr,r as $a,a as Za,v as Ba}from"./index-Bv3Sshd_.js";import{u as Va}from"./use-copy-button-U0RnQ-Sq.js";import{u as dr}from"./index-CLBYRJc0.js";import{X as Ua}from"./x-CXuLKQxc.js";import{S as qa}from"./search-CM3hxxjx.js";const Wa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ja=W("circle-check",Wa);const Ga=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ha=W("circle-x",Ga);const Ya=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],Qa=W("clipboard",Ya);const Ka=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xa=W("info",Ka);const en=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],tn=W("lightbulb",en);const rn=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],an=W("link",rn);const nn=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sn=W("loader-circle",nn);const on=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],ln=W("message-circle",on);const un=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],cn=W("refresh-cw",un);const dn=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],pn=W("send",dn);const fn=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mn=W("triangle-alert",fn);var pr="vercel.ai.error",hn=Symbol.for(pr),Mt,jt,G=class fr extends(jt=Error,Mt=hn,jt){constructor({name:t,message:r,cause:a}){super(r),this[Mt]=!0,this.name=t,this.cause=a}static isInstance(t){return fr.hasMarker(t,pr)}static hasMarker(t,r){const a=Symbol.for(r);return t!=null&&typeof t=="object"&&a in t&&typeof t[a]=="boolean"&&t[a]===!0}};function mr(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var hr="AI_InvalidArgumentError",gr=`vercel.ai.error.${hr}`,gn=Symbol.for(gr),Dt,Ot,vn=class extends(Ot=G,Dt=gn,Ot){constructor({message:e,cause:t,argument:r}){super({name:hr,message:e,cause:t}),this[Dt]=!0,this.argument=r}static isInstance(e){return G.hasMarker(e,gr)}},vr="AI_JSONParseError",yr=`vercel.ai.error.${vr}`,yn=Symbol.for(yr),Pt,Ft,Lt=class extends(Ft=G,Pt=yn,Ft){constructor({text:e,cause:t}){super({name:vr,message:`JSON parsing failed: Text: ${e}.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-C4jOG9I2.js","assets/index-CkdplsNl.js","assets/index-B65N5043.js","assets/index-OFfnl8sH.js","assets/index-B-5ouVG_.js","assets/merge-refs-BIez66Kl.js","assets/index-Bojr-xLv.js","assets/Icon-D30p-2dq.js","assets/schemas-BzqjMV9-.js","assets/use-copy-button-BO3GBlwZ.js","assets/index-DHENdpwd.js","assets/x-CB1cQ-bo.js","assets/search-D1WUBd3N.js","assets/index-CYJW3hzB.js"])))=>i.map(i=>d[i]);
2
+ import{I as nr}from"./index-B-5ouVG_.js";import{m as sr,C as Ia,L as vt}from"./merge-refs-BIez66Kl.js";import{g as _a,r as I,c as se,j as f,_ as yt,J as Ea}from"./index-OFfnl8sH.js";import{c as W,e as bt,u as it,k as Rt,j as ir,P as be,h as Q,i as or,f as Ca,d as ot,t as M,b as ge}from"./index-Bojr-xLv.js";import{a as Sa,t as Ta,u as z,s as w,_ as Ze,c as lr,b as Aa,r as Ee,o as D,l as E,e as L,d as Ra,f as Re,g as Na,n as Ma,h as X,i as O,j as ja}from"./schemas-BzqjMV9-.js";import{j as Da,k as Oa,o as xe,u as ve,l as xt,m as Ne,q as ur,w as wt,x as Ce,y as $,A as Pa,B as Fa,C as re,D as Ge,E as La,F as Nt,G as we,H as pe,I as za,t as cr,r as $a,a as Za,v as Ba}from"./index-B65N5043.js";import{u as Va}from"./use-copy-button-BO3GBlwZ.js";import{u as dr}from"./index-DHENdpwd.js";import{X as Ua}from"./x-CB1cQ-bo.js";import{S as qa}from"./search-D1WUBd3N.js";const Wa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ja=W("circle-check",Wa);const Ga=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ha=W("circle-x",Ga);const Ya=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],Qa=W("clipboard",Ya);const Ka=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xa=W("info",Ka);const en=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],tn=W("lightbulb",en);const rn=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],an=W("link",rn);const nn=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sn=W("loader-circle",nn);const on=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],ln=W("message-circle",on);const un=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],cn=W("refresh-cw",un);const dn=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],pn=W("send",dn);const fn=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mn=W("triangle-alert",fn);var pr="vercel.ai.error",hn=Symbol.for(pr),Mt,jt,G=class fr extends(jt=Error,Mt=hn,jt){constructor({name:t,message:r,cause:a}){super(r),this[Mt]=!0,this.name=t,this.cause=a}static isInstance(t){return fr.hasMarker(t,pr)}static hasMarker(t,r){const a=Symbol.for(r);return t!=null&&typeof t=="object"&&a in t&&typeof t[a]=="boolean"&&t[a]===!0}};function mr(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var hr="AI_InvalidArgumentError",gr=`vercel.ai.error.${hr}`,gn=Symbol.for(gr),Dt,Ot,vn=class extends(Ot=G,Dt=gn,Ot){constructor({message:e,cause:t,argument:r}){super({name:hr,message:e,cause:t}),this[Dt]=!0,this.argument=r}static isInstance(e){return G.hasMarker(e,gr)}},vr="AI_JSONParseError",yr=`vercel.ai.error.${vr}`,yn=Symbol.for(yr),Pt,Ft,Lt=class extends(Ft=G,Pt=yn,Ft){constructor({text:e,cause:t}){super({name:vr,message:`JSON parsing failed: Text: ${e}.
3
3
  Error message: ${mr(t)}`,cause:t}),this[Pt]=!0,this.text=e}static isInstance(e){return G.hasMarker(e,yr)}},br="AI_TypeValidationError",xr=`vercel.ai.error.${br}`,bn=Symbol.for(xr),zt,$t,ye=class lt extends($t=G,zt=bn,$t){constructor({value:t,cause:r,context:a}){let n="Type validation failed";if(a?.field&&(n+=` for ${a.field}`),a?.entityName||a?.entityId){n+=" (";const s=[];a.entityName&&s.push(a.entityName),a.entityId&&s.push(`id: "${a.entityId}"`),n+=s.join(", "),n+=")"}super({name:br,message:`${n}: Value: ${JSON.stringify(t)}.
4
4
  Error message: ${mr(r)}`,cause:r}),this[zt]=!0,this.value=t,this.context=a}static isInstance(t){return G.hasMarker(t,xr)}static wrap({value:t,cause:r,context:a}){var n,s,i;return lt.isInstance(r)&&r.value===t&&((n=r.context)==null?void 0:n.field)===a?.field&&((s=r.context)==null?void 0:s.entityName)===a?.entityName&&((i=r.context)==null?void 0:i.entityId)===a?.entityId?r:new lt({value:t,cause:r,context:a})}},Se;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const s={};for(const i of n)s[i]=i;return s},e.getValidEnumValues=n=>{const s=e.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of s)i[o]=n[o];return e.objectValues(i)},e.objectValues=n=>e.objectKeys(n).map(function(s){return n[s]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const s=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&s.push(i);return s},e.find=(n,s)=>{for(const i of n)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,s=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=a,e.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(Se||(Se={}));var Zt;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Zt||(Zt={}));Se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Se.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Be extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},a={_errors:[]},n=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)a._errors.push(r(i));else{let o=a,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return n(this),a}static assert(t){if(!(t instanceof Be))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),a=[];for(const n of this.issues)if(n.path.length>0){const s=n.path[0];r[s]=r[s]||[],r[s].push(t(n))}else a.push(t(n));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}}Be.create=e=>new Be(e);var Bt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Bt||(Bt={}));var S;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(S||(S={}));class Vt extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function He(e){}function xn(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=He,onError:r=He,onRetry:a=He,onComment:n}=e;let s="",i=!0,o,u="",l="";function p(b){const y=i?b.replace(/^\xEF\xBB\xBF/,""):b,[x,k]=wn(`${s}${y}`);for(const d of x)c(d);s=k,i=!1}function c(b){if(b===""){h();return}if(b.startsWith(":")){n&&n(b.slice(b.startsWith(": ")?2:1));return}const y=b.indexOf(":");if(y!==-1){const x=b.slice(0,y),k=b[y+1]===" "?2:1,d=b.slice(y+k);g(x,d,b);return}g(b,"",b)}function g(b,y,x){switch(b){case"event":l=y;break;case"data":u=`${u}${y}
5
5
  `;break;case"id":o=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?a(parseInt(y,10)):r(new Vt(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:x}));break;default:r(new Vt(`Unknown field "${b.length>20?`${b.slice(0,20)}…`:b}"`,{type:"unknown-field",field:b,value:y,line:x}));break}}function h(){u.length>0&&t({id:o,event:l||void 0,data:u.endsWith(`
@@ -18,8 +18,8 @@ Error message: ${mr(r)}`,cause:r}),this[zt]=!0,this.value=t,this.context=a}stati
18
18
  `)}function Zi(e){return e==null?"":String(e)}function Kt(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Bi(){return{enter:{table:Vi,tableData:Xt,tableHeader:Xt,tableRow:qi},exit:{codeText:Wi,table:Ui,tableData:rt,tableHeader:rt,tableRow:rt}}}function Vi(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function Ui(e){this.exit(e),this.data.inTable=void 0}function qi(e){this.enter({type:"tableRow",children:[]},e)}function rt(e){this.exit(e)}function Xt(e){this.enter({type:"tableCell",children:[]},e)}function Wi(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ji));const r=this.stack[this.stack.length-1];xe(r.type==="inlineCode"),r.value=t,this.exit(e)}function Ji(e,t){return t==="|"?t:e}function Gi(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,n=t.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
19
19
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:i,tableCell:u,tableRow:o}};function i(h,m,b,y){return l(p(h,b,y),h.align)}function o(h,m,b,y){const x=c(h,b,y),k=l([x]);return k.slice(0,k.indexOf(`
20
20
  `))}function u(h,m,b,y){const x=b.enter("tableCell"),k=b.enter("phrasing"),d=b.containerPhrasing(h,{...y,before:s,after:s});return k(),x(),d}function l(h,m){return $i(h,{align:m,alignDelimiters:a,padding:r,stringLength:n})}function p(h,m,b){const y=h.children;let x=-1;const k=[],d=m.enter("table");for(;++x<y.length;)k[x]=c(y[x],m,b);return d(),k}function c(h,m,b){const y=h.children;let x=-1;const k=[],d=m.enter("tableRow");for(;++x<y.length;)k[x]=u(y[x],h,m,b);return d(),k}function g(h,m,b){let y=ur.inlineCode(h,m,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Hi(){return{exit:{taskListCheckValueChecked:er,taskListCheckValueUnchecked:er,paragraph:Qi}}}function Yi(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ki}}}function er(e){const t=this.stack[this.stack.length-2];xe(t.type==="listItem"),t.checked=e.type==="taskListCheckValueChecked"}function Qi(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];xe(r.type==="paragraph");const a=r.children[0];if(a&&a.type==="text"){const n=t.children;let s=-1,i;for(;++s<n.length;){const o=n[s];if(o.type==="paragraph"){i=o;break}}i===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function Ki(e,t,r,a){const n=e.children[0],s=typeof e.checked=="boolean"&&n&&n.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",o=r.createTracker(a);s&&o.move(i);let u=ur.listItem(e,t,r,{...a,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(p){return p+i}}function Xi(){return[ui(),Ri(),Di(),Bi(),Hi()]}function eo(e){return{extensions:[ci(),Ni(e),Oi(),Gi(e),Yi()]}}const to={tokenize:oo,partial:!0},Vr={tokenize:lo,partial:!0},Ur={tokenize:uo,partial:!0},qr={tokenize:co,partial:!0},ro={tokenize:po,partial:!0},Wr={name:"wwwAutolink",tokenize:so,previous:Gr},Jr={name:"protocolAutolink",tokenize:io,previous:Hr},K={name:"emailAutolink",tokenize:no,previous:Yr},H={};function ao(){return{text:H}}let oe=48;for(;oe<123;)H[oe]=K,oe++,oe===58?oe=65:oe===91&&(oe=97);H[43]=K;H[45]=K;H[46]=K;H[95]=K;H[72]=[K,Jr];H[104]=[K,Jr];H[87]=[K,Wr];H[119]=[K,Wr];function no(e,t,r){const a=this;let n,s;return i;function i(c){return!mt(c)||!Yr.call(a,a.previous)||_t(a.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return mt(c)?(e.consume(c),o):c===64?(e.consume(c),u):r(c)}function u(c){return c===46?e.check(ro,p,l)(c):c===45||c===95||wt(c)?(s=!0,e.consume(c),u):p(c)}function l(c){return e.consume(c),n=!0,u}function p(c){return s&&n&&Ce(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):r(c)}}function so(e,t,r){const a=this;return n;function n(i){return i!==87&&i!==119||!Gr.call(a,a.previous)||_t(a.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(to,e.attempt(Vr,e.attempt(Ur,s),r),r)(i))}function s(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function io(e,t,r){const a=this;let n="",s=!1;return i;function i(c){return(c===72||c===104)&&Hr.call(a,a.previous)&&!_t(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(c),e.consume(c),o):r(c)}function o(c){if(Ce(c)&&n.length<5)return n+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const g=n.toLowerCase();if(g==="http"||g==="https")return e.consume(c),u}return r(c)}function u(c){return c===47?(e.consume(c),s?l:(s=!0,u)):r(c)}function l(c){return c===null||Pa(c)||$(c)||ve(c)||xt(c)?r(c):e.attempt(Vr,e.attempt(Ur,p),r)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function oo(e,t,r){let a=0;return n;function n(i){return(i===87||i===119)&&a<3?(a++,e.consume(i),n):i===46&&a===3?(e.consume(i),s):r(i)}function s(i){return i===null?r(i):t(i)}}function lo(e,t,r){let a,n,s;return i;function i(l){return l===46||l===95?e.check(qr,u,o)(l):l===null||$(l)||ve(l)||l!==45&&xt(l)?u(l):(s=!0,e.consume(l),i)}function o(l){return l===95?a=!0:(n=a,a=void 0),e.consume(l),i}function u(l){return n||a||!s?r(l):t(l)}}function uo(e,t){let r=0,a=0;return n;function n(i){return i===40?(r++,e.consume(i),n):i===41&&a<r?s(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(qr,t,s)(i):i===null||$(i)||ve(i)?t(i):(e.consume(i),n)}function s(i){return i===41&&a++,e.consume(i),n}}function co(e,t,r){return a;function a(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),a):o===38?(e.consume(o),s):o===93?(e.consume(o),n):o===60||o===null||$(o)||ve(o)?t(o):r(o)}function n(o){return o===null||o===40||o===91||$(o)||ve(o)?t(o):a(o)}function s(o){return Ce(o)?i(o):r(o)}function i(o){return o===59?(e.consume(o),a):Ce(o)?(e.consume(o),i):r(o)}}function po(e,t,r){return a;function a(s){return e.consume(s),n}function n(s){return wt(s)?r(s):t(s)}}function Gr(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$(e)}function Hr(e){return!Ce(e)}function Yr(e){return!(e===47||mt(e))}function mt(e){return e===43||e===45||e===46||e===95||wt(e)}function _t(e){let t=e.length,r=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const fo={tokenize:wo,partial:!0};function mo(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yo,continuation:{tokenize:bo},exit:xo}},text:{91:{name:"gfmFootnoteCall",tokenize:vo},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ho,resolveTo:go}}}}function ho(e,t,r){const a=this;let n=a.events.length;const s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let i;for(;n--;){const u=a.events[n][1];if(u.type==="labelImage"){i=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(!i||!i._balanced)return r(u);const l=Ne(a.sliceSerialize({start:i.end,end:a.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?r(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function go(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},n={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};n.end.column++,n.end.offset++,n.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},n.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[r+1],e[r+2],["enter",a,t],e[r+3],e[r+4],["enter",n,t],["exit",n,t],["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(r,e.length-r+1,...o),e}function vo(e,t,r){const a=this,n=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s=0,i;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(c){if(s>999||c===93&&!i||c===null||c===91||$(c))return r(c);if(c===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return n.includes(Ne(a.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(c)}return $(c)||(i=!0),s++,e.consume(c),c===92?p:l}function p(c){return c===91||c===92||c===93?(e.consume(c),s++,l):l(c)}}function yo(e,t,r){const a=this,n=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s,i=0,o;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):r(m)}function p(m){if(i>999||m===93&&!o||m===null||m===91||$(m))return r(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Ne(a.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return $(m)||(o=!0),i++,e.consume(m),m===92?c:p}function c(m){return m===91||m===92||m===93?(e.consume(m),i++,p):p(m)}function g(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),n.includes(s)||n.push(s),re(e,h,"gfmFootnoteDefinitionWhitespace")):r(m)}function h(m){return t(m)}}function bo(e,t,r){return e.check(Fa,t,e.attempt(fo,t,r))}function xo(e){e.exit("gfmFootnoteDefinition")}function wo(e,t,r){const a=this;return re(e,n,"gfmFootnoteDefinitionIndent",5);function n(s){const i=a.events[a.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(s):r(s)}}function ko(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:s,resolveAll:n};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function n(i,o){let u=-1;for(;++u<i.length;)if(i[u][0]==="enter"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._close){let l=u;for(;l--;)if(i[l][0]==="exit"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._open&&i[u][1].end.offset-i[u][1].start.offset===i[l][1].end.offset-i[l][1].start.offset){i[u][1].type="strikethroughSequence",i[l][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},i[l][1].start),end:Object.assign({},i[u][1].end)},c={type:"strikethroughText",start:Object.assign({},i[l][1].end),end:Object.assign({},i[u][1].start)},g=[["enter",p,o],["enter",i[l][1],o],["exit",i[l][1],o],["enter",c,o]],h=o.parser.constructs.insideSpan.null;h&&Ge(g,g.length,0,La(h,i.slice(l+1,u),o)),Ge(g,g.length,0,[["exit",c,o],["enter",i[u][1],o],["exit",i[u][1],o],["exit",p,o]]),Ge(i,l-1,u-l+3,g),u=l+g.length-2;break}}for(u=-1;++u<i.length;)i[u][1].type==="strikethroughSequenceTemporary"&&(i[u][1].type="data");return i}function s(i,o,u){const l=this.previous,p=this.events;let c=0;return g;function g(m){return l===126&&p[p.length-1][1].type!=="characterEscape"?u(m):(i.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const b=Nt(l);if(m===126)return c>1?u(m):(i.consume(m),c++,h);if(c<2&&!r)return u(m);const y=i.exit("strikethroughSequenceTemporary"),x=Nt(m);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,o(m)}}}class Io{constructor(){this.map=[]}add(t,r,a){_o(this,t,r,a)}consume(t){if(this.map.sort(function(s,i){return s[0]-i[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];a.push(t.slice()),t.length=0;let n=a.pop();for(;n;){for(const s of n)t.push(s);n=a.pop()}this.map.length=0}}function _o(e,t,r,a){let n=0;if(!(r===0&&a.length===0)){for(;n<e.map.length;){if(e.map[n][0]===t){e.map[n][1]+=r,e.map[n][2].push(...a);return}n+=1}e.map.push([t,r,a])}}function Eo(e,t){let r=!1;const a=[];for(;t<e.length;){const n=e[t];if(r){if(n[0]==="enter")n[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=a.length-1;a[s]=a[s]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function Co(){return{flow:{null:{name:"table",tokenize:So,resolveAll:To}}}}function So(e,t,r){const a=this;let n=0,s=0,i;return o;function o(v){let Y=a.events.length-1;for(;Y>-1;){const Je=a.events[Y][1].type;if(Je==="lineEnding"||Je==="linePrefix")Y--;else break}const Oe=Y>-1?a.events[Y][1].type:null,Pe=Oe==="tableHead"||Oe==="tableRow"?_:u;return Pe===_&&a.parser.lazy[a.now().line]?r(v):Pe(v)}function u(v){return e.enter("tableHead"),e.enter("tableRow"),l(v)}function l(v){return v===124||(i=!0,s+=1),p(v)}function p(v){return v===null?r(v):we(v)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):r(v):pe(v)?re(e,p,"whitespace")(v):(s+=1,i&&(i=!1,n+=1),v===124?(e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),i=!0,p):(e.enter("data"),c(v)))}function c(v){return v===null||v===124||$(v)?(e.exit("data"),p(v)):(e.consume(v),v===92?g:c)}function g(v){return v===92||v===124?(e.consume(v),c):c(v)}function h(v){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(v):(e.enter("tableDelimiterRow"),i=!1,pe(v)?re(e,m,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):m(v))}function m(v){return v===45||v===58?y(v):v===124?(i=!0,e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),b):T(v)}function b(v){return pe(v)?re(e,y,"whitespace")(v):y(v)}function y(v){return v===58?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(v),e.exit("tableDelimiterMarker"),x):v===45?(s+=1,x(v)):v===null||we(v)?C(v):T(v)}function x(v){return v===45?(e.enter("tableDelimiterFiller"),k(v)):T(v)}function k(v){return v===45?(e.consume(v),k):v===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(v),e.exit("tableDelimiterMarker"),d):(e.exit("tableDelimiterFiller"),d(v))}function d(v){return pe(v)?re(e,C,"whitespace")(v):C(v)}function C(v){return v===124?m(v):v===null||we(v)?!i||n!==s?T(v):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(v)):T(v)}function T(v){return r(v)}function _(v){return e.enter("tableRow"),A(v)}function A(v){return v===124?(e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),A):v===null||we(v)?(e.exit("tableRow"),t(v)):pe(v)?re(e,A,"whitespace")(v):(e.enter("data"),N(v))}function N(v){return v===null||v===124||$(v)?(e.exit("data"),A(v)):(e.consume(v),v===92?B:N)}function B(v){return v===92||v===124?(e.consume(v),N):N(v)}}function To(e,t){let r=-1,a=!0,n=0,s=[0,0,0,0],i=[0,0,0,0],o=!1,u=0,l,p,c;const g=new Io;for(;++r<e.length;){const h=e[r],m=h[1];h[0]==="enter"?m.type==="tableHead"?(o=!1,u!==0&&(tr(g,t,u,l,p),p=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},g.add(r,0,[["enter",l,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=!0,c=void 0,s=[0,0,0,0],i=[0,r+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},g.add(r,0,[["enter",p,t]])),n=m.type==="tableDelimiterRow"?2:p?3:1):n&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(a=!1,i[2]===0&&(s[1]!==0&&(i[0]=i[1],c=Fe(g,t,s,n,void 0,c),s=[0,0,0,0]),i[2]=r)):m.type==="tableCellDivider"&&(a?a=!1:(s[1]!==0&&(i[0]=i[1],c=Fe(g,t,s,n,void 0,c)),s=i,i=[s[1],r,0,0])):m.type==="tableHead"?(o=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,s[1]!==0?(i[0]=i[1],c=Fe(g,t,s,n,r,c)):i[1]!==0&&(c=Fe(g,t,i,n,r,c)),n=0):n&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=r)}for(u!==0&&tr(g,t,u,l,p),g.consume(t.events),r=-1;++r<t.events.length;){const h=t.events[r];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Eo(t.events,r))}return e}function Fe(e,t,r,a,n,s){const i=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",o="tableContent";r[0]!==0&&(s.end=Object.assign({},he(t.events,r[0])),e.add(r[0],0,[["exit",s,t]]));const u=he(t.events,r[1]);if(s={type:i,start:Object.assign({},u),end:Object.assign({},u)},e.add(r[1],0,[["enter",s,t]]),r[2]!==0){const l=he(t.events,r[2]),p=he(t.events,r[3]),c={type:o,start:Object.assign({},l),end:Object.assign({},p)};if(e.add(r[2],0,[["enter",c,t]]),a!==2){const g=t.events[r[2]],h=t.events[r[3]];if(g[1].end=Object.assign({},h[1].end),g[1].type="chunkText",g[1].contentType="text",r[3]>r[2]+1){const m=r[2]+1,b=r[3]-r[2]-1;e.add(m,b,[])}}e.add(r[3]+1,0,[["exit",c,t]])}return n!==void 0&&(s.end=Object.assign({},he(t.events,n)),e.add(n,0,[["exit",s,t]]),s=void 0),s}function tr(e,t,r,a,n){const s=[],i=he(t.events,r);n&&(n.end=Object.assign({},i),s.push(["exit",n,t])),a.end=Object.assign({},i),s.push(["exit",a,t]),e.add(r+1,0,s)}function he(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const Ao={name:"tasklistCheck",tokenize:No};function Ro(){return{text:{91:Ao}}}function No(e,t,r){const a=this;return n;function n(u){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return $(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),i):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),i):r(u)}function i(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):r(u)}function o(u){return we(u)?t(u):pe(u)?e.check({tokenize:Mo},t,r)(u):r(u)}}function Mo(e,t,r){return re(e,a,"whitespace");function a(n){return n===null?r(n):t(n)}}function jo(e){return za([ao(),mo(),ko(e),Co(),Ro()])}const Do={};function Oo(e){const t=this,r=e||Do,a=t.data(),n=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),i=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);n.push(jo(r)),s.push(Xi()),i.push(eo(r))}function Po(e){const t=e+"CollectionProvider",[r,a]=bt(t),[n,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:y,children:x}=b,k=se.useRef(null),d=se.useRef(new Map).current;return f.jsx(n,{scope:y,itemMap:d,collectionRef:k,children:x})};i.displayName=t;const o=e+"CollectionSlot",u=Rt(o),l=se.forwardRef((b,y)=>{const{scope:x,children:k}=b,d=s(o,x),C=it(y,d.collectionRef);return f.jsx(u,{ref:C,children:k})});l.displayName=o;const p=e+"CollectionItemSlot",c="data-radix-collection-item",g=Rt(p),h=se.forwardRef((b,y)=>{const{scope:x,children:k,...d}=b,C=se.useRef(null),T=it(y,C),_=s(p,x);return se.useEffect(()=>(_.itemMap.set(C,{ref:C,...d}),()=>{_.itemMap.delete(C)})),f.jsx(g,{[c]:"",ref:T,children:k})});h.displayName=p;function m(b){const y=s(e+"CollectionConsumer",b);return se.useCallback(()=>{const k=y.collectionRef.current;if(!k)return[];const d=Array.from(k.querySelectorAll(`[${c}]`));return Array.from(y.itemMap.values()).sort((_,A)=>d.indexOf(_.ref.current)-d.indexOf(A.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},m,a]}var at="rovingFocusGroup.onEntryFocus",Fo={bubbles:!1,cancelable:!0},De="RovingFocusGroup",[ht,Qr,Lo]=Po(De),[zo,Kr]=bt(De,[Lo]),[$o,Zo]=zo(De),Xr=I.forwardRef((e,t)=>f.jsx(ht.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(ht.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Bo,{...e,ref:t})})}));Xr.displayName=De;var Bo=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:n=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:p=!1,...c}=e,g=I.useRef(null),h=it(t,g),m=dr(s),[b,y]=or({prop:i,defaultProp:o??null,onChange:u,caller:De}),[x,k]=I.useState(!1),d=Ca(l),C=Qr(r),T=I.useRef(!1),[_,A]=I.useState(0);return I.useEffect(()=>{const N=g.current;if(N)return N.addEventListener(at,d),()=>N.removeEventListener(at,d)},[d]),f.jsx($o,{scope:r,orientation:a,dir:m,loop:n,currentTabStopId:b,onItemFocus:I.useCallback(N=>y(N),[y]),onItemShiftTab:I.useCallback(()=>k(!0),[]),onFocusableItemAdd:I.useCallback(()=>A(N=>N+1),[]),onFocusableItemRemove:I.useCallback(()=>A(N=>N-1),[]),children:f.jsx(be.div,{tabIndex:x||_===0?-1:0,"data-orientation":a,...c,ref:h,style:{outline:"none",...e.style},onMouseDown:Q(e.onMouseDown,()=>{T.current=!0}),onFocus:Q(e.onFocus,N=>{const B=!T.current;if(N.target===N.currentTarget&&B&&!x){const v=new CustomEvent(at,Fo);if(N.currentTarget.dispatchEvent(v),!v.defaultPrevented){const Y=C().filter(ne=>ne.focusable),Oe=Y.find(ne=>ne.active),Pe=Y.find(ne=>ne.id===b),ka=[Oe,Pe,...Y].filter(Boolean).map(ne=>ne.ref.current);ra(ka,p)}}T.current=!1}),onBlur:Q(e.onBlur,()=>k(!1))})})}),ea="RovingFocusGroupItem",ta=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:n=!1,tabStopId:s,children:i,...o}=e,u=ir(),l=s||u,p=Zo(ea,r),c=p.currentTabStopId===l,g=Qr(r),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:b}=p;return I.useEffect(()=>{if(a)return h(),()=>m()},[a,h,m]),f.jsx(ht.ItemSlot,{scope:r,id:l,focusable:a,active:n,children:f.jsx(be.span,{tabIndex:c?0:-1,"data-orientation":p.orientation,...o,ref:t,onMouseDown:Q(e.onMouseDown,y=>{a?p.onItemFocus(l):y.preventDefault()}),onFocus:Q(e.onFocus,()=>p.onItemFocus(l)),onKeyDown:Q(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=qo(y,p.orientation,p.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let d=g().filter(C=>C.focusable).map(C=>C.ref.current);if(x==="last")d.reverse();else if(x==="prev"||x==="next"){x==="prev"&&d.reverse();const C=d.indexOf(y.currentTarget);d=p.loop?Wo(d,C+1):d.slice(C+1)}setTimeout(()=>ra(d))}}),children:typeof i=="function"?i({isCurrentTabStop:c,hasTabStop:b!=null}):i})})});ta.displayName=ea;var Vo={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uo(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function qo(e,t,r){const a=Uo(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Vo[a]}function ra(e,t=!1){const r=document.activeElement;for(const a of e)if(a===r||(a.focus({preventScroll:t}),document.activeElement!==r))return}function Wo(e,t){return e.map((r,a)=>e[(t+a)%e.length])}var Jo=Xr,Go=ta,qe="Tabs",[Ho]=bt(qe,[Kr]),aa=Kr(),[Yo,Et]=Ho(qe),na=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,onValueChange:n,defaultValue:s,orientation:i="horizontal",dir:o,activationMode:u="automatic",...l}=e,p=dr(o),[c,g]=or({prop:a,onChange:n,defaultProp:s??"",caller:qe});return f.jsx(Yo,{scope:r,baseId:ir(),value:c,onValueChange:g,orientation:i,dir:p,activationMode:u,children:f.jsx(be.div,{dir:p,"data-orientation":i,...l,ref:t})})});na.displayName=qe;var sa="TabsList",ia=I.forwardRef((e,t)=>{const{__scopeTabs:r,loop:a=!0,...n}=e,s=Et(sa,r),i=aa(r);return f.jsx(Jo,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:a,children:f.jsx(be.div,{role:"tablist","aria-orientation":s.orientation,...n,ref:t})})});ia.displayName=sa;var oa="TabsTrigger",la=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,disabled:n=!1,...s}=e,i=Et(oa,r),o=aa(r),u=da(i.baseId,a),l=pa(i.baseId,a),p=a===i.value;return f.jsx(Go,{asChild:!0,...o,focusable:!n,active:p,children:f.jsx(be.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":l,"data-state":p?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:u,...s,ref:t,onMouseDown:Q(e.onMouseDown,c=>{!n&&c.button===0&&c.ctrlKey===!1?i.onValueChange(a):c.preventDefault()}),onKeyDown:Q(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&i.onValueChange(a)}),onFocus:Q(e.onFocus,()=>{const c=i.activationMode!=="manual";!p&&!n&&c&&i.onValueChange(a)})})})});la.displayName=oa;var ua="TabsContent",ca=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,forceMount:n,children:s,...i}=e,o=Et(ua,r),u=da(o.baseId,a),l=pa(o.baseId,a),p=a===o.value,c=I.useRef(p);return I.useEffect(()=>{const g=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(g)},[]),f.jsx(ot,{present:n||p,children:({present:g})=>f.jsx(be.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:l,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:g&&s})})});ca.displayName=ua;function da(e,t){return`${e}-trigger-${t}`}function pa(e,t){return`${e}-content-${t}`}const nt=new Map,fa=I.createContext(null);function Qo(){const e=I.use(fa);if(!e)throw new Error("You must wrap your component in <Tabs>");return e}const Ko=ia,Xo=la;function el({ref:e,groupId:t,persist:r=!1,updateAnchor:a=!1,defaultValue:n,value:s,onValueChange:i,...o}){const u=I.useRef(null),l=I.useMemo(()=>new Map,[]),[p,c]=s===void 0?I.useState(n):[s,I.useEffectEvent(g=>i?.(g))];return I.useLayoutEffect(()=>{if(!t)return;let g=sessionStorage.getItem(t);r&&(g??=localStorage.getItem(t)),g&&c(g);const h=nt.get(t)??new Set;return h.add(c),nt.set(t,h),()=>{h.delete(c)}},[t,r,c]),I.useLayoutEffect(()=>{const g=window.location.hash.slice(1);if(g){for(const[h,m]of l.entries())if(m===g){c(h),u.current?.scrollIntoView();break}}},[c,l]),f.jsx(na,{ref:sr(e,u),value:p,onValueChange:g=>{if(a){const h=l.get(g);h&&window.history.replaceState(null,"",`#${h}`)}if(t){const h=nt.get(t);if(h)for(const m of h)m(g);sessionStorage.setItem(t,g),r&&localStorage.setItem(t,g)}else c(g)},...o,children:f.jsx(fa,{value:I.useMemo(()=>({valueToIdMap:l}),[l]),children:o.children})})}function tl({value:e,...t}){const{valueToIdMap:r}=Qo();return t.id&&r.set(e,t.id),f.jsx(ca,{value:e,...t,children:t.children})}const gt=I.createContext(null);function Ct(e){return f.jsx("pre",{...e,className:M("min-w-full w-max *:flex *:flex-col",e.className),children:e.children})}function St({ref:e,title:t,allowCopy:r=!0,keepBackground:a=!1,icon:n,viewportProps:s={},children:i,Actions:o=l=>f.jsx("div",{...l,className:M("empty:hidden",l.className)}),...u}){const l=I.use(gt)!==null,p=I.useRef(null);return f.jsxs("figure",{ref:e,dir:"ltr",...u,tabIndex:-1,className:M(l?"bg-fd-secondary -mx-px -mb-px last:rounded-b-xl":"my-4 bg-fd-card rounded-xl",a&&"bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)","shiki relative border shadow-sm not-prose overflow-hidden text-sm",u.className),children:[t?f.jsxs("div",{className:"flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4",children:[typeof n=="string"?f.jsx("div",{className:"[&_svg]:size-3.5",dangerouslySetInnerHTML:{__html:n}}):n,f.jsx("figcaption",{className:"flex-1 truncate",children:t}),o({className:"-me-2",children:r&&f.jsx(rr,{containerRef:p})})]}):o({className:"absolute top-3 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground",children:r&&f.jsx(rr,{containerRef:p})}),f.jsx("div",{ref:p,...s,role:"region",tabIndex:0,className:M("text-[0.8125rem] py-3.5 overflow-auto max-h-[600px] fd-scroll-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring",s.className),style:{"--padding-right":t?void 0:"calc(var(--spacing) * 8)",counterSet:u["data-line-numbers"]?`line ${Number(u["data-line-numbers-start"]??1)-1}`:void 0,...s.style},children:i})]})}function rr({className:e,containerRef:t,...r}){const[a,n]=Va(()=>{const s=t.current?.getElementsByTagName("pre").item(0);if(!s)return;const i=s.cloneNode(!0);i.querySelectorAll(".nd-copy-ignore").forEach(o=>{o.replaceWith(`
21
- `)}),navigator.clipboard.writeText(i.textContent??"")});return f.jsx("button",{type:"button","data-checked":a||void 0,className:M(ge({className:"hover:text-fd-accent-foreground data-checked:text-fd-accent-foreground",size:"icon-xs"}),e),"aria-label":a?"Copied Text":"Copy Text",onClick:n,...r,children:a?f.jsx(Ia,{}):f.jsx(Qa,{})})}function ma({ref:e,...t}){const r=I.useRef(null),a=I.use(gt)!==null;return f.jsx(el,{ref:sr(r,e),...t,className:M("bg-fd-card rounded-xl border",!a&&"my-4",t.className),children:f.jsx(gt,{value:I.useMemo(()=>({containerRef:r,nested:a}),[a]),children:t.children})})}function ha(e){return f.jsx(Ko,{...e,className:M("flex flex-row px-2 overflow-x-auto text-fd-muted-foreground",e.className),children:e.children})}function ga({children:e,...t}){return f.jsxs(Xo,{...t,className:M("relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5",t.className),children:[f.jsx("div",{className:"absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary"}),e]})}function va(e){return f.jsx(tl,{...e})}async function rl(e,t){const{isSpecialTheme:r}=await yt(async()=>{const{isSpecialTheme:n}=await import("./core-Skfz1hTb.js");return{isSpecialTheme:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),a=t.filter(n=>{if(r(n))return!1;try{return e.getTheme(n),!1}catch{return!0}});a.length>0&&await e.loadTheme(...a)}function al(e){return"theme"in e?[e.theme]:Object.values(e.themes).filter(t=>t!==void 0)}function nl(e){let t;return{init(r){return t=e.init(r)},getOrInit(){return t??this.init()}}}async function sl(e,t,r){const{fallbackLanguage:a="text",...n}=r,{isSpecialLang:s}=await yt(async()=>{const{isSpecialLang:i}=await import("./core-Skfz1hTb.js");return{isSpecialLang:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));return!s(n.lang)&&!(n.lang in e.getBundledLanguages())&&!e.getLoadedLanguages().includes(n.lang)&&(n.lang=a),await Promise.all([rl(e,al(n)),e.loadLanguage(n.lang)]),e.codeToHast(t,n)}function il(e,t,r,a){const[n,s]=I.useState(r.defaultValue),i=I.useRef(null);return I.useEffect(()=>{async function o(){return cr(await sl(typeof e=="function"?await e():e,t,r),{...Ea,components:r.components})}const u=o();return i.current=u,u.then(l=>{i.current===u&&s(l)}),()=>{i.current=null}},a),n}const ya=I.createContext(void 0);function ol(e){const t=I.use(ya);return f.jsx(St,{...e,...t,className:M("my-0",e.className,t?.className),children:f.jsx(Ct,{children:e.children})})}function ll({lang:e,code:t,codeblock:r,options:a,wrapInSuspense:n=!0,highlighter:s}){const i=I.useId(),o={lang:e,defaultColor:!1,...a,components:{pre:ol,...a.components}};let u=il(s,t,o,[i,e,t]);return n&&(u??=f.jsx(ul,{code:t,components:o.components})),f.jsx(ya,{value:r,children:u})}function ul({code:e,components:t={}}){const{pre:r="pre",code:a="code"}=t;return f.jsx(r,{children:f.jsx(a,{children:e.split(`
22
- `).map((n,s)=>f.jsx("span",{className:"line",children:n},s))})})}const cl=nl({async init(e){const{createHighlighter:t,createJavaScriptRegexEngine:r}=await yt(async()=>{const{createHighlighter:a,createJavaScriptRegexEngine:n}=await import("./index-C4FVOzMP.js");return{createHighlighter:a,createJavaScriptRegexEngine:n}},__vite__mapDeps([13,3,0,1,2,4,5,6,7,8,9,10,11,12]));return t({langs:[],themes:[],langAlias:e?.langAlias,engine:r()})}});function dl(e){return f.jsx(ll,{highlighter:()=>cl.getOrInit(),options:{themes:{light:"github-light",dark:"github-dark"}},...e})}function pl(e){return f.jsx("div",{...e,className:M("grid grid-cols-2 gap-3 @container",e.className),children:e.children})}function fl({icon:e,title:t,description:r,...a}){return f.jsxs(a.href?vt:"div",{...a,"data-card":!0,className:M("block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full",a.href&&"hover:bg-fd-accent/80",a.className),children:[e?f.jsx("div",{className:"not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4",children:e}):null,f.jsx("h3",{className:"not-prose mb-1 text-sm font-medium",children:t}),r?f.jsx("p",{className:"my-0! text-sm text-fd-muted-foreground",children:r}):null,f.jsx("div",{className:"text-sm text-fd-muted-foreground prose-no-margin empty:hidden",children:a.children})]})}const Le="size-5 -me-0.5 fill-(--callout-color) text-fd-card";function ml({children:e,title:t,...r}){return f.jsxs(ba,{...r,children:[t&&f.jsx(xa,{children:t}),f.jsx(wa,{children:e})]})}function hl(e){return e==="warn"?"warning":e==="tip"?"info":e}function ba({type:e="info",icon:t,children:r,className:a,style:n,...s}){const i=hl(e);return f.jsxs("div",{className:M("flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground shadow-md",a),style:{"--callout-color":`var(--color-fd-${i}, var(--color-fd-muted))`,...n},...s,children:[f.jsx("div",{role:"none",className:"w-0.5 bg-(--callout-color)/50 rounded-sm"}),t??{info:f.jsx(Xa,{className:Le}),warning:f.jsx(mn,{className:Le}),error:f.jsx(Ha,{className:Le}),success:f.jsx(Ja,{className:Le}),idea:f.jsx(tn,{className:"size-5 -me-0.5 fill-(--callout-color) text-(--callout-color)"})}[i],f.jsx("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:r})]})}function xa({children:e,className:t,...r}){return f.jsx("p",{className:M("font-medium my-0!",t),...r,children:e})}function wa({children:e,className:t,...r}){return f.jsx("div",{className:M("text-fd-muted-foreground prose-no-margin empty:hidden",t),...r,children:e})}function de({as:e,className:t,...r}){const a=e??"h1";return r.id?f.jsxs(a,{className:M("flex scroll-m-28 flex-row items-center gap-2",t),...r,children:[f.jsx("a",{"data-card":"",href:`#${r.id}`,className:"peer",children:r.children}),f.jsx(an,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"})]}):f.jsx(a,{className:t,...r})}function gl(e){return f.jsx(nr,{sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",...e,className:M("rounded-lg",e.className)})}function vl(e){return f.jsx("div",{className:"relative overflow-auto prose-no-margin my-6",children:f.jsx("table",{...e})})}const yl={CodeBlockTab:va,CodeBlockTabs:ma,CodeBlockTabsList:ha,CodeBlockTabsTrigger:ga,pre:e=>f.jsx(St,{...e,children:f.jsx(Ct,{children:e.children})}),Card:fl,Cards:pl,a:vt,img:gl,h1:e=>f.jsx(de,{as:"h1",...e}),h2:e=>f.jsx(de,{as:"h2",...e}),h3:e=>f.jsx(de,{as:"h3",...e}),h4:e=>f.jsx(de,{as:"h4",...e}),h5:e=>f.jsx(de,{as:"h5",...e}),h6:e=>f.jsx(de,{as:"h6",...e}),table:vl,Callout:ml,CalloutContainer:ba,CalloutTitle:xa,CalloutDescription:wa};function bl(){return e=>{Ba(e,["text","element"],(t,r,a)=>{if(t.type==="element"&&t.tagName==="pre")return"skip";if(t.type!=="text"||!a||r===void 0)return;const s=t.value.split(/(?=\s)/).flatMap(i=>i.length===0?[]:{type:"element",tagName:"span",properties:{class:"animate-fd-fade-in"},children:[{type:"text",value:i}]});return Object.assign(t,{type:"element",tagName:"span",properties:{},children:s}),"skip"})}}function xl(){const e=$a().use(Oo).use(Za).use(bl);return{async process(t){const r=e.parse({value:t}),a=await e.run(r);return cr(a,{development:!1,jsx:f.jsx,jsxs:f.jsxs,Fragment:f.Fragment,components:{...yl,pre:wl,img:void 0}})}}}function wl(e){const r=I.Children.only(e.children).props,a=r.children;if(typeof a!="string")return null;let n=r.className?.split(" ").find(s=>s.startsWith("language-"))?.slice(9)??"text";return n==="mdx"&&(n="md"),f.jsx(dl,{lang:n,code:a.trimEnd()})}const kl=xl();function Il({text:e}){const t=I.useDeferredValue(e);return f.jsx(I.Suspense,{fallback:f.jsx("p",{className:"invisible",children:e}),children:f.jsx(_l,{text:t})})}const ar=new Map;function _l({text:e}){const t=ar.get(e)??kl.process(e);return ar.set(e,t),I.use(t)}const Tt=I.createContext(null);function El({className:e,...t}){const{setOpen:r}=We();return f.jsxs("div",{className:M("sticky top-0 flex items-start gap-2 border rounded-xl bg-fd-secondary text-fd-secondary-foreground shadow-sm",e),...t,children:[f.jsxs("div",{className:"px-3 py-2 flex-1",children:[f.jsx("p",{className:"text-sm font-medium mb-2",children:"AI Chat"}),f.jsx("p",{className:"text-xs text-fd-muted-foreground",children:"AI can be inaccurate, please verify the answers."})]}),f.jsx("button",{"aria-label":"Close",tabIndex:-1,className:M(ge({size:"icon-sm",color:"ghost",className:"text-fd-muted-foreground rounded-full"})),onClick:()=>r(!1),children:f.jsx(Ua,{})})]})}function Cl(){const{messages:e,status:t,setMessages:r,regenerate:a}=At(),n=t==="streaming";return e.length===0?null:f.jsxs(f.Fragment,{children:[!n&&e.at(-1)?.role==="assistant"&&f.jsxs("button",{type:"button",className:M(ge({color:"secondary",size:"sm",className:"rounded-full gap-1.5"})),onClick:()=>a(),children:[f.jsx(cn,{className:"size-4"}),"Retry"]}),f.jsx("button",{type:"button",className:M(ge({color:"secondary",size:"sm",className:"rounded-full"})),onClick:()=>r([]),children:"Clear Chat"})]})}const st="__ai_search_input";function Sl(e){const{status:t,sendMessage:r,stop:a}=At(),[n,s]=I.useState(()=>localStorage.getItem(st)??""),i=t==="streaming"||t==="submitted",o=u=>{u?.preventDefault(),r({text:n}),s(""),localStorage.removeItem(st)};return I.useEffect(()=>{i&&document.getElementById("nd-ai-input")?.focus()},[i]),f.jsxs("form",{...e,className:M("flex items-start pe-2",e.className),onSubmit:o,children:[f.jsx(Al,{value:n,placeholder:i?"AI is answering...":"Ask a question",autoFocus:!0,className:"p-3",disabled:t==="streaming"||t==="submitted",onChange:u=>{s(u.target.value),localStorage.setItem(st,u.target.value)},onKeyDown:u=>{!u.shiftKey&&u.key==="Enter"&&o(u)}}),i?f.jsxs("button",{type:"button",className:M(ge({color:"secondary",className:"transition-all rounded-full mt-2 gap-2"})),onClick:a,children:[f.jsx(sn,{className:"size-4 animate-spin text-fd-muted-foreground"}),"Abort Answer"]},"bn"):f.jsx("button",{type:"submit",className:M(ge({color:"primary",className:"transition-all rounded-full mt-2"})),disabled:n.length===0,children:f.jsx(pn,{className:"size-4"})},"bn")]})}function Tl(e){const t=I.useRef(null);return I.useEffect(()=>{if(!t.current)return;function r(){const s=t.current;s&&s.scrollTo({top:s.scrollHeight,behavior:"instant"})}const a=new ResizeObserver(r);r();const n=t.current?.firstElementChild;return n&&a.observe(n),()=>{a.disconnect()}},[]),f.jsx("div",{ref:t,...e,className:M("fd-scroll-container overflow-y-auto min-w-0 flex flex-col",e.className),children:e.children})}function Al(e){const t=I.useRef(null),r=M("col-start-1 row-start-1",e.className);return f.jsxs("div",{className:"grid flex-1",children:[f.jsx("textarea",{id:"nd-ai-input",...e,className:M("resize-none bg-transparent placeholder:text-fd-muted-foreground focus-visible:outline-none",r)}),f.jsx("div",{ref:t,className:M(r,"break-all invisible"),children:`${e.value?.toString()??""}
21
+ `)}),navigator.clipboard.writeText(i.textContent??"")});return f.jsx("button",{type:"button","data-checked":a||void 0,className:M(ge({className:"hover:text-fd-accent-foreground data-checked:text-fd-accent-foreground",size:"icon-xs"}),e),"aria-label":a?"Copied Text":"Copy Text",onClick:n,...r,children:a?f.jsx(Ia,{}):f.jsx(Qa,{})})}function ma({ref:e,...t}){const r=I.useRef(null),a=I.use(gt)!==null;return f.jsx(el,{ref:sr(r,e),...t,className:M("bg-fd-card rounded-xl border",!a&&"my-4",t.className),children:f.jsx(gt,{value:I.useMemo(()=>({containerRef:r,nested:a}),[a]),children:t.children})})}function ha(e){return f.jsx(Ko,{...e,className:M("flex flex-row px-2 overflow-x-auto text-fd-muted-foreground",e.className),children:e.children})}function ga({children:e,...t}){return f.jsxs(Xo,{...t,className:M("relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5",t.className),children:[f.jsx("div",{className:"absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary"}),e]})}function va(e){return f.jsx(tl,{...e})}async function rl(e,t){const{isSpecialTheme:r}=await yt(async()=>{const{isSpecialTheme:n}=await import("./core-C4jOG9I2.js");return{isSpecialTheme:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),a=t.filter(n=>{if(r(n))return!1;try{return e.getTheme(n),!1}catch{return!0}});a.length>0&&await e.loadTheme(...a)}function al(e){return"theme"in e?[e.theme]:Object.values(e.themes).filter(t=>t!==void 0)}function nl(e){let t;return{init(r){return t=e.init(r)},getOrInit(){return t??this.init()}}}async function sl(e,t,r){const{fallbackLanguage:a="text",...n}=r,{isSpecialLang:s}=await yt(async()=>{const{isSpecialLang:i}=await import("./core-C4jOG9I2.js");return{isSpecialLang:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));return!s(n.lang)&&!(n.lang in e.getBundledLanguages())&&!e.getLoadedLanguages().includes(n.lang)&&(n.lang=a),await Promise.all([rl(e,al(n)),e.loadLanguage(n.lang)]),e.codeToHast(t,n)}function il(e,t,r,a){const[n,s]=I.useState(r.defaultValue),i=I.useRef(null);return I.useEffect(()=>{async function o(){return cr(await sl(typeof e=="function"?await e():e,t,r),{...Ea,components:r.components})}const u=o();return i.current=u,u.then(l=>{i.current===u&&s(l)}),()=>{i.current=null}},a),n}const ya=I.createContext(void 0);function ol(e){const t=I.use(ya);return f.jsx(St,{...e,...t,className:M("my-0",e.className,t?.className),children:f.jsx(Ct,{children:e.children})})}function ll({lang:e,code:t,codeblock:r,options:a,wrapInSuspense:n=!0,highlighter:s}){const i=I.useId(),o={lang:e,defaultColor:!1,...a,components:{pre:ol,...a.components}};let u=il(s,t,o,[i,e,t]);return n&&(u??=f.jsx(ul,{code:t,components:o.components})),f.jsx(ya,{value:r,children:u})}function ul({code:e,components:t={}}){const{pre:r="pre",code:a="code"}=t;return f.jsx(r,{children:f.jsx(a,{children:e.split(`
22
+ `).map((n,s)=>f.jsx("span",{className:"line",children:n},s))})})}const cl=nl({async init(e){const{createHighlighter:t,createJavaScriptRegexEngine:r}=await yt(async()=>{const{createHighlighter:a,createJavaScriptRegexEngine:n}=await import("./index-CYJW3hzB.js");return{createHighlighter:a,createJavaScriptRegexEngine:n}},__vite__mapDeps([13,3,0,1,2,4,5,6,7,8,9,10,11,12]));return t({langs:[],themes:[],langAlias:e?.langAlias,engine:r()})}});function dl(e){return f.jsx(ll,{highlighter:()=>cl.getOrInit(),options:{themes:{light:"github-light",dark:"github-dark"}},...e})}function pl(e){return f.jsx("div",{...e,className:M("grid grid-cols-2 gap-3 @container",e.className),children:e.children})}function fl({icon:e,title:t,description:r,...a}){return f.jsxs(a.href?vt:"div",{...a,"data-card":!0,className:M("block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full",a.href&&"hover:bg-fd-accent/80",a.className),children:[e?f.jsx("div",{className:"not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4",children:e}):null,f.jsx("h3",{className:"not-prose mb-1 text-sm font-medium",children:t}),r?f.jsx("p",{className:"my-0! text-sm text-fd-muted-foreground",children:r}):null,f.jsx("div",{className:"text-sm text-fd-muted-foreground prose-no-margin empty:hidden",children:a.children})]})}const Le="size-5 -me-0.5 fill-(--callout-color) text-fd-card";function ml({children:e,title:t,...r}){return f.jsxs(ba,{...r,children:[t&&f.jsx(xa,{children:t}),f.jsx(wa,{children:e})]})}function hl(e){return e==="warn"?"warning":e==="tip"?"info":e}function ba({type:e="info",icon:t,children:r,className:a,style:n,...s}){const i=hl(e);return f.jsxs("div",{className:M("flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground shadow-md",a),style:{"--callout-color":`var(--color-fd-${i}, var(--color-fd-muted))`,...n},...s,children:[f.jsx("div",{role:"none",className:"w-0.5 bg-(--callout-color)/50 rounded-sm"}),t??{info:f.jsx(Xa,{className:Le}),warning:f.jsx(mn,{className:Le}),error:f.jsx(Ha,{className:Le}),success:f.jsx(Ja,{className:Le}),idea:f.jsx(tn,{className:"size-5 -me-0.5 fill-(--callout-color) text-(--callout-color)"})}[i],f.jsx("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:r})]})}function xa({children:e,className:t,...r}){return f.jsx("p",{className:M("font-medium my-0!",t),...r,children:e})}function wa({children:e,className:t,...r}){return f.jsx("div",{className:M("text-fd-muted-foreground prose-no-margin empty:hidden",t),...r,children:e})}function de({as:e,className:t,...r}){const a=e??"h1";return r.id?f.jsxs(a,{className:M("flex scroll-m-28 flex-row items-center gap-2",t),...r,children:[f.jsx("a",{"data-card":"",href:`#${r.id}`,className:"peer",children:r.children}),f.jsx(an,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"})]}):f.jsx(a,{className:t,...r})}function gl(e){return f.jsx(nr,{sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",...e,className:M("rounded-lg",e.className)})}function vl(e){return f.jsx("div",{className:"relative overflow-auto prose-no-margin my-6",children:f.jsx("table",{...e})})}const yl={CodeBlockTab:va,CodeBlockTabs:ma,CodeBlockTabsList:ha,CodeBlockTabsTrigger:ga,pre:e=>f.jsx(St,{...e,children:f.jsx(Ct,{children:e.children})}),Card:fl,Cards:pl,a:vt,img:gl,h1:e=>f.jsx(de,{as:"h1",...e}),h2:e=>f.jsx(de,{as:"h2",...e}),h3:e=>f.jsx(de,{as:"h3",...e}),h4:e=>f.jsx(de,{as:"h4",...e}),h5:e=>f.jsx(de,{as:"h5",...e}),h6:e=>f.jsx(de,{as:"h6",...e}),table:vl,Callout:ml,CalloutContainer:ba,CalloutTitle:xa,CalloutDescription:wa};function bl(){return e=>{Ba(e,["text","element"],(t,r,a)=>{if(t.type==="element"&&t.tagName==="pre")return"skip";if(t.type!=="text"||!a||r===void 0)return;const s=t.value.split(/(?=\s)/).flatMap(i=>i.length===0?[]:{type:"element",tagName:"span",properties:{class:"animate-fd-fade-in"},children:[{type:"text",value:i}]});return Object.assign(t,{type:"element",tagName:"span",properties:{},children:s}),"skip"})}}function xl(){const e=$a().use(Oo).use(Za).use(bl);return{async process(t){const r=e.parse({value:t}),a=await e.run(r);return cr(a,{development:!1,jsx:f.jsx,jsxs:f.jsxs,Fragment:f.Fragment,components:{...yl,pre:wl,img:void 0}})}}}function wl(e){const r=I.Children.only(e.children).props,a=r.children;if(typeof a!="string")return null;let n=r.className?.split(" ").find(s=>s.startsWith("language-"))?.slice(9)??"text";return n==="mdx"&&(n="md"),f.jsx(dl,{lang:n,code:a.trimEnd()})}const kl=xl();function Il({text:e}){const t=I.useDeferredValue(e);return f.jsx(I.Suspense,{fallback:f.jsx("p",{className:"invisible",children:e}),children:f.jsx(_l,{text:t})})}const ar=new Map;function _l({text:e}){const t=ar.get(e)??kl.process(e);return ar.set(e,t),I.use(t)}const Tt=I.createContext(null);function El({className:e,...t}){const{setOpen:r}=We();return f.jsxs("div",{className:M("sticky top-0 flex items-start gap-2 border rounded-xl bg-fd-secondary text-fd-secondary-foreground shadow-sm",e),...t,children:[f.jsxs("div",{className:"px-3 py-2 flex-1",children:[f.jsx("p",{className:"text-sm font-medium mb-2",children:"AI Chat"}),f.jsx("p",{className:"text-xs text-fd-muted-foreground",children:"AI can be inaccurate, please verify the answers."})]}),f.jsx("button",{"aria-label":"Close",tabIndex:-1,className:M(ge({size:"icon-sm",color:"ghost",className:"text-fd-muted-foreground rounded-full"})),onClick:()=>r(!1),children:f.jsx(Ua,{})})]})}function Cl(){const{messages:e,status:t,setMessages:r,regenerate:a}=At(),n=t==="streaming";return e.length===0?null:f.jsxs(f.Fragment,{children:[!n&&e.at(-1)?.role==="assistant"&&f.jsxs("button",{type:"button",className:M(ge({color:"secondary",size:"sm",className:"rounded-full gap-1.5"})),onClick:()=>a(),children:[f.jsx(cn,{className:"size-4"}),"Retry"]}),f.jsx("button",{type:"button",className:M(ge({color:"secondary",size:"sm",className:"rounded-full"})),onClick:()=>r([]),children:"Clear Chat"})]})}const st="__ai_search_input";function Sl(e){const{status:t,sendMessage:r,stop:a}=At(),[n,s]=I.useState(()=>localStorage.getItem(st)??""),i=t==="streaming"||t==="submitted",o=u=>{u?.preventDefault(),r({text:n}),s(""),localStorage.removeItem(st)};return I.useEffect(()=>{i&&document.getElementById("nd-ai-input")?.focus()},[i]),f.jsxs("form",{...e,className:M("flex items-start pe-2",e.className),onSubmit:o,children:[f.jsx(Al,{value:n,placeholder:i?"AI is answering...":"Ask a question",autoFocus:!0,className:"p-3",disabled:t==="streaming"||t==="submitted",onChange:u=>{s(u.target.value),localStorage.setItem(st,u.target.value)},onKeyDown:u=>{!u.shiftKey&&u.key==="Enter"&&o(u)}}),i?f.jsxs("button",{type:"button",className:M(ge({color:"secondary",className:"transition-all rounded-full mt-2 gap-2"})),onClick:a,children:[f.jsx(sn,{className:"size-4 animate-spin text-fd-muted-foreground"}),"Abort Answer"]},"bn"):f.jsx("button",{type:"submit",className:M(ge({color:"primary",className:"transition-all rounded-full mt-2"})),disabled:n.length===0,children:f.jsx(pn,{className:"size-4"})},"bn")]})}function Tl(e){const t=I.useRef(null);return I.useEffect(()=>{if(!t.current)return;function r(){const s=t.current;s&&s.scrollTo({top:s.scrollHeight,behavior:"instant"})}const a=new ResizeObserver(r);r();const n=t.current?.firstElementChild;return n&&a.observe(n),()=>{a.disconnect()}},[]),f.jsx("div",{ref:t,...e,className:M("fd-scroll-container overflow-y-auto min-w-0 flex flex-col",e.className),children:e.children})}function Al(e){const t=I.useRef(null),r=M("col-start-1 row-start-1",e.className);return f.jsxs("div",{className:"grid flex-1",children:[f.jsx("textarea",{id:"nd-ai-input",...e,className:M("resize-none bg-transparent placeholder:text-fd-muted-foreground focus-visible:outline-none",r)}),f.jsx("div",{ref:t,className:M(r,"break-all invisible"),children:`${e.value?.toString()??""}
23
23
  `})]})}const Rl={user:"you",assistant:"fumadocs"};function Nl({message:e,...t}){let r="";const a=[];for(const n of e.parts??[]){if(n.type==="text"){r+=n.text;continue}if(n.type.startsWith("tool-")){const s=n.type.slice(5),i=n;if(s!=="search"||!i.toolCallId)continue;a.push(i)}}return f.jsxs("div",{onClick:n=>n.stopPropagation(),...t,children:[f.jsx("p",{className:M("mb-1 text-sm font-medium text-fd-muted-foreground",e.role==="assistant"&&"text-fd-primary"),children:Rl[e.role]??"unknown"}),f.jsx("div",{className:"prose text-sm",children:f.jsx(Il,{text:r})}),a.map(n=>f.jsxs("div",{className:"flex flex-row gap-2 items-center mt-3 rounded-lg border bg-fd-secondary text-fd-muted-foreground text-xs p-2",children:[f.jsx(qa,{className:"size-4"}),n.state==="output-error"||n.state==="output-denied"?f.jsx("p",{className:"text-fd-error",children:n.errorText??"Failed to search"}):f.jsx("p",{children:n.output?`${n.output.length} search results`:"Searching…"})]},n.toolCallId))]})}function Ml({children:e}){const[t,r]=I.useState(!1),a=ai({id:"search",transport:new Fr({api:"/api/chat"})});return f.jsx(Tt,{value:I.useMemo(()=>({chat:a,open:t,setOpen:r}),[a,t]),children:e})}function jl({position:e="default",className:t,...r}){const{open:a,setOpen:n}=We();return f.jsx("button",{"data-state":a?"open":"closed",className:M(e==="float"&&["fixed bottom-4 gap-3 w-24 end-[calc(--spacing(4)+var(--removed-body-scroll-bar-size,0px))] shadow-lg z-20 transition-[translate,opacity]",a&&"translate-y-10 opacity-0"],t),onClick:()=>n(!a),...r,children:r.children})}function Dl(){const{open:e,setOpen:t}=We();return Pl(),f.jsxs(f.Fragment,{children:[f.jsx("style",{children:`
24
24
  @keyframes ask-ai-open {
25
25
  from {
@@ -1 +1 @@
1
- import{r as o,j as u}from"./index-DAcpNNU5.js";const c=()=>{throw new Error("You need to wrap your application inside `FrameworkProvider`.")},a=o.createContext({useParams:c,useRouter:c,usePathname:c});function f({Link:e,useRouter:r,useParams:t,usePathname:s,Image:n,children:i}){return u.jsx(a,{value:o.useMemo(()=>({usePathname:s,useRouter:r,Link:e,Image:n,useParams:t}),[e,s,r,t,n]),children:i})}function x(){return o.use(a).usePathname()}function h(){return o.use(a).useRouter()}function j(e){const{Image:r}=o.use(a);if(!r){const{src:t,alt:s,priority:n,...i}=e;return u.jsx("img",{alt:s,src:t,fetchPriority:n?"high":"auto",...i})}return u.jsx(r,{...e})}function p(e){const{Link:r}=o.use(a);if(!r){const{href:t,prefetch:s,...n}=e;return u.jsx("a",{href:t,...n})}return u.jsx(r,{...e})}export{f as F,j as I,p as L,x as a,h as u};
1
+ import{r as o,j as u}from"./index-OFfnl8sH.js";const c=()=>{throw new Error("You need to wrap your application inside `FrameworkProvider`.")},a=o.createContext({useParams:c,useRouter:c,usePathname:c});function f({Link:e,useRouter:r,useParams:t,usePathname:s,Image:n,children:i}){return u.jsx(a,{value:o.useMemo(()=>({usePathname:s,useRouter:r,Link:e,Image:n,useParams:t}),[e,s,r,t,n]),children:i})}function x(){return o.use(a).usePathname()}function h(){return o.use(a).useRouter()}function j(e){const{Image:r}=o.use(a);if(!r){const{src:t,alt:s,priority:n,...i}=e;return u.jsx("img",{alt:s,src:t,fetchPriority:n?"high":"auto",...i})}return u.jsx(r,{...e})}function p(e){const{Link:r}=o.use(a);if(!r){const{href:t,prefetch:s,...n}=e;return u.jsx("a",{href:t,...n})}return u.jsx(r,{...e})}export{f as F,j as I,p as L,x as a,h as u};