botframework-webchat 4.18.1-main.20250127.e44c342 → 4.18.1-main.20250129.b40802d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/botframework-webchat.es5.js +1 -1
- package/dist/botframework-webchat.es5.mjs +1 -1
- package/dist/botframework-webchat.js +1 -1
- package/dist/botframework-webchat.minimal.js +1 -1
- package/dist/botframework-webchat.minimal.mjs +1 -1
- package/dist/botframework-webchat.mjs +1 -1
- package/dist/{chunk-ASV62R53.mjs → chunk-2KQWLCLT.mjs} +3 -3
- package/dist/{chunk-E2QTQNYP.js → chunk-5MUSNARN.js} +3 -3
- package/dist/{chunk-E2QTQNYP.js.map → chunk-5MUSNARN.js.map} +1 -1
- package/dist/{chunk-3OAYAR43.js → chunk-7WMTUZ5O.js} +10 -10
- package/dist/{chunk-3OAYAR43.js.map → chunk-7WMTUZ5O.js.map} +1 -1
- package/dist/{chunk-BRCX6KNE.mjs → chunk-V775MBEJ.mjs} +3 -3
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/webchat-es5.js +5 -5
- package/dist/webchat-minimal.js +4 -4
- package/dist/webchat.js +5 -5
- package/package.json +8 -8
- /package/dist/{chunk-3OAYAR43.js.LEGAL.txt → chunk-2KQWLCLT.mjs.LEGAL.txt} +0 -0
- /package/dist/{chunk-ASV62R53.mjs.map → chunk-2KQWLCLT.mjs.map} +0 -0
- /package/dist/{chunk-ASV62R53.mjs.LEGAL.txt → chunk-5MUSNARN.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-BRCX6KNE.mjs.LEGAL.txt → chunk-7WMTUZ5O.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-E2QTQNYP.js.LEGAL.txt → chunk-V775MBEJ.mjs.LEGAL.txt} +0 -0
- /package/dist/{chunk-BRCX6KNE.mjs.map → chunk-V775MBEJ.mjs.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ke,b as fm,c as wt,d as eu,e as tu,g as nu,n as ru,q as iu,u as si,v as su}from"./chunk-ASV62R53.mjs";var Bp=Ke(()=>{});var Up=Ke(()=>{});var qp=Ke(()=>{});var Vp=Ke((DT,Hp)=>{"use strict";Hp.exports=function(e,n){if(n=n.split(":")[0],e=+e,!e)return!1;switch(n){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var Kp=Ke(hc=>{"use strict";var Ev=Object.prototype.hasOwnProperty,Zv;function Gp(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Wp(t){try{return encodeURIComponent(t)}catch{return null}}function Rv(t){for(var e=/([^=?#&]+)=?([^&]*)/g,n={},r;r=e.exec(t);){var i=Gp(r[1]),s=Gp(r[2]);i===null||s===null||i in n||(n[i]=s)}return n}function jv(t,e){e=e||"";var n=[],r,i;typeof e!="string"&&(e="?");for(i in t)if(Ev.call(t,i)){if(r=t[i],!r&&(r===null||r===Zv||isNaN(r))&&(r=""),i=Wp(i),r=Wp(r),i===null||r===null)continue;n.push(i+"="+r)}return n.length?e+n.join("&"):""}hc.stringify=jv;hc.parse=Rv});var rd=Ke((LT,nd)=>{"use strict";var Xp=Vp(),eo=Kp(),Tv=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Qp=/[\n\r\t]/g,Iv=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Yp=/:\d+$/,Pv=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Ov=/^[a-zA-Z]:/;function bc(t){return(t||"").toString().replace(Tv,"")}var gc=[["#","hash"],["?","query"],function(e,n){return bt(n.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Jp={hash:1,query:1};function ed(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var n=e.location||{};t=t||n;var r={},i=typeof t,s;if(t.protocol==="blob:")r=new yt(unescape(t.pathname),{});else if(i==="string"){r=new yt(t,{});for(s in Jp)delete r[s]}else if(i==="object"){for(s in t)s in Jp||(r[s]=t[s]);r.slashes===void 0&&(r.slashes=Iv.test(t.href))}return r}function bt(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function td(t,e){t=bc(t),t=t.replace(Qp,""),e=e||{};var n=Pv.exec(t),r=n[1]?n[1].toLowerCase():"",i=!!n[2],s=!!n[3],a=0,o;return i?s?(o=n[2]+n[3]+n[4],a=n[2].length+n[3].length):(o=n[2]+n[4],a=n[2].length):s?(o=n[3]+n[4],a=n[3].length):o=n[4],r==="file:"?a>=2&&(o=o.slice(2)):bt(r)?o=n[4]:r?i&&(o=o.slice(2)):a>=2&&bt(e.protocol)&&(o=n[4]),{protocol:r,slashes:i||bt(r),slashesCount:a,rest:o}}function Bv(t,e){if(t==="")return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,i=n[r-1],s=!1,a=0;r--;)n[r]==="."?n.splice(r,1):n[r]===".."?(n.splice(r,1),a++):a&&(r===0&&(s=!0),n.splice(r,1),a--);return s&&n.unshift(""),(i==="."||i==="..")&&n.push(""),n.join("/")}function yt(t,e,n){if(t=bc(t),t=t.replace(Qp,""),!(this instanceof yt))return new yt(t,e,n);var r,i,s,a,o,c,u=gc.slice(),l=typeof e,p=this,m=0;for(l!=="object"&&l!=="string"&&(n=e,e=null),n&&typeof n!="function"&&(n=eo.parse),e=ed(e),i=td(t||"",e),r=!i.protocol&&!i.slashes,p.slashes=i.slashes||r&&e.slashes,p.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||Ov.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!bt(p.protocol)))&&(u[3]=[/(.*)/,"pathname"]);m<u.length;m++){if(a=u[m],typeof a=="function"){t=a(t,p);continue}s=a[0],c=a[1],s!==s?p[c]=t:typeof s=="string"?(o=s==="@"?t.lastIndexOf(s):t.indexOf(s),~o&&(typeof a[2]=="number"?(p[c]=t.slice(0,o),t=t.slice(o+a[2])):(p[c]=t.slice(o),t=t.slice(0,o)))):(o=s.exec(t))&&(p[c]=o[1],t=t.slice(0,o.index)),p[c]=p[c]||r&&a[3]&&e[c]||"",a[4]&&(p[c]=p[c].toLowerCase())}n&&(p.query=n(p.query)),r&&e.slashes&&p.pathname.charAt(0)!=="/"&&(p.pathname!==""||e.pathname!=="")&&(p.pathname=Bv(p.pathname,e.pathname)),p.pathname.charAt(0)!=="/"&&bt(p.protocol)&&(p.pathname="/"+p.pathname),Xp(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(o=p.auth.indexOf(":"),~o?(p.username=p.auth.slice(0,o),p.username=encodeURIComponent(decodeURIComponent(p.username)),p.password=p.auth.slice(o+1),p.password=encodeURIComponent(decodeURIComponent(p.password))):p.username=encodeURIComponent(decodeURIComponent(p.auth)),p.auth=p.password?p.username+":"+p.password:p.username),p.origin=p.protocol!=="file:"&&bt(p.protocol)&&p.host?p.protocol+"//"+p.host:"null",p.href=p.toString()}function Dv(t,e,n){var r=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(n||eo.parse)(e)),r[t]=e;break;case"port":r[t]=e,Xp(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[t]="");break;case"hostname":r[t]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[t]=e,Yp.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";r[t]=e.charAt(0)!==i?i+e:e}else r[t]=e;break;case"username":case"password":r[t]=encodeURIComponent(e);break;case"auth":var s=e.indexOf(":");~s?(r.username=e.slice(0,s),r.username=encodeURIComponent(decodeURIComponent(r.username)),r.password=e.slice(s+1),r.password=encodeURIComponent(decodeURIComponent(r.password))):r.username=encodeURIComponent(decodeURIComponent(e))}for(var a=0;a<gc.length;a++){var o=gc[a];o[4]&&(r[o[1]]=r[o[1]].toLowerCase())}return r.auth=r.password?r.username+":"+r.password:r.username,r.origin=r.protocol!=="file:"&&bt(r.protocol)&&r.host?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function Mv(t){(!t||typeof t!="function")&&(t=eo.stringify);var e,n=this,r=n.host,i=n.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var s=i+(n.protocol&&n.slashes||bt(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):n.protocol!=="file:"&&bt(n.protocol)&&!r&&n.pathname!=="/"&&(s+="@"),(r[r.length-1]===":"||Yp.test(n.hostname)&&!n.port)&&(r+=":"),s+=r+n.pathname,e=typeof n.query=="object"?t(n.query):n.query,e&&(s+=e.charAt(0)!=="?"?"?"+e:e),n.hash&&(s+=n.hash),s}yt.prototype={set:Dv,toString:Mv};yt.extractProtocol=td;yt.location=ed;yt.trimLeft=bc;yt.qs=eo;nd.exports=yt});var id=Ke(()=>{});var sd=Ke(()=>{});var od=Ke(()=>{});var ad=Ke(()=>{});var cd=Ke(()=>{});import{Components as yv}from"botframework-webchat-component";import oc from"prop-types";import Rp from"react";import{singleToArray as Ep,warnOnce as fv}from"botframework-webchat-core";import Zp,{memo as hv}from"react";import*as bm from"adaptivecards";import ym,{useMemo as ou}from"react";import{createContext as hm}from"react";var gm=hm(void 0),oi=gm;var vm=({adaptiveCardsHostConfig:t,adaptiveCardsPackage:e,children:n})=>{let r=ou(()=>e||bm,[e]),i=ou(()=>({adaptiveCardsPackage:r,hostConfigFromProps:t}),[t,r]);return ym.createElement(oi.Provider,{value:i},n)},au=vm;import{CodeHighlighterComposer as qg}from"botframework-webchat-component/internal";import Hg,{memo as Vg,useEffect as Gg,useState as Wg}from"react";var ct=class extends Error{constructor(e){super(e),this.name="ShikiError"}};var ir=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Am(){return 2147483648}function _m(){return typeof performance<"u"?performance.now():Date.now()}var wm=(t,e)=>t+(e-t%e)%e;async function Cm(t){let e,n,r={};function i(d){n=d,r.HEAPU8=new Uint8Array(d),r.HEAPU32=new Uint32Array(d)}function s(d,h,f){r.HEAPU8.copyWithin(d,h,h+f)}function a(d){try{return e.grow(d-n.byteLength+65535>>>16),i(e.buffer),1}catch{}}function o(d){let h=r.HEAPU8.length;d=d>>>0;let f=Am();if(d>f)return!1;for(let g=1;g<=4;g*=2){let b=h*(1+.2/g);b=Math.min(b,d+100663296);let y=Math.min(f,wm(Math.max(d,b),65536));if(a(y))return!0}return!1}let c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(d,h,f=1024){let g=h+f,b=h;for(;d[b]&&!(b>=g);)++b;if(b-h>16&&d.buffer&&c)return c.decode(d.subarray(h,b));let y="";for(;h<b;){let w=d[h++];if(!(w&128)){y+=String.fromCharCode(w);continue}let C=d[h++]&63;if((w&224)===192){y+=String.fromCharCode((w&31)<<6|C);continue}let x=d[h++]&63;if((w&240)===224?w=(w&15)<<12|C<<6|x:w=(w&7)<<18|C<<12|x<<6|d[h++]&63,w<65536)y+=String.fromCharCode(w);else{let v=w-65536;y+=String.fromCharCode(55296|v>>10,56320|v&1023)}}return y}function l(d,h){return d?u(r.HEAPU8,d,h):""}let p={emscripten_get_now:_m,emscripten_memcpy_big:s,emscripten_resize_heap:o,fd_write:()=>0};async function m(){let h=await t({env:p,wasi_snapshot_preview1:p});e=h.memory,i(e.buffer),Object.assign(r,h),r.UTF8ToString=l}return await m(),r}var le=null;function xm(t){throw new ir(t.UTF8ToString(t.getLastOnigError()))}var ci=class t{static _utf8ByteLength(e){let n=0;for(let r=0,i=e.length;r<i;r++){let s=e.charCodeAt(r),a=s,o=!1;if(s>=55296&&s<=56319&&r+1<i){let c=e.charCodeAt(r+1);c>=56320&&c<=57343&&(a=(s-55296<<10)+65536|c-56320,o=!0)}a<=127?n+=1:a<=2047?n+=2:a<=65535?n+=3:n+=4,o&&r++}return n}utf16Length;utf8Length;utf16Value;utf8Value;utf16OffsetToUtf8;utf8OffsetToUtf16;constructor(e){let n=e.length,r=t._utf8ByteLength(e),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);let a=i?new Uint32Array(r+1):null;i&&(a[r]=n);let o=new Uint8Array(r),c=0;for(let u=0;u<n;u++){let l=e.charCodeAt(u),p=l,m=!1;if(l>=55296&&l<=56319&&u+1<n){let d=e.charCodeAt(u+1);d>=56320&&d<=57343&&(p=(l-55296<<10)+65536|d-56320,m=!0)}i&&(s[u]=c,m&&(s[u+1]=c),p<=127?a[c+0]=u:p<=2047?(a[c+0]=u,a[c+1]=u):p<=65535?(a[c+0]=u,a[c+1]=u,a[c+2]=u):(a[c+0]=u,a[c+1]=u,a[c+2]=u,a[c+3]=u)),p<=127?o[c++]=p:p<=2047?(o[c++]=192|(p&1984)>>>6,o[c++]=128|(p&63)>>>0):p<=65535?(o[c++]=224|(p&61440)>>>12,o[c++]=128|(p&4032)>>>6,o[c++]=128|(p&63)>>>0):(o[c++]=240|(p&1835008)>>>18,o[c++]=128|(p&258048)>>>12,o[c++]=128|(p&4032)>>>6,o[c++]=128|(p&63)>>>0),m&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=a}createString(e){let n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}},ui=class t{static LAST_ID=0;static _sharedPtr=0;static _sharedPtrInUse=!1;id=++t.LAST_ID;_onigBinding;content;utf16Length;utf8Length;utf16OffsetToUtf8;utf8OffsetToUtf16;ptr;constructor(e){if(!le)throw new ir("Must invoke loadWasm first.");this._onigBinding=le,this.content=e;let n=new ci(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!t._sharedPtrInUse?(t._sharedPtr||(t._sharedPtr=le.omalloc(1e4)),t._sharedPtrInUse=!0,le.HEAPU8.set(n.utf8Value,t._sharedPtr),this.ptr=t._sharedPtr):this.ptr=n.createString(le)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===t._sharedPtr?t._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}},po=class{_onigBinding;_ptr;constructor(e){if(!le)throw new ir("Must invoke loadWasm first.");let n=[],r=[];for(let o=0,c=e.length;o<c;o++){let u=new ci(e[o]);n[o]=u.createString(le),r[o]=u.utf8Length}let i=le.omalloc(4*e.length);le.HEAPU32.set(n,i/4);let s=le.omalloc(4*e.length);le.HEAPU32.set(r,s/4);let a=le.createOnigScanner(i,s,e.length);for(let o=0,c=e.length;o<c;o++)le.ofree(n[o]);le.ofree(s),le.ofree(i),a===0&&xm(le),this._onigBinding=le,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof e=="string"){e=new ui(e);let s=this._findNextMatchSync(e,n,!1,i);return e.dispose(),s}return this._findNextMatchSync(e,n,!1,i)}_findNextMatchSync(e,n,r,i){let s=this._onigBinding,a=s.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),i);if(a===0)return null;let o=s.HEAPU32,c=a/4,u=o[c++],l=o[c++],p=[];for(let m=0;m<l;m++){let d=e.convertUtf8OffsetToUtf16(o[c++]),h=e.convertUtf8OffsetToUtf16(o[c++]);p[m]={start:d,end:h,length:h-d}}return{index:u,captureIndices:p}}};function Sm(t){return typeof t.instantiator=="function"}function km(t){return typeof t.default=="function"}function $m(t){return typeof t.data<"u"}function zm(t){return typeof Response<"u"&&t instanceof Response}function Em(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}var ai;function cu(t){if(ai)return ai;async function e(){le=await Cm(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Sm(r)?r=await r.instantiator(n):km(r)?r=await r.default(n):($m(r)&&(r=r.data),zm(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Zm(r)(n):r=await Rm(r)(n):Em(r)?r=await lo(r)(n):r instanceof WebAssembly.Module?r=await lo(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await lo(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return ai=e(),ai}function lo(t){return e=>WebAssembly.instantiate(t,e)}function Zm(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Rm(t){return async e=>{let n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}var jm;function uu(){return jm}async function lu(t){return t&&await cu(t),{createScanner(e){return new po(e)},createString(e){return new ui(e)}}}var Tm=!1;function mo(t){Tm&&console.trace(`[SHIKI DEPRECATE]: ${t}`)}function Im(t){return xo(t)}function xo(t){return Array.isArray(t)?Pm(t):typeof t=="object"?Om(t):t}function Pm(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=xo(t[n]);return e}function Om(t){let e={};for(let n in t)e[n]=xo(t[n]);return e}function vu(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Au(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Au(t.substring(0,t.length-1)):t.substr(~e+1)}var fo=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,li=class{static hasCaptures(t){return t===null?!1:(fo.lastIndex=0,fo.test(t))}static replaceCaptures(t,e,n){return t.replace(fo,(r,i,s,a)=>{let o=n[parseInt(i||s,10)];if(o){let c=e.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(a){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function _u(t,e){return t<e?-1:t>e?1:0}function wu(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;i<n;i++){let s=_u(t[i],e[i]);if(s!==0)return s}return 0}return n-r}function pu(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Cu(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var xu=class{constructor(t){this.fn=t,this.cache=new Map}get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},ar=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n,this._cachedMatchRoot=new xu(r=>this._root.match(r))}static createFromRawTheme(t,e){return this.createFromParsedTheme(Mm(t),e)}static createFromParsedTheme(t,e){return Nm(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>Bm(t.parent,i.parentScopes));return r?new Su(r.fontStyle,r.foreground,r.background):null}},ho=class pi{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(let r of n)e=new pi(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new pi(n,e[r]);return n}push(e){return new pi(this,e)}getSegments(){let e=this,n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let n=[],r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Bm(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!Dm(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Dm(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Su=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Mm(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(!a.settings)continue;let o;if(typeof a.scope=="string"){let p=a.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),o=p.split(",")}else Array.isArray(a.scope)?o=a.scope:o=[""];let c=-1;if(typeof a.settings.fontStyle=="string"){c=0;let p=a.settings.fontStyle.split(" ");for(let m=0,d=p.length;m<d;m++)switch(p[m]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let u=null;typeof a.settings.foreground=="string"&&pu(a.settings.foreground)&&(u=a.settings.foreground);let l=null;typeof a.settings.background=="string"&&pu(a.settings.background)&&(l=a.settings.background);for(let p=0,m=o.length;p<m;p++){let h=o[p].trim().split(" "),f=h[h.length-1],g=null;h.length>1&&(g=h.slice(0,h.length-1),g.reverse()),n[r++]=new Lm(f,g,i,c,u,l)}}return n}var Lm=class{constructor(t,e,n,r,i,s){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Je=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Je||{});function Nm(t,e){t.sort((c,u)=>{let l=_u(c.scope,u.scope);return l!==0||(l=wu(c.parentScopes,u.parentScopes),l!==0)?l:c.index-u.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(i=c.background)}let s=new Fm(e),a=new Su(n,s.getId(r),s.getId(i)),o=new qm(new go(0,null,-1,0,0),[]);for(let c=0,u=t.length;c<u;c++){let l=t[c];o.insert(0,l.scope,l.parentScopes,l.fontStyle,s.getId(l.foreground),s.getId(l.background))}return new ar(s,a,o)}var Fm=class{constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Um=Object.freeze([]),go=class ku{constructor(e,n,r,i,s){this.scopeDepth=e,this.parentScopes=n||Um,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new ku(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,i=e.length;r<i;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},qm=class bo{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){let s=n.parentScopes[i].length-e.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,s;if(r===-1?(i=e,s=""):(i=e.substring(0,r),s=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(bo._cmpBySpecificity),n}insert(e,n,r,i,s,a){if(n===""){this._doInsertHere(e,r,i,s,a);return}let o=n.indexOf("."),c,u;o===-1?(c=n,u=""):(c=n.substring(0,o),u=n.substring(o+1));let l;this._children.hasOwnProperty(c)?l=this._children[c]:(l=new bo(this._mainRule.clone(),go.cloneArr(this._rulesWithParentScopes)),this._children[c]=l),l.insert(e+1,u,r,i,s,a)}_doInsertHere(e,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(e,r,i,s);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let c=this._rulesWithParentScopes[a];if(wu(c.parentScopes,n)===0){c.acceptOverwrite(e,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new go(e,n,r,i,s))}},Dt=class Me{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let n=Me.getLanguageId(e),r=Me.getTokenType(e),i=Me.getFontStyle(e),s=Me.getForeground(e),a=Me.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,s,a,o){let c=Me.getLanguageId(e),u=Me.getTokenType(e),l=Me.containsBalancedBrackets(e)?1:0,p=Me.getFontStyle(e),m=Me.getForeground(e),d=Me.getBackground(e);return n!==0&&(c=n),r!==8&&(u=r),i!==null&&(l=i?1:0),s!==-1&&(p=s),a!==0&&(m=a),o!==0&&(d=o),(c<<0|u<<8|l<<10|p<<11|m<<15|d<<24)>>>0}};function mi(t,e){let n=[],r=Hm(t),i=r.next();for(;i!==null;){let c=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=a();if(n.push({matcher:u,priority:c}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();let c=s();return u=>!!c&&!c(u)}if(i==="("){i=r.next();let c=o();return i===")"&&(i=r.next()),c}if(du(i)){let c=[];do c.push(i),i=r.next();while(du(i));return u=>e(c,u)}return null}function a(){let c=[],u=s();for(;u;)c.push(u),u=s();return l=>c.every(p=>p(l))}function o(){let c=[],u=a();for(;u&&(c.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=a()}return l=>c.some(p=>p(l))}}function du(t){return!!t&&!!t.match(/[\w\.:]+/)}function Hm(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;let r=n[0];return n=e.exec(t),r}}}function $u(t){typeof t.dispose=="function"&&t.dispose()}var cr=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Vm=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Gm=class{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(t){let e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Wm=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new cr(this.initialScopeName)]}processQueue(){let t=this.Q;this.Q=[];let e=new Gm;for(let n of t)Km(n,this.initialScopeName,this.repo,e);for(let n of e.references)if(n instanceof cr){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Km(t,e,n,r){let i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}let s=n.lookup(e);t instanceof cr?di({baseGrammar:s,selfGrammar:i},r):yo(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);let a=n.injections(t.scopeName);if(a)for(let o of a)r.add(new cr(o))}function yo(t,e,n){if(e.repository&&e.repository[t]){let r=e.repository[t];fi([r],e,n)}}function di(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&fi(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&fi(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function fi(t,e,n){for(let r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let i=r.repository?vu({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&fi(r.patterns,{...e,repository:i},n);let s=r.include;if(!s)continue;let a=zu(s);switch(a.kind){case 0:di({...e,selfGrammar:e.baseGrammar},n);break;case 1:di(e,n);break;case 2:yo(a.ruleName,{...e,repository:i},n);break;case 3:case 4:let o=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(o){let c={baseGrammar:e.baseGrammar,selfGrammar:o,repository:i};a.kind===4?yo(a.ruleName,c,n):di(c,n)}else a.kind===4?n.add(new Vm(a.scopeName,a.ruleName)):n.add(new cr(a.scopeName));break}}}var Jm=class{constructor(){this.kind=0}},Xm=class{constructor(){this.kind=1}},Qm=class{constructor(t){this.ruleName=t,this.kind=2}},Ym=class{constructor(t){this.scopeName=t,this.kind=3}},ef=class{constructor(t,e){this.scopeName=t,this.ruleName=e,this.kind=4}};function zu(t){if(t==="$base")return new Jm;if(t==="$self")return new Xm;let e=t.indexOf("#");if(e===-1)return new Ym(t);if(e===0)return new Qm(t.substring(1));{let n=t.substring(0,e),r=t.substring(e+1);return new ef(n,r)}}var tf=/\\(\d+)/,mu=/\\(\d+)/g,E0=Symbol("RuleId"),nf=-1,Eu=-2;var pr=class{constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=li.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=li.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${Au(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:li.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:li.replaceCaptures(this._contentName,t,e)}},rf=class extends pr{constructor(t,e,n,r,i){super(t,e,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},sf=class extends pr{constructor(t,e,n,r,i){super(t,e,n,null),this._match=new ur(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new lr,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},fu=class extends pr{constructor(t,e,n,r,i){super(t,e,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(let n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new lr,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vo=class extends pr{constructor(t,e,n,r,i,s,a,o,c,u){super(t,e,n,r),this._begin=new ur(i,this.id),this.beginCaptures=s,this._end=new ur(a||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new lr;for(let n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},hi=class extends pr{constructor(t,e,n,r,i,s,a,o,c){super(t,e,n,r),this._begin=new ur(i,this.id),this.beginCaptures=s,this.whileCaptures=o,this._while=new ur(a,Eu),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new lr;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new lr,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"\uFFFF"),this._cachedCompiledWhilePatterns}},Zu=class ve{static createCaptureRule(e,n,r,i,s){return e.registerRule(a=>new rf(n,a,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new sf(e.$vscodeTextmateLocation,e.id,e.name,e.match,ve._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=vu({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new fu(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,ve._compilePatterns(s,n,r))}return e.while?new hi(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ve._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,ve._compileCaptures(e.whileCaptures||e.captures,n,r),ve._compilePatterns(e.patterns,n,r)):new vo(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ve._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,ve._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,ve._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(let a in e){if(a==="$vscodeTextmateLocation")continue;let o=parseInt(a,10);o>s&&(s=o)}for(let a=0;a<=s;a++)i[a]=null;for(let a in e){if(a==="$vscodeTextmateLocation")continue;let o=parseInt(a,10),c=0;e[a].patterns&&(c=ve.getCompiledRuleId(e[a],n,r)),i[o]=ve.createCaptureRule(n,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,c)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,a=e.length;s<a;s++){let o=e[s],c=-1;if(o.include){let u=zu(o.include);switch(u.kind){case 0:case 1:c=ve.getCompiledRuleId(r[o.include],n,r);break;case 2:let l=r[u.ruleName];l&&(c=ve.getCompiledRuleId(l,n,r));break;case 3:case 4:let p=u.scopeName,m=u.kind===4?u.ruleName:null,d=n.getExternalGrammar(p,r);if(d)if(m){let h=d.repository[m];h&&(c=ve.getCompiledRuleId(h,n,d.repository))}else c=ve.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=ve.getCompiledRuleId(o,n,r);if(c!==-1){let u=n.getRule(c),l=!1;if((u instanceof fu||u instanceof vo||u instanceof hi)&&u.hasMissingPatterns&&u.patterns.length===0&&(l=!0),l)continue;i.push(c)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},ur=class Ru{constructor(e,n){if(e){let r=e.length,i=0,s=[],a=!1;for(let o=0;o<r;o++)if(e.charAt(o)==="\\"&&o+1<r){let u=e.charAt(o+1);u==="z"?(s.push(e.substring(i,o)),s.push("$(?!\\n)(?<!\\n)"),i=o+2):(u==="A"||u==="G")&&(a=!0),o++}this.hasAnchor=a,i===0?this.source=e:(s.push(e.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=tf.test(this.source)}clone(){return new Ru(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){let r=n.map(i=>e.substring(i.start,i.end));return mu.lastIndex=0,this.source.replace(mu,(i,s)=>Cu(r[parseInt(s,10)]||""))}_buildAnchorCache(){let e=[],n=[],r=[],i=[],s,a,o,c;for(s=0,a=this.source.length;s<a;s++)o=this.source.charAt(s),e[s]=o,n[s]=o,r[s]=o,i[s]=o,o==="\\"&&s+1<a&&(c=this.source.charAt(s+1),c==="A"?(e[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",i[s+1]="A"):c==="G"?(e[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",i[s+1]="G"):(e[s+1]=c,n[s+1]=c,r[s+1]=c,i[s+1]=c),s++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},lr=class{constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new hu(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new hu(t,r,this._items.map(i=>i.ruleId))}},hu=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
1
|
+
import{a as Ke,b as fm,c as wt,d as eu,e as tu,g as nu,n as ru,q as iu,u as si,v as su}from"./chunk-2KQWLCLT.mjs";var Bp=Ke(()=>{});var Up=Ke(()=>{});var qp=Ke(()=>{});var Vp=Ke((DT,Hp)=>{"use strict";Hp.exports=function(e,n){if(n=n.split(":")[0],e=+e,!e)return!1;switch(n){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var Kp=Ke(hc=>{"use strict";var Ev=Object.prototype.hasOwnProperty,Zv;function Gp(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Wp(t){try{return encodeURIComponent(t)}catch{return null}}function Rv(t){for(var e=/([^=?#&]+)=?([^&]*)/g,n={},r;r=e.exec(t);){var i=Gp(r[1]),s=Gp(r[2]);i===null||s===null||i in n||(n[i]=s)}return n}function jv(t,e){e=e||"";var n=[],r,i;typeof e!="string"&&(e="?");for(i in t)if(Ev.call(t,i)){if(r=t[i],!r&&(r===null||r===Zv||isNaN(r))&&(r=""),i=Wp(i),r=Wp(r),i===null||r===null)continue;n.push(i+"="+r)}return n.length?e+n.join("&"):""}hc.stringify=jv;hc.parse=Rv});var rd=Ke((LT,nd)=>{"use strict";var Xp=Vp(),eo=Kp(),Tv=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Qp=/[\n\r\t]/g,Iv=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Yp=/:\d+$/,Pv=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Ov=/^[a-zA-Z]:/;function bc(t){return(t||"").toString().replace(Tv,"")}var gc=[["#","hash"],["?","query"],function(e,n){return bt(n.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Jp={hash:1,query:1};function ed(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var n=e.location||{};t=t||n;var r={},i=typeof t,s;if(t.protocol==="blob:")r=new yt(unescape(t.pathname),{});else if(i==="string"){r=new yt(t,{});for(s in Jp)delete r[s]}else if(i==="object"){for(s in t)s in Jp||(r[s]=t[s]);r.slashes===void 0&&(r.slashes=Iv.test(t.href))}return r}function bt(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function td(t,e){t=bc(t),t=t.replace(Qp,""),e=e||{};var n=Pv.exec(t),r=n[1]?n[1].toLowerCase():"",i=!!n[2],s=!!n[3],a=0,o;return i?s?(o=n[2]+n[3]+n[4],a=n[2].length+n[3].length):(o=n[2]+n[4],a=n[2].length):s?(o=n[3]+n[4],a=n[3].length):o=n[4],r==="file:"?a>=2&&(o=o.slice(2)):bt(r)?o=n[4]:r?i&&(o=o.slice(2)):a>=2&&bt(e.protocol)&&(o=n[4]),{protocol:r,slashes:i||bt(r),slashesCount:a,rest:o}}function Bv(t,e){if(t==="")return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,i=n[r-1],s=!1,a=0;r--;)n[r]==="."?n.splice(r,1):n[r]===".."?(n.splice(r,1),a++):a&&(r===0&&(s=!0),n.splice(r,1),a--);return s&&n.unshift(""),(i==="."||i==="..")&&n.push(""),n.join("/")}function yt(t,e,n){if(t=bc(t),t=t.replace(Qp,""),!(this instanceof yt))return new yt(t,e,n);var r,i,s,a,o,c,u=gc.slice(),l=typeof e,p=this,m=0;for(l!=="object"&&l!=="string"&&(n=e,e=null),n&&typeof n!="function"&&(n=eo.parse),e=ed(e),i=td(t||"",e),r=!i.protocol&&!i.slashes,p.slashes=i.slashes||r&&e.slashes,p.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||Ov.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!bt(p.protocol)))&&(u[3]=[/(.*)/,"pathname"]);m<u.length;m++){if(a=u[m],typeof a=="function"){t=a(t,p);continue}s=a[0],c=a[1],s!==s?p[c]=t:typeof s=="string"?(o=s==="@"?t.lastIndexOf(s):t.indexOf(s),~o&&(typeof a[2]=="number"?(p[c]=t.slice(0,o),t=t.slice(o+a[2])):(p[c]=t.slice(o),t=t.slice(0,o)))):(o=s.exec(t))&&(p[c]=o[1],t=t.slice(0,o.index)),p[c]=p[c]||r&&a[3]&&e[c]||"",a[4]&&(p[c]=p[c].toLowerCase())}n&&(p.query=n(p.query)),r&&e.slashes&&p.pathname.charAt(0)!=="/"&&(p.pathname!==""||e.pathname!=="")&&(p.pathname=Bv(p.pathname,e.pathname)),p.pathname.charAt(0)!=="/"&&bt(p.protocol)&&(p.pathname="/"+p.pathname),Xp(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(o=p.auth.indexOf(":"),~o?(p.username=p.auth.slice(0,o),p.username=encodeURIComponent(decodeURIComponent(p.username)),p.password=p.auth.slice(o+1),p.password=encodeURIComponent(decodeURIComponent(p.password))):p.username=encodeURIComponent(decodeURIComponent(p.auth)),p.auth=p.password?p.username+":"+p.password:p.username),p.origin=p.protocol!=="file:"&&bt(p.protocol)&&p.host?p.protocol+"//"+p.host:"null",p.href=p.toString()}function Dv(t,e,n){var r=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(n||eo.parse)(e)),r[t]=e;break;case"port":r[t]=e,Xp(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[t]="");break;case"hostname":r[t]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[t]=e,Yp.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";r[t]=e.charAt(0)!==i?i+e:e}else r[t]=e;break;case"username":case"password":r[t]=encodeURIComponent(e);break;case"auth":var s=e.indexOf(":");~s?(r.username=e.slice(0,s),r.username=encodeURIComponent(decodeURIComponent(r.username)),r.password=e.slice(s+1),r.password=encodeURIComponent(decodeURIComponent(r.password))):r.username=encodeURIComponent(decodeURIComponent(e))}for(var a=0;a<gc.length;a++){var o=gc[a];o[4]&&(r[o[1]]=r[o[1]].toLowerCase())}return r.auth=r.password?r.username+":"+r.password:r.username,r.origin=r.protocol!=="file:"&&bt(r.protocol)&&r.host?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function Mv(t){(!t||typeof t!="function")&&(t=eo.stringify);var e,n=this,r=n.host,i=n.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var s=i+(n.protocol&&n.slashes||bt(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):n.protocol!=="file:"&&bt(n.protocol)&&!r&&n.pathname!=="/"&&(s+="@"),(r[r.length-1]===":"||Yp.test(n.hostname)&&!n.port)&&(r+=":"),s+=r+n.pathname,e=typeof n.query=="object"?t(n.query):n.query,e&&(s+=e.charAt(0)!=="?"?"?"+e:e),n.hash&&(s+=n.hash),s}yt.prototype={set:Dv,toString:Mv};yt.extractProtocol=td;yt.location=ed;yt.trimLeft=bc;yt.qs=eo;nd.exports=yt});var id=Ke(()=>{});var sd=Ke(()=>{});var od=Ke(()=>{});var ad=Ke(()=>{});var cd=Ke(()=>{});import{Components as yv}from"botframework-webchat-component";import oc from"prop-types";import Rp from"react";import{singleToArray as Ep,warnOnce as fv}from"botframework-webchat-core";import Zp,{memo as hv}from"react";import*as bm from"adaptivecards";import ym,{useMemo as ou}from"react";import{createContext as hm}from"react";var gm=hm(void 0),oi=gm;var vm=({adaptiveCardsHostConfig:t,adaptiveCardsPackage:e,children:n})=>{let r=ou(()=>e||bm,[e]),i=ou(()=>({adaptiveCardsPackage:r,hostConfigFromProps:t}),[t,r]);return ym.createElement(oi.Provider,{value:i},n)},au=vm;import{CodeHighlighterComposer as qg}from"botframework-webchat-component/internal";import Hg,{memo as Vg,useEffect as Gg,useState as Wg}from"react";var ct=class extends Error{constructor(e){super(e),this.name="ShikiError"}};var ir=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Am(){return 2147483648}function _m(){return typeof performance<"u"?performance.now():Date.now()}var wm=(t,e)=>t+(e-t%e)%e;async function Cm(t){let e,n,r={};function i(d){n=d,r.HEAPU8=new Uint8Array(d),r.HEAPU32=new Uint32Array(d)}function s(d,h,f){r.HEAPU8.copyWithin(d,h,h+f)}function a(d){try{return e.grow(d-n.byteLength+65535>>>16),i(e.buffer),1}catch{}}function o(d){let h=r.HEAPU8.length;d=d>>>0;let f=Am();if(d>f)return!1;for(let g=1;g<=4;g*=2){let b=h*(1+.2/g);b=Math.min(b,d+100663296);let y=Math.min(f,wm(Math.max(d,b),65536));if(a(y))return!0}return!1}let c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(d,h,f=1024){let g=h+f,b=h;for(;d[b]&&!(b>=g);)++b;if(b-h>16&&d.buffer&&c)return c.decode(d.subarray(h,b));let y="";for(;h<b;){let w=d[h++];if(!(w&128)){y+=String.fromCharCode(w);continue}let C=d[h++]&63;if((w&224)===192){y+=String.fromCharCode((w&31)<<6|C);continue}let x=d[h++]&63;if((w&240)===224?w=(w&15)<<12|C<<6|x:w=(w&7)<<18|C<<12|x<<6|d[h++]&63,w<65536)y+=String.fromCharCode(w);else{let v=w-65536;y+=String.fromCharCode(55296|v>>10,56320|v&1023)}}return y}function l(d,h){return d?u(r.HEAPU8,d,h):""}let p={emscripten_get_now:_m,emscripten_memcpy_big:s,emscripten_resize_heap:o,fd_write:()=>0};async function m(){let h=await t({env:p,wasi_snapshot_preview1:p});e=h.memory,i(e.buffer),Object.assign(r,h),r.UTF8ToString=l}return await m(),r}var le=null;function xm(t){throw new ir(t.UTF8ToString(t.getLastOnigError()))}var ci=class t{static _utf8ByteLength(e){let n=0;for(let r=0,i=e.length;r<i;r++){let s=e.charCodeAt(r),a=s,o=!1;if(s>=55296&&s<=56319&&r+1<i){let c=e.charCodeAt(r+1);c>=56320&&c<=57343&&(a=(s-55296<<10)+65536|c-56320,o=!0)}a<=127?n+=1:a<=2047?n+=2:a<=65535?n+=3:n+=4,o&&r++}return n}utf16Length;utf8Length;utf16Value;utf8Value;utf16OffsetToUtf8;utf8OffsetToUtf16;constructor(e){let n=e.length,r=t._utf8ByteLength(e),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);let a=i?new Uint32Array(r+1):null;i&&(a[r]=n);let o=new Uint8Array(r),c=0;for(let u=0;u<n;u++){let l=e.charCodeAt(u),p=l,m=!1;if(l>=55296&&l<=56319&&u+1<n){let d=e.charCodeAt(u+1);d>=56320&&d<=57343&&(p=(l-55296<<10)+65536|d-56320,m=!0)}i&&(s[u]=c,m&&(s[u+1]=c),p<=127?a[c+0]=u:p<=2047?(a[c+0]=u,a[c+1]=u):p<=65535?(a[c+0]=u,a[c+1]=u,a[c+2]=u):(a[c+0]=u,a[c+1]=u,a[c+2]=u,a[c+3]=u)),p<=127?o[c++]=p:p<=2047?(o[c++]=192|(p&1984)>>>6,o[c++]=128|(p&63)>>>0):p<=65535?(o[c++]=224|(p&61440)>>>12,o[c++]=128|(p&4032)>>>6,o[c++]=128|(p&63)>>>0):(o[c++]=240|(p&1835008)>>>18,o[c++]=128|(p&258048)>>>12,o[c++]=128|(p&4032)>>>6,o[c++]=128|(p&63)>>>0),m&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=a}createString(e){let n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}},ui=class t{static LAST_ID=0;static _sharedPtr=0;static _sharedPtrInUse=!1;id=++t.LAST_ID;_onigBinding;content;utf16Length;utf8Length;utf16OffsetToUtf8;utf8OffsetToUtf16;ptr;constructor(e){if(!le)throw new ir("Must invoke loadWasm first.");this._onigBinding=le,this.content=e;let n=new ci(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!t._sharedPtrInUse?(t._sharedPtr||(t._sharedPtr=le.omalloc(1e4)),t._sharedPtrInUse=!0,le.HEAPU8.set(n.utf8Value,t._sharedPtr),this.ptr=t._sharedPtr):this.ptr=n.createString(le)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===t._sharedPtr?t._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}},po=class{_onigBinding;_ptr;constructor(e){if(!le)throw new ir("Must invoke loadWasm first.");let n=[],r=[];for(let o=0,c=e.length;o<c;o++){let u=new ci(e[o]);n[o]=u.createString(le),r[o]=u.utf8Length}let i=le.omalloc(4*e.length);le.HEAPU32.set(n,i/4);let s=le.omalloc(4*e.length);le.HEAPU32.set(r,s/4);let a=le.createOnigScanner(i,s,e.length);for(let o=0,c=e.length;o<c;o++)le.ofree(n[o]);le.ofree(s),le.ofree(i),a===0&&xm(le),this._onigBinding=le,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof e=="string"){e=new ui(e);let s=this._findNextMatchSync(e,n,!1,i);return e.dispose(),s}return this._findNextMatchSync(e,n,!1,i)}_findNextMatchSync(e,n,r,i){let s=this._onigBinding,a=s.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),i);if(a===0)return null;let o=s.HEAPU32,c=a/4,u=o[c++],l=o[c++],p=[];for(let m=0;m<l;m++){let d=e.convertUtf8OffsetToUtf16(o[c++]),h=e.convertUtf8OffsetToUtf16(o[c++]);p[m]={start:d,end:h,length:h-d}}return{index:u,captureIndices:p}}};function Sm(t){return typeof t.instantiator=="function"}function km(t){return typeof t.default=="function"}function $m(t){return typeof t.data<"u"}function zm(t){return typeof Response<"u"&&t instanceof Response}function Em(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}var ai;function cu(t){if(ai)return ai;async function e(){le=await Cm(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Sm(r)?r=await r.instantiator(n):km(r)?r=await r.default(n):($m(r)&&(r=r.data),zm(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Zm(r)(n):r=await Rm(r)(n):Em(r)?r=await lo(r)(n):r instanceof WebAssembly.Module?r=await lo(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await lo(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return ai=e(),ai}function lo(t){return e=>WebAssembly.instantiate(t,e)}function Zm(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Rm(t){return async e=>{let n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}var jm;function uu(){return jm}async function lu(t){return t&&await cu(t),{createScanner(e){return new po(e)},createString(e){return new ui(e)}}}var Tm=!1;function mo(t){Tm&&console.trace(`[SHIKI DEPRECATE]: ${t}`)}function Im(t){return xo(t)}function xo(t){return Array.isArray(t)?Pm(t):typeof t=="object"?Om(t):t}function Pm(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=xo(t[n]);return e}function Om(t){let e={};for(let n in t)e[n]=xo(t[n]);return e}function vu(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Au(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Au(t.substring(0,t.length-1)):t.substr(~e+1)}var fo=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,li=class{static hasCaptures(t){return t===null?!1:(fo.lastIndex=0,fo.test(t))}static replaceCaptures(t,e,n){return t.replace(fo,(r,i,s,a)=>{let o=n[parseInt(i||s,10)];if(o){let c=e.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(a){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function _u(t,e){return t<e?-1:t>e?1:0}function wu(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;i<n;i++){let s=_u(t[i],e[i]);if(s!==0)return s}return 0}return n-r}function pu(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Cu(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var xu=class{constructor(t){this.fn=t,this.cache=new Map}get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},ar=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n,this._cachedMatchRoot=new xu(r=>this._root.match(r))}static createFromRawTheme(t,e){return this.createFromParsedTheme(Mm(t),e)}static createFromParsedTheme(t,e){return Nm(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>Bm(t.parent,i.parentScopes));return r?new Su(r.fontStyle,r.foreground,r.background):null}},ho=class pi{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(let r of n)e=new pi(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new pi(n,e[r]);return n}push(e){return new pi(this,e)}getSegments(){let e=this,n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let n=[],r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Bm(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!Dm(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Dm(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Su=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Mm(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,s=e.length;i<s;i++){let a=e[i];if(!a.settings)continue;let o;if(typeof a.scope=="string"){let p=a.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),o=p.split(",")}else Array.isArray(a.scope)?o=a.scope:o=[""];let c=-1;if(typeof a.settings.fontStyle=="string"){c=0;let p=a.settings.fontStyle.split(" ");for(let m=0,d=p.length;m<d;m++)switch(p[m]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let u=null;typeof a.settings.foreground=="string"&&pu(a.settings.foreground)&&(u=a.settings.foreground);let l=null;typeof a.settings.background=="string"&&pu(a.settings.background)&&(l=a.settings.background);for(let p=0,m=o.length;p<m;p++){let h=o[p].trim().split(" "),f=h[h.length-1],g=null;h.length>1&&(g=h.slice(0,h.length-1),g.reverse()),n[r++]=new Lm(f,g,i,c,u,l)}}return n}var Lm=class{constructor(t,e,n,r,i,s){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Je=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Je||{});function Nm(t,e){t.sort((c,u)=>{let l=_u(c.scope,u.scope);return l!==0||(l=wu(c.parentScopes,u.parentScopes),l!==0)?l:c.index-u.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(i=c.background)}let s=new Fm(e),a=new Su(n,s.getId(r),s.getId(i)),o=new qm(new go(0,null,-1,0,0),[]);for(let c=0,u=t.length;c<u;c++){let l=t[c];o.insert(0,l.scope,l.parentScopes,l.fontStyle,s.getId(l.foreground),s.getId(l.background))}return new ar(s,a,o)}var Fm=class{constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Um=Object.freeze([]),go=class ku{constructor(e,n,r,i,s){this.scopeDepth=e,this.parentScopes=n||Um,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new ku(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,i=e.length;r<i;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},qm=class bo{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){let s=n.parentScopes[i].length-e.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,s;if(r===-1?(i=e,s=""):(i=e.substring(0,r),s=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(bo._cmpBySpecificity),n}insert(e,n,r,i,s,a){if(n===""){this._doInsertHere(e,r,i,s,a);return}let o=n.indexOf("."),c,u;o===-1?(c=n,u=""):(c=n.substring(0,o),u=n.substring(o+1));let l;this._children.hasOwnProperty(c)?l=this._children[c]:(l=new bo(this._mainRule.clone(),go.cloneArr(this._rulesWithParentScopes)),this._children[c]=l),l.insert(e+1,u,r,i,s,a)}_doInsertHere(e,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(e,r,i,s);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let c=this._rulesWithParentScopes[a];if(wu(c.parentScopes,n)===0){c.acceptOverwrite(e,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new go(e,n,r,i,s))}},Dt=class Me{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let n=Me.getLanguageId(e),r=Me.getTokenType(e),i=Me.getFontStyle(e),s=Me.getForeground(e),a=Me.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,s,a,o){let c=Me.getLanguageId(e),u=Me.getTokenType(e),l=Me.containsBalancedBrackets(e)?1:0,p=Me.getFontStyle(e),m=Me.getForeground(e),d=Me.getBackground(e);return n!==0&&(c=n),r!==8&&(u=r),i!==null&&(l=i?1:0),s!==-1&&(p=s),a!==0&&(m=a),o!==0&&(d=o),(c<<0|u<<8|l<<10|p<<11|m<<15|d<<24)>>>0}};function mi(t,e){let n=[],r=Hm(t),i=r.next();for(;i!==null;){let c=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=a();if(n.push({matcher:u,priority:c}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();let c=s();return u=>!!c&&!c(u)}if(i==="("){i=r.next();let c=o();return i===")"&&(i=r.next()),c}if(du(i)){let c=[];do c.push(i),i=r.next();while(du(i));return u=>e(c,u)}return null}function a(){let c=[],u=s();for(;u;)c.push(u),u=s();return l=>c.every(p=>p(l))}function o(){let c=[],u=a();for(;u&&(c.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=a()}return l=>c.some(p=>p(l))}}function du(t){return!!t&&!!t.match(/[\w\.:]+/)}function Hm(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;let r=n[0];return n=e.exec(t),r}}}function $u(t){typeof t.dispose=="function"&&t.dispose()}var cr=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Vm=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Gm=class{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(t){let e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Wm=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new cr(this.initialScopeName)]}processQueue(){let t=this.Q;this.Q=[];let e=new Gm;for(let n of t)Km(n,this.initialScopeName,this.repo,e);for(let n of e.references)if(n instanceof cr){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Km(t,e,n,r){let i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}let s=n.lookup(e);t instanceof cr?di({baseGrammar:s,selfGrammar:i},r):yo(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);let a=n.injections(t.scopeName);if(a)for(let o of a)r.add(new cr(o))}function yo(t,e,n){if(e.repository&&e.repository[t]){let r=e.repository[t];fi([r],e,n)}}function di(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&fi(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&fi(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function fi(t,e,n){for(let r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let i=r.repository?vu({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&fi(r.patterns,{...e,repository:i},n);let s=r.include;if(!s)continue;let a=zu(s);switch(a.kind){case 0:di({...e,selfGrammar:e.baseGrammar},n);break;case 1:di(e,n);break;case 2:yo(a.ruleName,{...e,repository:i},n);break;case 3:case 4:let o=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(o){let c={baseGrammar:e.baseGrammar,selfGrammar:o,repository:i};a.kind===4?yo(a.ruleName,c,n):di(c,n)}else a.kind===4?n.add(new Vm(a.scopeName,a.ruleName)):n.add(new cr(a.scopeName));break}}}var Jm=class{constructor(){this.kind=0}},Xm=class{constructor(){this.kind=1}},Qm=class{constructor(t){this.ruleName=t,this.kind=2}},Ym=class{constructor(t){this.scopeName=t,this.kind=3}},ef=class{constructor(t,e){this.scopeName=t,this.ruleName=e,this.kind=4}};function zu(t){if(t==="$base")return new Jm;if(t==="$self")return new Xm;let e=t.indexOf("#");if(e===-1)return new Ym(t);if(e===0)return new Qm(t.substring(1));{let n=t.substring(0,e),r=t.substring(e+1);return new ef(n,r)}}var tf=/\\(\d+)/,mu=/\\(\d+)/g,E0=Symbol("RuleId"),nf=-1,Eu=-2;var pr=class{constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=li.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=li.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${Au(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:li.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:li.replaceCaptures(this._contentName,t,e)}},rf=class extends pr{constructor(t,e,n,r,i){super(t,e,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},sf=class extends pr{constructor(t,e,n,r,i){super(t,e,n,null),this._match=new ur(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new lr,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},fu=class extends pr{constructor(t,e,n,r,i){super(t,e,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(let n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new lr,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vo=class extends pr{constructor(t,e,n,r,i,s,a,o,c,u){super(t,e,n,r),this._begin=new ur(i,this.id),this.beginCaptures=s,this._end=new ur(a||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new lr;for(let n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},hi=class extends pr{constructor(t,e,n,r,i,s,a,o,c){super(t,e,n,r),this._begin=new ur(i,this.id),this.beginCaptures=s,this.whileCaptures=o,this._while=new ur(a,Eu),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new lr;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new lr,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"\uFFFF"),this._cachedCompiledWhilePatterns}},Zu=class ve{static createCaptureRule(e,n,r,i,s){return e.registerRule(a=>new rf(n,a,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new sf(e.$vscodeTextmateLocation,e.id,e.name,e.match,ve._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=vu({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new fu(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,ve._compilePatterns(s,n,r))}return e.while?new hi(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ve._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,ve._compileCaptures(e.whileCaptures||e.captures,n,r),ve._compilePatterns(e.patterns,n,r)):new vo(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ve._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,ve._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,ve._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(let a in e){if(a==="$vscodeTextmateLocation")continue;let o=parseInt(a,10);o>s&&(s=o)}for(let a=0;a<=s;a++)i[a]=null;for(let a in e){if(a==="$vscodeTextmateLocation")continue;let o=parseInt(a,10),c=0;e[a].patterns&&(c=ve.getCompiledRuleId(e[a],n,r)),i[o]=ve.createCaptureRule(n,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,c)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,a=e.length;s<a;s++){let o=e[s],c=-1;if(o.include){let u=zu(o.include);switch(u.kind){case 0:case 1:c=ve.getCompiledRuleId(r[o.include],n,r);break;case 2:let l=r[u.ruleName];l&&(c=ve.getCompiledRuleId(l,n,r));break;case 3:case 4:let p=u.scopeName,m=u.kind===4?u.ruleName:null,d=n.getExternalGrammar(p,r);if(d)if(m){let h=d.repository[m];h&&(c=ve.getCompiledRuleId(h,n,d.repository))}else c=ve.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=ve.getCompiledRuleId(o,n,r);if(c!==-1){let u=n.getRule(c),l=!1;if((u instanceof fu||u instanceof vo||u instanceof hi)&&u.hasMissingPatterns&&u.patterns.length===0&&(l=!0),l)continue;i.push(c)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},ur=class Ru{constructor(e,n){if(e){let r=e.length,i=0,s=[],a=!1;for(let o=0;o<r;o++)if(e.charAt(o)==="\\"&&o+1<r){let u=e.charAt(o+1);u==="z"?(s.push(e.substring(i,o)),s.push("$(?!\\n)(?<!\\n)"),i=o+2):(u==="A"||u==="G")&&(a=!0),o++}this.hasAnchor=a,i===0?this.source=e:(s.push(e.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=tf.test(this.source)}clone(){return new Ru(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){let r=n.map(i=>e.substring(i.start,i.end));return mu.lastIndex=0,this.source.replace(mu,(i,s)=>Cu(r[parseInt(s,10)]||""))}_buildAnchorCache(){let e=[],n=[],r=[],i=[],s,a,o,c;for(s=0,a=this.source.length;s<a;s++)o=this.source.charAt(s),e[s]=o,n[s]=o,r[s]=o,i[s]=o,o==="\\"&&s+1<a&&(c=this.source.charAt(s+1),c==="A"?(e[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",i[s+1]="A"):c==="G"?(e[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",i[s+1]="G"):(e[s+1]=c,n[s+1]=c,r[s+1]=c,i[s+1]=c),s++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},lr=class{constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new hu(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new hu(t,r,this._items.map(i=>i.ruleId))}},hu=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
2
|
`)}findNextMatchSync(t,e,n){let r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ao=class{constructor(t,e){this.languageId=t,this.tokenType=e}},So=class _o{constructor(e,n){this._getBasicScopeAttributes=new xu(r=>{let i=this._scopeToLanguage(r),s=this._toStandardTokenType(r);return new Ao(i,s)}),this._defaultAttributes=new Ao(e,8),this._embeddedLanguagesMatcher=new af(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?_o._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){let n=e.match(_o.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}};So._NULL_SCOPE_METADATA=new Ao(0,0);So.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;var of=So,af=class{constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);let e=t.map(([n,r])=>Cu(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;let e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Z0={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},ju=!1,gu=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Tu(t,e,n,r,i,s,a,o){let c=e.content.length,u=!1,l=-1;if(a){let d=cf(t,e,n,r,i,s);i=d.stack,r=d.linePos,n=d.isFirstLine,l=d.anchorPosition}let p=Date.now();for(;!u;){if(o!==0&&Date.now()-p>o)return new gu(i,!0);m()}return new gu(i,!1);function m(){let d=uf(t,e,n,r,i,l);if(!d){s.produce(i,c),u=!0;return}let h=d.captureIndices,f=d.matchedRuleId,g=h&&h.length>0?h[0].end>r:!1;if(f===nf){let b=i.getRule(t);s.produce(i,h[0].start),i=i.withContentNameScopesList(i.nameScopesList),sr(t,e,n,i,s,b.endCaptures,h),s.produce(i,h[0].end);let y=i;if(i=i.parent,l=y.getAnchorPos(),!g&&y.getEnterPos()===r){i=y,s.produce(i,c),u=!0;return}}else{let b=t.getRule(f);s.produce(i,h[0].start);let y=i,w=b.getName(e.content,h),C=i.contentNameScopesList.pushAttributed(w,t);if(i=i.push(f,r,l,h[0].end===c,null,C,C),b instanceof vo){let x=b;sr(t,e,n,i,s,x.beginCaptures,h),s.produce(i,h[0].end),l=h[0].end;let v=x.getContentName(e.content,h),S=C.pushAttributed(v,t);if(i=i.withContentNameScopesList(S),x.endHasBackReferences&&(i=i.withEndRule(x.getEndWithResolvedBackReferences(e.content,h))),!g&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,c),u=!0;return}}else if(b instanceof hi){let x=b;sr(t,e,n,i,s,x.beginCaptures,h),s.produce(i,h[0].end),l=h[0].end;let v=x.getContentName(e.content,h),S=C.pushAttributed(v,t);if(i=i.withContentNameScopesList(S),x.whileHasBackReferences&&(i=i.withEndRule(x.getWhileWithResolvedBackReferences(e.content,h))),!g&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,c),u=!0;return}}else if(sr(t,e,n,i,s,b.captures,h),s.produce(i,h[0].end),i=i.pop(),!g){i=i.safePop(),s.produce(i,c),u=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function cf(t,e,n,r,i,s){let a=i.beginRuleCapturedEOL?0:-1,o=[];for(let c=i;c;c=c.pop()){let u=c.getRule(t);u instanceof hi&&o.push({rule:u,stack:c})}for(let c=o.pop();c;c=o.pop()){let{ruleScanner:u,findOptions:l}=df(c.rule,t,c.stack.endRule,n,r===a),p=u.findNextMatchSync(e,r,l);if(p){if(p.ruleId!==Eu){i=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(s.produce(c.stack,p.captureIndices[0].start),sr(t,e,n,c.stack,s,c.rule.whileCaptures,p.captureIndices),s.produce(c.stack,p.captureIndices[0].end),a=p.captureIndices[0].end,p.captureIndices[0].end>r&&(r=p.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:a,isFirstLine:n}}function uf(t,e,n,r,i,s){let a=lf(t,e,n,r,i,s),o=t.getInjections();if(o.length===0)return a;let c=pf(o,t,e,n,r,i,s);if(!c)return a;if(!a)return c;let u=a.captureIndices[0].start,l=c.captureIndices[0].start;return l<u||c.priorityMatch&&l===u?c:a}function lf(t,e,n,r,i,s){let a=i.getRule(t),{ruleScanner:o,findOptions:c}=Iu(a,t,i.endRule,n,r===s),u=o.findNextMatchSync(e,r,c);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function pf(t,e,n,r,i,s,a){let o=Number.MAX_VALUE,c=null,u,l=0,p=s.contentNameScopesList.getScopeNames();for(let m=0,d=t.length;m<d;m++){let h=t[m];if(!h.matcher(p))continue;let f=e.getRule(h.ruleId),{ruleScanner:g,findOptions:b}=Iu(f,e,null,r,i===a),y=g.findNextMatchSync(n,i,b);if(!y)continue;let w=y.captureIndices[0].start;if(!(w>=o)&&(o=w,c=y.captureIndices,u=y.ruleId,l=h.priority,o===i))break}return c?{priorityMatch:l===-1,captureIndices:c,matchedRuleId:u}:null}function Iu(t,e,n,r,i){if(ju){let a=t.compile(e,n),o=Pu(r,i);return{ruleScanner:a,findOptions:o}}return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}function df(t,e,n,r,i){if(ju){let a=t.compileWhile(e,n),o=Pu(r,i);return{ruleScanner:a,findOptions:o}}return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}function Pu(t,e){let n=0;return t||(n|=1),e||(n|=4),n}function sr(t,e,n,r,i,s,a){if(s.length===0)return;let o=e.content,c=Math.min(s.length,a.length),u=[],l=a[0].end;for(let p=0;p<c;p++){let m=s[p];if(m===null)continue;let d=a[p];if(d.length===0)continue;if(d.start>l)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,d.start):i.produce(r,d.start),m.retokenizeCapturedWithRuleId){let f=m.getName(o,a),g=r.contentNameScopesList.pushAttributed(f,t),b=m.getContentName(o,a),y=g.pushAttributed(b,t),w=r.push(m.retokenizeCapturedWithRuleId,d.start,-1,!1,null,g,y),C=t.createOnigString(o.substring(0,d.end));Tu(t,C,n&&d.start===0,d.start,w,i,!1,0),$u(C);continue}let h=m.getName(o,a);if(h!==null){let g=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(h,t);u.push(new mf(g,d.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var mf=class{constructor(t,e){this.scopes=t,this.endPos=e}};function ff(t,e,n,r,i,s,a,o){return new gf(t,e,n,r,i,s,a,o)}function bu(t,e,n,r,i){let s=mi(e,gi),a=Zu.getCompiledRuleId(n,r,i.repository);for(let o of s)t.push({debugSelector:e,matcher:o.matcher,ruleId:a,grammar:i,priority:o.priority})}function gi(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let i=n;i<e.length;i++)if(hf(e[i],r))return n=i+1,!0;return!1})}function hf(t,e){if(!t)return!1;if(t===e)return!0;let n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var gf=class{constructor(t,e,n,r,i,s,a,o){if(this._rootScopeName=t,this.balancedBracketSelectors=s,this._onigLib=o,this._basicScopeAttributesProvider=new of(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=yu(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let c of Object.keys(i)){let u=mi(c,gi);for(let l of u)this._tokenTypeMatchers.push({matcher:l.matcher,type:i[c]})}}get themeProvider(){return this._grammarRepository}dispose(){for(let t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){let t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){let i=r.injections;if(i)for(let a in i)bu(e,a,i[a],this,r);let s=this._grammarRepository.injections(n);s&&s.forEach(a=>{let o=this.getExternalGrammar(a);if(o){let c=o.injectionSelector;c&&bu(e,c,o,this,o)}})}return e.sort((i,s)=>i.priority-s.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){let e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){let n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=yu(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){let r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){let r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Zu.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===Co.NULL){i=!0;let u=this._basicScopeAttributesProvider.getDefaultAttributes(),l=this.themeProvider.getDefaults(),p=Dt.set(0,u.languageId,u.tokenType,null,l.fontStyle,l.foregroundId,l.backgroundId),m=this.getRule(this._rootId).getName(null,null),d;m?d=or.createRootAndLookUpScopeName(m,p,this):d=or.createRoot("unknown",p),e=new Co(null,this._rootId,-1,-1,!1,null,d,d)}else i=!1,e.reset();t=t+`
|
|
3
3
|
`;let s=this.createOnigString(t),a=s.content.length,o=new yf(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Tu(this,s,i,0,e,o,!0,r);return $u(s),{lineLength:a,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function yu(t,e){return t=Im(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var or=class ut{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,i=e?.scopePath??null;for(let s of n)i=ho.push(i,s.scopeNames),r=new ut(r,i,s.encodedTokenAttributes);return r}static createRoot(e,n){return new ut(null,new ho(null,e),n)}static createRootAndLookUpScopeName(e,n,r){let i=r.getMetadataForScope(e),s=new ho(null,e),a=r.themeProvider.themeMatch(s),o=ut.mergeAttributes(n,i,a);return new ut(null,s,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return ut.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let i=-1,s=0,a=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,a=r.backgroundId),Dt.set(e,n.languageId,n.tokenType,null,i,s,a)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return ut._pushAttributed(this,e,n);let r=e.split(/ /g),i=this;for(let s of r)i=ut._pushAttributed(i,s,n);return i}static _pushAttributed(e,n,r){let i=r.getMetadataForScope(n),s=e.scopePath.push(n),a=r.themeProvider.themeMatch(s),o=ut.mergeAttributes(e.tokenAttributes,i,a);return new ut(e,s,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let n=[],r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},wo=class En{constructor(e,n,r,i,s,a,o,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=c,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(e){return e===null?!1:En._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?or.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){En._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,s,a,o){return new En(this,e,n,r,i,s,a,o)}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,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new En(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){let r=or.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new En(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,or.fromExtension(r,n.contentNameScopesList))}};wo.NULL=new wo(null,0,0,0,!1,null,null,null);var Co=wo,bf=class{constructor(t,e){this.allowAny=!1,this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):mi(n,gi).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>mi(n,gi).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(let e of this.unbalancedBracketScopes)if(e(t))return!1;for(let e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},yf=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let s=t?.getScopeNames()??[];for(let a of this._tokenTypeOverrides)a.matcher(s)&&(r=Dt.set(r,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=Dt.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}let n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},vf=class{constructor(t,e){this._onigLib=e,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=t}dispose(){for(let t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,i){if(!this._grammars.has(t)){let s=this._rawGrammars.get(t);if(!s)return null;this._grammars.set(t,ff(t,s,e,n,r,i,this,this._onigLib))}return this._grammars.get(t)}},Ou=class{constructor(t){this._options=t,this._syncRegistry=new vf(ar.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(ar.createFromRawTheme(t,e))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,e,n){return this.loadGrammarWithConfiguration(t,e,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,e,n){return this._loadGrammar(t,e,n.embeddedLanguages,n.tokenTypes,new bf(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,n,r,i){let s=new Wm(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,e,n,r,i)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){let e=this._options.loadGrammar(t);if(e){let n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,n)}}addGrammar(t,e=[],n=0,r=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,n,r)}_grammarForScopeName(t,e=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(t,e,n,r,i)}},bi=Co.NULL;var Bu=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Ct=class{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}};Ct.prototype.property={};Ct.prototype.normal={};Ct.prototype.space=null;function ko(t,e){let n={},r={},i=-1;for(;++i<t.length;)Object.assign(n,t[i].property),Object.assign(r,t[i].normal);return new Ct(n,r,e)}function dr(t){return t.toLowerCase()}var Ae=class{constructor(e,n){this.property=e,this.attribute=n}};Ae.prototype.space=null;Ae.prototype.boolean=!1;Ae.prototype.booleanish=!1;Ae.prototype.overloadedBoolean=!1;Ae.prototype.number=!1;Ae.prototype.commaSeparated=!1;Ae.prototype.spaceSeparated=!1;Ae.prototype.commaOrSpaceSeparated=!1;Ae.prototype.mustUseProperty=!1;Ae.prototype.defined=!1;var mr={};fm(mr,{boolean:()=>$,booleanish:()=>V,commaOrSpaceSeparated:()=>xe,commaSeparated:()=>Mt,number:()=>A,overloadedBoolean:()=>$o,spaceSeparated:()=>P});var Af=0,$=an(),V=an(),$o=an(),A=an(),P=an(),Mt=an(),xe=an();function an(){return 2**++Af}var zo=Object.keys(mr),cn=class extends Ae{constructor(e,n,r,i){let s=-1;if(super(e,n),Du(this,"space",i),typeof r=="number")for(;++s<zo.length;){let a=zo[s];Du(this,zo[s],(r&mr[a])===mr[a])}}};cn.prototype.defined=!0;function Du(t,e,n){n&&(t[e]=n)}var _f={}.hasOwnProperty;function Le(t){let e={},n={},r;for(r in t.properties)if(_f.call(t.properties,r)){let i=t.properties[r],s=new cn(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[dr(r)]=r,n[dr(s.attribute)]=r}return new Ct(e,n,t.space)}var Eo=Le({space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});var Zo=Le({space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function yi(t,e){return e in t?t[e]:e}function vi(t,e){return yi(t,e.toLowerCase())}var Ro=Le({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:vi,properties:{xmlns:null,xmlnsXLink:null}});var jo=Le({transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:V,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:P,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:A,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:P,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:V,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null}});var Mu=Le({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:vi,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mt,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:$,allowPaymentRequest:$,allowUserMedia:$,alt:null,as:null,async:$,autoCapitalize:null,autoComplete:P,autoFocus:$,autoPlay:$,blocking:P,capture:null,charSet:null,checked:$,cite:null,className:P,cols:A,colSpan:null,content:null,contentEditable:V,controls:$,controlsList:P,coords:A|Mt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$,defer:$,dir:null,dirName:null,disabled:$,download:$o,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$,formTarget:null,headers:P,height:A,hidden:$,high:A,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:$,inputMode:null,integrity:null,is:null,isMap:$,itemId:null,itemProp:P,itemRef:P,itemScope:$,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:$,muted:$,name:null,nonce:null,noModule:$,noValidate:$,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$,optimum:A,pattern:null,ping:P,placeholder:null,playsInline:$,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$,referrerPolicy:null,rel:P,required:$,reversed:$,rows:A,rowSpan:A,sandbox:P,scope:null,scoped:$,seamless:$,selected:$,shadowRootClonable:$,shadowRootDelegatesFocus:$,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:$,useMap:null,value:V,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$,declare:$,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:$,noHref:$,noShade:$,noWrap:$,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$,disableRemotePlayback:$,prefix:null,property:null,results:A,security:null,unselectable:null}});var Lu=Le({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:yi,properties:{about:xe,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:$,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Mt,g2:Mt,glyphName:Mt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:xe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xe,rev:xe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xe,requiredFeatures:xe,requiredFonts:xe,requiredFormats:xe,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:xe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xe,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}});var wf=/^data[-\w.:]+$/i,Nu=/-[a-z]/g,Cf=/[A-Z]/g;function To(t,e){let n=dr(e),r=e,i=Ae;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wf.test(e)){if(e.charAt(4)==="-"){let s=e.slice(5).replace(Nu,Sf);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{let s=e.slice(4);if(!Nu.test(s)){let a=s.replace(Cf,xf);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=cn}return new i(r,e)}function xf(t){return"-"+t.toLowerCase()}function Sf(t){return t.charAt(1).toUpperCase()}var Fu=ko([Zo,Eo,Ro,jo,Mu],"html"),Ai=ko([Zo,Eo,Ro,jo,Lu],"svg");var Uu={}.hasOwnProperty;function qu(t,e){let n=e||{};function r(i,...s){let a=r.invalid,o=r.handlers;if(i&&Uu.call(i,t)){let c=String(i[t]);a=Uu.call(o,c)?o[c]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var kf=/["&'<>`]/g,$f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zf=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ef=/[|\\{}()[\]^$+*?.]/g,Hu=new WeakMap;function Vu(t,e){if(t=t.replace(e.subset?Zf(e.subset):kf,r),e.subset||e.escapeOnly)return t;return t.replace($f,n).replace(zf,r);function n(i,s,a){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),e)}function r(i,s,a){return e.format(i.charCodeAt(0),a.charCodeAt(s+1),e)}}function Zf(t){let e=Hu.get(t);return e||(e=Rf(t),Hu.set(t,e)),e}function Rf(t){let e=[],n=-1;for(;++n<t.length;)e.push(t[n].replace(Ef,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}var jf=/[\dA-Fa-f]/;function Gu(t,e,n){let r="&#x"+t.toString(16).toUpperCase();return n&&e&&!jf.test(String.fromCharCode(e))?r:r+";"}var Tf=/\d/;function Wu(t,e,n){let r="&#"+String(t);return n&&e&&!Tf.test(String.fromCharCode(e))?r:r+";"}var Ku=["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"];var _i={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Ju=["cent","copy","divide","gt","lt","not","para","times"];var Xu={}.hasOwnProperty,Io={},wi;for(wi in _i)Xu.call(_i,wi)&&(Io[_i[wi]]=wi);var If=/[^\dA-Za-z]/;function Qu(t,e,n,r){let i=String.fromCharCode(t);if(Xu.call(Io,i)){let s=Io[i],a="&"+s;return n&&Ku.includes(s)&&!Ju.includes(s)&&(!r||e&&e!==61&&If.test(String.fromCharCode(e)))?a:a+";"}return""}function Yu(t,e,n){let r=Gu(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Qu(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let s=Wu(t,e,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function xt(t,e){return Vu(t,Object.assign({format:Yu},e))}var Pf=/^>|^->|<!--|-->|--!>|<!-$/g,Of=[">"],Bf=["<",">"];function el(t,e,n,r){return r.settings.bogusComments?"<?"+xt(t.value,Object.assign({},r.settings.characterReferences,{subset:Of}))+">":"<!--"+t.value.replace(Pf,i)+"-->";function i(s){return xt(s,Object.assign({},r.settings.characterReferences,{subset:Bf}))}}function tl(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Po(t,e){let n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function nl(t,e){let n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function rl(t){return t.join(" ").trim()}var Df=/[ \t\n\f\r]/g;function un(t){return typeof t=="object"?t.type==="text"?il(t.value):!1:il(t)}function il(t){return t.replace(Df,"")===""}var Y=sl(1),Oo=sl(-1),Mf=[];function sl(t){return e;function e(n,r,i){let s=n?n.children:Mf,a=(r||0)+t,o=s[a];if(!i)for(;o&&un(o);)a+=t,o=s[a];return o}}var Lf={}.hasOwnProperty;function Ci(t){return e;function e(n,r,i){return Lf.call(t,n.tagName)&&t[n.tagName](n,r,i)}}var fr=Ci({body:Ff,caption:Bo,colgroup:Bo,dd:Vf,dt:Hf,head:Bo,html:Nf,li:qf,optgroup:Gf,option:Wf,p:Uf,rp:ol,rt:ol,tbody:Jf,td:al,tfoot:Xf,th:al,thead:Kf,tr:Qf});function Bo(t,e,n){let r=Y(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&un(r.value.charAt(0)))}function Nf(t,e,n){let r=Y(n,e);return!r||r.type!=="comment"}function Ff(t,e,n){let r=Y(n,e);return!r||r.type!=="comment"}function Uf(t,e,n){let r=Y(n,e);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 qf(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Hf(t,e,n){let r=Y(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Vf(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ol(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Gf(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Wf(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Kf(t,e,n){let r=Y(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Jf(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Xf(t,e,n){return!Y(n,e)}function Qf(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function al(t,e,n){let r=Y(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var cl=Ci({body:th,colgroup:nh,head:eh,html:Yf,tbody:rh});function Yf(t){let e=Y(t,-1);return!e||e.type!=="comment"}function eh(t){let e=new Set;for(let r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}let n=t.children[0];return!n||n.type==="element"}function th(t){let e=Y(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&un(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function nh(t,e,n){let r=Oo(n,e),i=Y(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&fr(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function rh(t,e,n){let r=Oo(n,e),i=Y(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&fr(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}var xi={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
@@ -100,5 +100,5 @@ File System access not available, please use Push or PullAudioOutputStream`),thi
|
|
|
100
100
|
</prosody>
|
|
101
101
|
</voice>
|
|
102
102
|
</speak>`}var KA=/^\s*<speak(\s|\/?>)/u,JA=/^\s*<\?xml\s/u;function XA(t){return KA.test(t)||JA.test(t)}var QA="en-US",YA="riff-16khz-16bit-mono-pcm",e0="Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)",t0="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjU2LjEwMQAAAAAAAAAAAAAA//tAwAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAACAAABhgC7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7//////////////////////////////////////////////////////////////////8AAAAATGF2YzU3LjY0AAAAAAAAAAAAAAAAJAUHAAAAAAAAAYYoRBqpAAAAAAD/+xDEAAPAAAGkAAAAIAAANIAAAARMQU1FMy45OS41VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7EMQpg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";async function n0({deploymentId:t,fetchCredentials:e,lang:n=QA,outputFormat:r=YA,pitch:i,rate:s,text:a,voice:o=e0,volume:c}){if(!a)return Wd(t0);let{authorizationToken:u,region:l,speechSynthesisHostname:p,subscriptionKey:m}=await e();if(u&&m||!u&&!m)throw new Error('Only "authorizationToken" or "subscriptionKey" should be set.');if(l&&p||!l&&!p)throw new Error('Only "region" or "speechSynthesisHostnamename" should be set.');let d=XA(a)?a:WA({lang:n,pitch:i,rate:s,text:a,voice:o,volume:c}),h=p||(t?`${encodeURI(l)}.voice.speech.microsoft.com`:`${encodeURI(l)}.tts.speech.microsoft.com`),f=t?`?deploymentId=${encodeURI(t)}`:"",g=`https://${h}/cognitiveservices/v1${f}`,b=await fetch(g,{headers:{"Content-Type":"application/ssml+xml","X-Microsoft-OutputFormat":r,...u?{Authorization:`Bearer ${u}`}:{"Ocp-Apim-Subscription-Key":m}},method:"POST",body:d});if(!b.ok)throw new Error(`web-speech-cognitive-services: Failed to syntheis speech, server returned ${b.status}`);return b.arrayBuffer()}function r0(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}function i0(t,e){return new Promise((n,r)=>{let i=t.decodeAudioData(e,n,r);i&&typeof i.then=="function"&&n(i)})}function s0(t,e,n){return new Promise((r,i)=>{let s=new Dc,a=new Dc,o=r0(t,"statechange",({target:{state:c}})=>c==="closed"&&s.eventListener());try{n.buffer=e,n.onended=a.eventListener,n.connect(t.destination),n.start(0),Promise.race([s.upcoming(),a.upcoming()]).then(r)}catch(c){i(c)}finally{o()}})}var o0=class extends Ot{constructor(t){super(),this._lang=null,this._pitch=1,this._rate=1,this._voice=null,this._volume=1,this.text=t,this.onboundary=null,this.onend=null,this.onerror=null,this.onmark=null,this.onpause=null,this.onresume=null,this.onstart=null}get lang(){return this._lang}set lang(t){this._lang=t}get onboundary(){return At(this,"boundary")}set onboundary(t){_t(this,"boundary",t)}get onend(){return At(this,"end")}set onend(t){_t(this,"end",t)}get onerror(){return At(this,"error")}set onerror(t){_t(this,"error",t)}get onmark(){return At(this,"mark")}set onmark(t){_t(this,"mark",t)}get onpause(){return At(this,"pause")}set onpause(t){_t(this,"pause",t)}get onresume(){return At(this,"resume")}set onresume(t){_t(this,"resume",t)}get onstart(){return At(this,"start")}set onstart(t){_t(this,"start",t)}get pitch(){return this._pitch}set pitch(t){this._pitch=t}get rate(){return this._rate}set rate(t){this._rate=t}get voice(){return this._voice}set voice(t){this._voice=t}get volume(){return this._volume}set volume(t){this._volume=t}preload({deploymentId:t,fetchCredentials:e,outputFormat:n}){this.arrayBufferPromise=n0({fetchCredentials:e,deploymentId:t,lang:this.lang||window.navigator.language,outputFormat:n,pitch:this.pitch,rate:this.rate,text:this.text,voice:this.voice&&this.voice.voiceURI,volume:this.volume}),this.arrayBufferPromise.catch()}async play(t){try{this.dispatchEvent(new io("start"));let e=t.createBufferSource(),n=await i0(t,await this.arrayBufferPromise);this._playingSource=e,await s0(t,n,e),this._playingSource=null,this.dispatchEvent(new io("end"))}catch(e){this.dispatchEvent(new ErrorEvent("error",{error:"synthesis-failed",message:e.stack}))}}stop(){this._playingSource&&this._playingSource.stop()}},Yd=o0,sm=class{constructor({gender:t,lang:e,voiceURI:n}){this._default=!1,this._gender=t,this._lang=e,this._localService=!1,this._name=n,this._voiceURI=n}get default(){return this._default}get gender(){return this._gender}get lang(){return this._lang}get localService(){return this._localService}get name(){return this._name}get voiceURI(){return this._voiceURI}};async function a0({customVoiceHostname:t,deploymentId:e,region:n,subscriptionKey:r}){let i=t||`${n}.customvoice.api.speech.microsoft.com`,s=await fetch(`https://${encodeURI(i)}/api/texttospeech/v2.0/endpoints/${encodeURIComponent(e)}`,{headers:{accept:"application/json","ocp-apim-subscription-key":r}});if(!s.ok)throw new Error("Failed to fetch custom voices");return s.json()}async function c0({customVoiceHostname:t,deploymentId:e,region:n,subscriptionKey:r}){let{models:i}=await a0({customVoiceHostname:t,deploymentId:e,region:n,subscriptionKey:r});return i.map(({properties:{Gender:s},locale:a,name:o})=>new sm({gender:s,lang:a,voiceURI:o})).sort(({name:s},{name:a})=>s>a?1:s<a?-1:0)}async function u0({authorizationToken:t,region:e,speechSynthesisHostname:n,subscriptionKey:r}){let i=n||`${encodeURI(e)}.tts.speech.microsoft.com`,s=await fetch(`https://${i}/cognitiveservices/voices/list`,{headers:{"content-type":"application/json",...t?{authorization:`Bearer ${t}`}:{"Ocp-Apim-Subscription-Key":r}}});if(!s.ok)throw new Error("Failed to fetch voices");return(await s.json()).map(({Gender:o,Locale:c,Name:u})=>new sm({gender:o,lang:c,voiceURI:u})).sort(({name:o},{name:c})=>o>c?1:o<c?-1:0)}var l0="audio-24khz-160kbitrate-mono-mp3",p0=[],d0=t=>{let{audioContext:e,fetchCredentials:n,ponyfill:r={AudioContext:window.AudioContext||window.webkitAudioContext},speechSynthesisDeploymentId:i,speechSynthesisOutputFormat:s=l0}=nm(t);if(!e&&!r.AudioContext)return console.warn("web-speech-cognitive-services: This browser does not support Web Audio and it will not work with Cognitive Services Speech Services."),{};class a extends Ot{constructor(){super(),this.queue=new GA({audioContext:e,ponyfill:r}),this.updateVoices()}cancel(){this.queue.stop()}getVoices(){return p0}get onvoiceschanged(){return At(this,"voiceschanged")}set onvoiceschanged(c){_t(this,"voiceschanged",c)}pause(){this.queue.pause()}resume(){this.queue.resume()}speak(c){if(!(c instanceof Yd))throw new Error("invalid utterance");let{reject:u,resolve:l,promise:p}=rm(),m=({error:d,message:h})=>{let f=new Error(d);f.stack=h,u(f)};return c.addEventListener("end",l),c.addEventListener("error",m),c.preload({deploymentId:i,fetchCredentials:n,outputFormat:s}),this.queue.push(c),p.finally(()=>{c.removeEventListener("end",l),c.removeEventListener("error",m)})}get speaking(){return this.queue.speaking}async updateVoices(){let{customVoiceHostname:c,region:u,speechSynthesisHostname:l,subscriptionKey:p}=await n();i?p&&(console.warn("web-speech-cognitive-services: Listing of custom voice models are only available when using subscription key."),await Bc(async()=>{let m=await c0({customVoiceHostname:c,deploymentId:i,region:u,speechSynthesisHostname:l,subscriptionKey:p});this.getVoices=()=>m})):await Bc(async()=>{let m=await u0(await n());this.getVoices=()=>m}),this.dispatchEvent(new io("voiceschanged"))}}return{speechSynthesis:new a,SpeechSynthesisEvent:io,SpeechSynthesisUtterance:Yd}},m0=d0;function om(t={}){return{...HA(t),...m0(t)}}var Uc=document.createElement("meta");Uc.setAttribute("name","web-speech-cognitive-services");Uc.setAttribute("content","version=8.1.0");document.head.appendChild(Uc);function qc(t){return(t.sampleSize>>3)*t.channelCount*t.sampleRate}import{isForbiddenPropertyName as am,withResolvers as cm}from"botframework-webchat-core";import{v4 as f0}from"uuid";var oo=Symbol("deviceInfoDeferred"),ao=Symbol("events"),ri=Symbol("formatDeferred"),co=Symbol("options"),Hc=class extends Tt{constructor(e={}){super();let n={debug:e.debug||!1,id:e.id||f0().replace(/-/gu,"")};this[oo]=cm(),this[ao]=new ee,this[ri]=cm(),this[co]=n}[oo];[ao];[ri];[co];get events(){return this[ao]}get format(){return this.debug('Getting "format".'),this[ri].promise}id(){return this[co].id}onEvent(e){this[ao].onEvent(e),B.instance.onEvent(e)}emitInitializing(){this.debug('Emitting "AudioSourceInitializingEvent".'),this.onEvent(new et(this.id()))}emitReady(){this.debug('Emitting "AudioSourceReadyEvent".'),this.onEvent(new Ue(this.id()))}emitError(e){this.debug('Emitting "AudioSourceErrorEvent".',{error:e}),this.onEvent(new tt(this.id(),e.message))}emitNodeAttaching(e){this.debug(`Emitting "AudioStreamNodeAttachingEvent" for node "${e}".`),this.onEvent(new Pe(this.id(),e))}emitNodeAttached(e){this.debug(`Emitting "AudioStreamNodeAttachedEvent" for node "${e}".`),this.onEvent(new Oe(this.id(),e))}emitNodeError(e,n){this.debug(`Emitting "AudioStreamNodeErrorEvent" for node "${e}".`,{error:n}),this.onEvent(new dt(this.id(),e,n.message))}emitNodeDetached(e){this.debug('Emitting "AudioStreamNodeDetachedEvent".'),this.onEvent(new he(this.id(),e))}emitOff(){this.debug('Emitting "AudioSourceOffEvent".'),this.onEvent(new Ft(this.id()))}close(){throw this.debug('Callback for "close".'),new Error("Not implemented")}turnOn(){throw this.debug('Callback for "turnOn".'),new Error("Not implemented")}detach(){throw this.debug('Callback for "detach".'),new Error("Not implemented")}debug(e,...n){this[co].debug&&console.info(`CustomAudioInputStream: ${e}`,...n)}attach(e){return this.debug(`Callback for "attach" with "${e}".`),this.emitNodeAttaching(e),Promise.resolve().then(async()=>{this.emitInitializing();try{let{audioStreamNode:n,deviceInfo:r,format:i}=await this.performAttach(e);return this[oo].resolve(r),this[ri].resolve(new qe(i.samplesPerSec,i.bitsPerSample,i.channels)),this.emitReady(),this.emitNodeAttached(e),{detach:async()=>{this.debug(`Detaching audio node "${e}".`),await n.detach(),this.emitOff(),this.emitNodeDetached(e)},id:()=>n.id(),read:()=>(this.debug("Reading"),n.read())}}catch(n){throw this.emitNodeError(e,n),n}})}performTurnOff(){}async turnOff(){this.debug('Callback for "turnOff".'),await this.performTurnOff()}get deviceInfo(){return this.debug('Getting "deviceInfo".'),Promise.all([this[oo].promise,this[ri].promise]).then(([{connectivity:e,manufacturer:n,model:r,type:i},{bitsPerSample:s,channels:a,samplesPerSec:o}])=>({bitspersample:s,channelcount:a,connectivity:typeof e=="string"&&!am(e)&&He[e]||He.Unknown,manufacturer:n||"",model:r||"",samplerate:o,type:typeof i=="string"&&!am(i)&&ke[i]||ke.Unknown}))}},um=Hc;var Vc=Symbol("attach"),Gc=Symbol("turnOff"),Wc=class extends um{constructor({attach:e,debug:n,turnOff:r}){if(!e||typeof e!="function")throw new Error('"attach" must be a function.');if(r&&typeof r!="function")throw new Error('"turnOff", if defined, must be a function.');super({debug:n}),this[Vc]=e,this[Gc]=r}[Vc];[Gc];performAttach(e){return this[Vc](e)}performTurnOff(){let{[Gc]:e}=this;return e&&e()}};function Kc(t){return nt.fromStreamInput(new Wc(t))}function Jc(){if(typeof window.AudioContext<"u")return new window.AudioContext;if(typeof window.webkitAudioContext<"u")return new window.webkitAudioContext;throw new Error("This browser does not support Web Audio API.")}function Xc(t){let{navigator:e}=window;if(typeof e.mediaDevices<"u")return e.mediaDevices.getUserMedia(t);if(typeof e.getUserMedia<"u")return new Promise((n,r)=>e.getUserMedia(t,n,r));throw new Error("This browser does not support Web Audio API.")}var lm=100,uo=Object.freeze({channelCount:1,sampleRate:16e3,sampleSize:16}),h0=Object.freeze({bitsPerSample:uo.sampleSize,channels:uo.channelCount,samplesPerSec:uo.sampleRate});function g0(t){let{audioConstraints:e,audioContext:n,debug:r,enableTelemetry:i,pcmRecorderWorkletUrl:s}=t,a=t.bufferDurationInMS||lm,o=new Wt;return s&&o.setWorkletUrl(s),Kc({async attach(c){let u=await Xc({audio:e,video:!1}),[l]=u.getAudioTracks();if(!l)throw new Error("No audio device is found.");let p=new mt(qc(uo)*((a||lm)/1e3),c);return o.record(n,u,p),{audioStreamNode:{detach:()=>{p.readEnded(),p.close(),o.releaseMediaResources(n),u.getTracks().forEach(m=>u.removeTrack(m))},id:()=>c,read:()=>p.read()},deviceInfo:{manufacturer:"Bot Framework Web Chat",model:i?l.label:"",type:i?"Microphones":"Unknown"},format:h0}},debug:r})}function ii({audioContext:t,audioInputDeviceId:e,enableTelemetry:n}){return t||(t=Jc()),{audioConfig:g0({audioConstraints:e?{deviceId:e}:!0,audioContext:t,enableTelemetry:n?!0:void 0}),audioContext:t}}function pm({audioConfig:t,audioContext:e,audioInputDeviceId:n,credentials:r,enableTelemetry:i,initialSilenceTimeout:s,speechRecognitionEndpointId:a,speechSynthesisDeploymentId:o,speechSynthesisOutputFormat:c,textNormalization:u}){return!window.navigator.mediaDevices&&!t?(console.warn("botframework-webchat: Your browser does not support Web Audio or the page is not loaded via HTTPS or localhost. Cognitive Services Speech Services is disabled. However, you may pass a custom AudioConfig to enable speech in this environment."),()=>({})):(t?(n&&console.warn('botframework-webchat: "audioConfig" and "audioInputDeviceId" cannot be set at the same time; ignoring "audioInputDeviceId".'),e&&console.warn('botframework-webchat: "audioConfig" and "audioContext" cannot be set at the same time; ignoring "audioContext" for speech recognition.')):{audioConfig:t,audioContext:e}=ii({audioContext:e,audioInputDeviceId:n,enableTelemetry:i}),({referenceGrammarID:l}={})=>{let{SpeechGrammarList:p,SpeechRecognition:m,speechSynthesis:d,SpeechSynthesisUtterance:h}=om({audioConfig:t,audioContext:e,credentials:r,enableTelemetry:i,initialSilenceTimeout:s,referenceGrammars:l?[`luis/${l}-PRODUCTION`]:[],speechRecognitionEndpointId:a,speechSynthesisDeploymentId:o,speechSynthesisOutputFormat:c,textNormalization:u});return{resumeAudioContext:()=>e&&e.state==="suspended"&&e.resume(),SpeechGrammarList:p,SpeechRecognition:m,speechSynthesis:d,SpeechSynthesisUtterance:h}})}import{createAdapters as b0}from"botframework-directlinespeech-sdk";var y0="en-US";function dm({audioConfig:t,audioContext:e,audioInputDeviceId:n,enableInternalHTTPSupport:r,enableTelemetry:i,fetchCredentials:s,speechRecognitionEndpointId:a,speechRecognitionLanguage:o=window?.navigator?.language||y0,speechSynthesisDeploymentId:c,speechSynthesisOutputFormat:u,textNormalization:l,userID:p,username:m}){return t?(n&&console.warn('botframework-webchat: "audioConfig" and "audioInputDeviceId" cannot be set at the same time; ignoring "audioInputDeviceId".'),e&&console.warn('botframework-webchat: "audioConfig" and "audioContext" cannot be set at the same time; ignoring "audioContext" for speech recognition.')):window.navigator.mediaDevices?{audioConfig:t,audioContext:e}=ii({audioContext:e,audioInputDeviceId:n,enableTelemetry:i}):console.warn('botframework-webchat: Your browser does not support or allow microphone access or the page is not loaded via HTTPS or localhost. Speech is disabled for Direct Line Speech. However, you may pass a custom "audioConfig" to enable speech in this environment.'),b0({audioConfig:t,audioContext:e,audioInputDeviceId:void 0,enableInternalHTTPSupport:r,enableTelemetry:i,fetchCredentials:s,speechRecognitionEndpointId:a,speechRecognitionLanguage:o,speechSynthesisDeploymentId:c,speechSynthesisOutputFormat:u,textNormalization:l,userID:p,username:m})}import{createStyleSet as v0}from"botframework-webchat-component";function mm(t){return{...v0(t),...Sr(t)}}var $O=nu.bind(null,ns),zO=Object.freeze({...su,variant:"full"}),EO=t=>(t.botAgent&&console.warn("Web Chat: Developers are not currently allowed to set botAgent. See https://github.com/microsoft/BotFramework-WebChat/issues/2119 for more details."),eu({...t,botAgent:`WebChat/${si} (Full)`})),ZO=t=>(t.botAgent&&console.warn("Web Chat: Developers are not currently allowed to set botAgent. See https://github.com/microsoft/BotFramework-WebChat/issues/2119 for more details."),tu({...t,botAgent:`WebChat/${si} (Full)`})),RO=Object.freeze({...iu,useAdaptiveCardsHostConfig:_r,useAdaptiveCardsPackage:ae,useStyleOptions:fe,useStyleSet:Ee}),A0=Object.freeze({AdaptiveCardContent:Di,AnimationCardContent:Li,AudioCardContent:Ni,Composer:jp,HeroCardContent:Fi,OAuthCardContent:qi,ReactWebChat:ns,ReceiptCardContent:Vi,SignInCardContent:Gi,ThumbnailCardContent:Wi,VideoCardContent:Ki}),jO=Object.freeze({...ru,...A0}),TO=ns;export{Pi as a,Ji as b,es as c,ns as d,pm as e,dm as f,mm as g,$O as h,zO as i,EO as j,ZO as k,RO as l,jO as m,TO as n};
|
|
103
|
-
/*! For license information please see chunk-
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
/*! For license information please see chunk-V775MBEJ.mjs.LEGAL.txt */
|
|
104
|
+
//# sourceMappingURL=chunk-V775MBEJ.mjs.map
|