@velcro/runner
Version:
Opinionated tool for easily bundling and running code from anywhere
1 lines • 220 kB
JavaScript
this.Velcro=this.Velcro||{},this.Velcro.Runner=function(t){"use strict";class e extends Error{constructor(){super(...arguments),this.name=this.constructor.name}}class i extends e{}class r extends e{constructor(t){super(`Entry was excluded by current configuration '${t.toString()}'`)}}class n extends e{constructor(t){super(`Unable to resolve '${t.toString()}'`)}}class s extends n{constructor(t,e){super(`The dependency '${t}' of '${e.toString()}' was not found`)}}function o(t,e){let i=!1;const r=t.map((t=>h(t)?(i=!0,a(t,e)):t));return i?Promise.all(r):t}async function a(t,e){try{const r=await t;return e.isCancellationRequested?Promise.reject(new i):r}catch(t){if(e.isCancellationRequested)return Promise.reject(new i);throw t}}function h(t){return t&&("function"==typeof t.then||"boolean"==typeof t.done&&"number"==typeof t.next&&"number"==typeof t.pre)}var c;!function(t){t.decode="object"==typeof global&&"function"==typeof global.Buffer?t=>global.Buffer.from(t,"base64").toString("utf-8"):"function"==typeof atob?t=>decodeURIComponent(escape(atob(t))):t=>{throw new Error("The environment has neither the Buffer nor btoa functions. Please consider polyfilling one of these apis.")},t.encode="object"==typeof global&&"function"==typeof global.Buffer?t=>global.Buffer.from(t).toString("base64"):"function"==typeof btoa?t=>btoa(unescape(encodeURIComponent(t))):t=>{throw new Error("The environment has neither the Buffer nor btoa functions. Please consider polyfilling one of these apis.")}}(c||(c={}));const l=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout((()=>{if(t.stack)throw new Error(t.message+"\n\n"+t.stack);throw t}),0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach((e=>{e(t)}))}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}};function u(t){var e;(e=t)instanceof Error&&e.name===p&&e.message===p||l.onUnexpectedError(t)}const p="Canceled";var d,f;function g(t){}function m(...t){return t.forEach(g),{dispose:()=>function(t){if(d.is(t)){for(let e of t)e&&e.dispose();return Array.isArray(t)?[]:t}if(t)return t.dispose(),t}(t)}}!function(t){t.is=function(t){return t&&"object"==typeof t&&"function"==typeof t[Symbol.iterator]};const e=Object.freeze([]);t.empty=function(){return e},t.single=function*(t){yield t},t.from=function(t){return t||e},t.first=function(t){return t[Symbol.iterator]().next().value},t.some=function(t,e){for(const i of t)if(e(i))return!0;return!1},t.filter=function*(t,e){for(const i of t)e(i)&&(yield i)},t.map=function*(t,e){for(const i of t)yield e(i)},t.concat=function*(...t){for(const e of t)for(const t of e)yield t},t.consume=function(e,i=Number.POSITIVE_INFINITY){const r=[];if(0===i)return[r,e];const n=e[Symbol.iterator]();for(let e=0;e<i;e++){const e=n.next();if(e.done)return[r,t.empty()];r.push(e.value)}return[r,{[Symbol.iterator]:()=>n}]}}(d||(d={}));class v{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){this._toDispose.forEach((t=>t.dispose())),this._toDispose.clear()}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?v.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}v.DISABLE_DISPOSED_WARNING=!1;class y{constructor(){this._store=new v}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}y.None=Object.freeze({dispose(){}});class x{constructor(t){this.element=t,this.next=x.Undefined,this.prev=x.Undefined}}x.Undefined=new x(void 0);class E{constructor(){this._first=x.Undefined,this._last=x.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===x.Undefined}clear(){this._first=x.Undefined,this._last=x.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){const i=new x(t);if(this._first===x.Undefined)this._first=i,this._last=i;else if(e){const t=this._last;this._last=i,i.prev=t,t.next=i}else{const t=this._first;this._first=i,i.next=t,t.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==x.Undefined){const t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==x.Undefined){const t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==x.Undefined&&t.next!==x.Undefined){const e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===x.Undefined&&t.next===x.Undefined?(this._first=x.Undefined,this._last=x.Undefined):t.next===x.Undefined?(this._last=this._last.prev,this._last.next=x.Undefined):t.prev===x.Undefined&&(this._first=this._first.next,this._first.prev=x.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==x.Undefined;)yield t.element,t=t.next}toArray(){const t=[];for(let e=this._first;e!==x.Undefined;e=e.next)t.push(e.element);return t}}!function(t){function e(t){return(e,i=null,r)=>{let n,s=!1;return n=t((t=>{if(!s)return n?n.dispose():s=!0,e.call(i,t)}),null,r),s&&n.dispose(),n}}function i(t,e){return o(((i,r=null,n)=>t((t=>i.call(r,e(t))),null,n)))}function r(t,e){return o(((i,r=null,n)=>t((t=>{e(t),i.call(r,t)}),null,n)))}function n(t,e){return o(((i,r=null,n)=>t((t=>e(t)&&i.call(r,t)),null,n)))}function s(t,e,r){let n=r;return i(t,(t=>(n=e(n,t),n)))}function o(t){let e;const i=new w({onFirstListenerAdd(){e=t(i.fire,i)},onLastListenerRemove(){e.dispose()}});return i.event}function a(t,e,i=100,r=!1,n){let s,o=void 0,a=void 0,h=0;const c=new w({leakWarningThreshold:n,onFirstListenerAdd(){s=t((t=>{h++,o=e(o,t),r&&!a&&(c.fire(o),o=void 0),clearTimeout(a),a=setTimeout((()=>{const t=o;o=void 0,a=void 0,(!r||h>1)&&c.fire(t),h=0}),i)}))},onLastListenerRemove(){s.dispose()}});return c.event}function h(t){let e,i=!0;return n(t,(t=>{const r=i||t!==e;return i=!1,e=t,r}))}t.None=()=>y.None,t.once=e,t.map=i,t.forEach=r,t.filter=n,t.signal=function(t){return t},t.any=function(...t){return(e,i=null,r)=>m(...t.map((t=>t((t=>e.call(i,t)),null,r))))},t.reduce=s,t.snapshot=o,t.debounce=a,t.stopwatch=function(t){const r=(new Date).getTime();return i(e(t),(t=>(new Date).getTime()-r))},t.latch=h,t.buffer=function(t,e=!1,i=[]){let r=i.slice(),n=t((t=>{r?r.push(t):o.fire(t)}));const s=()=>{r&&r.forEach((t=>o.fire(t))),r=null},o=new w({onFirstListenerAdd(){n||(n=t((t=>o.fire(t))))},onFirstListenerDidAdd(){r&&(e?setTimeout(s):s())},onLastListenerRemove(){n&&n.dispose(),n=null}});return o.event};class c{constructor(t){this.event=t}map(t){return new c(i(this.event,t))}forEach(t){return new c(r(this.event,t))}filter(t){return new c(n(this.event,t))}reduce(t,e){return new c(s(this.event,t,e))}latch(){return new c(h(this.event))}debounce(t,e=100,i=!1,r){return new c(a(this.event,t,e,i,r))}on(t,e,i){return this.event(t,e,i)}once(t,i,r){return e(this.event)(t,i,r)}}t.chain=function(t){return new c(t)},t.fromNodeEventEmitter=function(t,e,i=(t=>t)){const r=(...t)=>n.fire(i(...t)),n=new w({onFirstListenerAdd:()=>t.on(e,r),onLastListenerRemove:()=>t.removeListener(e,r)});return n.event},t.fromDOMEventEmitter=function(t,e,i=(t=>t)){const r=(...t)=>n.fire(i(...t)),n=new w({onFirstListenerAdd:()=>t.addEventListener(e,r),onLastListenerRemove:()=>t.removeEventListener(e,r)});return n.event},t.fromPromise=function(t){const e=new w;let i=!1;return t.then(void 0,(()=>null)).then((()=>{i?e.fire(void 0):setTimeout((()=>e.fire(void 0)),0)})),i=!0,e.event},t.toPromise=function(t){return new Promise((i=>e(t)(i)))}}(f||(f={}));class w{constructor(t){this._disposed=!1,this._options=t,this._leakageMon=void 0}get event(){return this._event||(this._event=(t,e,i)=>{this._listeners||(this._listeners=new E);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const n=this._listeners.push(e?[t,e]:t);let s,o;return r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,t,e),this._leakageMon&&(s=this._leakageMon.check(this._listeners.size)),o={dispose:()=>{if(s&&s(),o.dispose=w._noop,!this._disposed&&(n(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}},i instanceof v?i.add(o):Array.isArray(i)&&i.push(o),o}),this._event}fire(t){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new E);for(let e of this._listeners)this._deliveryQueue.push([e,t]);for(;this._deliveryQueue.size>0;){const[t,e]=this._deliveryQueue.shift();try{"function"==typeof t?t.call(void 0,e):t[0].call(t[1],e)}catch(t){u(t)}}}}dispose(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0}}w._noop=function(){};const b=Object.freeze((function(t,e){const i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}));var C;!function(t){t.isCancellationToken=function(e){return e===t.None||e===t.Cancelled||(e instanceof S||!(!e||"object"!=typeof e)&&("boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested))},t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:f.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:b})}(C||(C={}));class S{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?b:(this._emitter||(this._emitter=new w),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class k{constructor(t){this._token=void 0,this._parentListener=void 0,this._parentListener=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new S),this._token}cancel(){this._token?this._token instanceof S&&this._token.cancel():this._token=C.Cancelled}dispose(t=!1){t&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof S&&this._token.dispose():this._token=C.None}}!function(){if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){Object.freeze({didTimeout:!0,timeRemaining:()=>15})}}();const _="object"==typeof self?self:"object"==typeof global?global:{},A=function(){if(_.setImmediate)return _.setImmediate.bind(_);if("function"==typeof _.postMessage&&!_.importScripts){let t=[];_.addEventListener("message",(e=>{if(e.data&&e.data.vscodeSetImmediateId)for(let i=0,r=t.length;i<r;i++){const r=t[i];if(r.id===e.data.vscodeSetImmediateId)return t.splice(i,1),void r.callback()}}));let e=0;return i=>{const r=++e;t.push({id:r,callback:i}),_.postMessage({vscodeSetImmediateId:r},"*")}}if("undefined"!=typeof process&&"function"==typeof process.nextTick)return process.nextTick.bind(process);const t=Promise.resolve();return e=>t.then(e)}(),I="undefined"==typeof process?{cwd:()=>"/",env:Object.create(null),get platform(){return"linux"},nextTick:t=>A(t)}:process,R=I.cwd,P=I.env,T=(I.platform,I.nextTick,46),L=47,N=92,O=58;class M extends Error{constructor(t,e,i){let r;"string"==typeof e&&0===e.indexOf("not ")?(r="must not be",e=e.replace(/^not /,"")):r="must be";const n=-1!==t.indexOf(".")?"property":"argument";let s=`The "${t}" ${n} ${r} of type ${e}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function $(t,e){if("string"!=typeof t)throw new M(e,"string",t)}function U(t){return t===L||t===N}function V(t){return t===L}function D(t){return t>=65&&t<=90||t>=97&&t<=122}function F(t,e,i,r){let n="",s=0,o=-1,a=0,h=0;for(let c=0;c<=t.length;++c){if(c<t.length)h=t.charCodeAt(c);else{if(r(h))break;h=L}if(r(h)){if(o===c-1||1===a);else if(2===a){if(n.length<2||2!==s||n.charCodeAt(n.length-1)!==T||n.charCodeAt(n.length-2)!==T){if(n.length>2){const t=n.lastIndexOf(i);-1===t?(n="",s=0):(n=n.slice(0,t),s=n.length-1-n.lastIndexOf(i)),o=c,a=0;continue}if(0!==n.length){n="",s=0,o=c,a=0;continue}}e&&(n+=n.length>0?i+"..":"..",s=2)}else n.length>0?n+=`${i}${t.slice(o+1,c)}`:n=t.slice(o+1,c),s=c-o-1;o=c,a=0}else h===T&&-1!==a?++a:a=-1}return n}function j(t,e){if(null===e||"object"!=typeof e)throw new M("pathObject","Object",e);const i=e.dir||e.root,r=e.base||`${e.name||""}${e.ext||""}`;return i?i===e.root?`${i}${r}`:`${i}${t}${r}`:r}const B={resolve(...t){let e="",i="",r=!1;for(let n=t.length-1;n>=-1;n--){let s;if(n>=0){if(s=t[n],$(s,"path"),0===s.length)continue}else 0===e.length?s=R():(s=P["="+e]||R(),(void 0===s||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===N)&&(s=e+"\\"));const o=s.length;let a=0,h="",c=!1;const l=s.charCodeAt(0);if(1===o)U(l)&&(a=1,c=!0);else if(U(l))if(c=!0,U(s.charCodeAt(1))){let t=2,e=t;for(;t<o&&!U(s.charCodeAt(t));)t++;if(t<o&&t!==e){const i=s.slice(e,t);for(e=t;t<o&&U(s.charCodeAt(t));)t++;if(t<o&&t!==e){for(e=t;t<o&&!U(s.charCodeAt(t));)t++;t!==o&&t===e||(h=`\\\\${i}\\${s.slice(e,t)}`,a=t)}}}else a=1;else D(l)&&s.charCodeAt(1)===O&&(h=s.slice(0,2),a=2,o>2&&U(s.charCodeAt(2))&&(c=!0,a=3));if(h.length>0)if(e.length>0){if(h.toLowerCase()!==e.toLowerCase())continue}else e=h;if(r){if(e.length>0)break}else if(i=`${s.slice(a)}\\${i}`,r=c,c&&e.length>0)break}return i=F(i,!r,"\\",U),r?`${e}\\${i}`:`${e}${i}`||"."},normalize(t){$(t,"path");const e=t.length;if(0===e)return".";let i,r=0,n=!1;const s=t.charCodeAt(0);if(1===e)return V(s)?"\\":t;if(U(s))if(n=!0,U(t.charCodeAt(1))){let n=2,s=n;for(;n<e&&!U(t.charCodeAt(n));)n++;if(n<e&&n!==s){const o=t.slice(s,n);for(s=n;n<e&&U(t.charCodeAt(n));)n++;if(n<e&&n!==s){for(s=n;n<e&&!U(t.charCodeAt(n));)n++;if(n===e)return`\\\\${o}\\${t.slice(s)}\\`;n!==s&&(i=`\\\\${o}\\${t.slice(s,n)}`,r=n)}}}else r=1;else D(s)&&t.charCodeAt(1)===O&&(i=t.slice(0,2),r=2,e>2&&U(t.charCodeAt(2))&&(n=!0,r=3));let o=r<e?F(t.slice(r),!n,"\\",U):"";return 0!==o.length||n||(o="."),o.length>0&&U(t.charCodeAt(e-1))&&(o+="\\"),void 0===i?n?"\\"+o:o:n?`${i}\\${o}`:`${i}${o}`},isAbsolute(t){$(t,"path");const e=t.length;if(0===e)return!1;const i=t.charCodeAt(0);return U(i)||e>2&&D(i)&&t.charCodeAt(1)===O&&U(t.charCodeAt(2))},join(...t){if(0===t.length)return".";let e,i;for(let r=0;r<t.length;++r){const n=t[r];$(n,"path"),n.length>0&&(void 0===e?e=i=n:e+="\\"+n)}if(void 0===e)return".";let r=!0,n=0;if("string"==typeof i&&U(i.charCodeAt(0))){++n;const t=i.length;t>1&&U(i.charCodeAt(1))&&(++n,t>2&&(U(i.charCodeAt(2))?++n:r=!1))}if(r){for(;n<e.length&&U(e.charCodeAt(n));)n++;n>=2&&(e="\\"+e.slice(n))}return B.normalize(e)},relative(t,e){if($(t,"from"),$(e,"to"),t===e)return"";const i=B.resolve(t),r=B.resolve(e);if(i===r)return"";if((t=i.toLowerCase())===(e=r.toLowerCase()))return"";let n=0;for(;n<t.length&&t.charCodeAt(n)===N;)n++;let s=t.length;for(;s-1>n&&t.charCodeAt(s-1)===N;)s--;const o=s-n;let a=0;for(;a<e.length&&e.charCodeAt(a)===N;)a++;let h=e.length;for(;h-1>a&&e.charCodeAt(h-1)===N;)h--;const c=h-a,l=o<c?o:c;let u=-1,p=0;for(;p<l;p++){const i=t.charCodeAt(n+p);if(i!==e.charCodeAt(a+p))break;i===N&&(u=p)}if(p!==l){if(-1===u)return r}else{if(c>l){if(e.charCodeAt(a+p)===N)return r.slice(a+p+1);if(2===p)return r.slice(a+p)}o>l&&(t.charCodeAt(n+p)===N?u=p:2===p&&(u=3)),-1===u&&(u=0)}let d="";for(p=n+u+1;p<=s;++p)p!==s&&t.charCodeAt(p)!==N||(d+=0===d.length?"..":"\\..");return a+=u,d.length>0?`${d}${r.slice(a,h)}`:(r.charCodeAt(a)===N&&++a,r.slice(a,h))},toNamespacedPath(t){if("string"!=typeof t)return t;if(0===t.length)return"";const e=B.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===N){if(e.charCodeAt(1)===N){const t=e.charCodeAt(2);if(63!==t&&t!==T)return"\\\\?\\UNC\\"+e.slice(2)}}else if(D(e.charCodeAt(0))&&e.charCodeAt(1)===O&&e.charCodeAt(2)===N)return"\\\\?\\"+e;return t},dirname(t){$(t,"path");const e=t.length;if(0===e)return".";let i=-1,r=0;const n=t.charCodeAt(0);if(1===e)return U(n)?t:".";if(U(n)){if(i=r=1,U(t.charCodeAt(1))){let n=2,s=n;for(;n<e&&!U(t.charCodeAt(n));)n++;if(n<e&&n!==s){for(s=n;n<e&&U(t.charCodeAt(n));)n++;if(n<e&&n!==s){for(s=n;n<e&&!U(t.charCodeAt(n));)n++;if(n===e)return t;n!==s&&(i=r=n+1)}}}}else D(n)&&t.charCodeAt(1)===O&&(i=e>2&&U(t.charCodeAt(2))?3:2,r=i);let s=-1,o=!0;for(let i=e-1;i>=r;--i)if(U(t.charCodeAt(i))){if(!o){s=i;break}}else o=!1;if(-1===s){if(-1===i)return".";s=i}return t.slice(0,s)},basename(t,e){void 0!==e&&$(e,"ext"),$(t,"path");let i,r=0,n=-1,s=!0;if(t.length>=2&&D(t.charCodeAt(0))&&t.charCodeAt(1)===O&&(r=2),void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(i=t.length-1;i>=r;--i){const h=t.charCodeAt(i);if(U(h)){if(!s){r=i+1;break}}else-1===a&&(s=!1,a=i+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(n=i):(o=-1,n=a))}return r===n?n=a:-1===n&&(n=t.length),t.slice(r,n)}for(i=t.length-1;i>=r;--i)if(U(t.charCodeAt(i))){if(!s){r=i+1;break}}else-1===n&&(s=!1,n=i+1);return-1===n?"":t.slice(r,n)},extname(t){$(t,"path");let e=0,i=-1,r=0,n=-1,s=!0,o=0;t.length>=2&&t.charCodeAt(1)===O&&D(t.charCodeAt(0))&&(e=r=2);for(let a=t.length-1;a>=e;--a){const e=t.charCodeAt(a);if(U(e)){if(!s){r=a+1;break}}else-1===n&&(s=!1,n=a+1),e===T?-1===i?i=a:1!==o&&(o=1):-1!==i&&(o=-1)}return-1===i||-1===n||0===o||1===o&&i===n-1&&i===r+1?"":t.slice(i,n)},format:j.bind(null,"\\"),parse(t){$(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;const i=t.length;let r=0,n=t.charCodeAt(0);if(1===i)return U(n)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(U(n)){if(r=1,U(t.charCodeAt(1))){let e=2,n=e;for(;e<i&&!U(t.charCodeAt(e));)e++;if(e<i&&e!==n){for(n=e;e<i&&U(t.charCodeAt(e));)e++;if(e<i&&e!==n){for(n=e;e<i&&!U(t.charCodeAt(e));)e++;e===i?r=e:e!==n&&(r=e+1)}}}}else if(D(n)&&t.charCodeAt(1)===O){if(i<=2)return e.root=e.dir=t,e;if(r=2,U(t.charCodeAt(2))){if(3===i)return e.root=e.dir=t,e;r=3}}r>0&&(e.root=t.slice(0,r));let s=-1,o=r,a=-1,h=!0,c=t.length-1,l=0;for(;c>=r;--c)if(n=t.charCodeAt(c),U(n)){if(!h){o=c+1;break}}else-1===a&&(h=!1,a=c+1),n===T?-1===s?s=c:1!==l&&(l=1):-1!==s&&(l=-1);return-1!==a&&(-1===s||0===l||1===l&&s===a-1&&s===o+1?e.base=e.name=t.slice(o,a):(e.name=t.slice(o,s),e.base=t.slice(o,a),e.ext=t.slice(s,a))),e.dir=o>0&&o!==r?t.slice(0,o-1):e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},q={resolve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){const n=r>=0?t[r]:R();$(n,"path"),0!==n.length&&(e=`${n}/${e}`,i=n.charCodeAt(0)===L)}return e=F(e,!i,"/",V),i?"/"+e:e.length>0?e:"."},normalize(t){if($(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===L,i=t.charCodeAt(t.length-1)===L;return 0===(t=F(t,!e,"/",V)).length?e?"/":i?"./":".":(i&&(t+="/"),e?"/"+t:t)},isAbsolute:t=>($(t,"path"),t.length>0&&t.charCodeAt(0)===L),join(...t){if(0===t.length)return".";let e;for(let i=0;i<t.length;++i){const r=t[i];$(r,"path"),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":q.normalize(e)},relative(t,e){if($(t,"from"),$(e,"to"),t===e)return"";if((t=q.resolve(t))===(e=q.resolve(e)))return"";const i=t.length,r=i-1,n=e.length-1,s=r<n?r:n;let o=-1,a=0;for(;a<s;a++){const i=t.charCodeAt(1+a);if(i!==e.charCodeAt(1+a))break;i===L&&(o=a)}if(a===s)if(n>s){if(e.charCodeAt(1+a)===L)return e.slice(1+a+1);if(0===a)return e.slice(1+a)}else r>s&&(t.charCodeAt(1+a)===L?o=a:0===a&&(o=0));let h="";for(a=1+o+1;a<=i;++a)a!==i&&t.charCodeAt(a)!==L||(h+=0===h.length?"..":"/..");return`${h}${e.slice(1+o)}`},toNamespacedPath:t=>t,dirname(t){if($(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===L;let i=-1,r=!0;for(let e=t.length-1;e>=1;--e)if(t.charCodeAt(e)===L){if(!r){i=e;break}}else r=!1;return-1===i?e?"/":".":e&&1===i?"//":t.slice(0,i)},basename(t,e){void 0!==e&&$(e,"ext"),$(t,"path");let i,r=0,n=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(i=t.length-1;i>=0;--i){const h=t.charCodeAt(i);if(h===L){if(!s){r=i+1;break}}else-1===a&&(s=!1,a=i+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(n=i):(o=-1,n=a))}return r===n?n=a:-1===n&&(n=t.length),t.slice(r,n)}for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===L){if(!s){r=i+1;break}}else-1===n&&(s=!1,n=i+1);return-1===n?"":t.slice(r,n)},extname(t){$(t,"path");let e=-1,i=0,r=-1,n=!0,s=0;for(let o=t.length-1;o>=0;--o){const a=t.charCodeAt(o);if(a!==L)-1===r&&(n=!1,r=o+1),a===T?-1===e?e=o:1!==s&&(s=1):-1!==e&&(s=-1);else if(!n){i=o+1;break}}return-1===e||-1===r||0===s||1===s&&e===r-1&&e===i+1?"":t.slice(e,r)},format:j.bind(null,"/"),parse(t){$(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;const i=t.charCodeAt(0)===L;let r;i?(e.root="/",r=1):r=0;let n=-1,s=0,o=-1,a=!0,h=t.length-1,c=0;for(;h>=r;--h){const e=t.charCodeAt(h);if(e!==L)-1===o&&(a=!1,o=h+1),e===T?-1===n?n=h:1!==c&&(c=1):-1!==n&&(c=-1);else if(!a){s=h+1;break}}if(-1!==o){const r=0===s&&i?1:s;-1===n||0===c||1===c&&n===o-1&&n===s+1?e.base=e.name=t.slice(r,o):(e.name=t.slice(r,n),e.base=t.slice(r,o),e.ext=t.slice(n,o))}return s>0?e.dir=t.slice(0,s-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};q.win32=B.win32=B,q.posix=B.posix=q;class G{constructor(){if("undefined"!=typeof TextDecoder)this.decoder=new TextDecoder;else if("function"!=typeof Buffer||"function"!=typeof Buffer.from)throw new Error("The environment supports neither the TextDecoder nor Buffer API. Please consider polyfilling one of these.")}decode(t){const e=this.decoder?this.decoder.decode(t):Buffer.from(t).toString("utf-8");return 65279===e.charCodeAt(0)?e.slice(1):e}}class H{constructor(){this._data=new Map}get size(){return this._data.size}add(t,e){let i=this._data.get(t);return i||(i=new Set,this._data.set(t,i)),i.add(e),this}clear(){this._data.clear()}delete(t,e){const i=this._data.get(t);if(i){const r=i.delete(e);return i.size||this._data.delete(t),r}return!1}deleteAll(t){return this._data.delete(t)}get(t){return this._data.get(t)}has(t){return this._data.has(t)}hasValue(t,e){const i=this._data.get(t);return!!i&&i.has(e)}*entries(){for(const[t,e]of this._data.entries())for(const i of e)yield[t,i]}*values(){for(const t of this._data.values())yield*t.values()}}function W(t){return!("object"!=typeof t||null===t||z(t,"name")||z(t,"version")||function(t){let e="";const i=t.browser;if(i&&"object"==typeof i)for(const t in i){if("string"!=typeof t){e=`The key ${t} of .browser must be a string`;break}if("string"!=typeof i[t]&&!1!==i[t]){e=`The value ${t} of .browser must be a string or false`;break}}return e}(t)||z(t,"main")||z(t,"module")||z(t,"jsnext:main")||z(t,"unpkg")||J(t,"dependencies")||J(t,"devDependencies")||J(t,"peerDependencies"))}function K(t,e){return"string"!=typeof t[e]}function z(t,e){return void 0!==t[e]&&"string"!=typeof t[e]}function J(t,e){return void 0!==t[e]&&"object"==typeof t[e]&&null!==t[e]&&!Object.keys(t[e]).every((i=>"string"==typeof i&&"string"==typeof t[e][i]))}function X(t,e,i){try{return Y(t.decode(e),i)}catch(t){throw new Error(`Error decoding manifest buffer for package ${i}: ${t.message}`)}}function Q(t,e,i){try{return function(t,e){const i=Y(t,e);if(!function(t){return W(t)&&!K(t,"name")&&!K(t,"version")}(i))throw new Error("Invalid manifest for the package "+e);return i}(t.decode(e),i)}catch(t){throw new Error(`Error decoding manifest buffer for package ${i}: ${t.message}`)}}function Y(t,e){let i;try{i=JSON.parse(t)}catch(t){throw new Error(`Error parsing manifest as json for package ${e}: ${t.message}`)}if(!W(i))throw new Error("Invalid manifest for the package "+e);return i}const Z=47;class tt extends Error{constructor(t,e,i){let r;"string"==typeof e&&0===e.indexOf("not ")?(r="must not be",e=e.replace(/^not /,"")):r="must be";const n=-1!==t.indexOf(".")?"property":"argument";let s=`The "${t}" ${n} ${r} of type ${e}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function et(t,e){if("string"!=typeof t)throw new tt(e,"string",t)}function it(t){return t===Z}function rt(t,e,i,r){let n="",s=0,o=-1,a=0,h=0;for(let c=0;c<=t.length;++c){if(c<t.length)h=t.charCodeAt(c);else{if(r(h))break;h=Z}if(r(h)){if(o===c-1||1===a);else if(2===a){if(n.length<2||2!==s||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){const t=n.lastIndexOf(i);-1===t?(n="",s=0):(n=n.slice(0,t),s=n.length-1-n.lastIndexOf(i)),o=c,a=0;continue}if(0!==n.length){n="",s=0,o=c,a=0;continue}}e&&(n+=n.length>0?i+"..":"..",s=2)}else n.length>0?n+=`${i}${t.slice(o+1,c)}`:n=t.slice(o+1,c),s=c-o-1;o=c,a=0}else 46===h&&-1!==a?++a:a=-1}return n}const nt={resolve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){const n=r>=0?t[r]:process.cwd();et(n,"path"),0!==n.length&&(e=`${n}/${e}`,i=n.charCodeAt(0)===Z)}return e=rt(e,!i,"/",it),i?"/"+e:e.length>0?e:"."},normalize(t){if(et(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===Z,i=t.charCodeAt(t.length-1)===Z;return 0===(t=rt(t,!e,"/",it)).length?e?"/":i?"./":".":(i&&(t+="/"),e?"/"+t:t)},isAbsolute:t=>(et(t,"path"),t.length>0&&t.charCodeAt(0)===Z),join(...t){if(0===t.length)return".";let e;for(let i=0;i<t.length;++i){const r=t[i];et(r,"path"),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":nt.normalize(e)},relative(t,e){if(et(t,"from"),et(e,"to"),t===e)return"";if((t=nt.resolve(t))===(e=nt.resolve(e)))return"";const i=t.length,r=i-1,n=e.length-1,s=r<n?r:n;let o=-1,a=0;for(;a<s;a++){const i=t.charCodeAt(1+a);if(i!==e.charCodeAt(1+a))break;i===Z&&(o=a)}if(a===s)if(n>s){if(e.charCodeAt(1+a)===Z)return e.slice(1+a+1);if(0===a)return e.slice(1+a)}else r>s&&(t.charCodeAt(1+a)===Z?o=a:0===a&&(o=0));let h="";for(a=1+o+1;a<=i;++a)a!==i&&t.charCodeAt(a)!==Z||(h+=0===h.length?"..":"/..");return`${h}${e.slice(1+o)}`},toNamespacedPath:t=>t,dirname(t){if(et(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===Z;let i=-1,r=!0;for(let e=t.length-1;e>=1;--e)if(t.charCodeAt(e)===Z){if(!r){i=e;break}}else r=!1;return-1===i?e?"/":".":e&&1===i?"//":t.slice(0,i)},basename(t,e){void 0!==e&&et(e,"ext"),et(t,"path");let i,r=0,n=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(i=t.length-1;i>=0;--i){const h=t.charCodeAt(i);if(h===Z){if(!s){r=i+1;break}}else-1===a&&(s=!1,a=i+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(n=i):(o=-1,n=a))}return r===n?n=a:-1===n&&(n=t.length),t.slice(r,n)}for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===Z){if(!s){r=i+1;break}}else-1===n&&(s=!1,n=i+1);return-1===n?"":t.slice(r,n)},extname(t){et(t,"path");let e=-1,i=0,r=-1,n=!0,s=0;for(let o=t.length-1;o>=0;--o){const a=t.charCodeAt(o);if(a!==Z)-1===r&&(n=!1,r=o+1),46===a?-1===e?e=o:1!==s&&(s=1):-1!==e&&(s=-1);else if(!n){i=o+1;break}}return-1===e||-1===r||0===s||1===s&&e===r-1&&e===i+1?"":t.slice(e,r)},format:function(t,e){if(null===e||"object"!=typeof e)throw new tt("pathObject","Object",e);const i=e.dir||e.root,r=e.base||`${e.name||""}${e.ext||""}`;return i?i===e.root?`${i}${r}`:`${i}${t}${r}`:r}.bind(null,"/"),parse(t){et(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;const i=t.charCodeAt(0)===Z;let r;i?(e.root="/",r=1):r=0;let n=-1,s=0,o=-1,a=!0,h=t.length-1,c=0;for(;h>=r;--h){const e=t.charCodeAt(h);if(e!==Z)-1===o&&(a=!1,o=h+1),46===e?-1===n?n=h:1!==c&&(c=1):-1!==n&&(c=-1);else if(!a){s=h+1;break}}if(-1!==o){const r=0===s&&i?1:s;-1===n||0===c||1===c&&n===o-1&&n===s+1?e.base=e.name=t.slice(r,o):(e.name=t.slice(r,n),e.base=t.slice(r,o),e.ext=t.slice(n,o))}return s>0?e.dir=t.slice(0,s-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null},st=nt.join,ot=nt.dirname,at=nt.basename,ht=/^\w[\w\d+.-]*$/,ct=/^\//,lt=/^\/\//;const ut="",pt="/",dt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ft{constructor(t,e,i,r,n,s=!1){"object"==typeof t?(this.scheme=t.scheme||ut,this.authority=t.authority||ut,this.path=t.path||ut,this.query=t.query||ut,this.fragment=t.fragment||ut):(this.scheme=function(t,e){return t||e?t:"file"}(t,s),this.authority=e||ut,this.path=function(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==pt&&(e=pt+e):e=pt}return e}(this.scheme,i||ut),this.query=r||ut,this.fragment=n||ut,function(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!ht.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!ct.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(lt.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,s))}static ensureTrailingSlash(t,e="/"){return t.with({path:t.path.replace(kt,e)})}static equals(t,e){return t.authority===e.authority&&t.fragment===e.fragment&&t.path===e.path&&t.query===e.query&&t.scheme===e.scheme}static getFirstPathSegmentAfterPrefix(t,e){const i=t.path,r=e.path,n="/"===r.charAt(r.length-1)?-1:0;for(let s=0;s<=i.length;s++)if(s<r.length){if(i.charAt(s)!==r.charAt(s))throw new Error(`The child entry ${t.toString()} does not have the pathname of ${e.toString()} as a prefix`)}else if(s===r.length+n){if("/"!==i.charAt(s))throw new Error(`The child entry ${t.toString()} does not have the pathname of ${e.toString()} as a prefix`)}else if("/"===i.charAt(s))return i.slice(r.length+1+n,s);return i.slice(r.length+1+n)}static isPrefixOf(t,e,i){return t.authority===e.authority&&t.fragment===e.fragment&&t.query===e.query&&t.scheme===e.scheme&&e.path.startsWith(t.path)&&(!i||e.path.length>t.path.length)}static isUri(t){return t instanceof ft||!!t&&("string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString)}get fsPath(){return Et(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:i,path:r,query:n,fragment:s}=t;return void 0===e?e=this.scheme:null===e&&(e=ut),void 0===i?i=this.authority:null===i&&(i=ut),void 0===r?r=this.path:null===r&&(r=ut),void 0===n?n=this.query:null===n&&(n=ut),void 0===s?s=this.fragment:null===s&&(s=ut),e===this.scheme&&i===this.authority&&r===this.path&&n===this.query&&s===this.fragment?this:new mt(e,i,r,n,s)}static parse(t,e=!1){const i=dt.exec(t);return i?new mt(i[2]||ut,St(i[4]||ut),St(i[5]||ut),St(i[7]||ut),St(i[9]||ut),e):new mt(ut,ut,ut,ut,ut)}static file(t){let e=ut;if(t[0]===pt&&t[1]===pt){const i=t.indexOf(pt,2);-1===i?(e=t.substring(2),t=pt):(e=t.substring(2,i),t=t.substring(i)||pt)}return new mt("file",e,t,ut,ut)}static from(t){return new mt(t.scheme,t.authority,t.path,t.query,t.fragment)}static joinPath(t,...e){if(!t.path)throw new Error("[UriError]: cannot call joinPaths on URI without path");const i=st(t.path,...e);return t.with({path:i})}toString(t=!0){return wt(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof ft)return t;{const e=new mt(t);return e._formatted=t.external,e._fsPath=t._sep===gt?t.fsPath:null,e}}return t}}const gt=void 0;class mt extends ft{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Et(this,!1)),this._fsPath}toString(t=!0){return t?(this._formatted||(this._formatted=wt(this,!0)),this._formatted):wt(this,!1)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=gt),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}}const vt={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function yt(t,e){let i=void 0,r=-1;for(let n=0;n<t.length;n++){const s=t.charCodeAt(n);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||e&&47===s)-1!==r&&(i+=encodeURIComponent(t.substring(r,n)),r=-1),void 0!==i&&(i+=t.charAt(n));else{void 0===i&&(i=t.substr(0,n));const e=vt[s];void 0!==e?(-1!==r&&(i+=encodeURIComponent(t.substring(r,n)),r=-1),i+=e):-1===r&&(r=n)}}return-1!==r&&(i+=encodeURIComponent(t.substring(r))),void 0!==i?i:t}function xt(t){let e=void 0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);35===r||63===r?(void 0===e&&(e=t.substr(0,i)),e+=vt[r]):void 0!==e&&(e+=t[i])}return void 0!==e?e:t}function Et(t,e){let i;return i=t.authority&&t.path.length>1&&"file"===t.scheme?`//${t.authority}${t.path}`:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?e?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,i}function wt(t,e){const i=e?xt:yt;let r="",{scheme:n,authority:s,path:o,query:a,fragment:h}=t;if(n&&(r+=n,r+=":"),(s||"file"===n)&&(r+=pt,r+=pt),s){let t=s.indexOf("@");if(-1!==t){const e=s.substr(0,t);s=s.substr(t+1),t=e.indexOf(":"),-1===t?r+=i(e,!1):(r+=i(e.substr(0,t),!1),r+=":",r+=i(e.substr(t+1),!1)),r+="@"}s=s.toLowerCase(),t=s.indexOf(":"),-1===t?r+=i(s,!1):(r+=i(s.substr(0,t),!1),r+=s.substr(t))}if(o){if(o.length>=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){const t=o.charCodeAt(1);t>=65&&t<=90&&(o=`/${String.fromCharCode(t+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){const t=o.charCodeAt(0);t>=65&&t<=90&&(o=`${String.fromCharCode(t+32)}:${o.substr(2)}`)}r+=i(o,!0)}return a&&(r+="?",r+=i(a,!1)),h&&(r+="#",r+=e?h:yt(h,!1)),r}function bt(t){try{return decodeURIComponent(t)}catch(e){return t.length>3?t.substr(0,3)+bt(t.substr(3)):t}}const Ct=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function St(t){return t.match(Ct)?t.replace(Ct,(t=>bt(t))):t}const kt=/\/?$/;for(var _t={},At="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",It=0;It<At.length;It++)_t[At.charCodeAt(It)]=It;function Rt(t){for(var e=[],i=[],r=[0,0,0,0,0],n=0,s=0,o=0,a=0;s<t.length;s++){var h=t.charCodeAt(s);if(44===h)Pt(i,r,n),n=0;else if(59===h)Pt(i,r,n),n=0,e.push(i),i=[],r[0]=0;else{var c=_t[h];if(void 0===c)throw new Error("Invalid character ("+String.fromCharCode(h)+")");var l=32&c;if(a+=(c&=31)<<o,l)o+=5;else{var u=1&a;a>>>=1,u&&(a=0===a?-2147483648:-a),r[n]+=a,n++,a=o=0}}}return Pt(i,r,n),e.push(i),e}function Pt(t,e,i){4===i?t.push([e[0],e[1],e[2],e[3]]):5===i?t.push([e[0],e[1],e[2],e[3],e[4]]):1===i&&t.push([e[0]])}function Tt(t){for(var e=0,i=0,r=0,n=0,s="",o=0;o<t.length;o++){var a=t[o];if(o>0&&(s+=";"),0!==a.length){for(var h=0,c=[],l=0,u=a;l<u.length;l++){var p=u[l],d=Lt(p[0]-h);h=p[0],p.length>1&&(d+=Lt(p[1]-e)+Lt(p[2]-i)+Lt(p[3]-r),e=p[1],i=p[2],r=p[3]),5===p.length&&(d+=Lt(p[4]-n),n=p[4]),c.push(d)}s+=c.join(",")}}return s}function Lt(t){var e="";t=t<0?-t<<1|1:t<<1;do{var i=31&t;(t>>>=5)>0&&(i|=32),e+=At[i]}while(t>0);return e}var Nt=function t(e){this.bits=e instanceof t?e.bits.slice():[]};Nt.prototype.add=function(t){this.bits[t>>5]|=1<<(31&t)},Nt.prototype.has=function(t){return!!(this.bits[t>>5]&1<<(31&t))};var Ot=function(t,e,i){this.start=t,this.end=e,this.original=i,this.intro="",this.outro="",this.content=i,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};Ot.prototype.appendLeft=function(t){this.outro+=t},Ot.prototype.appendRight=function(t){this.intro=this.intro+t},Ot.prototype.clone=function(){var t=new Ot(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t},Ot.prototype.contains=function(t){return this.start<t&&t<this.end},Ot.prototype.eachNext=function(t){for(var e=this;e;)t(e),e=e.next},Ot.prototype.eachPrevious=function(t){for(var e=this;e;)t(e),e=e.previous},Ot.prototype.edit=function(t,e,i){return this.content=t,i||(this.intro="",this.outro=""),this.storeName=e,this.edited=!0,this},Ot.prototype.prependLeft=function(t){this.outro=t+this.outro},Ot.prototype.prependRight=function(t){this.intro=t+this.intro},Ot.prototype.split=function(t){var e=t-this.start,i=this.original.slice(0,e),r=this.original.slice(e);this.original=i;var n=new Ot(t,this.end,r);return n.outro=this.outro,this.outro="",this.end=t,this.edited?(n.edit("",!1),this.content=""):this.content=i,n.next=this.next,n.next&&(n.next.previous=n),n.previous=this,this.next=n,n},Ot.prototype.toString=function(){return this.intro+this.content+this.outro},Ot.prototype.trimEnd=function(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var e=this.content.replace(t,"");return e.length?(e!==this.content&&this.split(this.start+e.length).edit("",void 0,!0),!0):(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),!!this.intro.length||void 0)},Ot.prototype.trimStart=function(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var e=this.content.replace(t,"");return e.length?(e!==this.content&&(this.split(this.end-e.length),this.edit("",void 0,!0)),!0):(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),!!this.outro.length||void 0)};var Mt=function(){throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};"undefined"!=typeof window&&"function"==typeof window.btoa?Mt=function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"function"==typeof Buffer&&(Mt=function(t){return Buffer.from(t,"utf-8").toString("base64")});var $t=function(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=Tt(t.mappings)};function Ut(t){var e=t.split("\n"),i=e.filter((function(t){return/^\t+/.test(t)})),r=e.filter((function(t){return/^ {2,}/.test(t)}));if(0===i.length&&0===r.length)return null;if(i.length>=r.length)return"\t";var n=r.reduce((function(t,e){var i=/^ +/.exec(e)[0].length;return Math.min(i,t)}),1/0);return new Array(n+1).join(" ")}function Vt(t,e){var i=t.split(/[/\\]/),r=e.split(/[/\\]/);for(i.pop();i[0]===r[0];)i.shift(),r.shift();if(i.length)for(var n=i.length;n--;)i[n]="..";return i.concat(r).join("/")}$t.prototype.toString=function(){return JSON.stringify(this)},$t.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+Mt(this.toString())};var Dt=Object.prototype.toString;function Ft(t){return"[object Object]"===Dt.call(t)}function jt(t){for(var e=t.split("\n"),i=[],r=0,n=0;r<e.length;r++)i.push(n),n+=e[r].length+1;return function(t){for(var e=0,r=i.length;e<r;){var n=e+r>>1;t<i[n]?r=n:e=n+1}var s=e-1;return{line:s,column:t-i[s]}}}var Bt=function(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null};Bt.prototype.addEdit=function(t,e,i,r){if(e.length){var n=[this.generatedCodeColumn,t,i.line,i.column];r>=0&&n.push(r),this.rawSegments.push(n)}else this.pending&&this.rawSegments.push(this.pending);this.advance(e),this.pending=null},Bt.prototype.addUneditedChunk=function(t,e,i,r,n){for(var s=e.start,o=!0;s<e.end;)(this.hires||o||n.has(s))&&this.rawSegments.push([this.generatedCodeColumn,t,r.line,r.column]),"\n"===i[s]?(r.line+=1,r.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=!0):(r.column+=1,this.generatedCodeColumn+=1,o=!1),s+=1;this.pending=null},Bt.prototype.advance=function(t){if(t){var e=t.split("\n");if(e.length>1){for(var i=0;i<e.length-1;i++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=e[e.length-1].length}};var qt="\n",Gt={insertLeft:!1,insertRight:!1,storeName:!1},Ht=function(t,e){void 0===e&&(e={});var i=new Ot(0,t.length,t);Object.defineProperties(this,{original:{writable:!0,value:t},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:i},lastChunk:{writable:!0,value:i},lastSearchedChunk:{writable:!0,value:i},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:e.filename},indentExclusionRanges:{writable:!0,value:e.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new Nt},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:Ut(t)}}),this.byStart[0]=i,this.byEnd[t.length]=i};Ht.prototype.addSourcemapLocation=function(t){this.sourcemapLocations.add(t)},Ht.prototype.append=function(t){if("string"!=typeof t)throw new TypeError("outro content must be a string");return this.outro+=t,this},Ht.prototype.appendLeft=function(t,e){if("string"!=typeof e)throw new TypeError("inserted content must be a string");this._split(t);var i=this.byEnd[t];return i?i.appendLeft(e):this.intro+=e,this},Ht.prototype.appendRight=function(t,e){if("string"!=typeof e)throw new TypeError("inserted content must be a string");this._split(t);var i=this.byStart[t];return i?i.appendRight(e):this.outro+=e,this},Ht.prototype.clone=function(){for(var t=new Ht(this.original,{filename:this.filename}),e=this.firstChunk,i=t.firstChunk=t.lastSearchedChunk=e.clone();e;){t.byStart[i.start]=i,t.byEnd[i.end]=i;var r=e.next,n=r&&r.clone();n&&(i.next=n,n.previous=i,i=n),e=r}return t.lastChunk=i,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new Nt(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t},Ht.prototype.generateDecodedMap=function(t){var e=this;t=t||{};var i=Object.keys(this.storedNames),r=new Bt(t.hires),n=jt(this.original);return this.intro&&r.advance(this.intro),this.firstChunk.eachNext((function(t){var s=n(t.start);t.intro.length&&r.advance(t.intro),t.edited?r.addEdit(0,t.content,s,t.storeName?i.indexOf(t.original):-1):r.addUneditedChunk(0,t,e.original,s,e.sourcemapLocations),t.outro.length&&r.advance(t.outro)})),{file:t.file?t.file.split(/[/\\]/).pop():null,sources:[t.source?Vt(t.file||"",t.source):null],sourcesContent:t.includeContent?[this.original]:[null],names:i,mappings:r.raw}},Ht.prototype.generateMap=function(t){return new $t(this.generateDecodedMap(t))},Ht.prototype.getIndentString=function(){return null===this.indentStr?"\t":this.indentStr},Ht.prototype.indent=function(t,e){var i=/^[^\r\n]/gm;if(Ft(t)&&(e=t,t=void 0),""===(t=void 0!==t?t:this.indentStr||"\t"))return this;var r={};(e=e||{}).exclude&&("number"==typeof e.exclude[0]?[e.exclude]:e.exclude).forEach((function(t){for(var e=t[0];e<t[1];e+=1)r[e]=!0}));var n=!1!==e.indentStart,s=function(e){return n?""+t+e:(n=!0,e)};this.intro=this.intro.replace(i,s);for(var o=0,a=this.firstChunk;a;){var h=a.end;if(a.edited)r[o]||(a.content=a.content.replace(i,s),a.content.length&&(n="\n"===a.content[a.content.length-1]));else for(o=a.start;o<h;){if(!r[o]){var c=this.original[o];"\n"===c?n=!0:"\r"!==c&&n&&(n=!1,o===a.start?a.prependRight(t):(this._splitChunk(a,o),(a=a.next).prependRight(t)))}o+=1}o=a.end,a=a.next}return this.outro=this.outro.replace(i,s),this},Ht.prototype.insert=function(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")},Ht.prototype.insertLeft=function(t,e){return Gt.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),Gt.insertLeft=!0),this.appendLeft(t,e)},Ht.prototype.insertRight=function(t,e){return Gt.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),Gt.insertRight=!0),this.prependRight(t,e)},Ht.prototype.move=function(t,e,i){if(i>=t&&i<=e)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(e),this._split(i);var r=this.byStart[t],n=this.byEnd[e],s=r.previous,o=n.next,a=this.byStart[i];if(!a&&n===this.lastChunk)return this;var h=a?a.previous:this.lastChunk;return s&&(s.next=o),o&&(o.previous=s),h&&(h.next=r),a&&(a.previous=n),r.previous||(this.firstChunk=n.next),n.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=h,n.next=a||null,h||(this.firstChunk=r),a||(this.lastChunk=n),this},Ht.prototype.overwrite=function(t,e,i,r){if("string"!=typeof i)throw new TypeError("replacement content must be a string");for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;if(e>this.original.length)throw new Error("end is out of bounds");if(t===e)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(t),this._split(e),!0===r&&(Gt.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),Gt.storeName=!0),r={storeName:!0});var n=void 0!==r&&r.storeName,s=void 0!==r&&r.contentOnly;if(n){var o=this.original.slice(t,e);this.storedNames[o]=!0}var a=this.byStart[t],h=this.byEnd[e];if(a){if(e>a.end&&a.next!==this.byStart[a.end])throw new Error("Cannot overwrite across a split point");if(a.edit(i,n,s),a!==h){for(var c=a.next;c!==h;)c.edit("",!1),c=c.next;c.edit("",!1)}}else{var l=new Ot(t,e,"").edit(i,n);h.next=l,l.previous=h}return this},Ht.prototype.prepend=function(t){if("string"!=typeof t)throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this},Ht.prototype.prependLeft=function(t,e){if("string"!=typeof e)throw new TypeError("inserted content must be a string");this._split(t);var i=this.byEnd[t];return i?i.prependLeft(e):this.intro=e+this.intro,this},Ht.prototype.prependRight=function(t,e){if("string"!=typeof e)throw new TypeError("inserted content must be a string");this._split(t);var i=this.byStart[t];return i?i.prependRight(e):this.outro=e+this.outro,this},Ht.prototype.remove=function(t,e){for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;if(t===e)return this;if(t<0||e>this.original.length)throw new Error("Character is out of bounds");if(t>e)throw new Error("end must be greater than start");this._split(t),this._split(e);for(var i=this.byStart[t];i;)i.intro="",i.outro="",i.edit(""),i=e>i.end?this.byStart[i.end]:null;return this},Ht.prototype.lastChar=function(){if(this.outro.length)return this.outro[this.outro.length-1];var t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""},Ht.prototype.lastLine=function(){var t=this.outro.lastIndexOf(qt);if(-1!==t)return this.outro.substr(t+1);var e=this.outro,i=this.lastChunk;do{if(i.outro.length>0){if(-1!==(t=i.outro.lastIndexOf(qt)))return i.outro.substr(t+1)+e;e=i.outro+e}if(i.content.length>0){if(-1!==(t=i.content.lastIndexOf(qt)))return i.content.substr(t+1)+e;e=i.content+e}if(i.intro.length>0){if(-1!==(t=i.intro.lastIndexOf(qt)))return i.intro.substr(t+1)+e;e=i.intro+e}}while(i=i.previous);return-1!==(t=this.intro.lastIndexOf(qt))?this.intro.substr(t+1)+e:this.intro+e},Ht.prototype.slice=function(t,e){for(void 0===t&&(t=0),void 0===e&&(e=this.original.length);t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;for(var i="",r=this.firstChunk;r&&(r.start>t||r.end<=t);){if(r.start<e&&r.end>=e)return i;r=r.next}if(r&&r.edited&&r.start!==t)throw new Error("Cannot use replaced character "+t+" as slice start anchor.");for(var n=r;r;){!r.intro||n===r&&r.start!==t||(i+=r.intro);var s=r.start<e&&r.end>=e;if(s&&r.edited&&r.end!==e)throw new Error("Cannot use replaced character "+e+" as slice end anchor.");var o=n===r?t-r.start:0,a=s?r.content.length+e-r.end:r.content.length;if(i+=r.content.slice(o,a),!r.outro||s&&r.end!==e||(i+=r.outro),s)break;r=r.next}return i},Ht.prototype.snip=function(t,e){var i=this.clone();return i.remove(0,t),i.remove(e,i.original.length),i},Ht.prototype._split=function(t){if(!this.byStart[t]&&!this.byEnd[t])for(var e=this.lastSearchedChunk,i=t>e.end;e;){if(e.contains(t))return this._splitChunk(e,t);e=i?this.byStart[e.end]:this.byEnd[e.start]}},Ht.prototype._splitChunk=function(t,e){if(t.edited&&t.content.length){var i=jt(this.original)(e);throw new Error("Cannot split a chunk that has already been edited ("+i.line+":"+i.column+' – "'+t.original+'")')}var r=t.split(e);return this.byEnd[e]=t,this.byStart[e]=r,this.byEnd[r.end]=r,t===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=t,!0},Ht.prototype.toString=function(){for(var t=this.intro,e=this.firstChunk;e;)t+=e.toString(),e=e.next;return t+this.outro},Ht.prototype.isEmpty=function(){var t=this.firstChunk;do{if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1}while(t=t.next);return!0},Ht.prototype.length=function(){var t=this.firstChunk,e=0;do{e+=t.intro.length+t.content.length+t.outro.length}while(t=t.next);return e},Ht.prototype.trimLines=function(){return this.trim("[\\r\\n]")},Ht.prototype.trim=function(t){return this.trimStart(t).trimEnd(t)},Ht.prototype.trimEndAborted=function(t){var e=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;var i=this.lastChunk;do{var r=i.end,n=i.trimEnd(e);if(i.end!==r&&(this.lastChunk===i&&(this.lastChunk=i.next),this.byEnd[i.end]=i,this.byStart[i.next.start]=i.next,this.byEnd[i.next.end]=i.next),n)return!0;i=i.previous}while(i);return!1},Ht.prototype.trimEnd=function(t){return this.trimEndAborted(t),this},Ht.prototype.trimStartAborted=function(t){var e=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;var i=this.firstChunk;do{var r=i.end,n=i.trimStart(e);if(i.end!=