@usine/server 0.4.1-next.263.g21813b5 → 0.4.1-next.264.gfdecd7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/configuration/catalog.d.ts +5 -0
- package/dist/configuration/catalog.d.ts.map +1 -0
- package/dist/configuration/catalog.js +38 -0
- package/dist/configuration/catalog.js.map +1 -0
- package/dist/http.d.ts +3 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +7 -0
- package/dist/http.js.map +1 -1
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +4 -2
- package/dist/up.js.map +1 -1
- package/dist/web/assets/_agent-CK1JZbEZ.js +1 -0
- package/dist/web/assets/{_label-CjbmpOS8.js → _label-CkDrdgxa.js} +1 -1
- package/dist/web/assets/_loop-DLKJmqFq.js +1 -0
- package/dist/web/assets/_name-BzeOsU08.js +1 -0
- package/dist/web/assets/_name-CCrJHJTI.js +1 -0
- package/dist/web/assets/_name-LWtfT5Eq.js +2 -0
- package/dist/web/assets/_number-BzeOsU08.js +1 -0
- package/dist/web/assets/{_number-Cak-hr88.js → _number-CpU9ru_u.js} +1 -1
- package/dist/web/assets/_number-n4iejSEq.js +1 -0
- package/dist/web/assets/_run-BzeOsU08.js +1 -0
- package/dist/web/assets/_run-CHrGLkXR.js +5 -0
- package/dist/web/assets/{_worker-Ce5spGKK.js → _worker-BvlkSKMd.js} +1 -1
- package/dist/web/assets/{action-BN5NBgLV.js → action-DQzkdVHs.js} +1 -1
- package/dist/web/assets/actions-CG0hkpe7.js +1 -0
- package/dist/web/assets/agents-CgWsAMoz.js +1 -0
- package/dist/web/assets/{agents-CvLlV1IU.js → agents-D3eAK_60.js} +1 -1
- package/dist/web/assets/code-block-Y9Y-8fHK.js +4 -0
- package/dist/web/assets/collapsible-BKcakxvM.js +1 -0
- package/dist/web/assets/{core-CuokrI3P.js → core-S_rVxu-b.js} +3 -3
- package/dist/web/assets/drawer-ClcvABkO.js +1 -0
- package/dist/web/assets/dropdown-menu-BHKHYfLs.js +1 -0
- package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +1 -0
- package/dist/web/assets/error-alert-hABzwCSY.js +1 -0
- package/dist/web/assets/{file-error-eIMly20p.js → file-error-B5tv6DhJ.js} +1 -1
- package/dist/web/assets/{heading-ss9Xdc-n.js → heading-zIOXe3qT.js} +1 -1
- package/dist/web/assets/{history-DgnatlLO.js → history-PYEz5wbe.js} +1 -1
- package/dist/web/assets/index-C_S4sA5L.css +2 -0
- package/dist/web/assets/index-Dki55xSv.js +10 -0
- package/dist/web/assets/label-badge-JdNthOHh.js +1 -0
- package/dist/web/assets/{labels-Ca7Ov7o0.js → labels-Dr9t-xYj.js} +1 -1
- package/dist/web/assets/{list-6VjnLdz_.js → list-NcxSR9Ja.js} +1 -1
- package/dist/web/assets/loops-DI4kElkX.js +1 -0
- package/dist/web/assets/mark-uyeJ8aPC.js +1 -0
- package/dist/web/assets/markdown-BNebzGGH.js +29 -0
- package/dist/web/assets/model-87X7P9Uh.js +1 -0
- package/dist/web/assets/moves-DS1ecXd6.js +1 -0
- package/dist/web/assets/native-select-BzF8xUnx.js +1 -0
- package/dist/web/assets/{not-found-xvnvMs0s.js → not-found-D7GT8Sj7.js} +1 -1
- package/dist/web/assets/outcome-DvqnSso3.js +5 -0
- package/dist/web/assets/{overview-CF8vBUkv.js → overview-C73v5kbv.js} +1 -1
- package/dist/web/assets/{page-0tuebez8.js → page-C47YAWAl.js} +1 -1
- package/dist/web/assets/{pull-request-marks-Doq7DaVI.js → pull-request-marks-B4f7z4xa.js} +1 -1
- package/dist/web/assets/queries-BZMW2wiD.js +1 -0
- package/dist/web/assets/queries-oea_Y4on.js +1 -0
- package/dist/web/assets/repositories-CZBhubWh.js +1 -0
- package/dist/web/assets/route-BtU2HI1M.js +1 -0
- package/dist/web/assets/route-CD6OvH-7.js +1 -0
- package/dist/web/assets/{route-status-Cg2e753V.js → route-status-DGpeFNCC.js} +1 -1
- package/dist/web/assets/routes-BzeOsU08.js +1 -0
- package/dist/web/assets/{routes-aXaODFL1.js → routes-g6SHTgCO.js} +4 -4
- package/dist/web/assets/run-again-DPa5c27z.js +1 -0
- package/dist/web/assets/{section-Dvf2zdjI.js → section-BZs0sQLB.js} +1 -1
- package/dist/web/assets/section-eyIYzZrG.js +24 -0
- package/dist/web/assets/{settings-C7SrVNWn.js → settings-DusVdmgP.js} +1 -1
- package/dist/web/assets/sortable.esm-Lp8AM6j2.js +5 -0
- package/dist/web/assets/{strings-D8AeU2ul.js → strings-Bexnszes.js} +1 -1
- package/dist/web/assets/{strings-BcIxtDID.js → strings-DXB6PB2g.js} +63 -63
- package/dist/web/assets/tasks-BzeOsU08.js +1 -0
- package/dist/web/assets/tasks-ClShPUFW.js +1 -0
- package/dist/web/assets/usage-BMYuEDo9.js +1 -0
- package/dist/web/assets/use-open-run-B8nD_BT1.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +1 -0
- package/dist/web/assets/useControlled-B5kAMgo-.js +1 -0
- package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +1 -0
- package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +1 -0
- package/dist/web/assets/{workers-BWNVF5aS.js → workers-CDWbu1Tb.js} +1 -1
- package/dist/web/index.html +14 -15
- package/package.json +11 -11
- package/dist/web/assets/_agent-NYU8ZbHV.js +0 -1
- package/dist/web/assets/_loop-BjVObygk.js +0 -1
- package/dist/web/assets/_name-B6oTm1fE.js +0 -6
- package/dist/web/assets/_name-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/_name-D3Tep-4Y.js +0 -1
- package/dist/web/assets/_number-8w6uiYOA.js +0 -1
- package/dist/web/assets/_number-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/_run-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/_run-DbyRF4Hm.js +0 -5
- package/dist/web/assets/actions-BPHDKUD8.js +0 -1
- package/dist/web/assets/agents-BN4G7qse.js +0 -1
- package/dist/web/assets/ccount-8deXbw7O.js +0 -1
- package/dist/web/assets/code-block-B32s6oe9.js +0 -4
- package/dist/web/assets/collapsible-C9-9oo50.js +0 -1
- package/dist/web/assets/drawer-DYJv3cI2.js +0 -1
- package/dist/web/assets/dropdown-menu-BiC7TTLR.js +0 -1
- package/dist/web/assets/edit-and-retry-f_LbEfud.js +0 -1
- package/dist/web/assets/error-alert-B_2zeHFu.js +0 -1
- package/dist/web/assets/index-C-kJ1rRt.js +0 -10
- package/dist/web/assets/index-CdIl44fJ.css +0 -2
- package/dist/web/assets/label-badge-BE80XVOx.js +0 -1
- package/dist/web/assets/label-f_7LisR0.js +0 -1
- package/dist/web/assets/loops-D2E-MWMy.js +0 -1
- package/dist/web/assets/mark-mFortOAt.js +0 -1
- package/dist/web/assets/markdown-3NxaXixH.js +0 -29
- package/dist/web/assets/model-BTe4eohR.js +0 -1
- package/dist/web/assets/moves-Ci10cwSz.js +0 -1
- package/dist/web/assets/outcome-7cxhEvRx.js +0 -5
- package/dist/web/assets/queries-CCEL6uj9.js +0 -1
- package/dist/web/assets/queries-CiGD_2IE.js +0 -1
- package/dist/web/assets/reason-parts-DmsEA117.js +0 -1
- package/dist/web/assets/repositories-DdX53hco.js +0 -1
- package/dist/web/assets/route-BQYtlrWB.js +0 -1
- package/dist/web/assets/route-nKcGNWV5.js +0 -1
- package/dist/web/assets/routes-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/run-again-LTJXpcOt.js +0 -1
- package/dist/web/assets/section-BF7kbQsU.js +0 -24
- package/dist/web/assets/tasks-Ce_Q-lHb.js +0 -1
- package/dist/web/assets/tasks-D8qgj3xb.js +0 -1
- package/dist/web/assets/usage-BmhM4Mev.js +0 -1
- package/dist/web/assets/use-open-run-D4GtXqIL.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-heUDjEK1.js +0 -1
- package/dist/web/assets/useSuspenseQuery-NLdoz0Gs.js +0 -1
- package/dist/web/assets/useTransitionStatus-Dpq86WgF.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./ccount-8deXbw7O.js";var s={}.hasOwnProperty;function c(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&s.call(t,e)){let n=String(t[e]);i=s.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e!==null&&(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function v(e,t){return e<t?-1:+(e>t)}function ee(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ae(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new le(l,u,e,o,s,c)}}return n}var le=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},b=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new y(a,o,s)}var de=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},me=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null)this._mainRule.acceptOverwrite(e,n,r,i);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pe(e,t,n,r,i))}}},x=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ge(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c|0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ce(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof C?w({baseGrammar:a,selfGrammar:i},r):we(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];T([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&T(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&T(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function T(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&T(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ae(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName))}}}var Te=class{kind=0},Ee=class{kind=1},De=class{constructor(e){this.ruleName=e}kind=2},Oe=class{constructor(e){this.scopeName=e}kind=3},ke=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ae(e){if(e===`$base`)return new Te;if(e===`$self`)return new Ee;let t=e.indexOf(`#`);return t===-1?new Oe(e):t===0?new De(e.substring(1)):new ke(e.substring(0,t),e.substring(t+1))}var je=/\\(\d+)/,Me=/\\(\d+)/g,Ne=-1,Pe=-2;function Fe(e){return e}function Ie(e){return e}var E=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Le=class extends E{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Re=class extends E{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new D(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ze=class extends E{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends E{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new D(i,this.id),this.beginCaptures=a,this._end=new D(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new O;for(let t of this.patterns)e.getRule(t).collectPatterns(e,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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ve=class extends E{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new D(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new D(o,Pe),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(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new O;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new O,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},He=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Le(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ze(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ve(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Be(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ae(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof ze||e instanceof Be||e instanceof Ve)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},D=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&je.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Me.lastIndex=0,this.source.replace(Me,(e,t)=>ne(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},O=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(),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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ue(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Ue(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ue=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o}from"./markdown-BNebzGGH.js";var s={}.hasOwnProperty;function c(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&s.call(t,e)){let n=String(t[e]);i=s.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e!==null&&(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function v(e,t){return e<t?-1:+(e>t)}function ee(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ae(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new le(l,u,e,o,s,c)}}return n}var le=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},b=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new y(a,o,s)}var de=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},me=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null)this._mainRule.acceptOverwrite(e,n,r,i);else{for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pe(e,t,n,r,i))}}},x=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ge(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c|0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ce(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof C?w({baseGrammar:a,selfGrammar:i},r):we(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];T([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&T(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&T(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function T(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&T(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ae(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName))}}}var Te=class{kind=0},Ee=class{kind=1},De=class{constructor(e){this.ruleName=e}kind=2},Oe=class{constructor(e){this.scopeName=e}kind=3},ke=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ae(e){if(e===`$base`)return new Te;if(e===`$self`)return new Ee;let t=e.indexOf(`#`);return t===-1?new Oe(e):t===0?new De(e.substring(1)):new ke(e.substring(0,t),e.substring(t+1))}var je=/\\(\d+)/,Me=/\\(\d+)/g,Ne=-1,Pe=-2;function Fe(e){return e}function Ie(e){return e}var E=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Le=class extends E{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Re=class extends E{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new D(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ze=class extends E{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new O,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends E{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new D(i,this.id),this.beginCaptures=a,this._end=new D(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new O;for(let t of this.patterns)e.getRule(t).collectPatterns(e,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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ve=class extends E{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new D(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new D(o,Pe),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(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new O;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new O,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},He=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Le(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Re(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ze(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ve(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Be(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ae(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof ze||e instanceof Be||e instanceof Ve)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},D=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&je.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Me.lastIndex=0,this.source.replace(Me,(e,t)=>ne(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},O=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(),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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ue(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Ue(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Ue=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
2
2
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},We=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ge=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new We(e,8),this._embeddedLanguagesMatcher=new Ke(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new We(0,0);_getBasicScopeAttributes=new re(e=>new We(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.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 Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ke=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>ne(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var qe=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Je(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ye(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new qe(i,!0);f()}return new qe(i,!1);function f(){let o=Xe(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ne){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),k(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Be){let r=o;k(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Ve){let r=o;k(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(k(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Ye(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Ve&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=et(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Pe){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),k(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Xe(e,t,n,r,i,a){let o=Ze(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Qe(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Ze(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=$e(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Qe(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=$e(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function $e(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function et(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function k(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Je(e,p,n&&d.start===0,d.start,f,i,!1,0),ye(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new tt(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var tt=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function nt(e,t,n,r,i,a,o,s){return new at(e,t,n,r,i,a,o,s)}function rt(e,t,n,r,i){let a=S(t,A),o=He.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function A(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(it(t[r],e))return n=r+1,!0;return!1})}function it(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var at=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ge(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ot(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=S(e,A);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)rt(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&rt(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Fe(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Ie(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ot(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=He.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===st.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=x.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?j.createRootAndLookUpScopeName(a,r,this):j.createRoot(`unknown`,r),t=new st(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
3
|
-
`;let a=this.createOnigString(e),o=a.content.length,s=new lt(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Je(this,a,i,0,t,s,!0,r);return ye(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ot(e,t){return e=u(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var j=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=ie.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new ie(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new ie(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),x.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},st=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?j.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}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(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Ie(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=j.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Fe(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,j.fromExtension(r,n.contentNameScopesList))}},ct=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):S(e,A).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>S(e,A).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},lt=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=x.set(n,0,he(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=x.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ut=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,nt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},dt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ut(y.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(y.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ct(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Se(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ft=st.NULL;function M(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function N(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function pt(e){return Array.isArray(e)?e:[e]}async function mt(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function P(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function ht(e){return e===`ansi`||P(e)}function F(e){return e===`none`}function gt(e){return F(e)}var _t=/(\r?\n)/g;function I(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(_t),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var vt={light:`#333333`,dark:`#bbbbbb`},yt={light:`#fffffe`,dark:`#1e1e1e`},bt=`__shiki_resolved`;function L(e){if(e?.[bt])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?vt.light:vt.dark,n||=t.type===`light`?yt.light:yt.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,bt,{enumerable:!1,writable:!1,value:!0}),t}async function xt(e){return[...new Set((await Promise.all(e.filter(e=>!ht(e)).map(async e=>await mt(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function St(e){return(await Promise.all(e.map(async e=>gt(e)?null:L(await mt(e))))).filter(e=>!!e)}function Ct(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new l(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wt=class extends dt{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=L(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=y.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ct(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new l(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Tt=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},R=0;function z(e){R+=1,e.warnings!==!1&&R>=10&&R%10==0&&console.warn(`[Shiki] ${R} 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 t=!1;if(!e.engine)throw new l("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(L),i=new wt(new Tt(e.engine,n),r,n,e.langAlias),a;function o(t){return Ct(t,e.langAlias)}function s(e){_();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new l(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};_();let t=i.getTheme(e);if(!t)throw new l(`Theme \`${e}\` not found, you may need to load it first`);return t}function u(e){_();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function d(){return _(),i.getLoadedThemes()}function f(){return _(),i.getLoadedLanguages()}function p(...e){_(),i.loadLanguages(e.flat(1))}async function m(...e){return p(await xt(e))}function h(...e){_();for(let t of e.flat(1))i.loadTheme(t)}async function g(...e){return _(),h(await St(e))}function _(){if(t)throw new l(`Shiki instance has been disposed`)}function v(){t||(t=!0,i.dispose(),--R)}return{setTheme:u,getTheme:c,getLanguage:s,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:o,loadLanguage:m,loadLanguageSync:p,loadTheme:g,loadThemeSync:h,dispose:v,[Symbol.dispose]:v}}var Et=z;async function Dt(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([St(e.themes||[]),xt(e.langs||[]),e.engine]);return z({...e,themes:t,langs:n,engine:r})}var Ot=Dt,kt=new WeakMap;function B(e,t){kt.set(e,t)}function V(e){return kt.get(e)}var H=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(pt(n).map(e=>[e,ft])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return At(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function At(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function jt(e,t){if(!(e instanceof H))throw new l(`Invalid grammar state`);return e.getInternalStack(t)}var Mt=/,/,Nt=/ /;function Pt(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(P(e.resolveLangAlias(n.lang||`text`))||F(r))return I(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new l(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new l(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return It(t,o,i,a,n)}function Ft(...e){if(e.length===2)return V(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(P(i)||F(a))throw new l(`Plain language does not have grammar state`);if(i===`ansi`)throw new l(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new H(Lt(n,c,o,s,r).stateStack,c.name,o.name)}function It(e,t,n,r,i){let a=Lt(e,t,n,r,i),o=new H(a.stateStack,t.name,n.name);return B(a.tokens,o),a.tokens}function Lt(e,t,n,r,i){let a=M(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=I(e),u=i.grammarState?jt(i.grammarState,n.name)??ft:i.grammarContextCode==null?ft:Lt(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=N(r[x.getForeground(s)],a),u=x.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=x.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Mt).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Nt))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Rt(t.scopes):zt(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Rt(e){return e.map(e=>({scopeName:e}))}function zt(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ht(e,i,t.slice(0,r))}}return n}function Bt(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Vt(e,t,n){if(!Bt(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Bt(e[r],n[i])&&--r,--i;return r===-1}function Ht(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Vt(e,t,n)){r.push(a);break}return r}function U(e,t,n,r=Pt){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:V(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Ut(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new H(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&B(s,c),s}function Ut(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Wt=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Gt=/["&'<>`]/g,Kt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qt=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jt=/[|\\{}()[\]^$+*?.]/g,Yt=new WeakMap;function Xt(e,t){return e=e.replace(t.subset?Zt(t.subset):Gt,r),t.subset||t.escapeOnly?e:e.replace(Kt,n).replace(qt,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Zt(e){let t=Yt.get(e);return t||(t=Qt(e),Yt.set(e,t)),t}function Qt(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Jt,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var $t=/[\dA-Fa-f]/;function en(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!$t.test(String.fromCharCode(t))?r:r+`;`}var tn=/\d/;function nn(e,t,n){let r=`&#`+String(e);return n&&t&&!tn.test(String.fromCharCode(t))?r:r+`;`}var rn=`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`.split(`.`),an={nbsp:`\xA0`,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:`€`},on=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],sn={}.hasOwnProperty,cn={},W;for(W in an)sn.call(an,W)&&(cn[an[W]]=W);var ln=/[^\dA-Za-z]/;function un(e,t,n,r){let i=String.fromCharCode(e);if(sn.call(cn,i)){let e=cn[i],a=`&`+e;return n&&rn.includes(e)&&!on.includes(e)&&(!r||t&&t!==61&&ln.test(String.fromCharCode(t)))?a:a+`;`}return``}function dn(e,t,n){let r=en(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=un(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=nn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function G(e,t){return Xt(e,Object.assign({format:dn},t))}var fn=/^>|^->|<!--|-->|--!>|<!-$/g,pn=[`>`],mn=[`<`,`>`];function hn(e,t,n,r){return r.settings.bogusComments?`<?`+G(e.value,Object.assign({},r.settings.characterReferences,{subset:pn}))+`>`:`<!--`+e.value.replace(fn,i)+`-->`;function i(e){return G(e,Object.assign({},r.settings.characterReferences,{subset:mn}))}}function gn(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var K=yn(1),_n=yn(-1),vn=[];function yn(e){return t;function t(t,n,i){let a=t?t.children:vn,o=(n||0)+e,s=a[o];if(!i)for(;s&&r(s);)o+=e,s=a[o];return s}}var bn={}.hasOwnProperty;function xn(e){return t;function t(t,n,r){return bn.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Sn=xn({body:Tn,caption:Cn,colgroup:Cn,dd:kn,dt:On,head:Cn,html:wn,li:Dn,optgroup:jn,option:Mn,p:En,rp:An,rt:An,tbody:Pn,td:Ln,tfoot:Fn,th:Ln,thead:Nn,tr:In});function Cn(e,t,n){let i=K(n,t,!0);return!i||i.type!==`comment`&&!(i.type===`text`&&r(i.value.charAt(0)))}function wn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function Tn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function En(e,t,n){let r=K(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.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 Dn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`li`}function On(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function kn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function An(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function jn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Mn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Nn(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Pn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Fn(e,t,n){return!K(n,t)}function In(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ln(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rn=xn({body:Vn,colgroup:Hn,head:Bn,html:zn,tbody:Un});function zn(e){let t=K(e,-1);return!t||t.type!==`comment`}function Bn(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Vn(e){let t=K(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&r(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Hn(e,t,n){let r=_n(n,t),i=K(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Un(e,t,n){let r=_n(n,t),i=K(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var q={name:[[`
|
|
3
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new lt(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Je(this,a,i,0,t,s,!0,r);return ye(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ot(e,t){return e=u(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var j=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=ie.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new ie(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new ie(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),x.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},st=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?j.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}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(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Ie(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=j.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Fe(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,j.fromExtension(r,n.contentNameScopesList))}},ct=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):S(e,A).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>S(e,A).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},lt=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=x.set(n,0,he(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=x.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ut=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,nt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},dt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ut(y.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(y.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ct(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Se(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ft=st.NULL;function M(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function N(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function pt(e){return Array.isArray(e)?e:[e]}async function mt(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function P(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function ht(e){return e===`ansi`||P(e)}function F(e){return e===`none`}function gt(e){return F(e)}var _t=/(\r?\n)/g;function I(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(_t),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var vt={light:`#333333`,dark:`#bbbbbb`},yt={light:`#fffffe`,dark:`#1e1e1e`},bt=`__shiki_resolved`;function L(e){if(e?.[bt])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?vt.light:vt.dark,n||=t.type===`light`?yt.light:yt.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,bt,{enumerable:!1,writable:!1,value:!0}),t}async function xt(e){return[...new Set((await Promise.all(e.filter(e=>!ht(e)).map(async e=>await mt(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function St(e){return(await Promise.all(e.map(async e=>gt(e)?null:L(await mt(e))))).filter(e=>!!e)}function Ct(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new l(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wt=class extends dt{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=L(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=y.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ct(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._syncRegistry?._grammars?.get(e.scopeName)?.dispose(),this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new l(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Tt=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},R=0;function z(e){R+=1,e.warnings!==!1&&R>=10&&R%10==0&&console.warn(`[Shiki] ${R} 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 t=!1;if(!e.engine)throw new l("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(L),i=new wt(new Tt(e.engine,n),r,n,e.langAlias),a;function o(t){return Ct(t,e.langAlias)}function s(e){_();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new l(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};_();let t=i.getTheme(e);if(!t)throw new l(`Theme \`${e}\` not found, you may need to load it first`);return t}function u(e){_();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function d(){return _(),i.getLoadedThemes()}function f(){return _(),i.getLoadedLanguages()}function p(...e){_(),i.loadLanguages(e.flat(1))}async function m(...e){return p(await xt(e))}function h(...e){_();for(let t of e.flat(1))i.loadTheme(t)}async function g(...e){return _(),h(await St(e))}function _(){if(t)throw new l(`Shiki instance has been disposed`)}function v(){t||(t=!0,i.dispose(),--R)}return{setTheme:u,getTheme:c,getLanguage:s,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:o,loadLanguage:m,loadLanguageSync:p,loadTheme:g,loadThemeSync:h,dispose:v,[Symbol.dispose]:v}}var Et=z;async function Dt(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([St(e.themes||[]),xt(e.langs||[]),e.engine]);return z({...e,themes:t,langs:n,engine:r})}var Ot=Dt,kt=new WeakMap;function B(e,t){kt.set(e,t)}function V(e){return kt.get(e)}var H=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(pt(n).map(e=>[e,ft])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return At(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function At(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function jt(e,t){if(!(e instanceof H))throw new l(`Invalid grammar state`);return e.getInternalStack(t)}var Mt=/,/,Nt=/ /;function Pt(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(P(e.resolveLangAlias(n.lang||`text`))||F(r))return I(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new l(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new l(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return It(t,o,i,a,n)}function Ft(...e){if(e.length===2)return V(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(P(i)||F(a))throw new l(`Plain language does not have grammar state`);if(i===`ansi`)throw new l(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new H(Lt(n,c,o,s,r).stateStack,c.name,o.name)}function It(e,t,n,r,i){let a=Lt(e,t,n,r,i),o=new H(a.stateStack,t.name,n.name);return B(a.tokens,o),a.tokens}function Lt(e,t,n,r,i){let a=M(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=I(e),u=i.grammarState?jt(i.grammarState,n.name)??ft:i.grammarContextCode==null?ft:Lt(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=N(r[x.getForeground(s)],a),u=x.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=x.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Mt).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Nt))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Rt(t.scopes):zt(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Rt(e){return e.map(e=>({scopeName:e}))}function zt(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ht(e,i,t.slice(0,r))}}return n}function Bt(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Vt(e,t,n){if(!Bt(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Bt(e[r],n[i])&&--r,--i;return r===-1}function Ht(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Vt(e,t,n)){r.push(a);break}return r}function U(e,t,n,r=Pt){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:V(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Ut(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new H(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&B(s,c),s}function Ut(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Wt=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Gt=/["&'<>`]/g,Kt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qt=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jt=/[|\\{}()[\]^$+*?.]/g,Yt=new WeakMap;function Xt(e,t){return e=e.replace(t.subset?Zt(t.subset):Gt,r),t.subset||t.escapeOnly?e:e.replace(Kt,n).replace(qt,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Zt(e){let t=Yt.get(e);return t||(t=Qt(e),Yt.set(e,t)),t}function Qt(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Jt,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var $t=/[\dA-Fa-f]/;function en(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!$t.test(String.fromCharCode(t))?r:r+`;`}var tn=/\d/;function nn(e,t,n){let r=`&#`+String(e);return n&&t&&!tn.test(String.fromCharCode(t))?r:r+`;`}var rn=`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`.split(`.`),an={nbsp:`\xA0`,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:`€`},on=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],sn={}.hasOwnProperty,cn={},W;for(W in an)sn.call(an,W)&&(cn[an[W]]=W);var ln=/[^\dA-Za-z]/;function un(e,t,n,r){let i=String.fromCharCode(e);if(sn.call(cn,i)){let e=cn[i],a=`&`+e;return n&&rn.includes(e)&&!on.includes(e)&&(!r||t&&t!==61&&ln.test(String.fromCharCode(t)))?a:a+`;`}return``}function dn(e,t,n){let r=en(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=un(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=nn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function G(e,t){return Xt(e,Object.assign({format:dn},t))}var fn=/^>|^->|<!--|-->|--!>|<!-$/g,pn=[`>`],mn=[`<`,`>`];function hn(e,t,n,r){return r.settings.bogusComments?`<?`+G(e.value,Object.assign({},r.settings.characterReferences,{subset:pn}))+`>`:`<!--`+e.value.replace(fn,i)+`-->`;function i(e){return G(e,Object.assign({},r.settings.characterReferences,{subset:mn}))}}function gn(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var K=yn(1),_n=yn(-1),vn=[];function yn(e){return t;function t(t,n,r){let i=t?t.children:vn,a=(n||0)+e,s=i[a];if(!r)for(;s&&o(s);)a+=e,s=i[a];return s}}var bn={}.hasOwnProperty;function xn(e){return t;function t(t,n,r){return bn.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Sn=xn({body:Tn,caption:Cn,colgroup:Cn,dd:kn,dt:On,head:Cn,html:wn,li:Dn,optgroup:jn,option:Mn,p:En,rp:An,rt:An,tbody:Pn,td:Ln,tfoot:Fn,th:Ln,thead:Nn,tr:In});function Cn(e,t,n){let r=K(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&o(r.value.charAt(0)))}function wn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function Tn(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function En(e,t,n){let r=K(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.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 Dn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`li`}function On(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function kn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function An(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function jn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Mn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Nn(e,t,n){let r=K(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Pn(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Fn(e,t,n){return!K(n,t)}function In(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ln(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rn=xn({body:Vn,colgroup:Hn,head:Bn,html:zn,tbody:Un});function zn(e){let t=K(e,-1);return!t||t.type!==`comment`}function Bn(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Vn(e){let t=K(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&o(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Hn(e,t,n){let r=_n(n,t),i=K(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Un(e,t,n){let r=_n(n,t),i=K(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var q={name:[[`
|
|
4
4
|
\f\r &/=>`.split(``),`
|
|
5
5
|
\f\r "&'/=>\``.split(``)],[`\0
|
|
6
6
|
\f\r "&'/<=>`.split(``),`\0
|
|
@@ -8,5 +8,5 @@ import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./ccount-8deXbw7O.js";va
|
|
|
8
8
|
\f\r &>`.split(``),`\0
|
|
9
9
|
\f\r "&'<=>\``.split(``)],[`\0
|
|
10
10
|
\f\r "&'<=>\``.split(``),`\0
|
|
11
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Wn(e,n,r,i){let a=i.schema,o=a.space!==`svg`&&i.settings.omitOptionalTags,s=a.space===`svg`?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase()),c=[],l;a.space===`html`&&e.tagName===`svg`&&(i.schema=t);let u=Gn(i,e.properties),d=i.all(a.space===`html`&&e.tagName===`template`?e.content:e);return i.schema=a,d&&(s=!1),(u||!o||!Rn(e,n,r))&&(c.push(`<`,e.tagName,u?` `+u:``),s&&(a.space===`svg`||i.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!i.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&c.push(` `),c.push(`/`)),c.push(`>`)),c.push(d),!s&&(!o||!Sn(e,n,r))&&c.push(`</`+e.tagName+`>`),c.join(``)}function Gn(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Kn(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Kn(t,r,i){let s=e(t.schema,r),c=t.settings.allowParseErrors&&t.schema.space===`html`?0:1,l=+!t.settings.allowDangerousCharacters,u=t.quote,d;if(s.overloadedBoolean&&(i===s.attribute||i===``)?i=!0:(s.boolean||s.overloadedBoolean)&&(typeof i!=`string`||i===s.attribute||i===``)&&(i=!!i),i==null||i===!1||typeof i==`number`&&Number.isNaN(i))return``;let f=G(s.attribute,Object.assign({},t.settings.characterReferences,{subset:q.name[c][l]}));return i===!0||(i=Array.isArray(i)?(s.commaSeparated?a:n)(i,{padLeft:!t.settings.tightCommaSeparatedLists}):String(i),t.settings.collapseEmptyAttributes&&!i)?f:(t.settings.preferUnquoted&&(d=G(i,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:q.unquoted[c][l]}))),d!==i&&(t.settings.quoteSmart&&o(i,u)>o(i,t.alternative)&&(u=t.alternative),d=u+G(i,Object.assign({},t.settings.characterReferences,{subset:(u===`'`?q.single:q.double)[c][l],attribute:!0}))+u),f+(d&&`=`+d))}var qn=[`<`,`&`];function Jn(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:G(e.value,Object.assign({},r.settings.characterReferences,{subset:qn}))}function Yn(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Jn(e,t,n,r)}function Xn(e,t,n,r){return r.all(e)}var Zn=c(`type`,{invalid:Qn,unknown:$n,handlers:{comment:hn,doctype:gn,element:Wn,raw:Yn,root:Xn,text:Jn}});function Qn(e){throw Error("Expected node, not `"+e+"`")}function $n(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var er={},tr={},nr=[];function rr(e,n){let r=n||er,a=r.quote||`"`,o=a===`"`?`'`:`"`;if(a!==`"`&&a!==`'`)throw Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:ir,all:ar,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||Wt,characterReferences:r.characterReferences||tr,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space===`svg`?t:i,quote:a,alternative:o}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ir(e,t,n){return Zn(e,t,n,this)}function ar(e){let t=[],n=e&&e.children||nr,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var or=/\s+/g;function sr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(or)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(or);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var cr=/:?lang=["']([^"']+)["']/g,lr=/(?:```|~~~)([\w-]+)/g,ur=/\\begin\{([\w-]+)\}/g,dr=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,fr=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function pr(e){let t=I(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function mr(e,t,n){let r=new Set;for(let t of e.matchAll(cr)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(lr)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ur)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(dr)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(fr.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var hr=[`color`,`background-color`];function gr(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function _r(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function vr(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=_r(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return gr(e,a)})):e}function yr(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>J(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},u=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&hr.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new l('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let d=o[e][a]||`inherit`,f=o[r][a]||`inherit`;c[a]=`light-dark(${d}, ${f})`,i===`css-vars`&&(c[u(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[u(n,a)]=s)}}),a.htmlStyle=c,a}function J(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&b.Italic&&(t[`font-style`]=`italic`),e.fontStyle&b.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&b.Underline&&n.push(`underline`),e.fontStyle&b.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Y(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function br(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=pr(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new l(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new l(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new l(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));xr(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return vr(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new l(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,u=-1;if(t===0&&(c=0),n===0&&(u=0),n===1/0&&(u=a.children.length),c===-1||u===-1)for(let e=0;e<a.children.length;e++)s+=Sr(a.children[e]),c===-1&&s.length===t&&(c=e+1),u===-1&&s.length===n&&(u=e+1);if(c===-1)throw new l(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(u===-1)throw new l(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let d=a.children.slice(c,u);if(!i.alwaysWrap&&d.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&d.length===1&&d[0].type===`element`)o(d[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:d};o(e,i,`wrapper`),a.children.splice(c,d.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&sr(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function xr(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new l(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new l(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Sr(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Sr).join(``):``}var Cr=[br()];function wr(e){let t=Tr(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Cr]}function Tr(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var X=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Er={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Dr(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Or(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function kr(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Er[r]&&t.push({type:`setDecoration`,value:Er[r]});else if(r<=29){let e=Er[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:X[r-30]}});else if(r===38){let n=Or(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:X[r-40]}});else if(r===48){let n=Or(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:X[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:X[r-100+8]}})}}return t}function Ar(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Dr(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=kr(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var jr={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Mr(e=jr){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<X.length;e++)r.push(t(X[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Nr=/#([0-9a-f]{3,8})/i,Pr=/var\((--[\w-]+-ansi-[\w-]+)\)/,Fr={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Ir(e,t,n){let r=M(e,n),i=I(t),a=Mr(Object.fromEntries(X.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Fr[t]]}))),o=Ar();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=N(i,r),o=N(o,r),n.decorations.has(`dim`)&&(i=Lr(i));let s=b.None;return n.decorations.has(`bold`)&&(s|=b.Bold),n.decorations.has(`italic`)&&(s|=b.Italic),n.decorations.has(`underline`)&&(s|=b.Underline),n.decorations.has(`strikethrough`)&&(s|=b.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Lr(e){let t=e.match(Nr);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Pr);return n?`var(${n[1]}-dim)`:e}function Z(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!P(r)&&!F(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Ir(r,t,n)}return Pt(e,t,n)}function Q(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:u=`light`,cssVariablePrefix:d=`--shiki-`,colorsRendering:f=`css-vars`}=n,p=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===u?-1:+(t.color===u));if(p.length===0)throw new l("`themes` option must not be empty");let m=U(e,t,n,Z);if(c=V(m),u&&u!==`light-dark()`&&!p.some(e=>e.color===u))throw new l(`\`themes\` option must contain the defaultColor key \`${u}\``);let h=p.map(t=>e.getTheme(t.theme)),g=p.map(e=>e.color);a=m.map(e=>e.map(e=>yr(e,g,d,u,f))),c&&B(a,c);let _=p.map(e=>M(e.theme,n));i=Rr(p,h,_,d,u,`fg`,f),r=Rr(p,h,_,d,u,`bg`,f),o=`shiki-themes ${h.map(e=>e.name).join(` `)}`,s=u?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=M(n.theme,n);a=Z(e,t,n);let l=e.getTheme(n.theme);r=N(l.bg,s),i=N(l.fg,s),o=l.name,c=V(a)}else throw new l("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Rr(e,t,n,r,i,a,o){return e.map((s,c)=>{let u=N(t[c][a],n[c])||`inherit`,d=`${r+s.color}${a===`bg`?`-bg`:``}:${u}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new l('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${N(t[r][a],n[r])||`inherit`}, ${N(t[i][a],n[i])||`inherit`});${d}`}return u}return o===`css-vars`?d:null}).filter(e=>!!e).join(`;`)}var zr=/^\s+$/,Br=/^(\s*)(.*?)(\s*)$/;function $(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>$(e,t,n),codeToTokens:(t,n)=>Q(e,t,n)}){let i=t;for(let e of wr(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Q(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Hr(a):d===`never`&&(a=Ur(a)),f&&(a=Wr(a));let p={...r,get source(){return i}};for(let e of wr(n))a=e.tokens?.call(p,a)||a;return Vr(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Vr(e,t,n,r=V(e)){let i=wr(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:sr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
11
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Wn(t,n,r,i){let a=i.schema,o=a.space!==`svg`&&i.settings.omitOptionalTags,s=a.space===`svg`?i.settings.closeEmptyElements:i.settings.voids.includes(t.tagName.toLowerCase()),c=[],l;a.space===`html`&&t.tagName===`svg`&&(i.schema=e);let u=Gn(i,t.properties),d=i.all(a.space===`html`&&t.tagName===`template`?t.content:t);return i.schema=a,d&&(s=!1),(u||!o||!Rn(t,n,r))&&(c.push(`<`,t.tagName,u?` `+u:``),s&&(a.space===`svg`||i.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!i.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&c.push(` `),c.push(`/`)),c.push(`>`)),c.push(d),!s&&(!o||!Sn(t,n,r))&&c.push(`</`+t.tagName+`>`),c.join(``)}function Gn(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Kn(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Kn(e,n,o){let s=i(e.schema,n),c=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,l=+!e.settings.allowDangerousCharacters,u=e.quote,d;if(s.overloadedBoolean&&(o===s.attribute||o===``)?o=!0:(s.boolean||s.overloadedBoolean)&&(typeof o!=`string`||o===s.attribute||o===``)&&(o=!!o),o==null||o===!1||typeof o==`number`&&Number.isNaN(o))return``;let f=G(s.attribute,Object.assign({},e.settings.characterReferences,{subset:q.name[c][l]}));return o===!0||(o=Array.isArray(o)?(s.commaSeparated?t:a)(o,{padLeft:!e.settings.tightCommaSeparatedLists}):String(o),e.settings.collapseEmptyAttributes&&!o)?f:(e.settings.preferUnquoted&&(d=G(o,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:q.unquoted[c][l]}))),d!==o&&(e.settings.quoteSmart&&r(o,u)>r(o,e.alternative)&&(u=e.alternative),d=u+G(o,Object.assign({},e.settings.characterReferences,{subset:(u===`'`?q.single:q.double)[c][l],attribute:!0}))+u),f+(d&&`=`+d))}var qn=[`<`,`&`];function Jn(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:G(e.value,Object.assign({},r.settings.characterReferences,{subset:qn}))}function Yn(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Jn(e,t,n,r)}function Xn(e,t,n,r){return r.all(e)}var Zn=c(`type`,{invalid:Qn,unknown:$n,handlers:{comment:hn,doctype:gn,element:Wn,raw:Yn,root:Xn,text:Jn}});function Qn(e){throw Error("Expected node, not `"+e+"`")}function $n(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var er={},tr={},nr=[];function rr(t,r){let i=r||er,a=i.quote||`"`,o=a===`"`?`'`:`"`;if(a!==`"`&&a!==`'`)throw Error("Invalid quote `"+a+"`, expected `'` or `\"`");return{one:ir,all:ar,settings:{omitOptionalTags:i.omitOptionalTags||!1,allowParseErrors:i.allowParseErrors||!1,allowDangerousCharacters:i.allowDangerousCharacters||!1,quoteSmart:i.quoteSmart||!1,preferUnquoted:i.preferUnquoted||!1,tightAttributes:i.tightAttributes||!1,upperDoctype:i.upperDoctype||!1,tightDoctype:i.tightDoctype||!1,bogusComments:i.bogusComments||!1,tightCommaSeparatedLists:i.tightCommaSeparatedLists||!1,tightSelfClosing:i.tightSelfClosing||!1,collapseEmptyAttributes:i.collapseEmptyAttributes||!1,allowDangerousHtml:i.allowDangerousHtml||!1,voids:i.voids||Wt,characterReferences:i.characterReferences||tr,closeSelfClosing:i.closeSelfClosing||!1,closeEmptyElements:i.closeEmptyElements||!1},schema:i.space===`svg`?e:n,quote:a,alternative:o}.one(Array.isArray(t)?{type:`root`,children:t}:t,void 0,void 0)}function ir(e,t,n){return Zn(e,t,n,this)}function ar(e){let t=[],n=e&&e.children||nr,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var or=/\s+/g;function sr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(or)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(or);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var cr=/:?lang=["']([^"']+)["']/g,lr=/(?:```|~~~)([\w-]+)/g,ur=/\\begin\{([\w-]+)\}/g,dr=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,fr=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function pr(e){let t=I(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function mr(e,t,n){let r=new Set;for(let t of e.matchAll(cr)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(lr)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ur)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(dr)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(fr.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var hr=[`color`,`background-color`];function gr(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function _r(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function vr(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=_r(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return gr(e,a)})):e}function yr(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>J(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},u=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&hr.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new l('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let d=o[e][a]||`inherit`,f=o[r][a]||`inherit`;c[a]=`light-dark(${d}, ${f})`,i===`css-vars`&&(c[u(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[u(n,a)]=s)}}),a.htmlStyle=c,a}function J(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&b.Italic&&(t[`font-style`]=`italic`),e.fontStyle&b.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&b.Underline&&n.push(`underline`),e.fontStyle&b.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Y(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function br(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=pr(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new l(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new l(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new l(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));xr(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return vr(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new l(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,u=-1;if(t===0&&(c=0),n===0&&(u=0),n===1/0&&(u=a.children.length),c===-1||u===-1)for(let e=0;e<a.children.length;e++)s+=Sr(a.children[e]),c===-1&&s.length===t&&(c=e+1),u===-1&&s.length===n&&(u=e+1);if(c===-1)throw new l(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(u===-1)throw new l(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let d=a.children.slice(c,u);if(!i.alwaysWrap&&d.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&d.length===1&&d[0].type===`element`)o(d[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:d};o(e,i,`wrapper`),a.children.splice(c,d.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&sr(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function xr(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new l(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new l(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Sr(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Sr).join(``):``}var Cr=[br()];function wr(e){let t=Tr(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Cr]}function Tr(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var X=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Er={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Dr(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Or(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function kr(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Er[r]&&t.push({type:`setDecoration`,value:Er[r]});else if(r<=29){let e=Er[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:X[r-30]}});else if(r===38){let n=Or(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:X[r-40]}});else if(r===48){let n=Or(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:X[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:X[r-100+8]}})}}return t}function Ar(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Dr(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=kr(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var jr={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Mr(e=jr){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<X.length;e++)r.push(t(X[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Nr=/#([0-9a-f]{3,8})/i,Pr=/var\((--[\w-]+-ansi-[\w-]+)\)/,Fr={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Ir(e,t,n){let r=M(e,n),i=I(t),a=Mr(Object.fromEntries(X.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Fr[t]]}))),o=Ar();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=N(i,r),o=N(o,r),n.decorations.has(`dim`)&&(i=Lr(i));let s=b.None;return n.decorations.has(`bold`)&&(s|=b.Bold),n.decorations.has(`italic`)&&(s|=b.Italic),n.decorations.has(`underline`)&&(s|=b.Underline),n.decorations.has(`strikethrough`)&&(s|=b.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Lr(e){let t=e.match(Nr);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Pr);return n?`var(${n[1]}-dim)`:e}function Z(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!P(r)&&!F(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Ir(r,t,n)}return Pt(e,t,n)}function Q(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:u=`light`,cssVariablePrefix:d=`--shiki-`,colorsRendering:f=`css-vars`}=n,p=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===u?-1:+(t.color===u));if(p.length===0)throw new l("`themes` option must not be empty");let m=U(e,t,n,Z);if(c=V(m),u&&u!==`light-dark()`&&!p.some(e=>e.color===u))throw new l(`\`themes\` option must contain the defaultColor key \`${u}\``);let h=p.map(t=>e.getTheme(t.theme)),g=p.map(e=>e.color);a=m.map(e=>e.map(e=>yr(e,g,d,u,f))),c&&B(a,c);let _=p.map(e=>M(e.theme,n));i=Rr(p,h,_,d,u,`fg`,f),r=Rr(p,h,_,d,u,`bg`,f),o=`shiki-themes ${h.map(e=>e.name).join(` `)}`,s=u?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=M(n.theme,n);a=Z(e,t,n);let l=e.getTheme(n.theme);r=N(l.bg,s),i=N(l.fg,s),o=l.name,c=V(a)}else throw new l("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Rr(e,t,n,r,i,a,o){return e.map((s,c)=>{let u=N(t[c][a],n[c])||`inherit`,d=`${r+s.color}${a===`bg`?`-bg`:``}:${u}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new l('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${N(t[r][a],n[r])||`inherit`}, ${N(t[i][a],n[i])||`inherit`});${d}`}return u}return o===`css-vars`?d:null}).filter(e=>!!e).join(`;`)}var zr=/^\s+$/,Br=/^(\s*)(.*?)(\s*)$/;function $(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>$(e,t,n),codeToTokens:(t,n)=>Q(e,t,n)}){let i=t;for(let e of wr(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Q(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Hr(a):d===`never`&&(a=Ur(a)),f&&(a=Wr(a));let p={...r,get source(){return i}};for(let e of wr(n))a=e.tokens?.call(p,a)||a;return Vr(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Vr(e,t,n,r=V(e)){let i=wr(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:sr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
12
12
|
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Y(a.htmlStyle||J(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&B(m,r),m}function Hr(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&b.Underline||i.fontStyle&b.Strikethrough));o&&zr.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Ur(e){return e.map(e=>e.flatMap(e=>{if(zr.test(e.content))return e;let t=e.content.match(Br);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Wr(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Y(e.htmlStyle||J(e)),i=Y(n.htmlStyle||J(n)),a=e.fontStyle&&(e.fontStyle&b.Underline||e.fontStyle&b.Strikethrough),o=n.fontStyle&&(n.fontStyle&b.Underline||n.fontStyle&b.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Gr=rr;function Kr(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>$(e,t,n),codeToTokens:(t,n)=>Q(e,t,n)},i=Gr($(e,t,n,r));for(let e of wr(n))i=e.postprocess?.call(r,i,n)||i;return i}async function qr(e){let t=await Dt(e);return{getLastGrammarState:(...e)=>Ft(t,...e),codeToTokensBase:(e,n)=>Z(t,e,n),codeToTokensWithThemes:(e,n)=>U(t,e,n),codeToTokens:(e,n)=>Q(t,e,n),codeToHast:(e,n)=>$(t,e,n),codeToHtml:(e,n)=>Kr(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Jr(e){let t=z(e);return{getLastGrammarState:(...e)=>Ft(t,...e),codeToTokensBase:(e,n)=>Z(t,e,n),codeToTokensWithThemes:(e,n)=>U(t,e,n),codeToTokens:(e,n)=>Q(t,e,n),codeToHast:(e,n)=>$(t,e,n),codeToHtml:(e,n)=>Kr(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Yr(e){let t;async function n(n){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}return n}var Xr=Yr(qr);function Zr(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,ht(n))return[];let r=t[n];if(!r)throw new l(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(gt(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new l(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await qr({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Qr(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function $r(e,t){let n=Qr(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}function ei(e={}){let{name:t=`css-variables`,variablePrefix:n=`--shiki-`,fontStyle:r=!0}=e,i=t=>e.variableDefaults?.[t]?`var(${n}${t}, ${e.variableDefaults[t]})`:`var(${n}${t})`,a={name:t,type:`dark`,colors:{"editor.foreground":i(`foreground`),"editor.background":i(`background`),"terminal.ansiBlack":i(`ansi-black`),"terminal.ansiRed":i(`ansi-red`),"terminal.ansiGreen":i(`ansi-green`),"terminal.ansiYellow":i(`ansi-yellow`),"terminal.ansiBlue":i(`ansi-blue`),"terminal.ansiMagenta":i(`ansi-magenta`),"terminal.ansiCyan":i(`ansi-cyan`),"terminal.ansiWhite":i(`ansi-white`),"terminal.ansiBrightBlack":i(`ansi-bright-black`),"terminal.ansiBrightRed":i(`ansi-bright-red`),"terminal.ansiBrightGreen":i(`ansi-bright-green`),"terminal.ansiBrightYellow":i(`ansi-bright-yellow`),"terminal.ansiBrightBlue":i(`ansi-bright-blue`),"terminal.ansiBrightMagenta":i(`ansi-bright-magenta`),"terminal.ansiBrightCyan":i(`ansi-bright-cyan`),"terminal.ansiBrightWhite":i(`ansi-bright-white`)},tokenColors:[{scope:[`keyword.operator.accessor`,`meta.group.braces.round.function.arguments`,`meta.template.expression`,`markup.fenced_code meta.embedded.block`],settings:{foreground:i(`foreground`)}},{scope:`emphasis`,settings:{fontStyle:`italic`}},{scope:[`strong`,`markup.heading.markdown`,`markup.bold.markdown`],settings:{fontStyle:`bold`}},{scope:[`markup.italic.markdown`],settings:{fontStyle:`italic`}},{scope:`meta.link.inline.markdown`,settings:{fontStyle:`underline`,foreground:i(`token-link`)}},{scope:[`string`,`markup.fenced_code`,`markup.inline`],settings:{foreground:i(`token-string`)}},{scope:[`comment`,`string.quoted.docstring.multi`],settings:{foreground:i(`token-comment`)}},{scope:[`constant.numeric`,`constant.language`,`constant.other.placeholder`,`constant.character.format.placeholder`,`variable.language.this`,`variable.other.object`,`variable.other.class`,`variable.other.constant`,`meta.property-name`,`meta.property-value`,`support`],settings:{foreground:i(`token-constant`)}},{scope:[`keyword`,`storage.modifier`,`storage.type`,`storage.control.clojure`,`entity.name.function.clojure`,`entity.name.tag.yaml`,`support.function.node`,`support.type.property-name.json`,`punctuation.separator.key-value`,`punctuation.definition.template-expression`],settings:{foreground:i(`token-keyword`)}},{scope:`variable.parameter.function`,settings:{foreground:i(`token-parameter`)}},{scope:[`support.function`,`entity.name.type`,`entity.other.inherited-class`,`meta.function-call`,`meta.instance.constructor`,`entity.other.attribute-name`,`entity.name.function`,`constant.keyword.clojure`],settings:{foreground:i(`token-function`)}},{scope:[`entity.name.tag`,`string.quoted`,`string.regexp`,`string.interpolated`,`string.template`,`string.unquoted.plain.out.yaml`,`keyword.other.template`],settings:{foreground:i(`token-string-expression`)}},{scope:[`punctuation.definition.arguments`,`punctuation.definition.dict`,`punctuation.separator`,`meta.function-call.arguments`],settings:{foreground:i(`token-punctuation`)}},{scope:[`markup.underline.link`,`punctuation.definition.metadata.markdown`],settings:{foreground:i(`token-link`)}},{scope:[`beginning.punctuation.definition.list.markdown`],settings:{foreground:i(`token-string`)}},{scope:[`punctuation.definition.string.begin.markdown`,`punctuation.definition.string.end.markdown`,`string.other.link.title.markdown`,`string.other.link.description.markdown`],settings:{foreground:i(`token-keyword`)}},{scope:[`markup.inserted`,`meta.diff.header.to-file`,`punctuation.definition.inserted`],settings:{foreground:i(`token-inserted`)}},{scope:[`markup.deleted`,`meta.diff.header.from-file`,`punctuation.definition.deleted`],settings:{foreground:i(`token-deleted`)}},{scope:[`markup.changed`,`punctuation.definition.changed`],settings:{foreground:i(`token-changed`)}}]};return r||(a.tokenColors=a.tokenColors?.map(e=>(e.settings?.fontStyle&&delete e.settings.fontStyle,e))),a}export{l as ShikiError,sr as addClassToHast,N as applyColorReplacements,$ as codeToHast,Kr as codeToHtml,Q as codeToTokens,Z as codeToTokensBase,U as codeToTokensWithThemes,Zr as createBundledHighlighter,ei as createCssVariablesTheme,qr as createHighlighterCore,Jr as createHighlighterCoreSync,pr as createPositionConverter,Ot as createShikiInternal,Et as createShikiInternalSync,z as createShikiPrimitive,Dt as createShikiPrimitiveAsync,$r as createSingletonShorthands,yr as flatTokenVariants,Ft as getLastGrammarState,Xr as getSingletonHighlighterCore,J as getTokenStyleObject,mr as guessEmbeddedLanguages,Gr as hastToHtml,F as isNoneTheme,P as isPlainLang,ht as isSpecialLang,gt as isSpecialTheme,Qr as makeSingletonHighlighter,Yr as makeSingletonHighlighterCore,mt as normalizeGetter,L as normalizeTheme,M as resolveColorReplacements,I as splitLines,gr as splitToken,vr as splitTokens,Y as stringifyTokenStyle,pt as toArray,Ir as tokenizeAnsiWithTheme,It as tokenizeWithTheme,Vr as tokensToHast,br as transformerDecorations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{M as r}from"./page-C47YAWAl.js";import{s as i,t as a}from"./error-alert-hABzwCSY.js";import{L as o}from"./visuallyHidden-BUGCJ1D9.js";import{t as s}from"./useSuspenseQuery-DbhQN-t-.js";import{A as c,n as l,r as u,v as d}from"./overview-C73v5kbv.js";import{t as f}from"./link-C7GfYrMt.js";import{c as p,d as m,f as h,p as g,r as _,s as v,t as y}from"./outcome-DvqnSso3.js";import{D as b,W as x,n as S}from"./button-4rhhIcK8.js";import{Bn as C,Hn as w,Mn as T,f as E,r as D,zn as O}from"./strings-DXB6PB2g.js";import{t as k}from"./use-open-run-B8nD_BT1.js";import{D as A,F as j,I as M,L as N,O as P,P as F,R as I,k as L}from"./index-Dki55xSv.js";import{t as R}from"./use-now-vNgLntlV.js";import{n as z,t as B}from"./edit-and-retry-DZ5FH7N6.js";var V=n(e(),1),H=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z`}))]]),U=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:H}));U.displayName=`ArrowsOutSimpleIcon`;var W=t(),G=({detail:e})=>{let t=(0,V.useMemo)(()=>_(m(e.transcript,e.run.attempts,e.sessionState),e.run.attempts,e.transcript),[e.transcript,e.sessionState,e.run.attempts]),n=[...t.chapters].reverse().find(({live:e})=>e),r=t.chapters.flatMap(({rows:e})=>e).reverse().find(e=>e._tag===`Message`);return(0,W.jsxs)(`div`,{className:`space-y-4`,children:[n===void 0?(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Attempt starting`}):(0,W.jsx)(p,{chapter:n}),r?._tag===`Message`&&(0,W.jsxs)(`section`,{"aria-label":`Latest message`,className:`space-y-1`,children:[(0,W.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:r.speaker.name}),(0,W.jsx)(`time`,{dateTime:r.receivedAt,title:E(r.receivedAt),className:`font-mono tabular-nums text-muted-foreground`,children:D(r.receivedAt)})]}),(0,W.jsx)(`p`,{className:`line-clamp-6 text-md wrap-anywhere`,children:v(r.text)}),r.queued!==null&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(r.queued)})]})]})},K=e=>{let t=e.attempts.at(-1),n=t?.salvage??null;return e.state===`Succeeded`?w({_tag:`Succeeded`,message:T(e.resultMessage)}):e.state===`Canceled`?w({_tag:`Canceled`,salvage:n}):e.state===`Failed`&&t?.outcome?._tag===`Failed`?w({_tag:`Failed`,failure:t.outcome.failure,salvage:n}):C()},q=({machine:e})=>{let t=R(15e3);return(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:c(e,t)})},J=({detail:e})=>{let t=e.run;switch(t.state){case`Pending`:return(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Opened, not scheduled yet`});case`Waiting`:return(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Waiting for approval`});case`Queued`:return e.machine?.state===`creating`?(0,W.jsx)(q,{machine:e.machine}):(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Approved, waiting for a free worker`});case`Running`:return(0,W.jsx)(G,{detail:e});case`Succeeded`:case`Failed`:case`Canceled`:return O(K(t),{onNone:()=>(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempt started`}),onSome:e=>(0,W.jsx)(y,{end:e,outOfMemory:t.attempts.at(-1)?.outOfMemory??null})})}},Y=({runId:e,open:t,close:n})=>{let{data:c}=s(l()),d=r(),p=o({...i(d,e),enabled:t}),[m,_]=(0,V.useState)(null),v=k(),y=p.data?.run;return(0,W.jsx)(F,{open:t,onOpenChange:e=>{e||n()},children:(0,W.jsxs)(j,{side:`right`,"aria-label":`Run detail`,className:`gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-md`,children:[(0,W.jsx)(N,{className:`shrink-0 gap-3 border-b px-5 pt-5 pb-4 pr-20`,children:y===void 0||p.data===void 0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(I,{children:`Loading…`}),(0,W.jsx)(M,{children:`Loading run…`})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(g,{detail:p.data,overview:c,placement:`drawer`,shared:t,as:I,actions:(0,W.jsx)(h,{detail:p.data,onEdit:_,openRun:v})}),(0,W.jsxs)(M,{className:`sr-only`,children:[`Run `,y.id,` of `,y.loop,` on `,y.repository]})]})}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[p.isError&&(0,W.jsx)(a,{message:p.error.message}),y!==void 0&&m!==null&&z(y,m)&&(0,W.jsx)(B,{run:y,intent:m,close:()=>_(null),openRun:v},`${y.id}:${m}`),p.data!==void 0&&(0,W.jsx)(J,{detail:p.data}),y!==void 0&&(0,W.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...u(y.repository),run:y.id},search:{},viewTransition:!0,className:S({variant:`outline`}),children:`Open run page`})]}),y!==void 0&&(0,W.jsxs)(A,{children:[(0,W.jsx)(L,{render:(0,W.jsx)(f,{to:`/projects/$owner/$name/runs/$run`,params:{...u(y.repository),run:y.id},search:{},viewTransition:!0,"aria-label":`Open run page`,className:b(S({variant:`ghost`,size:`icon-sm`}),`absolute top-4 right-11`)}),children:(0,W.jsx)(U,{"aria-hidden":`true`})}),(0,W.jsx)(P,{side:`bottom`,children:`Open run page`})]})]})})};export{Y as RunDrawer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{O as r,P as i,T as a,b as o,c as s,d as c,f as l,h as u,k as d,l as f,m as p,r as m,s as h,u as g,x as _,y as v}from"./visuallyHidden-BUGCJ1D9.js";import{o as y}from"./actions-CG0hkpe7.js";import{A as b,D as x,F as S,H as ee,L as C,M as w,N as T,P as E,R as D,V as O,W as k,h as A,i as j,k as M,m as te,o as ne,r as N,v as P,y as F}from"./button-4rhhIcK8.js";import{A as I,B as L,Bt as R,C as z,Ct as B,D as V,Dt as re,E as H,Et as ie,F as U,G as W,Gt as ae,H as oe,Ht as G,I as K,J as se,Jt as q,K as ce,Kt as J,L as le,M as ue,Mt as de,Nt as fe,O as Y,P as pe,Rt as me,T as he,U as ge,V as _e,Vt as ve,W as ye,Wt as X,X as be,Xt as xe,Y as Se,Z as Ce,Zt as we,_t as Te,at as Ee,bt as De,f as Oe,ft as ke,gt as Ae,ht as je,jt as Me,k as Ne,mt as Pe,nt as Fe,ot as Ie,p as Le,pt as Re,q as ze,qt as Be,rt as Ve,tt as He,u as Ue,v as We,w as Z,xt as Ge,yt as Ke,zt as qe}from"./mark-uyeJ8aPC.js";import{i as Je,n as Ye,o as Xe,r as Ze,t as Qe}from"./useAnchoredPopupScrollLock-NN99o6YU.js";import{A as $e,B as et,H as tt,M as nt,U as rt,V as it,j as at,z as ot}from"./index-Dki55xSv.js";import{t as st}from"./ToolbarRootContext-aq6udDVh.js";import{n as ct,r as lt,t as ut}from"./CompositeItem-DL5QWzlf.js";var Q=n(e(),1),dt=new Map([[`bold`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),Q.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,Q.createElement(Q.Fragment,null,Q.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),ft=Q.forwardRef((e,t)=>Q.createElement(k,{ref:t,...e,weights:dt}));ft.displayName=`DotsThreeIcon`;var pt=Q.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return E(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function mt(e){return q&&e.movementX===0&&e.movementY===0}function ht(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gt(e,t){return ht(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _t(e,t,n){return ht(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vt(e,t,n){return ht(t,n?e===qe:e===R,e===me)}function yt(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:ht(t,n?e===R:e===qe,e===ve)}function bt(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:l=!1,loopFocus:u=!1,nested:d=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:g=!0,openOnArrowKeyDown:_=!0,disabledIndices:y=void 0,orientation:x=`vertical`,triggerOrientation:S=x,parentOrientation:ee,id:C,resetOnPointerLeave:w=!0,externalTree:T,nestedReturnFocusRef:E,grid:D}=t,O=D!=null,k=e.useState(`open`),A=e.useState(`floatingElement`),j=e.useState(`domReferenceElement`),te=e.context.dataRef,ne=B(A),N=ie(j),F=Ie(ne),I=se(),L=Se(T),R=Q.useRef(m),z=Q.useRef(s??-1),V=Q.useRef(null),H=Q.useRef(!0),U=b(e=>{a(z.current===-1?null:z.current,e)}),W=Q.useRef(!!A),oe=Q.useRef(k),K=Q.useRef(!1),q=Q.useRef(!1),ce=Q.useRef(null),J=Ie(y),le=Ie(k),ue=Ie(s),de=Ie(w),fe=i(),Y=i(),pe=b(()=>{fe.cancel();function e(e){p||(ce.current=Ve(e,{sync:K.current,preventScroll:!0}))}let t=n.current[z.current],r=q.current;t&&e(t),(K.current?e=>e():e=>fe.request(e))(()=>{let i=n.current[z.current]||t;i&&(t||e(i),ye&&(r||!H.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});M(()=>{te.current.orientation=x},[te,x]),M(()=>{k||(V.current=null),(!k||m!==`auto`)&&(R.current=m)},[k,m]),M(()=>{o&&(k&&A?(z.current=s??-1,R.current&&s!=null&&(q.current=!0,U())):W.current&&(z.current=-1,U()))},[o,k,A,s,U]),M(()=>{if(o){if(!k)K.current=!1;else if(A){if(r==null){if(K.current=!1,ue.current!=null)return;if(W.current&&(z.current=-1,pe()),(!oe.current||!W.current)&&R.current&&(V.current!=null||R.current===!0&&V.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>Y.request(e):queueMicrotask)(t),e+=1):(z.current=V.current==null||_t(V.current,S,f)||d?Re(n):ke(n),V.current=null,U())};t()}}else Ae(n.current,r)||(z.current=r,pe(),q.current=!1)}}},[o,k,A,r,ue,d,n,S,f,U,pe,Y]),M(()=>{if(!o||A||!L||p||!W.current)return;let e=L.nodesRef.current,t=e.find(e=>e.id===I)?.context?.elements.floating,n=G(we(j??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&H.current&&t.focus({preventScroll:!0})},[o,A,j,L,I,p]),M(()=>{oe.current=k,W.current=!!A});let me=r!=null,he=b(e=>{if(!le.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(z.current!==t||r!==t)&&(z.current=t,U(e))}),ge=b(()=>ee??L?.nodesRef.current.find(e=>e.id===I)?.context?.dataRef?.current.orientation),_e=b(()=>Re(n,J.current)),ve=b(t=>{if(H.current=!1,K.current=!0,t.which===229||!le.current&&t.currentTarget===F.current)return;if(d&&yt(t.key,x,f,O)){gt(t.key,ge())||Ge(t),e.setOpen(!1,v(c,t.nativeEvent));let n=E?.current??j;P(n)&&n.focus();return}r!=null&&r!==z.current&&!Ae(n.current,r)&&(z.current=r);let i=z.current,a=Re(n,y),o=ke(n,y);if(N||(t.key===`Home`&&(Ge(t),z.current=a,U(t)),t.key===`End`&&(Ge(t),z.current=o,U(t))),D!=null){let e=D(t,z.current,n,x,u,f,y,a,o);if(e!=null&&e!==z.current&&(z.current=e,U(t)),x===`both`)return}if(gt(t.key,x)){Ge(t);let e=G(t.currentTarget.ownerDocument);if(k&&!p&&X(t.currentTarget,e)&&!n.current.some(t=>t!=null&&X(t,e))){z.current=_t(t.key,x,f)?a:o,U(t),r===z.current&&pe();return}let{index:s,wrapped:c}=Pe(n.current,i,{decrement:!_t(t.key,x,f),loopFocus:u,allowEscape:l,disabledIndices:y,minIndex:a,maxIndex:o});c&&(K.current=!1),z.current=s,U(t)}}),ye=Q.useMemo(()=>({onFocus(e){K.current=!0,he(e)},onClick({currentTarget:e}){p||e.focus({preventScroll:!0})},onMouseMove(e){mt(e)||(K.current=!0,q.current=!1,g&&he(e))},onPointerLeave(e){if(!le.current||!H.current||e.pointerType===`touch`)return;K.current=!0;let t=e.relatedTarget;if(g&&!n.current.includes(t)&&de.current&&(ce.current?.(),ce.current=null,z.current=-1,U(e),!p)){let e=F.current,t=G(we(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[he,le,F,g,n,U,de,p]),be=Q.useMemo(()=>p&&k&&me&&{"aria-activedescendant":`${C}-${r}`},[p,k,me,C,r]),xe=Q.useMemo(()=>({...N?{}:be,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&k&&!p){let n=ae(t.nativeEvent);if(n&&!X(F.current,n))return;Ge(t);let r=v(h,t.nativeEvent);e.setOpen(!1,r);let i=E?.current??j;!r.isCanceled&&P(i)&&i.focus()}else ve(t)},onPointerMove(e){mt(e)||(H.current=!0)}}),[be,ve,F,N,e,k,p,j,E]),Ce=Q.useMemo(()=>{function t(t){e.setOpen(!0,v(c,t.nativeEvent,t.currentTarget))}function n(e){m===`auto`&&Ke(e.nativeEvent)&&(R.current=!p)}function r(e){R.current=m,m===`auto`&&De(e.nativeEvent)&&(R.current=!0)}return{onKeyDown(n){let r=e.select(`open`);H.current=!1;let i=n.key.startsWith(`Arrow`),a=vt(n.key,ge(),f),o=gt(n.key,r?x:S),s=(d?a:o)||n.key===`Enter`||n.key.trim()===``;if(p&&r&&(!d||re(n.currentTarget)))return ve(n);if(r||_||!i){if(s){let e=gt(n.key,ge());V.current=d&&e?null:n.key}d?a&&(Ge(n),r?(z.current=_e(),U(n),p&&F.current?.focus()):t(n)):o&&(ue.current!=null&&(z.current=ue.current),Ge(n),!r&&_?t(n):ve(n),r&&U(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!p&&(z.current=-1,U(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ve,m,_e,d,U,e,_,x,S,ge,f,ue,p,F]),Te=Q.useMemo(()=>({...be,...Ce}),[be,Ce]);return Q.useMemo(()=>o?{reference:Te,floating:xe,item:ye,trigger:Ce}:{},[o,Te,xe,Ce,ye])}function xt(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=b(c),p=e.useState(`open`),m=a(),h=Q.useRef(``),g=Q.useRef(d??i??-1),_=Q.useRef(null),v=b(e=>{function t(e){return r?.current[e]}function a(e){let n=t(e);return n&&!je(n)||n?.matches(`:disabled`)?!1:s==null||!Te(C,e,s)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&a(n))return n}return-1}let l=n.current;if(h.current.length>0&&e.key===` `&&(Ge(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(l,h.current)===-1&&e.key!==` `&&f?.(!1),l==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(Ge(e),f?.(!0));let v=h.current===``;v&&(g.current=d??i??-1),l.every((e,t)=>e&&a(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,f?.(!1)});let y=((v?d??i??-1:g.current)??0)+1,b=c(l,h.current,y);b===-1?e.key!==` `&&(h.current=``,f?.(!1)):(o?.(b,e),_.current=b)}),y=b(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);X(r,n)||X(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});M(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let x=Q.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return Q.useMemo(()=>l?{reference:x,floating:x}:{},[l,x])}var $=t(),St=Q.createContext(void 0);function Ct(e){let t=Q.useContext(St);if(t===void 0&&!e)throw Error(w(33));return t}var wt=Q.createContext(void 0);function Tt(e){let t=Q.useContext(wt);if(t===void 0&&!e)throw Error(w(36));return t}var Et=Q.createContext(void 0);function Dt(e=!0){let t=Q.useContext(Et);if(t===void 0&&!e)throw Error(w(25));return t}var Ot=Q.createContext(null);function kt(e=`root`){let t=Q.useContext(Ot),n=Q.useContext(wt);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var At={visible:!0,ref:null};function jt(){return At}function Mt(e,t,n=`root`){let r=kt(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??jt)({label:e.label,children:e.children,render:e.render}),a=O(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Nt(e){e.preventDefault()}function Pt(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Tt(),u=Dt(!0),d=c.type===`submenu-trigger`,p=d?l.parentVirtualFocus:l.virtualFocus,m=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:h}=a.useState(`floatingTreeRoot`),g=a.useState(`open`),_=u!==void 0,v=!p&&g&&n?0:-1;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":m,onMouseDown:p?Nt:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&h.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&h.emit(`close`,{domEvent:e.nativeEvent,reason:f})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,_&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||_&&!xe&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!_||e.button===2)&&c.type===`regular-item`&&j(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,h,i,a.context.allowMouseUpTriggerRef,o,s,u,_,c.type,m,p])}var Ft={type:`regular-item`};function It(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=Q.useRef(null),{getButtonProps:d,buttonRef:f}=N({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Pt({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Q.useCallback(e=>S(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=O(u,f);return Q.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Lt=Q.createContext(void 0),Rt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Q.useState(void 0),c=E(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,$.jsx)(Lt.Provider,{value:s,children:c})}),zt=Q.forwardRef(function(e,t){let n=kt()?.Group??Rt;return(0,$.jsx)(n,{...e,ref:t})}),Bt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Tt(),f=lt({guess:!0,label:a}),p=_(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),v=d.useState(`itemProps`),y=s||m,{getItemProps:b,itemRef:x}=It({closeOnClick:c,disabled:y,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Ft});return E(`div`,e,{state:{disabled:y,highlighted:h},props:[v,u,b],ref:[x,t,f.ref]})}),Vt=Q.forwardRef(function(e,t){let n=Mt(e,t);return n.visible?(0,$.jsx)(Bt,{...e,ref:n.ref}):null}),Ht=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,closeOnClick:o=!1,style:s,...c}=e,{store:l}=Tt(),u=Q.useRef(null),d=lt({guess:!0,label:a}),f=_(i),p=l.useState(`isActive`,d.index),m=l.useState(`floatingNodeId`),h=l.useState(`itemProps`),g=l.context.typingRef,{getButtonProps:v,buttonRef:y}=N({native:!1,composite:!0}),b=Pt({closeOnClick:o,highlighted:p,id:f,nodeId:m,store:l,typingRef:g,itemRef:u,itemMetadata:Ft});function x(e){return S(b,e,v)}return E(`a`,e,{state:{highlighted:p},props:[h,c,x],ref:[u,y,t,d.ref]})}),Ut=Q.forwardRef(function(e,t){let n=Mt(e,t);return n.visible?(0,$.jsx)(Ht,{...e,ref:n.ref}):null}),Wt=Q.createContext(void 0);function Gt(){return Q.useContext(Wt)}function Kt(e,t){let n=T(e.render);if(Q.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function qt(e,t,n){let r=Kt(e,t),i=r===t?void 0:r;return[r,Q.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Jt(e,t,n){let r=T(e.render),i=Q.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Yt=Q.forwardRef(function(e,t){let{render:n,className:i,style:a,finalFocus:o,id:s,initialFocus:c,...l}=e,{store:u,defaultFloatingId:d,setRenderedFloatingId:f,virtualFocus:p,orientation:m}=Tt(),h=Gt(),{side:g,align:_}=Ct(),y=st(!0)!=null,b=u.useState(`open`),x=u.useState(`transitionStatus`),S=u.useState(`popupProps`),ee=u.useState(`mounted`),C=u.useState(`instantType`),w=u.useState(`activeTriggerElement`),T=u.useState(`parent`),D=u.useState(`lastOpenChangeReason`),O=u.useState(`rootId`),k=u.useState(`floatingRootContext`),A=u.useState(`floatingTreeRoot`),j=u.useState(`closeDelay`),M=u.useState(`hoverEnabled`),te=u.useState(`disabled`),ne=u.useState(`openMethod`),N=u.useState(`activeTriggerId`),P=u.useState(`listElement`),[F,I]=qt(e,d,f),L=Jt(e,w,N),R=T.type===`menu`?h:void 0,z=T.type===`context-menu`,B=c??T.type!==`menu`;c===void 0&&P&&T.type!==`menu`&&(B=()=>u.state.activeIndex===null&&P),r({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){u.setOpen(!1,v(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,u]),it(k,{enabled:M&&!te&&!z&&T.type!==`menubar`,closeDelay:j});let V=u.useStateSetter(`popupElement`),{parentVirtualFocusRef:re,handleFocus:H}=(Q.useContext(Ot)?.useParentHandoff??Zt)(u,T,b,p),ie={transitionStatus:x,side:g,align:_,open:b,nested:T.type===`menu`,instant:C},U=E(`div`,e,{state:ie,ref:[t,u.context.popupRef,V,I],stateAttributesMapping:Me,props:[S,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":m===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),y&&We.has(e.key)&&e.stopPropagation()},onFocus:H},at(x),l,{"data-rootownerid":O}]}),W=T.type===void 0||z;(w||T.type===`menubar`&&D!==`outside-press`)&&(W=!0);let ae=R?.getReturnElement??re;return(0,$.jsx)(ye,{context:k,openInteractionType:ne,modal:z,disabled:!ee,returnFocus:o??ae??W,explicitReturnFocus:o===void 0&&ae?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[u.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:A,previousFocusableElement:w,nextFocusableElement:T.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:U})}),Xt={parentVirtualFocusRef:void 0,handleFocus:void 0};function Zt(){return Xt}var Qt=Q.forwardRef(function(e,t){let n=kt()?.Popup??Yt;return(0,$.jsx)(n,{...e,ref:t})}),$t=Q.createContext(void 0);function en(){let e=Q.useContext($t);if(e===void 0)throw Error(w(32));return e}var tn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Tt();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,$.jsx)($t.Provider,{value:n,children:(0,$.jsx)(Ce,{ref:t,...r,portalOwnerRole:o})})}),nn=Q.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:o,side:s,align:c,sideOffset:l=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=He,style:y,...b}=e,{store:x,virtualFocus:S,syncHighlightedItem:ee}=Tt(),C=en(),w=Dt(!0),T=x.useState(`parent`),E=x.useState(`floatingRootContext`),D=x.useState(`floatingTreeRoot`),O=x.useState(`mounted`),k=x.useState(`open`),A=x.useState(`modal`),j=x.useState(`openMethod`),M=x.useState(`activeTriggerElement`),te=x.useState(`transitionStatus`),ne=x.useState(`positionerElement`),N=x.useState(`instantType`),P=x.useState(`adaptiveOrigin`),F=x.useState(`lastOpenChangeReason`),I=x.useState(`floatingNodeId`),L=x.useState(`floatingParentNodeId`),R=E.useState(`domReferenceElement`),z=n,B=l,V=d,re=c,H=_;T.type===`context-menu`&&(z=n??T.context?.anchor,re??=`start`,!s&&re!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let ie=s,U=re;T.type===`menu`?(ie??=`inline-end`,U??=`start`,H=e.collisionAvoidance??Fe):T.type===`menubar`&&(ie??=T.context.orientation===`vertical`?`inline-end`:`bottom`,U??=`start`);let ae=T.type===`context-menu`,oe=nt({anchor:z,floatingRootContext:E,positionMethod:w?`fixed`:r,mounted:O,side:ie,sideOffset:B,align:U,alignOffset:V,arrowPadding:ae?0:m,collisionBoundary:f,collisionPadding:p,sticky:h,nodeId:I,keepMounted:C,disableAnchorTracking:g,collisionAvoidance:H,shift:ae?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:D,adaptiveOrigin:P,lazyFlip:S?`placement`:!1});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&x.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===x.select(`floatingParentNodeId`)&&x.setOpen(!1,v(u)))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[x,D.events,I]),Q.useEffect(()=>{if(x.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==x.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;x.setOpen(!1,v(t))}return D.events.on(`menuopenchange`,e),()=>{D.events.off(`menuopenchange`,e)}},[D.events,x]);let G=a();Q.useEffect(()=>{k||G.clear()},[k,G]),Q.useEffect(()=>{function e(e){if(k&&e.nodeId===x.select(`floatingParentNodeId`)){if(e.target&&M&&M!==e.target){let e=x.select(`closeDelay`);e>0?G.isStarted()||G.start(e,()=>{x.setOpen(!1,v(u))}):x.setOpen(!1,v(u))}else G.clear()}}return D.events.on(`itemhover`,e),()=>{D.events.off(`itemhover`,e)}},[D.events,k,M,x,G]),Q.useEffect(()=>{let e={open:k,nodeId:I,parentNodeId:L,reason:x.select(`lastOpenChangeReason`)};D.events.emit(`menuopenchange`,e)},[D.events,k,x,I,L]),Ye({store:x,domReference:R,positionerElement:ne,open:k});let K={open:k,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,nested:T.type===`menu`,instant:N},se=T.type===`menubar`&&T.context.modal;Qe(k&&(se||A&&F!==`trigger-hover`),j===`touch`,ne,M);let q=$e(e,K,{styles:oe.positionerStyles,transitionStatus:te,props:b,refs:[t,x.useStateSetter(`positionerElement`)],hidden:!O,inert:!k}),ce=O&&T.type!==`menu`&&(T.type!==`menubar`&&A&&F!==`trigger-hover`||T.type===`menubar`&&T.context.modal),J=null;return T.type===`menubar`?J=T.context.contentElement:T.type===void 0&&(J=M),(0,$.jsxs)(St.Provider,{value:oe,children:[ce&&(0,$.jsx)(Oe,{ref:T.type===`context-menu`||T.type===`nested-context-menu`?T.context.internalBackdropRef:null,inert:Le(!k),cutout:J}),(0,$.jsx)(W,{id:I,children:(0,$.jsx)(ct,{elementsRef:x.context.itemDomElements,labelsRef:x.context.itemLabels,onMapChange:ee,children:q})})]})}),rn=Q.createContext(null);function an(e){let t=Q.useContext(rn);if(t===null&&!e)throw Error(w(5));return t}function on(e){return e==null?l:e.type.startsWith(`key`)?g:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?p:l}var sn={...Z,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=Z.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>q&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!Z.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},cn=class extends he{constructor(e,t,n=!1){let r=new Y,i=un(r,t,n,e);super(i,ln(r),sn),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function ln(e){return{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Q.createRef(),beforeTriggerFocusGuardRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function un(e,t,n=!1,r){return{...z(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:D,inputProps:D,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new be,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:D,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var dn=Q.createContext(null);function fn(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function pn(e,t){return e===`list-navigation`||fn(e,t)}var mn=H(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:c,defaultOpen:u=!1,disabled:f=!1,modal:p,loopFocus:m=!0,orientation:h=`vertical`,actionsRef:y,closeParentOnEsc:x=!1,handle:w,triggerId:T,defaultTriggerId:E=null,highlightItemOnHover:O=!0,isSubmenu:k=!1,virtualFocus:A=!1,virtualFocusRef:j,allowEscape:te=!0,resetOnPointerLeave:ne=!0}=e,N=Dt(!0),P=Tt(!0),F=an(!0),L=P?.store,R=P?.virtualFocus??!1,z=Q.useMemo(()=>k&&L?{type:`menu`,store:L}:F?{type:`menubar`,context:F}:N&&!L?{type:`context-menu`,context:N}:{type:void 0},[N,L,F,k]),B=_(),V=_(),[re,H]=Q.useState(void 0),ie=(re??V)||void 0,W=se(),ae=z.type===`menu`?z.store:void 0,G=(n??u)&&ae?.state.transitionStatus===`starting`,q=ee(()=>G?ae?.state.instantType:void 0).current,J=ee(()=>{let e=new cn({open:u,openProp:n,activeTriggerId:E,triggerIdProp:T,parent:z,disabled:f,highlightItemOnHover:O,modal:z.type===void 0?p:void 0,rootId:B,instantType:q},ie,W!=null);return e.context.virtualFocusRef=j,e}).current;J.useControlledProp(`openProp`,n),J.useControlledProp(`triggerIdProp`,T),J.useContextCallback(`onOpenChangeComplete`,i);let de=J.useState(`floatingTreeRoot`),fe=ze(de),Y=J.useState(`open`),me=J.useState(`activeTriggerElement`),he=J.useState(`positionerElement`),_e=J.useState(`hoverEnabled`),ve=J.useState(`disabled`),ye=J.useState(`lastOpenChangeReason`),X=J.useState(`parent`),be=J.useState(`activeIndex`),xe=J.useState(`keyboardOpen`),Se=J.useState(`payload`),Ce=J.useState(`floatingParentNodeId`),we=Q.useRef(null),Te=Q.useRef(X.type!==`context-menu`),Ee=a(),De=Q.useRef(!0),Oe=a(),ke=Ce!=null,{openMethod:Ae,triggerProps:je}=Je(Y);J.useSyncedValues({disabled:f,highlightItemOnHover:O,modal:X.type===void 0?p:void 0,openMethod:Ae,rootId:B}),U(J);let{forceUnmount:Me,transitionStatus:Pe}=K(Y,J,()=>{J.set(`allowMouseEnter`,!1)},G),Fe=d(J.context.popupRef);Q.useEffect(()=>{if(q===void 0)return;let e=()=>{J.state.instantType===q&&J.set(`instantType`,void 0)};if(!Y){e();return}if(Pe!==void 0)return;if(J.context.popupRef.current==null){e();return}let t=new AbortController;return Fe(e,t.signal),()=>{t.abort()}},[q,Y,Pe,Fe,J]),M(()=>{N&&!P?J.update({parent:{type:`context-menu`,context:N},floatingNodeId:fe,floatingParentNodeId:W}):(P||!J.select(`activeTriggerElement`))&&J.update({floatingNodeId:fe,floatingParentNodeId:W})},[N,P,fe,W,me,J]),Q.useEffect(()=>{Y||(we.current=null),X.type===`context-menu`&&(Y?Ee.start(500,()=>{Te.current=!0}):(Ee.clear(),Te.current=!1))},[Ee,Y,X.type]),M(()=>{!Y&&!_e&&J.set(`hoverEnabled`,!0)},[Y,_e,J]);let Ie=b((e,t)=>{let n=t.reason;if(!e&&!J.select(`open`)||Y===e&&t.trigger===me&&ye===n)return;let i=ue(t);if(!e&&t.trigger==null&&(t.trigger=me??void 0),r?.(e,t),t.isCanceled)return;J.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!De.current)return;e&&n===`trigger-focus`?(De.current=!1,Oe.start(300,()=>{De.current=!0})):(De.current=!0,Oe.clear());let o=!e&&(n===`escape-key`||n==null);we.current=t.event;let s=pe(J.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&pn(n,a),s.instantType=X.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:fn(n,a)?`click`:o?`dismiss`:void 0,J.update(s)}),Le=oe({popupStore:J,floatingRootContext:J.state.floatingRootContext,floatingId:ie,nested:W!=null,onOpenChange:Ie}),Re=Le.context.events;M(()=>{let e=({open:e,eventDetails:t})=>Ie(e,t);return Re.on(`setOpen`,e),()=>{Re?.off(`setOpen`,e)}},[Re,Ie]),M(()=>J.subscribeToParentMenu(),[J]);let Be=Q.useCallback(()=>{J.setOpen(!1,v(s))},[J]);Q.useImperativeHandle(y,()=>({unmount:Me,close:Be}),[Me,Be]);let Ve;X.type===`context-menu`&&(Ve=X.context),Q.useImperativeHandle(Ve?.positionerRef,()=>he,[he]),Q.useImperativeHandle(Ve?.actionsRef,()=>({setOpen:Ie}),[Ie]);let He=ge(Le,{enabled:!ve,bubbles:{escapeKey:x&&X.type===`menu`},outsidePress(){return X.type!==`context-menu`||we.current?.type===`contextmenu`||Te.current},externalTree:ke?de:void 0}),We=Ue(),Z=bt(Le,{enabled:!ve,listRef:J.context.itemDomElements,activeIndex:be,virtual:A,nested:X.type===`menubar`||!A&&X.type!==void 0,parentOrientation:X.type===`menubar`?X.context.orientation:void 0,loopFocus:m,focusItemOnOpen:A?xe:void 0,allowEscape:A&&m&&te,orientation:h,triggerOrientation:A?`vertical`:h,rtl:We===`rtl`,disabledIndices:C,onNavigate(e,t){J.setActiveIndex(e,on(t),t?.nativeEvent)},openOnArrowKeyDown:X.type!==`context-menu`&&!(A&&k),externalTree:!A&&ke?de:void 0,nestedReturnFocusRef:ae?.context.virtualFocusRef,focusItemOnHover:O,resetOnPointerLeave:ne}),Ge=Q.useCallback(e=>{J.context.typingRef.current=e},[J]),Ke=xt(Le,{enabled:!ve&&!A,listRef:J.context.itemLabels,elementsRef:J.context.itemDomElements,activeIndex:be,resetMs:500,onMatch:(e,t)=>{Y&&e!==be&&J.setActiveIndex(e,g,t.nativeEvent)},onTyping:Ge}),qe=b(c),Ye=Q.useRef(-1),Xe=b(()=>{let e=J.state.activeIndex,t=e===null?void 0:J.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ye.current===n&&J.context.reportedItem===t)return;Ye.current=n,J.context.reportedItem=t,A&&J.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=J.context;J.context.highlightReason=l,J.context.highlightEvent=void 0,c&&qe(t,o(r,i,{label:t===void 0?void 0:J.context.itemLabels.current[n]??void 0}))});M(()=>{Xe()},[be,Xe]);let Ze=Q.useMemo(()=>{if(!A)return Z.reference;if(!Z.trigger)return D;let{onFocus:e,...t}=Z.trigger;return t},[A,Z.reference,Z.trigger]);J.useSyncedValue(`inputProps`,A?Z.reference??D:D);let Qe=Q.useMemo(()=>{let e=S(Ke.reference,Ze,He.reference,{onMouseMove(){J.set(`allowMouseEnter`,!0)}},je);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=Y,e},[J,Ke.reference,Ze,He.reference,je,Y]),$e=Q.useMemo(()=>{let e=S(Z.trigger,He.trigger,je);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Z.trigger,He.trigger,je]);ee(()=>(J.update({inactiveTriggerProps:$e}),null));let et=Q.useMemo(()=>S(Ne,{onMouseMove(){J.set(`allowMouseEnter`,!0),X.type===`menu`&&J.set(`hoverEnabled`,!1)},onClick(){J.select(`hoverEnabled`)&&J.set(`hoverEnabled`,!1)},onKeyDown(e){let t=J.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ke.floating,Z.floating,He.floating),[X.type,J,Ke.floating,Z.floating,He.floating]),tt=Z.item??D;le(J,{floatingRootContext:Le,activeTriggerProps:Qe,inactiveTriggerProps:$e,popupProps:et,itemProps:tt});let nt=Q.useMemo(()=>({store:J,parent:z,orientation:h,loopFocus:m,allowEscape:te,defaultFloatingId:V,setRenderedFloatingId:H,virtualFocus:A,parentVirtualFocus:R,syncHighlightedItem:Xe}),[J,z,h,m,te,V,A,R,Xe]),rt=typeof t==`function`?t({payload:Se}):t,it=(0,$.jsxs)(wt.Provider,{value:nt,children:[w&&(0,$.jsx)(I,{handle:w,store:J}),rt]});return(X.type===void 0||X.type===`context-menu`)&&(it=(0,$.jsx)(ce,{externalTree:de,children:it})),it});function hn(e){let t=Q.useContext(dn);if(t===null)return(0,$.jsx)(mn,{...e});let n=t.Root;return(0,$.jsx)(dn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}var gn={};function _n(e){Tt();let t=Q.useContext(dn);if(t!==null){let n=t.SubmenuRoot;return(0,$.jsx)(dn.Provider,{value:null,children:(0,$.jsx)(n,{...t.options,...e})})}return(0,$.jsx)(Wt.Provider,{value:gn,children:(0,$.jsx)(mn,{...e,isSubmenu:!0})})}var vn=5;function yn(e,t){let n=bn(t);return e.clientX>=n.left-vn&&e.clientX<=n.right+vn&&e.clientY>=n.top-vn&&e.clientY<=n.bottom+vn}function bn(e){let t=e.getBoundingClientRect(),n=A(e);if(J)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function xn(e){if(P(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!F(e))return xn(te(e))}function Sn(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,we(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:D,[t,n,r])}var Cn=V(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:l,delay:u=100,closeDelay:d=0,handle:f,payload:p,...h}=e,g=Tt(!0),v=rt(f)??g?.store;if(!v)throw Error(w(85));let y=_(c),x=v.useState(`isTriggerActive`,y),ee=v.useState(`floatingRootContext`),C=v.useState(`isOpenedByTrigger`,y),T=v.useState(`triggerControlsId`,y),O=Q.useRef(null),k=Tn(),A=ne(!0),j=Se(),M=Q.useMemo(()=>j??new be,[j]),te=ze(M),P=se(),{registerTrigger:F,isMountedByThisTrigger:I}=L(y,O,v,{payload:p,closeDelay:d,parent:k,floatingTreeRoot:M,floatingNodeId:te,floatingParentNodeId:P,keyboardEventRelay:A?.relayKeyboardEvent}),R=k.type===`menubar`,z=v.useState(`disabled`),B=o||z||R&&k.context.disabled,{getButtonProps:V,buttonRef:re}=N({disabled:B,native:s});Q.useEffect(()=>{!C&&k.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,C,k.type]);let H=Q.useRef(null),ie=a(),U=b(e=>{if(!H.current)return;ie.clear(),v.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(H.current,t)||X(v.select(`positionerElement`),t)||t===H.current||(t==null||xn(t)!==v.select(`rootId`))&&(yn(e,H.current)||M.events.emit(`close`,{domEvent:e,reason:m}))});Q.useEffect(()=>{let e=we(H.current);if(C&&v.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,U,{once:!0}),()=>{e.removeEventListener(`mouseup`,U)}},[C,U,v]);let W=R&&k.context.hasSubmenuOpen,ae=et(ee,{enabled:(l??W)&&!B&&(!R||W&&!I),handleClose:ot({blockPointerEvents:!R}),mouseOnly:!0,move:!1,restMs:k.type===void 0?u:void 0,delay:{close:d},triggerElementRef:O,externalTree:M,isActiveTrigger:x,isClosing:()=>v.select(`transitionStatus`)===`ending`}),oe=wn(C,v.select(`lastOpenChangeReason`)),G=Xe(ee,{enabled:!B,event:C&&R?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:k.type===void 0&&oe}),K=tt(ee,{enabled:!B&&W}),q=Sn({open:C,enabled:R,mouseDownAction:`open`}),ce=Q.useMemo(()=>S(K.reference,G.reference),[K.reference,G.reference]),J=v.useState(`triggerProps`,I),le=v.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ue,handleFocusTargetFocus:fe}=Ze(v,O),Y={disabled:B,open:C},pe=[H,t,re,F,O],me=[ce,ae??D,J,{"aria-haspopup":`menu`,"aria-controls":T,id:y,onMouseDown:e=>{v.select(`open`)||(ie.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),we(e.currentTarget).addEventListener(`mouseup`,U,{once:!0}))}},le,R?{role:`menuitem`}:{},q,h,V],he=E(`button`,e,{enabled:!R,stateAttributesMapping:de,state:Y,ref:pe,props:me});return R?(0,$.jsx)(ut,{tag:`button`,render:n,className:r,style:i,state:Y,refs:pe,props:me,stateAttributesMapping:de}):C?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(Ee,{ref:v.context.beforeTriggerFocusGuardRef,onFocus:ue},`${y}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:he},y),(0,$.jsx)(Ee,{ref:v.context.triggerFocusTargetRef,onFocus:fe},`${y}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:he},y)});function wn(e,t){let n=a(),[r,i]=Q.useState(!1);return M(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Tn(){let e=an(!0);return Q.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var En={"aria-expanded":void 0},Dn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:u=100,closeDelay:d=0,disabled:f=!1,...m}=e,g=Tt(!0);if(g?.parent.type!==`menu`)throw Error(w(37));let y=Ct(),x=Gt(),{store:S,parentVirtualFocus:ee}=g,C=g.parent.store,T=lt({guess:!0,label:a}),O=_(o),k=S.useState(`open`),A=Q.useRef(!1),j=S.useState(`positionerElement`),te=S.useState(`floatingRootContext`),ne=S.useState(`floatingTreeRoot`),N=S.useState(`triggerPopupId`,O),P=_e(O,S),F=b(e=>{P(e);let t=S.select(`activeTriggerElement`);e!==null&&S.select(`open`)&&(t===e||S.select(`activeTriggerId`)==null)&&S.update({activeTriggerId:O??null,activeTriggerElement:e,closeDelay:d})}),I=Q.useRef(null),L=Q.useCallback(e=>{I.current=e,S.set(`activeTriggerElement`,e)},[S]);M(()=>(F(I.current),()=>F(null)),[F,O,S]),M(()=>{if(!k||!j)return;function e(e){ae(e)===S.context.beforeContentFocusGuardRef.current&&(A.current=e.relatedTarget===I.current)}return j.addEventListener(`focusout`,e,!0),()=>{A.current=!1,j.removeEventListener(`focusout`,e,!0)}},[k,j,S]),S.useSyncedValue(`closeDelay`,d);let R=S.useState(`disabled`),z=C.useState(`disabled`),B=f||R||z,V=C.useState(`itemProps`),re=C.useState(`isActive`,T.index),H=Q.useMemo(()=>({type:`submenu-trigger`,setActive(e){C.select(`highlightItemOnHover`)&&C.setActiveIndex(T.index,p,e)}}),[C,T.index]),{getItemProps:ie,itemRef:U}=It({closeOnClick:!1,disabled:B,highlighted:re,id:O,store:S,typingRef:C.context.typingRef,nativeButton:s,itemMetadata:H,nodeId:y?.context.nodeId}),W=S.useState(`hoverEnabled`),oe=et(te,{enabled:W&&c&&!B,handleClose:ot({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:d},shouldOpen:u>0?()=>C.select(`allowMouseEnter`):void 0,triggerElementRef:I,externalTree:ne,isClosing:()=>S.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),G=Xe(te,{enabled:!B,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??D,K=S.useState(`triggerProps`,!0);delete K.id;let se={disabled:B,highlighted:re,open:k},q=S.useState(`openMethod`),ce=S.useState(`lastOpenChangeReason`)===`list-navigation`||q===`keyboard`,J=k&&ce&&Be,le=x?.onTriggerKeyDown?{onKeyDown:x.onTriggerKeyDown}:void 0;return E(`div`,e,{state:se,stateAttributesMapping:fe,props:[G,oe,K,le,V,J?En:void 0,{"aria-controls":N,tabIndex:ee||!(k||re)?-1:0,onFocus(e){S.select(`open`)&&A.current&&(A.current=!1,S.setOpen(!1,v(h,e.nativeEvent)))},onBlur(){re&&C.setActiveIndex(null,l)}},m,ie],ref:[t,T.ref,U,F,L]})}),On=Q.forwardRef(function(e,t){let n=Mt(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?S(n.props,e):e;return(0,$.jsx)(Dn,{...r,ref:n.ref})});function kn({...e}){return(0,$.jsx)(hn,{"data-slot":`dropdown-menu`,...e})}function An({...e}){return(0,$.jsx)(Cn,{"data-slot":`dropdown-menu-trigger`,...e})}function jn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(tn,{children:(0,$.jsx)(nn,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)(Qt,{"data-slot":`dropdown-menu-content`,className:x(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-sm text-popover-foreground shadow-raised ring-1 ring-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Mn({...e}){return(0,$.jsx)(zt,{"data-slot":`dropdown-menu-group`,...e})}function Nn({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(Vt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:x(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/15 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Pn({className:e,inset:t,...n}){return(0,$.jsx)(Ut,{"data-slot":`dropdown-menu-link-item`,"data-inset":t,className:x(`relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...n})}function Fn({...e}){return(0,$.jsx)(_n,{"data-slot":`dropdown-menu-sub`,...e})}function In({className:e,inset:t,children:n,...r}){return(0,$.jsxs)(On,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:x(`flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...r,children:[n,(0,$.jsx)(y,{className:`ml-auto`})]})}function Ln({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,$.jsx)(jn,{"data-slot":`dropdown-menu-sub-content`,className:x(`w-auto min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-raised ring-1 ring-border duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function Rn({className:e,...t}){return(0,$.jsx)(pt,{"data-slot":`dropdown-menu-separator`,className:x(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Pn as a,Ln as c,ft as d,Nn as i,In as l,jn as n,Rn as o,Mn as r,Fn as s,kn as t,An as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{M as r}from"./page-C47YAWAl.js";import{a as i,t as a,u as o}from"./error-alert-hABzwCSY.js";import{L as s}from"./visuallyHidden-BUGCJ1D9.js";import{n as c}from"./overview-C73v5kbv.js";import{a as l}from"./actions-CG0hkpe7.js";import{i as u,n as d,r as f,t as p}from"./native-select-BzF8xUnx.js";import{D as m,t as h}from"./button-4rhhIcK8.js";import{bt as g,et as _,gt as v,v as y}from"./strings-DXB6PB2g.js";import{t as b}from"./queries-BZMW2wiD.js";var x=n(e(),1),S=t(),C={retry:{title:`Edit and retry`,note:`Uses the selected agent's current definition, even if you keep the same name. Later attempts use this task and agent until you edit them again.`,submit:`Save and retry`},runAgain:{title:`Edit and run again`,note:`Opens a new run on this item with this task and agent. This run is unchanged.`,submit:`Save and run again`}},w=(e,t)=>t===`retry`?e.canRetry:e.canRunAgain,T=(e,t)=>{let n=r();return o({mutationFn:t=>y(n=>n.editAndRetry({params:{runId:e.id},payload:t})),onSuccess:async()=>{await Promise.all([n.invalidateQueries({queryKey:i(e.id)}),n.invalidateQueries({queryKey:c().queryKey})]),t()}})},E=({run:e,intent:t,close:n,openRun:r,className:i})=>{let[o,c]=(0,x.useState)(e.task),[y,w]=(0,x.useState)(e.agent),E=(0,x.useId)(),D=C[t],O=s(b()),k=T(e,n),A=l(),j=t===`retry`?k:A,M=o.trim().length>0&&O.data?.some(e=>e===y)===!0,N=()=>{let n=new _({task:v.make(o),agent:g.make(y)});t===`retry`?k.mutate(n):A.mutate({runId:e.id,amendment:n},{onSuccess:e=>{e._tag===`Claimed`&&r(e.runId)}})};return(0,S.jsxs)(`form`,{"aria-label":D.title,className:m(`space-y-3`,i),onSubmit:e=>{e.preventDefault(),!j.isPending&&M&&N()},children:[(0,S.jsx)(`h3`,{className:`text-md font-semibold`,children:D.title}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:D.note}),(0,S.jsx)(f,{htmlFor:`${E}-task`,children:`Task`}),(0,S.jsx)(u,{id:`${E}-task`,value:o,onChange:e=>c(e.target.value),rows:7,disabled:j.isPending}),(0,S.jsx)(f,{htmlFor:`${E}-agent`,children:`Agent`}),(0,S.jsxs)(p,{id:`${E}-agent`,value:y,onChange:e=>w(e.target.value),disabled:j.isPending||O.isPending,children:[!O.data?.includes(e.agent)&&(0,S.jsxs)(d,{value:e.agent,disabled:!0,children:[e.agent,` · unavailable`]}),O.data?.map(e=>(0,S.jsx)(d,{value:e,children:e},e))]}),(0,S.jsxs)(`div`,{className:`flex gap-2`,children:[(0,S.jsx)(h,{type:`submit`,size:`sm`,disabled:j.isPending||!M,children:D.submit}),(0,S.jsx)(h,{type:`button`,size:`sm`,variant:`ghost`,disabled:j.isPending,onClick:n,children:`Close editor`})]}),A.data?._tag===`CycleBlocked`&&(0,S.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),O.isError&&(0,S.jsx)(a,{message:O.error.message}),j.isError&&(0,S.jsx)(a,{message:j.error.message})]})};export{w as n,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{M as r,O as i,_ as a,f as o,h as s,k as c,p as l,w as u,y as d}from"./page-C47YAWAl.js";import{P as f}from"./overview-C73v5kbv.js";import{D as p,E as m,U as h}from"./button-4rhhIcK8.js";import{Cn as g,at as _,rt as v,tt as y,v as b}from"./strings-DXB6PB2g.js";var x=class extends o{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||S(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=l({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),s.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function S(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var C=class extends a{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),i(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&d(t.mutationKey)!==d(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??S();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){s.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},w=n(e(),1);function T(e,t){let n=r(t),[i]=w.useState(()=>new C(n,e));w.useEffect(()=>{i.setOptions(e)},[i,e]);let a=w.useSyncExternalStore(w.useCallback(e=>i.subscribe(s.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=w.useCallback((...e)=>{i.mutate(e[0],e[1]).catch(u)},[i]);if(a.error&&c(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var E=(e,t)=>{let n=new Map(e.map(e=>[e.sequence,e]));for(let e of t)n.has(e.sequence)||n.set(e.sequence,e);return[...n.values()].sort((e,t)=>e.sequence-t.sequence)},D=(e,t,n)=>[...e.filter(({attemptId:e})=>e!==t),...n].sort((e,t)=>e.before-t.before),O=(e,t,n)=>new y({...e,transcript:E(e.transcript,t.transcript),earlierTranscript:D(e.earlierTranscript,n.attemptId,t.earlierTranscript)}),k=e=>{let t=new Map;for(let n of e){if(n.payload._tag!==`SessionEvent`)continue;let e=n.payload.event;e._tag===`PoolRateLimitsUpdated`&&t.set(e.pool,{pool:e.pool,windows:g([e.rateLimits.primary,e.rateLimits.secondary])})}return[...t.values()]},A=async(e,t)=>{let n=await t(e);if(e._tag===`ColdTranscriptRequest`)return n;let r=n.transcript;for(;!n.run.canCancel;){let e=n.transcript.at(-1);if(e===void 0)break;n=await t(new _({after:e.sequence})),r=E(r,n.transcript)}return new y({...n,transcript:r})},j=[`run`],M=e=>[...j,e],N=(e,t)=>{let n=M(t);return f({queryKey:n,queryFn:async()=>{let r=e.getQueryData(n)?.transcript.at(-1)?.sequence,i=await A(r===void 0?new v:new _({after:r}),e=>b(n=>n.detail({params:{runId:t},query:e}))),a=e.getQueryData(n);return r===void 0||a===void 0?i:new y({...i,transcript:E(a.transcript,i.transcript),earlierTranscript:a.earlierTranscript})},staleTime:1e3,structuralSharing:!1,refetchInterval:e=>e.state.data?.run.canCancel===!0&&1e3})},P=t(),F=m(`group/alert relative grid w-full gap-0.5 rounded-lg border px-3 py-2.5 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive/25 bg-destructive/8 text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function I({className:e,variant:t,...n}){return(0,P.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:p(F({variant:t}),e),...n})}function L({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`alert-title`,className:p(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function R({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`alert-description`,className:p(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}var z=({title:e,message:t,className:n})=>(0,P.jsxs)(I,{variant:`destructive`,className:p(`wrap-anywhere`,n),children:[(0,P.jsx)(h,{weight:`fill`}),e!==void 0&&(0,P.jsx)(L,{children:e}),(0,P.jsx)(R,{children:t})]});export{M as a,O as c,x as d,L as i,k as l,I as n,j as o,R as r,N as s,z as t,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{Fn as t}from"./strings-DXB6PB2g.js";var n=e(),r={read:`Could not read the file`,yaml:`Frontmatter is not valid YAML`,frontmatter:`Frontmatter block missing or not closed`,schema:`Invalid file name or field value`,expression:`Invalid expression`,reference:`Unknown agent, repository, or tag`},i=({error:e,consequence:i})=>{let a=t(e.expression);return(0,n.jsxs)(`div`,{className:`flex max-w-[72ch] flex-col gap-3`,children:[(0,n.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 wrap-anywhere`,children:[(0,n.jsx)(`p`,{className:`font-medium text-destructive`,children:r[e.stage]}),(0,n.jsx)(`p`,{children:e.message}),a!==void 0&&(0,n.jsx)(`code`,{className:`mt-1 font-mono text-xs whitespace-pre-wrap text-muted-foreground`,children:a})]}),(0,n.jsxs)(`p`,{className:`text-muted-foreground`,children:[i,` Fix `,(0,n.jsx)(`code`,{className:`font-mono text-xs`,children:e.file}),`, then reload the configuration.`]})]})};export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t}from"./button-4rhhIcK8.js";import{
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t}from"./button-4rhhIcK8.js";import{zn as n}from"./strings-DXB6PB2g.js";import{t as r}from"./mark-uyeJ8aPC.js";var i=e(),a=({item:e,title:a,variant:o,linked:s=!0,as:c=o===`page`?`h1`:`span`,className:l,style:u})=>(0,i.jsxs)(c,{className:t(o===`page`?`text-xl font-semibold wrap-anywhere`:`block truncate text-sm font-medium`,l),...u===void 0?{}:{style:u},...o===`row`?{title:a}:{},children:[n(e,{onNone:()=>null,onSome:e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r,{item:e,size:o===`page`?`title`:`inline`,linked:s}),` `]})}),a]});export{a as t};
|