@velcro/bundler
Version:
Build a module graph of modules and serialize these to different formats
1 lines • 177 kB
JavaScript
this.Velcro=this.Velcro||{},this.Velcro.Bundler=function(t){"use strict";class e extends Error{constructor(){super(...arguments),this.name=this.constructor.name}}class i extends Error{constructor(){super(...arguments),this.name=this.constructor.name}}class r extends i{}class s extends i{constructor(t){super(`Entry was excluded by current configuration '${t.toString()}'`)}}class n extends i{constructor(t){super(`Unable to resolve '${t.toString()}'`)}}class a extends n{constructor(t,e){super(`The dependency '${t}' of '${e.toString()}' was not found`)}}async function o(t,e){try{const i=await t;return e.isCancellationRequested?Promise.reject(new r):i}catch(t){if(e.isCancellationRequested)return Promise.reject(new r);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 u=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 l(t){var e;(e=t)instanceof Error&&e.name===p&&e.message===p||u.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 s=e[Symbol.iterator]();for(let e=0;e<i;e++){const e=s.next();if(e.done)return[r,t.empty()];r.push(e.value)}return[r,{[Symbol.iterator]:()=>s}]}}(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 b{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 s,n=!1;return s=t((t=>{if(!n)return s?s.dispose():n=!0,e.call(i,t)}),null,r),n&&s.dispose(),s}}function i(t,e){return a(((i,r=null,s)=>t((t=>i.call(r,e(t))),null,s)))}function r(t,e){return a(((i,r=null,s)=>t((t=>{e(t),i.call(r,t)}),null,s)))}function s(t,e){return a(((i,r=null,s)=>t((t=>e(t)&&i.call(r,t)),null,s)))}function n(t,e,r){let s=r;return i(t,(t=>(s=e(s,t),s)))}function a(t){let e;const i=new _({onFirstListenerAdd(){e=t(i.fire,i)},onLastListenerRemove(){e.dispose()}});return i.event}function o(t,e,i=100,r=!1,s){let n,a=void 0,o=void 0,h=0;const c=new _({leakWarningThreshold:s,onFirstListenerAdd(){n=t((t=>{h++,a=e(a,t),r&&!o&&(c.fire(a),a=void 0),clearTimeout(o),o=setTimeout((()=>{const t=a;a=void 0,o=void 0,(!r||h>1)&&c.fire(t),h=0}),i)}))},onLastListenerRemove(){n.dispose()}});return c.event}function h(t){let e,i=!0;return s(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=s,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=n,t.snapshot=a,t.debounce=o,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(),s=t((t=>{r?r.push(t):a.fire(t)}));const n=()=>{r&&r.forEach((t=>a.fire(t))),r=null},a=new _({onFirstListenerAdd(){s||(s=t((t=>a.fire(t))))},onFirstListenerDidAdd(){r&&(e?setTimeout(n):n())},onLastListenerRemove(){s&&s.dispose(),s=null}});return a.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(s(this.event,t))}reduce(t,e){return new c(n(this.event,t,e))}latch(){return new c(h(this.event))}debounce(t,e=100,i=!1,r){return new c(o(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)=>s.fire(i(...t)),s=new _({onFirstListenerAdd:()=>t.on(e,r),onLastListenerRemove:()=>t.removeListener(e,r)});return s.event},t.fromDOMEventEmitter=function(t,e,i=(t=>t)){const r=(...t)=>s.fire(i(...t)),s=new _({onFirstListenerAdd:()=>t.addEventListener(e,r),onLastListenerRemove:()=>t.removeEventListener(e,r)});return s.event},t.fromPromise=function(t){const e=new _;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 _{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 b);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(e?[t,e]:t);let n,a;return r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,t,e),this._leakageMon&&(n=this._leakageMon.check(this._listeners.size)),a={dispose:()=>{if(n&&n(),a.dispose=_._noop,!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}},i instanceof v?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event}fire(t){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new b);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){l(t)}}}}dispose(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0}}_._noop=function(){};const w=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:w})}(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?w:(this._emitter||(this._emitter=new _),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 E="object"==typeof self?self:"object"==typeof global?global:{},A=function(){if(E.setImmediate)return E.setImmediate.bind(E);if("function"==typeof E.postMessage&&!E.importScripts){let t=[];E.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}),E.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,P=I.cwd,L=I.env,T=(I.platform,I.nextTick,46),N=47,R=92,M=58;class V 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 s=-1!==t.indexOf(".")?"property":"argument";let n=`The "${t}" ${s} ${r} of type ${e}`;n+=". Received type "+typeof i,super(n),this.code="ERR_INVALID_ARG_TYPE"}}function O(t,e){if("string"!=typeof t)throw new V(e,"string",t)}function D(t){return t===N||t===R}function B(t){return t===N}function U(t){return t>=65&&t<=90||t>=97&&t<=122}function j(t,e,i,r){let s="",n=0,a=-1,o=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=N}if(r(h)){if(a===c-1||1===o);else if(2===o){if(s.length<2||2!==n||s.charCodeAt(s.length-1)!==T||s.charCodeAt(s.length-2)!==T){if(s.length>2){const t=s.lastIndexOf(i);-1===t?(s="",n=0):(s=s.slice(0,t),n=s.length-1-s.lastIndexOf(i)),a=c,o=0;continue}if(0!==s.length){s="",n=0,a=c,o=0;continue}}e&&(s+=s.length>0?i+"..":"..",n=2)}else s.length>0?s+=`${i}${t.slice(a+1,c)}`:s=t.slice(a+1,c),n=c-a-1;a=c,o=0}else h===T&&-1!==o?++o:o=-1}return s}function q(t,e){if(null===e||"object"!=typeof e)throw new V("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 F={resolve(...t){let e="",i="",r=!1;for(let s=t.length-1;s>=-1;s--){let n;if(s>=0){if(n=t[s],O(n,"path"),0===n.length)continue}else 0===e.length?n=P():(n=L["="+e]||P(),(void 0===n||n.slice(0,2).toLowerCase()!==e.toLowerCase()&&n.charCodeAt(2)===R)&&(n=e+"\\"));const a=n.length;let o=0,h="",c=!1;const u=n.charCodeAt(0);if(1===a)D(u)&&(o=1,c=!0);else if(D(u))if(c=!0,D(n.charCodeAt(1))){let t=2,e=t;for(;t<a&&!D(n.charCodeAt(t));)t++;if(t<a&&t!==e){const i=n.slice(e,t);for(e=t;t<a&&D(n.charCodeAt(t));)t++;if(t<a&&t!==e){for(e=t;t<a&&!D(n.charCodeAt(t));)t++;t!==a&&t===e||(h=`\\\\${i}\\${n.slice(e,t)}`,o=t)}}}else o=1;else U(u)&&n.charCodeAt(1)===M&&(h=n.slice(0,2),o=2,a>2&&D(n.charCodeAt(2))&&(c=!0,o=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=`${n.slice(o)}\\${i}`,r=c,c&&e.length>0)break}return i=j(i,!r,"\\",D),r?`${e}\\${i}`:`${e}${i}`||"."},normalize(t){O(t,"path");const e=t.length;if(0===e)return".";let i,r=0,s=!1;const n=t.charCodeAt(0);if(1===e)return B(n)?"\\":t;if(D(n))if(s=!0,D(t.charCodeAt(1))){let s=2,n=s;for(;s<e&&!D(t.charCodeAt(s));)s++;if(s<e&&s!==n){const a=t.slice(n,s);for(n=s;s<e&&D(t.charCodeAt(s));)s++;if(s<e&&s!==n){for(n=s;s<e&&!D(t.charCodeAt(s));)s++;if(s===e)return`\\\\${a}\\${t.slice(n)}\\`;s!==n&&(i=`\\\\${a}\\${t.slice(n,s)}`,r=s)}}}else r=1;else U(n)&&t.charCodeAt(1)===M&&(i=t.slice(0,2),r=2,e>2&&D(t.charCodeAt(2))&&(s=!0,r=3));let a=r<e?j(t.slice(r),!s,"\\",D):"";return 0!==a.length||s||(a="."),a.length>0&&D(t.charCodeAt(e-1))&&(a+="\\"),void 0===i?s?"\\"+a:a:s?`${i}\\${a}`:`${i}${a}`},isAbsolute(t){O(t,"path");const e=t.length;if(0===e)return!1;const i=t.charCodeAt(0);return D(i)||e>2&&U(i)&&t.charCodeAt(1)===M&&D(t.charCodeAt(2))},join(...t){if(0===t.length)return".";let e,i;for(let r=0;r<t.length;++r){const s=t[r];O(s,"path"),s.length>0&&(void 0===e?e=i=s:e+="\\"+s)}if(void 0===e)return".";let r=!0,s=0;if("string"==typeof i&&D(i.charCodeAt(0))){++s;const t=i.length;t>1&&D(i.charCodeAt(1))&&(++s,t>2&&(D(i.charCodeAt(2))?++s:r=!1))}if(r){for(;s<e.length&&D(e.charCodeAt(s));)s++;s>=2&&(e="\\"+e.slice(s))}return F.normalize(e)},relative(t,e){if(O(t,"from"),O(e,"to"),t===e)return"";const i=F.resolve(t),r=F.resolve(e);if(i===r)return"";if((t=i.toLowerCase())===(e=r.toLowerCase()))return"";let s=0;for(;s<t.length&&t.charCodeAt(s)===R;)s++;let n=t.length;for(;n-1>s&&t.charCodeAt(n-1)===R;)n--;const a=n-s;let o=0;for(;o<e.length&&e.charCodeAt(o)===R;)o++;let h=e.length;for(;h-1>o&&e.charCodeAt(h-1)===R;)h--;const c=h-o,u=a<c?a:c;let l=-1,p=0;for(;p<u;p++){const i=t.charCodeAt(s+p);if(i!==e.charCodeAt(o+p))break;i===R&&(l=p)}if(p!==u){if(-1===l)return r}else{if(c>u){if(e.charCodeAt(o+p)===R)return r.slice(o+p+1);if(2===p)return r.slice(o+p)}a>u&&(t.charCodeAt(s+p)===R?l=p:2===p&&(l=3)),-1===l&&(l=0)}let d="";for(p=s+l+1;p<=n;++p)p!==n&&t.charCodeAt(p)!==R||(d+=0===d.length?"..":"\\..");return o+=l,d.length>0?`${d}${r.slice(o,h)}`:(r.charCodeAt(o)===R&&++o,r.slice(o,h))},toNamespacedPath(t){if("string"!=typeof t)return t;if(0===t.length)return"";const e=F.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===R){if(e.charCodeAt(1)===R){const t=e.charCodeAt(2);if(63!==t&&t!==T)return"\\\\?\\UNC\\"+e.slice(2)}}else if(U(e.charCodeAt(0))&&e.charCodeAt(1)===M&&e.charCodeAt(2)===R)return"\\\\?\\"+e;return t},dirname(t){O(t,"path");const e=t.length;if(0===e)return".";let i=-1,r=0;const s=t.charCodeAt(0);if(1===e)return D(s)?t:".";if(D(s)){if(i=r=1,D(t.charCodeAt(1))){let s=2,n=s;for(;s<e&&!D(t.charCodeAt(s));)s++;if(s<e&&s!==n){for(n=s;s<e&&D(t.charCodeAt(s));)s++;if(s<e&&s!==n){for(n=s;s<e&&!D(t.charCodeAt(s));)s++;if(s===e)return t;s!==n&&(i=r=s+1)}}}}else U(s)&&t.charCodeAt(1)===M&&(i=e>2&&D(t.charCodeAt(2))?3:2,r=i);let n=-1,a=!0;for(let i=e-1;i>=r;--i)if(D(t.charCodeAt(i))){if(!a){n=i;break}}else a=!1;if(-1===n){if(-1===i)return".";n=i}return t.slice(0,n)},basename(t,e){void 0!==e&&O(e,"ext"),O(t,"path");let i,r=0,s=-1,n=!0;if(t.length>=2&&U(t.charCodeAt(0))&&t.charCodeAt(1)===M&&(r=2),void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let a=e.length-1,o=-1;for(i=t.length-1;i>=r;--i){const h=t.charCodeAt(i);if(D(h)){if(!n){r=i+1;break}}else-1===o&&(n=!1,o=i+1),a>=0&&(h===e.charCodeAt(a)?-1==--a&&(s=i):(a=-1,s=o))}return r===s?s=o:-1===s&&(s=t.length),t.slice(r,s)}for(i=t.length-1;i>=r;--i)if(D(t.charCodeAt(i))){if(!n){r=i+1;break}}else-1===s&&(n=!1,s=i+1);return-1===s?"":t.slice(r,s)},extname(t){O(t,"path");let e=0,i=-1,r=0,s=-1,n=!0,a=0;t.length>=2&&t.charCodeAt(1)===M&&U(t.charCodeAt(0))&&(e=r=2);for(let o=t.length-1;o>=e;--o){const e=t.charCodeAt(o);if(D(e)){if(!n){r=o+1;break}}else-1===s&&(n=!1,s=o+1),e===T?-1===i?i=o:1!==a&&(a=1):-1!==i&&(a=-1)}return-1===i||-1===s||0===a||1===a&&i===s-1&&i===r+1?"":t.slice(i,s)},format:q.bind(null,"\\"),parse(t){O(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;const i=t.length;let r=0,s=t.charCodeAt(0);if(1===i)return D(s)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(D(s)){if(r=1,D(t.charCodeAt(1))){let e=2,s=e;for(;e<i&&!D(t.charCodeAt(e));)e++;if(e<i&&e!==s){for(s=e;e<i&&D(t.charCodeAt(e));)e++;if(e<i&&e!==s){for(s=e;e<i&&!D(t.charCodeAt(e));)e++;e===i?r=e:e!==s&&(r=e+1)}}}}else if(U(s)&&t.charCodeAt(1)===M){if(i<=2)return e.root=e.dir=t,e;if(r=2,D(t.charCodeAt(2))){if(3===i)return e.root=e.dir=t,e;r=3}}r>0&&(e.root=t.slice(0,r));let n=-1,a=r,o=-1,h=!0,c=t.length-1,u=0;for(;c>=r;--c)if(s=t.charCodeAt(c),D(s)){if(!h){a=c+1;break}}else-1===o&&(h=!1,o=c+1),s===T?-1===n?n=c:1!==u&&(u=1):-1!==n&&(u=-1);return-1!==o&&(-1===n||0===u||1===u&&n===o-1&&n===a+1?e.base=e.name=t.slice(a,o):(e.name=t.slice(a,n),e.base=t.slice(a,o),e.ext=t.slice(n,o))),e.dir=a>0&&a!==r?t.slice(0,a-1):e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},$={resolve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){const s=r>=0?t[r]:P();O(s,"path"),0!==s.length&&(e=`${s}/${e}`,i=s.charCodeAt(0)===N)}return e=j(e,!i,"/",B),i?"/"+e:e.length>0?e:"."},normalize(t){if(O(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===N,i=t.charCodeAt(t.length-1)===N;return 0===(t=j(t,!e,"/",B)).length?e?"/":i?"./":".":(i&&(t+="/"),e?"/"+t:t)},isAbsolute:t=>(O(t,"path"),t.length>0&&t.charCodeAt(0)===N),join(...t){if(0===t.length)return".";let e;for(let i=0;i<t.length;++i){const r=t[i];O(r,"path"),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":$.normalize(e)},relative(t,e){if(O(t,"from"),O(e,"to"),t===e)return"";if((t=$.resolve(t))===(e=$.resolve(e)))return"";const i=t.length,r=i-1,s=e.length-1,n=r<s?r:s;let a=-1,o=0;for(;o<n;o++){const i=t.charCodeAt(1+o);if(i!==e.charCodeAt(1+o))break;i===N&&(a=o)}if(o===n)if(s>n){if(e.charCodeAt(1+o)===N)return e.slice(1+o+1);if(0===o)return e.slice(1+o)}else r>n&&(t.charCodeAt(1+o)===N?a=o:0===o&&(a=0));let h="";for(o=1+a+1;o<=i;++o)o!==i&&t.charCodeAt(o)!==N||(h+=0===h.length?"..":"/..");return`${h}${e.slice(1+a)}`},toNamespacedPath:t=>t,dirname(t){if(O(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===N;let i=-1,r=!0;for(let e=t.length-1;e>=1;--e)if(t.charCodeAt(e)===N){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&&O(e,"ext"),O(t,"path");let i,r=0,s=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let a=e.length-1,o=-1;for(i=t.length-1;i>=0;--i){const h=t.charCodeAt(i);if(h===N){if(!n){r=i+1;break}}else-1===o&&(n=!1,o=i+1),a>=0&&(h===e.charCodeAt(a)?-1==--a&&(s=i):(a=-1,s=o))}return r===s?s=o:-1===s&&(s=t.length),t.slice(r,s)}for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===N){if(!n){r=i+1;break}}else-1===s&&(n=!1,s=i+1);return-1===s?"":t.slice(r,s)},extname(t){O(t,"path");let e=-1,i=0,r=-1,s=!0,n=0;for(let a=t.length-1;a>=0;--a){const o=t.charCodeAt(a);if(o!==N)-1===r&&(s=!1,r=a+1),o===T?-1===e?e=a:1!==n&&(n=1):-1!==e&&(n=-1);else if(!s){i=a+1;break}}return-1===e||-1===r||0===n||1===n&&e===r-1&&e===i+1?"":t.slice(e,r)},format:q.bind(null,"/"),parse(t){O(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;const i=t.charCodeAt(0)===N;let r;i?(e.root="/",r=1):r=0;let s=-1,n=0,a=-1,o=!0,h=t.length-1,c=0;for(;h>=r;--h){const e=t.charCodeAt(h);if(e!==N)-1===a&&(o=!1,a=h+1),e===T?-1===s?s=h:1!==c&&(c=1):-1!==s&&(c=-1);else if(!o){n=h+1;break}}if(-1!==a){const r=0===n&&i?1:n;-1===s||0===c||1===c&&s===a-1&&s===n+1?e.base=e.name=t.slice(r,a):(e.name=t.slice(r,s),e.base=t.slice(r,a),e.ext=t.slice(s,a))}return n>0?e.dir=t.slice(0,n-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};$.win32=F.win32=F,$.posix=F.posix=$;class G{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()}}const H=47;class z 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 s=-1!==t.indexOf(".")?"property":"argument";let n=`The "${t}" ${s} ${r} of type ${e}`;n+=". Received type "+typeof i,super(n),this.code="ERR_INVALID_ARG_TYPE"}}function W(t,e){if("string"!=typeof t)throw new z(e,"string",t)}function Q(t){return t===H}function K(t,e,i,r){let s="",n=0,a=-1,o=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=H}if(r(h)){if(a===c-1||1===o);else if(2===o){if(s.length<2||2!==n||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){const t=s.lastIndexOf(i);-1===t?(s="",n=0):(s=s.slice(0,t),n=s.length-1-s.lastIndexOf(i)),a=c,o=0;continue}if(0!==s.length){s="",n=0,a=c,o=0;continue}}e&&(s+=s.length>0?i+"..":"..",n=2)}else s.length>0?s+=`${i}${t.slice(a+1,c)}`:s=t.slice(a+1,c),n=c-a-1;a=c,o=0}else 46===h&&-1!==o?++o:o=-1}return s}const J={resolve(...t){let e="",i=!1;for(let r=t.length-1;r>=-1&&!i;r--){const s=r>=0?t[r]:process.cwd();W(s,"path"),0!==s.length&&(e=`${s}/${e}`,i=s.charCodeAt(0)===H)}return e=K(e,!i,"/",Q),i?"/"+e:e.length>0?e:"."},normalize(t){if(W(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===H,i=t.charCodeAt(t.length-1)===H;return 0===(t=K(t,!e,"/",Q)).length?e?"/":i?"./":".":(i&&(t+="/"),e?"/"+t:t)},isAbsolute:t=>(W(t,"path"),t.length>0&&t.charCodeAt(0)===H),join(...t){if(0===t.length)return".";let e;for(let i=0;i<t.length;++i){const r=t[i];W(r,"path"),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":J.normalize(e)},relative(t,e){if(W(t,"from"),W(e,"to"),t===e)return"";if((t=J.resolve(t))===(e=J.resolve(e)))return"";const i=t.length,r=i-1,s=e.length-1,n=r<s?r:s;let a=-1,o=0;for(;o<n;o++){const i=t.charCodeAt(1+o);if(i!==e.charCodeAt(1+o))break;i===H&&(a=o)}if(o===n)if(s>n){if(e.charCodeAt(1+o)===H)return e.slice(1+o+1);if(0===o)return e.slice(1+o)}else r>n&&(t.charCodeAt(1+o)===H?a=o:0===o&&(a=0));let h="";for(o=1+a+1;o<=i;++o)o!==i&&t.charCodeAt(o)!==H||(h+=0===h.length?"..":"/..");return`${h}${e.slice(1+a)}`},toNamespacedPath:t=>t,dirname(t){if(W(t,"path"),0===t.length)return".";const e=t.charCodeAt(0)===H;let i=-1,r=!0;for(let e=t.length-1;e>=1;--e)if(t.charCodeAt(e)===H){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&&W(e,"ext"),W(t,"path");let i,r=0,s=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let a=e.length-1,o=-1;for(i=t.length-1;i>=0;--i){const h=t.charCodeAt(i);if(h===H){if(!n){r=i+1;break}}else-1===o&&(n=!1,o=i+1),a>=0&&(h===e.charCodeAt(a)?-1==--a&&(s=i):(a=-1,s=o))}return r===s?s=o:-1===s&&(s=t.length),t.slice(r,s)}for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===H){if(!n){r=i+1;break}}else-1===s&&(n=!1,s=i+1);return-1===s?"":t.slice(r,s)},extname(t){W(t,"path");let e=-1,i=0,r=-1,s=!0,n=0;for(let a=t.length-1;a>=0;--a){const o=t.charCodeAt(a);if(o!==H)-1===r&&(s=!1,r=a+1),46===o?-1===e?e=a:1!==n&&(n=1):-1!==e&&(n=-1);else if(!s){i=a+1;break}}return-1===e||-1===r||0===n||1===n&&e===r-1&&e===i+1?"":t.slice(e,r)},format:function(t,e){if(null===e||"object"!=typeof e)throw new z("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){W(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;const i=t.charCodeAt(0)===H;let r;i?(e.root="/",r=1):r=0;let s=-1,n=0,a=-1,o=!0,h=t.length-1,c=0;for(;h>=r;--h){const e=t.charCodeAt(h);if(e!==H)-1===a&&(o=!1,a=h+1),46===e?-1===s?s=h:1!==c&&(c=1):-1!==s&&(c=-1);else if(!o){n=h+1;break}}if(-1!==a){const r=0===n&&i?1:n;-1===s||0===c||1===c&&s===a-1&&s===n+1?e.base=e.name=t.slice(r,a):(e.name=t.slice(r,s),e.base=t.slice(r,a),e.ext=t.slice(s,a))}return n>0?e.dir=t.slice(0,n-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null},X=J.join,Y=/^\w[\w\d+.-]*$/,Z=/^\//,tt=/^\/\//;const et="",it="/",rt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class st{constructor(t,e,i,r,s,n=!1){"object"==typeof t?(this.scheme=t.scheme||et,this.authority=t.authority||et,this.path=t.path||et,this.query=t.query||et,this.fragment=t.fragment||et):(this.scheme=function(t,e){return t||e?t:"file"}(t,n),this.authority=e||et,this.path=function(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==it&&(e=it+e):e=it}return e}(this.scheme,i||et),this.query=r||et,this.fragment=s||et,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&&!Y.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!Z.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(tt.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,n))}static ensureTrailingSlash(t,e="/"){return t.with({path:t.path.replace(gt,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,s="/"===r.charAt(r.length-1)?-1:0;for(let n=0;n<=i.length;n++)if(n<r.length){if(i.charAt(n)!==r.charAt(n))throw new Error(`The child entry ${t.toString()} does not have the pathname of ${e.toString()} as a prefix`)}else if(n===r.length+s){if("/"!==i.charAt(n))throw new Error(`The child entry ${t.toString()} does not have the pathname of ${e.toString()} as a prefix`)}else if("/"===i.charAt(n))return i.slice(r.length+1+s,n);return i.slice(r.length+1+s)}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 st||!!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 ut(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:i,path:r,query:s,fragment:n}=t;return void 0===e?e=this.scheme:null===e&&(e=et),void 0===i?i=this.authority:null===i&&(i=et),void 0===r?r=this.path:null===r&&(r=et),void 0===s?s=this.query:null===s&&(s=et),void 0===n?n=this.fragment:null===n&&(n=et),e===this.scheme&&i===this.authority&&r===this.path&&s===this.query&&n===this.fragment?this:new at(e,i,r,s,n)}static parse(t,e=!1){const i=rt.exec(t);return i?new at(i[2]||et,ft(i[4]||et),ft(i[5]||et),ft(i[7]||et),ft(i[9]||et),e):new at(et,et,et,et,et)}static file(t){let e=et;if(t[0]===it&&t[1]===it){const i=t.indexOf(it,2);-1===i?(e=t.substring(2),t=it):(e=t.substring(2,i),t=t.substring(i)||it)}return new at("file",e,t,et,et)}static from(t){return new at(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=X(t.path,...e);return t.with({path:i})}toString(t=!0){return lt(this,t)}toJSON(){return this}static revive(t){if(t){if(t instanceof st)return t;{const e=new at(t);return e._formatted=t.external,e._fsPath=t._sep===nt?t.fsPath:null,e}}return t}}const nt=void 0;class at extends st{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ut(this,!1)),this._fsPath}toString(t=!0){return t?(this._formatted||(this._formatted=lt(this,!0)),this._formatted):lt(this,!1)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=nt),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 ot={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 ht(t,e){let i=void 0,r=-1;for(let s=0;s<t.length;s++){const n=t.charCodeAt(s);if(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||45===n||46===n||95===n||126===n||e&&47===n)-1!==r&&(i+=encodeURIComponent(t.substring(r,s)),r=-1),void 0!==i&&(i+=t.charAt(s));else{void 0===i&&(i=t.substr(0,s));const e=ot[n];void 0!==e?(-1!==r&&(i+=encodeURIComponent(t.substring(r,s)),r=-1),i+=e):-1===r&&(r=s)}}return-1!==r&&(i+=encodeURIComponent(t.substring(r))),void 0!==i?i:t}function ct(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+=ot[r]):void 0!==e&&(e+=t[i])}return void 0!==e?e:t}function ut(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 lt(t,e){const i=e?ct:ht;let r="",{scheme:s,authority:n,path:a,query:o,fragment:h}=t;if(s&&(r+=s,r+=":"),(n||"file"===s)&&(r+=it,r+=it),n){let t=n.indexOf("@");if(-1!==t){const e=n.substr(0,t);n=n.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+="@"}n=n.toLowerCase(),t=n.indexOf(":"),-1===t?r+=i(n,!1):(r+=i(n.substr(0,t),!1),r+=n.substr(t))}if(a){if(a.length>=3&&47===a.charCodeAt(0)&&58===a.charCodeAt(2)){const t=a.charCodeAt(1);t>=65&&t<=90&&(a=`/${String.fromCharCode(t+32)}:${a.substr(3)}`)}else if(a.length>=2&&58===a.charCodeAt(1)){const t=a.charCodeAt(0);t>=65&&t<=90&&(a=`${String.fromCharCode(t+32)}:${a.substr(2)}`)}r+=i(a,!0)}return o&&(r+="?",r+=i(o,!1)),h&&(r+="#",r+=e?h:ht(h,!1)),r}function pt(t){try{return decodeURIComponent(t)}catch(e){return t.length>3?t.substr(0,3)+pt(t.substr(3)):t}}const dt=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ft(t){return t.match(dt)?t.replace(dt,(t=>pt(t))):t}const gt=/\/?$/;for(var mt={},vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yt=0;yt<vt.length;yt++)mt[vt.charCodeAt(yt)]=yt;function xt(t){for(var e=[],i=[],r=[0,0,0,0,0],s=0,n=0,a=0,o=0;n<t.length;n++){var h=t.charCodeAt(n);if(44===h)bt(i,r,s),s=0;else if(59===h)bt(i,r,s),s=0,e.push(i),i=[],r[0]=0;else{var c=mt[h];if(void 0===c)throw new Error("Invalid character ("+String.fromCharCode(h)+")");var u=32&c;if(o+=(c&=31)<<a,u)a+=5;else{var l=1&o;o>>>=1,l&&(o=0===o?-2147483648:-o),r[s]+=o,s++,o=a=0}}}return bt(i,r,s),e.push(i),e}function bt(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 _t(t){for(var e=0,i=0,r=0,s=0,n="",a=0;a<t.length;a++){var o=t[a];if(a>0&&(n+=";"),0!==o.length){for(var h=0,c=[],u=0,l=o;u<l.length;u++){var p=l[u],d=wt(p[0]-h);h=p[0],p.length>1&&(d+=wt(p[1]-e)+wt(p[2]-i)+wt(p[3]-r),e=p[1],i=p[2],r=p[3]),5===p.length&&(d+=wt(p[4]-s),s=p[4]),c.push(d)}n+=c.join(",")}}return n}function wt(t){var e="";t=t<0?-t<<1|1:t<<1;do{var i=31&t;(t>>>=5)>0&&(i|=32),e+=vt[i]}while(t>0);return e}var Ct=function t(e){this.bits=e instanceof t?e.bits.slice():[]};Ct.prototype.add=function(t){this.bits[t>>5]|=1<<(31&t)},Ct.prototype.has=function(t){return!!(this.bits[t>>5]&1<<(31&t))};var St=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}})};St.prototype.appendLeft=function(t){this.outro+=t},St.prototype.appendRight=function(t){this.intro=this.intro+t},St.prototype.clone=function(){var t=new St(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},St.prototype.contains=function(t){return this.start<t&&t<this.end},St.prototype.eachNext=function(t){for(var e=this;e;)t(e),e=e.next},St.prototype.eachPrevious=function(t){for(var e=this;e;)t(e),e=e.previous},St.prototype.edit=function(t,e,i){return this.content=t,i||(this.intro="",this.outro=""),this.storeName=e,this.edited=!0,this},St.prototype.prependLeft=function(t){this.outro=t+this.outro},St.prototype.prependRight=function(t){this.intro=t+this.intro},St.prototype.split=function(t){var e=t-this.start,i=this.original.slice(0,e),r=this.original.slice(e);this.original=i;var s=new St(t,this.end,r);return s.outro=this.outro,this.outro="",this.end=t,this.edited?(s.edit("",!1),this.content=""):this.content=i,s.next=this.next,s.next&&(s.next.previous=s),s.previous=this,this.next=s,s},St.prototype.toString=function(){return this.intro+this.content+this.outro},St.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)},St.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 kt=function(){throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};"undefined"!=typeof window&&"function"==typeof window.btoa?kt=function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"function"==typeof Buffer&&(kt=function(t){return Buffer.from(t,"utf-8").toString("base64")});var Et=function(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=_t(t.mappings)};function At(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 s=r.reduce((function(t,e){var i=/^ +/.exec(e)[0].length;return Math.min(i,t)}),1/0);return new Array(s+1).join(" ")}function It(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 s=i.length;s--;)i[s]="..";return i.concat(r).join("/")}Et.prototype.toString=function(){return JSON.stringify(this)},Et.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+kt(this.toString())};var Pt=Object.prototype.toString;function Lt(t){return"[object Object]"===Pt.call(t)}function Tt(t){for(var e=t.split("\n"),i=[],r=0,s=0;r<e.length;r++)i.push(s),s+=e[r].length+1;return function(t){for(var e=0,r=i.length;e<r;){var s=e+r>>1;t<i[s]?r=s:e=s+1}var n=e-1;return{line:n,column:t-i[n]}}}var Nt=function(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null};Nt.prototype.addEdit=function(t,e,i,r){if(e.length){var s=[this.generatedCodeColumn,t,i.line,i.column];r>=0&&s.push(r),this.rawSegments.push(s)}else this.pending&&this.rawSegments.push(this.pending);this.advance(e),this.pending=null},Nt.prototype.addUneditedChunk=function(t,e,i,r,s){for(var n=e.start,a=!0;n<e.end;)(this.hires||a||s.has(n))&&this.rawSegments.push([this.generatedCodeColumn,t,r.line,r.column]),"\n"===i[n]?(r.line+=1,r.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=!0):(r.column+=1,this.generatedCodeColumn+=1,a=!1),n+=1;this.pending=null},Nt.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 Rt="\n",Mt={insertLeft:!1,insertRight:!1,storeName:!1},Vt=function(t,e){void 0===e&&(e={});var i=new St(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 Ct},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:At(t)}}),this.byStart[0]=i,this.byEnd[t.length]=i};Vt.prototype.addSourcemapLocation=function(t){this.sourcemapLocations.add(t)},Vt.prototype.append=function(t){if("string"!=typeof t)throw new TypeError("outro content must be a string");return this.outro+=t,this},Vt.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},Vt.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},Vt.prototype.clone=function(){for(var t=new Vt(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,s=r&&r.clone();s&&(i.next=s,s.previous=i,i=s),e=r}return t.lastChunk=i,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new Ct(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t},Vt.prototype.generateDecodedMap=function(t){var e=this;t=t||{};var i=Object.keys(this.storedNames),r=new Nt(t.hires),s=Tt(this.original);return this.intro&&r.advance(this.intro),this.firstChunk.eachNext((function(t){var n=s(t.start);t.intro.length&&r.advance(t.intro),t.edited?r.addEdit(0,t.content,n,t.storeName?i.indexOf(t.original):-1):r.addUneditedChunk(0,t,e.original,n,e.sourcemapLocations),t.outro.length&&r.advance(t.outro)})),{file:t.file?t.file.split(/[/\\]/).pop():null,sources:[t.source?It(t.file||"",t.source):null],sourcesContent:t.includeContent?[this.original]:[null],names:i,mappings:r.raw}},Vt.prototype.generateMap=function(t){return new Et(this.generateDecodedMap(t))},Vt.prototype.getIndentString=function(){return null===this.indentStr?"\t":this.indentStr},Vt.prototype.indent=function(t,e){var i=/^[^\r\n]/gm;if(Lt(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 s=!1!==e.indentStart,n=function(e){return s?""+t+e:(s=!0,e)};this.intro=this.intro.replace(i,n);for(var a=0,o=this.firstChunk;o;){var h=o.end;if(o.edited)r[a]||(o.content=o.content.replace(i,n),o.content.length&&(s="\n"===o.content[o.content.length-1]));else for(a=o.start;a<h;){if(!r[a]){var c=this.original[a];"\n"===c?s=!0:"\r"!==c&&s&&(s=!1,a===o.start?o.prependRight(t):(this._splitChunk(o,a),(o=o.next).prependRight(t)))}a+=1}a=o.end,o=o.next}return this.outro=this.outro.replace(i,n),this},Vt.prototype.insert=function(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")},Vt.prototype.insertLeft=function(t,e){return Mt.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),Mt.insertLeft=!0),this.appendLeft(t,e)},Vt.prototype.insertRight=function(t,e){return Mt.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),Mt.insertRight=!0),this.prependRight(t,e)},Vt.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],s=this.byEnd[e],n=r.previous,a=s.next,o=this.byStart[i];if(!o&&s===this.lastChunk)return this;var h=o?o.previous:this.lastChunk;return n&&(n.next=a),a&&(a.previous=n),h&&(h.next=r),o&&(o.previous=s),r.previous||(this.firstChunk=s.next),s.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=h,s.next=o||null,h||(this.firstChunk=r),o||(this.lastChunk=s),this},Vt.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&&(Mt.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),Mt.storeName=!0),r={storeName:!0});var s=void 0!==r&&r.storeName,n=void 0!==r&&r.contentOnly;if(s){var a=this.original.slice(t,e);this.storedNames[a]=!0}var o=this.byStart[t],h=this.byEnd[e];if(o){if(e>o.end&&o.next!==this.byStart[o.end])throw new Error("Cannot overwrite across a split point");if(o.edit(i,s,n),o!==h){for(var c=o.next;c!==h;)c.edit("",!1),c=c.next;c.edit("",!1)}}else{var u=new St(t,e,"").edit(i,s);h.next=u,u.previous=h}return this},Vt.prototype.prepend=function(t){if("string"!=typeof t)throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this},Vt.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},Vt.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},Vt.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},Vt.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]:""},Vt.prototype.lastLine=function(){var t=this.outro.lastIndexOf(Rt);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(Rt)))return i.outro.substr(t+1)+e;e=i.outro+e}if(i.content.length>0){if(-1!==(t=i.content.lastIndexOf(Rt)))return i.content.substr(t+1)+e;e=i.content+e}if(i.intro.length>0){if(-1!==(t=i.intro.lastIndexOf(Rt)))return i.intro.substr(t+1)+e;e=i.intro+e}}while(i=i.previous);return-1!==(t=this.intro.lastIndexOf(Rt))?this.intro.substr(t+1)+e:this.intro+e},Vt.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 s=r;r;){!r.intro||s===r&&r.start!==t||(i+=r.intro);var n=r.start<e&&r.end>=e;if(n&&r.edited&&r.end!==e)throw new Error("Cannot use replaced character "+e+" as slice end anchor.");var a=s===r?t-r.start:0,o=n?r.content.length+e-r.end:r.content.length;if(i+=r.content.slice(a,o),!r.outro||n&&r.end!==e||(i+=r.outro),n)break;r=r.next}return i},Vt.prototype.snip=function(t,e){var i=this.clone();return i.remove(0,t),i.remove(e,i.original.length),i},Vt.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]}},Vt.prototype._splitChunk=function(t,e){if(t.edited&&t.content.length){var i=Tt(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},Vt.prototype.toString=function(){for(var t=this.intro,e=this.firstChunk;e;)t+=e.toString(),e=e.next;return t+this.outro},Vt.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},Vt.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},Vt.prototype.trimLines=function(){return this.trim("[\\r\\n]")},Vt.prototype.trim=function(t){return this.trimStart(t).trimEnd(t)},Vt.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,s=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),s)return!0;i=i.previous}while(i);return!1},Vt.prototype.trimEnd=function(t){return this.trimEndAborted(t),this},Vt.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,s=i.trimStart(e);if(i.end!==r&&(i===this.lastChunk&&(this.lastChunk=i.next),this.byEnd[i.end]=i,this.byStart[i.next.start]=i.next,this.byEnd[i.next.end]=i.next),s)return!0;i=i.next}while(i);return!1},Vt.prototype.trimStart=function(t){return this.trimStartAborted(t),this};var Ot,Dt=Object.prototype.hasOwnProperty,Bt=function(t){void 0===t&&(t={}),this.intro=t.intro||"",this.separator=void 0!==t.separator?t.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}};Bt.prototype.addSource=function(t){if(t instanceof Vt)return this.addSource({content:t,filename:t.filename,separator:this.separator});if(!Lt(t)||!t.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","indentExclusionRanges","separator"].forEach((function(e){Dt.call(t,e)||(t[e]=t.content[e])})),void 0===t.separator&&(t.separator=this.separator),t.filename)if(Dt.call(this.uniqueSourceIndexByFilename,t.filename)){var e=this.uniqueSources[this.uniqueSourceIndexByFilename[t.filename]];if(t.content.original!==e.content)throw new Error("Illegal source: same filename ("+t.filename+"), different contents")}else this.uniqueSourceIndexByFilename[t.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:t.filename,content:t.content.original});return this.sources.push(t),this},Bt.prototype.append=function(t,e){return this.addSource({content:new Vt(t),separator:e&&e.separator||""}),this},Bt.prototype.clone=function(){var t=new Bt({intro:this.intro,separator:this.separator});return this.sources.forEach((function(e){t.addSource({filename:e.filename,content:e.content.clone(),separator:e.separator})})),t},Bt.prototype.generateDecodedMap=function(t){var e=this;void 0===t&&(t={});var i=[];this.sources.forEach((function(t){Object.keys(t.