@castlabs/ui 8.4.1 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ var e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,t=new Uint8Array(64),n=new Uint8Array(128);for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t[r]=i,n[i]=r}function r(e,n){do{let r=n&31;n>>>=5,n>0&&(r|=32),e.write(t[r])}while(n>0)}function i(e){return e<0?-e<<1|1:e<<1}var a=16384,o=typeof TextDecoder<`u`?new TextDecoder:typeof Buffer<`u`?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},s=class{constructor(){this.pos=0,this.out=``,this.buffer=new Uint8Array(a)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===a&&(this.out+=o.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+o.decode(e.subarray(0,n)):t}};function c(e){if(e.length===0)return``;let t=new s;for(let n=0;n<e.length;n++){let i=e[n];n>0&&t.write(59);let a=0;for(let e=0;e<i.length;e++){let n=i[e];r(t,n-a),a=n}}return t.flush()}function l(e){let t=new s,n=0,a=0,o=0,c=0;for(let s=0;s<e.length;s++){let l=e[s];if(s>0&&t.write(59),l.length===0)continue;let u=0;for(let e=0;e<l.length;e++){let s=l[e];e>0&&t.write(44),r(t,i(s[0]-u)),u=s[0],s.length!==1&&(r(t,i(s[1]-n)),r(t,i(s[2]-a)),r(t,i(s[3]-o)),n=s[1],a=s[2],o=s[3],s.length!==4&&(r(t,i(s[4]-c)),c=s[4]))}}return t.flush()}var u=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}},d=class e{constructor(e,t,n){this.start=e,this.end=t,this.original=n,this.intro=``,this.outro=``,this.content=n,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro+=e}clone(){let t=new e(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}contains(e){return this.start<e&&e<this.end}eachNext(e){e(this);let t=this.next;for(;t;)e(t),t=t.next}eachPrevious(e){e(this);let t=this.previous;for(;t;)e(t),t=t.previous}edit(e,t,n){return this.content=e,n||(this.intro=``,this.outro=``),this.storeName=t,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro=``,this.outro=``,this.edited&&=(this.content=this.original,this.storeName=!1,!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),i=this.original.slice(n);this.original=r;let a=new e(t,this.end,i);return a.outro=this.outro,this.outro=``,this.end=t,this.edited?(a.edit(``,!1),this.content=``):this.content=r,a.next=this.next,a.next&&(a.next.previous=a),a.previous=this,this.next=a,a}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,``),this.outro.length)return!0;let t=this.content.replace(e,``);if(t.length)return t!==this.content&&(this.edited?this.edit(t,this.storeName,!0):this.split(this.start+t.length).edit(``,void 0,!0)),!0;if(this.edit(``,void 0,!0),this.intro=this.intro.replace(e,``),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,``),this.intro.length)return!0;let t=this.content.replace(e,``);if(t.length)return t!==this.content&&(this.edited?this.edit(t,this.storeName,!0):(this.split(this.end-t.length),this.edit(``,void 0,!0))),!0;if(this.edit(``,void 0,!0),this.outro=this.outro.replace(e,``),this.outro.length)return!0}},f=class extends Error{name=`MagicStringError`;constructor(e,t){super(`[MagicString] ${e}`,t)}};function p(){if(typeof globalThis<`u`&&typeof globalThis.btoa==`function`)return e=>globalThis.btoa(unescape(encodeURIComponent(e)));let e=globalThis.Buffer;return e?t=>e.from(t,`utf-8`).toString(`base64`):()=>{throw new f("unsupported environment: `btoa` or `Buffer` is required")}}var m=p(),h=class{constructor(e){if(this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=typeof e.mappings==`string`?e.mappings:l(e.mappings),e.x_google_ignoreList!==void 0&&(this.x_google_ignoreList=e.x_google_ignoreList),e.debugId!==void 0&&(this.debugId=e.debugId),e.rangeMappings!==void 0){let t=!1;for(let n of e.rangeMappings)if(n.length!==0){t=!0;break}t&&(this.rangeMappings=c(e.rangeMappings))}}toString(){return JSON.stringify(this)}toUrl(){return`data:application/json;charset=utf-8;base64,${m(this.toString())}`}};function g(e){let t=[0];for(let n=e.indexOf(`
2
+ `);n!==-1;n=e.indexOf(`
3
+ `,n+1))t.push(n+1);return function(e){let n=0,r=t.length;for(;n<r;){let i=n+r>>1;e<t[i]?r=i:n=i+1}let i=n-1;return{line:i,column:e-t[i]}}}function _(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let e=n.length;for(;e--;)n[e]=`..`}return n.concat(r).join(`/`)}function v(e){let t=e.split(`
4
+ `),n=t.filter(e=>/^\t+/.test(e)),r=t.filter(e=>/^ {2,}/.test(e));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return` `;let i=r.reduce((e,t)=>{let n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return` `.repeat(i)}var y=Object.prototype.toString;function b(e){return y.call(e)===`[object Object]`}var x=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,S=(()=>{let e=new Uint8Array(64);for(let t=0;t<64;t++)e[t]=x.charCodeAt(t);return e})(),C=44,w=59,T=16384,E=16348,D=new Uint8Array(T);function O(e,t){t=t<0?-t<<1|1:t<<1;do{let n=t&31;t>>>=5,t>0&&(n|=32),D[e++]=S[n]}while(t>0);return e}var k=new TextDecoder,A=class{constructor(){this.out=``,this.pos=0,this.lines=[],this.buffered=0,this.needsComma=!1,this.prevGenColumn=0,this.prevSourceIndex=0,this.prevSourceLine=0,this.prevSourceColumn=0,this.prevNameIndex=0}endLine(e){this.lines.push(e),this.buffered+=e.length+1,this.buffered>=4096&&this.drain(null)}segments(e){this.drain(e)}finish(e){return this.drain(e),this.flush(),this.out}drain(e){let t=this.lines,n=t.length;for(let r=0;r<=n;r++){let i=r<n?t[r]:e;if(i===null)break;for(let e=0;e<i.length;e++){this.pos>E&&this.flush();let t=i[e];this.needsComma&&(D[this.pos++]=C),this.needsComma=!0,this.pos=O(this.pos,t[0]-this.prevGenColumn),this.prevGenColumn=t[0],this.pos=O(this.pos,t[1]-this.prevSourceIndex),this.prevSourceIndex=t[1],this.pos=O(this.pos,t[2]-this.prevSourceLine),this.prevSourceLine=t[2],this.pos=O(this.pos,t[3]-this.prevSourceColumn),this.prevSourceColumn=t[3],t.length===5&&(this.pos=O(this.pos,t[4]-this.prevNameIndex),this.prevNameIndex=t[4])}r<n&&(this.pos>E&&this.flush(),D[this.pos++]=w,this.needsComma=!1,this.prevGenColumn=0)}t.length=0,this.buffered=0,this.flush()}flush(){this.out+=k.decode(D.subarray(0,this.pos)),this.pos=0}},j=10;function M(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95}var N=class{constructor(e,t=null){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.rawRangeMappings=[],this.rawRangeMappingsIndices=this.rawRangeMappings[this.generatedCodeLine]=[],this.encoder=t}nextLine(){this.encoder===null?(this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[]):(this.encoder.endLine(this.rawSegments),this.rawSegments=[],this.generatedCodeLine+=1),this.generatedCodeColumn=0,this.rawRangeMappings[this.generatedCodeLine]=this.rawRangeMappingsIndices=[]}addEdit(e,t,n,r){if(t.length){let i=t.length-1,a=t.indexOf(`
5
+ `,0),o=-1;for(;a>=0&&i>a;){let i=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&i.push(r),this.rawSegments.push(i),this.nextLine(),o=a,a=t.indexOf(`
6
+ `,a+1)}let s=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&s.push(r),this.rawSegments.push(s),this.advance(t.slice(o+1))}}addUneditedChunk(e,t,n,r,i){let a=t.end,o=t.start;if(this.hires){let i=this.hires===`boundary`,s=this.hires===`experimental-range`,c=s?null:this.encoder,l=!1;for(;o<a;){c!==null&&this.rawSegments.length>=4096&&(c.segments(this.rawSegments),this.rawSegments.length=0),s&&o+1>=a&&this.rawSegments.push([this.generatedCodeColumn,e,r.line,r.column]);let u=n.charCodeAt(o);u===j?(r.line+=1,r.column=0,this.nextLine(),l=!1):(i?M(u)?l||=(this.rawSegments.push([this.generatedCodeColumn,e,r.line,r.column]),!0):(this.rawSegments.push([this.generatedCodeColumn,e,r.line,r.column]),l=!1):s?o===t.start&&(this.rawRangeMappingsIndices.push(this.rawSegments.length),this.rawSegments.push([this.generatedCodeColumn,e,r.line,r.column])):this.rawSegments.push([this.generatedCodeColumn,e,r.line,r.column]),r.column+=1,this.generatedCodeColumn+=1),o+=1}}else{let t=i.bits;for(;o<a;){let i=n.indexOf(`
7
+ `,o);if((i===-1||i>a)&&(i=a),i>o){this.rawSegments.push([this.generatedCodeColumn,e,r.line,r.column]);for(let n=o+1>>5,a=i-1>>5;n<=a;n++){let a=t[n];if(!a)continue;let s=n<<5;for(;a;){let t=a&-a,n=s+31-Math.clz32(t);if(n>o&&n<i){let t=n-o;this.rawSegments.push([this.generatedCodeColumn+t,e,r.line,r.column+t])}a^=t}}r.column+=i-o,this.generatedCodeColumn+=i-o}if(i===a)break;r.line+=1,r.column=0,this.nextLine(),o=i+1}}}advance(e){if(!e)return;let t=e.lastIndexOf(`
8
+ `);for(let t=e.indexOf(`
9
+ `);t!==-1;t=e.indexOf(`
10
+ `,t+1))this.nextLine();this.generatedCodeColumn+=e.length-t-1}},P=`
11
+ `,F=10,I=13,L={insertLeft:!1,insertRight:!1,storeName:!1};function R(e,t,n,r,i,a){if(!e.includes(`$`))return e;let o=``,s=0;for(;s<e.length;){let c=e.indexOf(`$`,s);if(c===-1){o+=e.slice(s);break}o+=e.slice(s,c);let l=e[c+1],u=`$`,d=1;if(l===`$`)d=2;else if(l===`&`)u=t,d=2;else if(l==="`")u=r.slice(0,n),d=2;else if(l===`'`)u=r.slice(n+t.length),d=2;else if(l===`<`&&a!==void 0){let t=e.indexOf(`>`,c+2);t!==-1&&(u=a[e.slice(c+2,t)]??``,d=t+1-c)}else if(l>=`0`&&l<=`9`){let t=e[c+2],n=t>=`0`&&t<=`9`?Number(l+t):NaN,r=Number(l);n>=1&&n<=i.length?(u=i[n-1]??``,d=3):r>=1&&r<=i.length&&(u=i[r-1]??``,d=2)}o+=u,s=c+d}return o}var z=class e{constructor(e,t={}){let n=new d(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:``},intro:{writable:!0,value:``},firstChunk:{writable:!0,value:n},lastChunk:{writable:!0,value:n},lastSearchedChunk:{writable:!0,value:n},byStart:{writable:!0,value:new Map([[0,n]])},byEnd:{writable:!0,value:new Map([[e.length,n]])},filename:{writable:!0,value:t.filename},indentExclusionRanges:{writable:!0,value:t.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new u},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:t.ignoreList},offset:{writable:!0,value:t.offset||0},hasMovedChunks:{writable:!0,value:!1}})}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=`string`)throw new f(`content must be a string, got ${typeof e}`);return this.outro+=e,this}appendLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw new f(`content must be a string, got ${typeof t}`);this._split(e);let n=this.byEnd.get(e);return n?n.appendLeft(t):this.intro+=t,this}appendRight(e,t){if(e+=this.offset,typeof t!=`string`)throw new f(`content must be a string, got ${typeof t}`);this._split(e);let n=this.byStart.get(e);return n?n.appendRight(t):this.outro+=t,this}clone(){let t=new e(this.original,{filename:this.filename,ignoreList:this.ignoreList,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart.set(r.start,r),t.byEnd.set(r.end,r);let e=n.next,i=e&&e.clone();i&&(r.next=i,i.previous=r,r=i),n=e}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new u(this.sourcemapLocations),t.storedNames={...this.storedNames},t.intro=this.intro,t.outro=this.outro,t.hasMovedChunks=this.hasMovedChunks,t}generateDecodedMap(e){e||={};let t=new N(e.hires),n=this._generateMappings(t);return{...this._mapProperties(e,n),mappings:t.raw,rangeMappings:t.rawRangeMappings}}generateMap(e){e||={};let t=new A,n=new N(e.hires,t),r=this._generateMappings(n);return new h({...this._mapProperties(e,r),mappings:t.finish(n.rawSegments),rangeMappings:n.rawRangeMappings})}_generateMappings(e){let t=Object.keys(this.storedNames),n=g(this.original);return this.intro&&e.advance(this.intro),this.firstChunk.eachNext(r=>{let i=n(r.start);r.intro.length&&e.advance(r.intro),r.edited?e.addEdit(0,r.content,i,r.storeName?t.indexOf(r.original):-1):e.addUneditedChunk(0,r,this.original,i,this.sourcemapLocations),r.outro.length&&e.advance(r.outro)}),this.outro&&e.advance(this.outro),t}_mapProperties(e,t){return{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?_(e.file||``,e.source):e.file||``],sourcesContent:e.includeContent?[this.original]:void 0,names:t,x_google_ignoreList:this.ignoreList?[0]:void 0}}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=v(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?` `:this.indentStr}indent(e,t){let n=/^[^\r\n]/gm;if(b(e)&&(t=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||` `),e===``)return this;let r=e;t||={};let i={};t.exclude&&(typeof t.exclude[0]==`number`?[t.exclude]:t.exclude).forEach(e=>{for(let t=e[0];t<e[1];t+=1)i[t]=!0});let a=t.indentStart!==!1,o=e=>{if(e===``)return e;let t=e.replace(n,(e,t)=>t>0||a?`${r}${e}`:e);return a=e[e.length-1]===`
12
+ `,t};this.intro=o(this.intro);let s=0,c=this.firstChunk,l=e=>{a=!1,e===c.start?c.appendRight(r):(this._splitChunk(c,e),c=c.next,c.prependRight(r))};for(;c;){let e=c.end;if(i[c.start]||(c.intro=o(c.intro)),c.edited)i[s]||(c.content=o(c.content));else if(t.exclude)for(s=c.start;s<e;){if(!i[s]){let e=this.original.charCodeAt(s);e===F?a=!0:e!==I&&a&&l(s)}s+=1}else for(s=c.start;s<e;){if(!a){let t=this.original.indexOf(P,s);if(t===-1||t>=e)break;a=!0,s=t+1;continue}let t=this.original.charCodeAt(s);if(t===F||t===I){s+=1;continue}l(s),s+=1}i[c.end-1]||(c.outro=o(c.outro)),s=c.end,c=c.next}return this.outro=o(this.outro),this}insert(){throw new f(`insert() is deprecated, use appendLeft() or prependRight()`)}insertLeft(e,t){return L.insertLeft||=(console.warn(`magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead`),!0),this.appendLeft(e,t)}insertRight(e,t){return L.insertRight||=(console.warn(`magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead`),!0),this.prependRight(e,t)}move(e,t,n,r=`right`){if(e+=this.offset,t+=this.offset,n+=this.offset,e===t)return this;if(n>=e&&n<=t)throw new f(`cannot move a selection inside itself`);this._split(e),this._split(t),this._split(n);let i=this.byStart.get(e),a=this.byEnd.get(t);if(this.hasMovedChunks){let n=i;for(;n!==a;)if(n=n.next,!n||n.start<e||n.end>t)throw new f(`cannot move ${e} to ${t} because an earlier move split that range`)}let o=i.previous,s=a.next,c,l;if(r===`left`){if(c=this.byEnd.get(n)??null,c){if(c.next===i)return this;l=c.next}else{if(i===this.firstChunk)return this;l=this.firstChunk}}else if(l=this.byStart.get(n)??null,l){if(l.previous===a)return this;c=l.previous}else{if(a===this.lastChunk)return this;c=this.lastChunk}return o&&(o.next=s),s&&(s.previous=o),c&&(c.next=i),l&&(l.previous=a),i.previous||(this.firstChunk=a.next),a.next||(this.lastChunk=i.previous,this.lastChunk.next=null),i.previous=c,a.next=l||null,c||(this.firstChunk=i),l||(this.lastChunk=a),this.hasMovedChunks=!0,this}overwrite(e,t,n,r){let i=typeof r==`object`&&r?r:{};return this.update(e,t,n,{...i,overwrite:!i.contentOnly})}update(e,t,n,r){if(e+=this.offset,t+=this.offset,typeof n!=`string`)throw new f(`content must be a string, got ${typeof n}`);if(this.original.length!==0&&(e<0&&(e=Math.max(0,e+this.original.length)),t<0&&(t=Math.max(0,t+this.original.length))),e<0)throw new f(`start ${e} is out of bounds`);if(t>this.original.length)throw new f(`end ${t} is out of bounds`);if(e===t)throw new f(`cannot overwrite a zero-length range at ${e}, use appendLeft() or prependRight()`);if(e>t)throw new f(`end must be greater than start (start: ${e}, end: ${t})`);this._split(e),this._split(t),r===!0&&(L.storeName||=(console.warn(`The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string`),!0),r={storeName:!0});let i=typeof r==`object`&&r?r:{},a=i.storeName||!1,o=i.overwrite||!1;if(a){let n=this.original.slice(e,t);Object.defineProperty(this.storedNames,n,{writable:!0,value:!0,enumerable:!0})}let s=this.byStart.get(e),c=this.byEnd.get(t);if(s){let e=s;for(;e!==c;){if(e.next!==this.byStart.get(e.end))throw new f(`cannot overwrite across a split point`);e=e.next,e.edit(``,!1)}s.edit(n,a,!o)}else{let r=new d(e,t,``).edit(n,a);c.next=r,r.previous=c}return this}prepend(e){if(typeof e!=`string`)throw new f(`content must be a string, got ${typeof e}`);return this.intro=e+this.intro,this}prependLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw new f(`content must be a string, got ${typeof t}`);this._split(e);let n=this.byEnd.get(e);return n?n.prependLeft(t):this.intro=t+this.intro,this}prependRight(e,t){if(e+=this.offset,typeof t!=`string`)throw new f(`content must be a string, got ${typeof t}`);this._split(e);let n=this.byStart.get(e);return n?n.prependRight(t):this.outro=t+this.outro,this}remove(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0&&(e<0&&(e=Math.max(0,e+this.original.length)),t<0&&(t=Math.max(0,t+this.original.length))),e===t)return this;if(e<0||t>this.original.length)throw new f(`range ${e}–${t} is out of bounds`);if(e>t)throw new f(`end must be greater than start (start: ${e}, end: ${t})`);this._split(e),this._split(t);let n=this.byStart.get(e);for(;n;)n.start>e&&(n.intro=``),n.end<t&&(n.outro=``),n.edit(``,!1,!0),n=t>n.end?this.byStart.get(n.end):null;return this}reset(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0&&(e<0&&(e=Math.max(0,e+this.original.length)),t<0&&(t=Math.max(0,t+this.original.length))),e===t)return this;if(e<0||t>this.original.length)throw new f(`range ${e}–${t} is out of bounds`);if(e>t)throw new f(`end must be greater than start (start: ${e}, end: ${t})`);this._split(e),this._split(t);let n=this.byStart.get(e);for(;n;)n.reset(),n=t>n.end?this.byStart.get(n.end):null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;for(;e;){if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1];e=e.previous}return this.intro.length?this.intro[this.intro.length-1]:``}lastLine(){let e=this.outro.lastIndexOf(P);if(e!==-1)return this.outro.substr(e+1);let t=this.outro,n=this.lastChunk;for(;n;){if(n.outro.length>0){if(e=n.outro.lastIndexOf(P),e!==-1)return n.outro.substr(e+1)+t;t=n.outro+t}if(n.content.length>0){if(e=n.content.lastIndexOf(P),e!==-1)return n.content.substr(e+1)+t;t=n.content+t}if(n.intro.length>0){if(e=n.intro.lastIndexOf(P),e!==-1)return n.intro.substr(e+1)+t;t=n.intro+t}n=n.previous}return e=this.intro.lastIndexOf(P),e===-1?this.intro+t:this.intro.substr(e+1)+t}slice(e=0,t=this.original.length-this.offset){e+=this.offset,t+=this.offset,this.original.length!==0&&(e<0&&(e=Math.max(0,e+this.original.length)),t<0&&(t=Math.max(0,t+this.original.length)));let n=``,r=this.firstChunk;for(;r&&(r.start>e||r.end<=e);){if(r.start<t&&r.end>=t||t===0&&r.start===0)return n;r=r.next}if(r&&r.edited&&r.start!==e)throw new f(`cannot use edited character ${e} as slice start anchor`);let i=r;for(;r&&(t!==0||r.start!==0);){r.intro&&(i!==r||r.start===e)&&(n+=r.intro);let a=r.start<t&&r.end>=t;if(a&&r.edited&&r.end!==t)throw new f(`cannot use edited character ${t} as slice end anchor`);let o=i===r?e-r.start:0,s=a?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,s),r.outro&&(!a||r.end===t)&&(n+=r.outro),a)break;r=r.next}return n}snip(e,t){let n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n}_split(e){if(this.byStart.get(e)||this.byEnd.get(e))return;let t=this.lastSearchedChunk,n=t,r=e>t.end;for(;t;){if(t.contains(e))return this._splitChunk(t,e);if(t=r?this.byStart.get(t.end):this.byEnd.get(t.start),t===n)return;n=t}}_splitChunk(e,t){if(e.edited&&e.content.length){let n=g(this.original)(t);throw new f(`cannot split a chunk that has already been edited (${n.line}:${n.column} – "${e.original}")`)}let n=e.split(t);return this.byEnd.set(t,e),this.byStart.set(t,n),this.byEnd.set(n.end,n),e===this.lastChunk&&(this.lastChunk=n),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,t=this.firstChunk;for(;t;)e+=t.toString(),t=t.next;return e+this.outro}isEmpty(){if(this.intro.length&&this.intro.trim())return!1;let e=this.firstChunk;for(;e;){if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1;e=e.next}return!(this.outro.length&&this.outro.trim())}length(){let e=this.firstChunk,t=0;for(;e;)t+=e.intro.length+e.content.length+e.outro.length,e=e.next;return t}trimLines(){return this.trim(`[\\r\\n]`)}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){let t=RegExp(`${e||`\\s`}+$`);if(this.outro=this.outro.replace(t,``),this.outro.length)return!0;let n=this.lastChunk;do{let e=n.end,r=n.trimEnd(t);if(n.end!==e&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd.set(n.end,n),this.byStart.set(n.next.start,n.next),this.byEnd.set(n.next.end,n.next)),r)return!0;n=n.previous}while(n);return this.intro=this.intro.replace(t,``),this.intro.length>0}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){let t=RegExp(`^${e||`\\s`}+`);if(this.intro=this.intro.replace(t,``),this.intro.length)return!0;let n=this.firstChunk;do{let e=n.end,r=n.trimStart(t);if(n.end!==e&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd.set(n.end,n),this.byStart.set(n.next.start,n.next),this.byEnd.set(n.next.end,n.next)),r)return!0;n=n.next}while(n);return this.outro=this.outro.replace(t,``),this.outro.length>0}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){if(this.intro||this.outro)return!0;let e=0,t=this.firstChunk;for(;t;){if(t.intro||t.outro)return!0;if(!t.edited&&t.start===e)e=t.end;else{if(!this.original.startsWith(t.content,e))return!0;e+=t.content.length}t=t.next}return e!==this.original.length}_hasRemovedContent(e,t){let n=this.firstChunk;for(;n;){if(n.content===``&&n.start<t&&n.end>e)return!0;n=n.next}return!1}_replaceRegexp(e,t){function n(e,n){return typeof t==`string`?R(t,e[0],e.index,n,e.slice(1),e.groups):e.groups===void 0?t(e[0],...e.slice(1),e.index,n):t(e[0],...e.slice(1),e.index,n,e.groups)}let r=e=>{if(e.index==null||this._hasRemovedContent(e.index,e.index+e[0].length))return!1;let t=n(e,this.original);return t===e[0]||(e[0].length===0?this.appendRight(e.index,t):this.overwrite(e.index,e.index+e[0].length,t)),!0};if(e.global){e.lastIndex=0;for(let t of this.original.matchAll(e))r(t)}else{let t=this.original.match(e);if(t&&!r(t)){let t=new RegExp(e.source,`${e.flags}g`);for(let e of this.original.matchAll(t))if(r(e))break}}return this}_replaceString(e,t){let{original:n}=this,r=n.indexOf(e);for(;r!==-1;){if(this._hasRemovedContent(r,r+e.length)){r=n.indexOf(e,r+e.length);continue}t=typeof t==`function`?t(e,r,n):R(t,e,r,n,[],void 0),e!==t&&(e.length===0?this.appendRight(r,t):this.overwrite(r,r+e.length,t));break}return this}replace(e,t){return typeof e==`string`?this._replaceString(e,t):this._replaceRegexp(e,t)}_replaceAllString(e,t){let{original:n}=this,r=e.length;if(r===0){for(let e=0;e<=n.length;e+=1){let r=typeof t==`function`?t(``,e,n):R(t,``,e,n,[],void 0);r!==``&&this.appendRight(e,r)}return this}for(let i=n.indexOf(e);i!==-1;i=n.indexOf(e,i+r)){if(this._hasRemovedContent(i,i+r))continue;let e=n.slice(i,i+r),a=typeof t==`function`?t(e,i,n):R(t,e,i,n,[],void 0);e!==a&&this.overwrite(i,i+r,a)}return this}replaceAll(e,t){if(typeof e==`string`)return this._replaceAllString(e,t);if(!e.global)throw new f(`replaceAll() requires a global RegExp`);return this._replaceRegexp(e,t)}};exports.MagicString=z,exports.default=z;
13
+ //# sourceMappingURL=dist-e2259382.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-e2259382.js","names":["intToChar"],"sources":["../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../node_modules/magic-string/dist/index.mjs"],"sourcesContent":["// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n return value;\n}\nfunction decodeSign(num) {\n return num & 1 ? -2147483648 | -(num >>> 1) : num >>> 1;\n}\nfunction encodeInteger(builder, num) {\n do {\n let clamped = num & 31;\n num >>>= 5;\n if (num > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (num > 0);\n}\nfunction encodeSign(num) {\n return num < 0 ? -num << 1 | 1 : num << 1;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line += decodeSign(decodeInteger(reader));\n const column = decodeSign(decodeInteger(reader));\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeSign(decodeInteger(reader));\n const fields = decodeSign(decodeInteger(reader));\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeSign(decodeInteger(reader))] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeSign(decodeInteger(reader));\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n encodeInteger(writer, encodeSign(startLine - state[0]));\n state[0] = startLine;\n encodeInteger(writer, encodeSign(startColumn));\n encodeInteger(writer, encodeSign(kind));\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, encodeSign(fields));\n if (scope.length === 6) encodeInteger(writer, encodeSign(scope[5]));\n for (const v of vars) {\n encodeInteger(writer, encodeSign(v));\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n encodeInteger(writer, encodeSign(endLine - state[0]));\n state[0] = endLine;\n encodeInteger(writer, encodeSign(endColumn));\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn += decodeSign(decodeInteger(reader));\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeSign(decodeInteger(reader));\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = definitionSourcesIndex + decodeSign(decodeInteger(reader));\n definitionScopeIndex = decodeSign(decodeInteger(reader)) + (definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0);\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex += decodeSign(decodeInteger(reader));\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = (sameSource ? callsiteLine : 0) + decodeSign(decodeInteger(reader));\n callsiteColumn = (sameSource && prevLine === callsiteLine ? callsiteColumn : 0) + decodeSign(decodeInteger(reader));\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeSign(decodeInteger(reader));\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeSign(decodeInteger(reader))]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine += decodeSign(decodeInteger(reader));\n bindingColumn = (bindingLine === prevBl ? bindingColumn : 0) + decodeSign(decodeInteger(reader));\n const expression = decodeSign(decodeInteger(reader));\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n encodeInteger(writer, encodeSign(range[1] - state[1]));\n state[1] = range[1];\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, encodeSign(fields));\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n encodeInteger(writer, encodeSign(sourcesIndex - state[2]));\n state[2] = sourcesIndex;\n encodeInteger(writer, encodeSign(scopesIndex - state[3]));\n state[3] = scopesIndex;\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n encodeInteger(writer, encodeSign(sourcesIndex - state[4]));\n state[4] = sourcesIndex;\n encodeInteger(writer, encodeSign(callLine - state[5]));\n state[5] = callLine;\n encodeInteger(writer, encodeSign(callColumn - state[6]));\n state[6] = callColumn;\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, encodeSign(-binding.length));\n const expression = binding[0][0];\n encodeInteger(writer, encodeSign(expression));\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n encodeInteger(writer, encodeSign(expRange[1] - bindingStartLine));\n bindingStartLine = expRange[1];\n encodeInteger(writer, encodeSign(expRange[2] - bindingStartColumn));\n bindingStartColumn = expRange[2];\n encodeInteger(writer, encodeSign(expRange[0]));\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n encodeInteger(writer, encodeSign(endColumn - state[1]));\n state[1] = endColumn;\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/range-mappings.ts\nfunction decodeRangeMappings(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const rangeMappings = [];\n do {\n const semi = reader.indexOf(\";\");\n const indices = [];\n let index = 0;\n while (reader.pos < semi) {\n index += decodeInteger(reader);\n indices.push(index);\n }\n rangeMappings.push(indices);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return rangeMappings;\n}\nfunction encodeRangeMappings(decoded) {\n if (decoded.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < decoded.length; i++) {\n const indices = decoded[i];\n if (i > 0) writer.write(semicolon);\n let index = 0;\n for (let j = 0; j < indices.length; j++) {\n const offset = indices[j];\n encodeInteger(writer, offset - index);\n index = offset;\n }\n }\n return writer.flush();\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn += decodeSign(decodeInteger(reader));\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex += decodeSign(decodeInteger(reader));\n sourceLine += decodeSign(decodeInteger(reader));\n sourceColumn += decodeSign(decodeInteger(reader));\n if (hasMoreVlq(reader, semi)) {\n namesIndex += decodeSign(decodeInteger(reader));\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n encodeInteger(writer, encodeSign(segment[0] - genColumn));\n genColumn = segment[0];\n if (segment.length === 1) continue;\n encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));\n encodeInteger(writer, encodeSign(segment[2] - sourceLine));\n encodeInteger(writer, encodeSign(segment[3] - sourceColumn));\n sourcesIndex = segment[1];\n sourceLine = segment[2];\n sourceColumn = segment[3];\n if (segment.length === 4) continue;\n encodeInteger(writer, encodeSign(segment[4] - namesIndex));\n namesIndex = segment[4];\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n decodeRangeMappings,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes,\n encodeRangeMappings\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","import { encode, encodeRangeMappings } from \"@jridgewell/sourcemap-codec\";\n//#region src/BitSet.ts\nvar BitSet = class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & 1 << (n & 31));\n\t}\n};\n//#endregion\n//#region src/Chunk.ts\nvar Chunk = class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\t\tthis.intro = \"\";\n\t\tthis.outro = \"\";\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\t\tthis.previous = null;\n\t\tthis.next = null;\n\t}\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\t\treturn chunk;\n\t}\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\teachNext(fn) {\n\t\tfn(this);\n\t\tlet chunk = this.next;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\teachPrevious(fn) {\n\t\tfn(this);\n\t\tlet chunk = this.previous;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = \"\";\n\t\t\tthis.outro = \"\";\n\t\t}\n\t\tthis.storeName = storeName;\n\t\tthis.edited = true;\n\t\treturn this;\n\t}\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\treset() {\n\t\tthis.intro = \"\";\n\t\tthis.outro = \"\";\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\t\tthis.original = originalBefore;\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = \"\";\n\t\tthis.end = index;\n\t\tif (this.edited) {\n\t\t\tnewChunk.edit(\"\", false);\n\t\t\tthis.content = \"\";\n\t\t} else this.content = originalBefore;\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\t\treturn newChunk;\n\t}\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, \"\");\n\t\tif (this.outro.length) return true;\n\t\tconst trimmed = this.content.replace(rx, \"\");\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tif (this.edited) this.edit(trimmed, this.storeName, true);\n\t\t\t\telse this.split(this.start + trimmed.length).edit(\"\", void 0, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit(\"\", void 0, true);\n\t\t\tthis.intro = this.intro.replace(rx, \"\");\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, \"\");\n\t\tif (this.intro.length) return true;\n\t\tconst trimmed = this.content.replace(rx, \"\");\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tif (this.edited) this.edit(trimmed, this.storeName, true);\n\t\t\t\telse {\n\t\t\t\t\tthis.split(this.end - trimmed.length);\n\t\t\t\t\tthis.edit(\"\", void 0, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit(\"\", void 0, true);\n\t\t\tthis.outro = this.outro.replace(rx, \"\");\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n};\n//#endregion\n//#region src/MagicStringError.ts\n/**\n* The single error type thrown by MagicString.\n*\n* Every message is prefixed with `[MagicString]` so its source is obvious at a\n* glance, and is kept short and consistent in tone.\n*/\nvar MagicStringError = class extends Error {\n\tname = \"MagicStringError\";\n\tconstructor(message, options) {\n\t\tsuper(`[MagicString] ${message}`, options);\n\t}\n};\n//#endregion\n//#region src/SourceMap.ts\nfunction getBtoa() {\n\t/* v8 ignore next -- environment fallback, unreachable when `btoa` is present */\n\tif (typeof globalThis !== \"undefined\" && typeof globalThis.btoa === \"function\") return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\tconst buffer = globalThis[\"Buffer\"];\n\tif (buffer) return (str) => buffer.from(str, \"utf-8\").toString(\"base64\");\n\treturn () => {\n\t\tthrow new MagicStringError(\"unsupported environment: `btoa` or `Buffer` is required\");\n\t};\n\t/* v8 ignore stop */\n}\nconst btoa = /* #__PURE__ */ getBtoa();\nvar SourceMap = class {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = typeof properties.mappings === \"string\" ? properties.mappings : encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== \"undefined\") this.x_google_ignoreList = properties.x_google_ignoreList;\n\t\tif (typeof properties.debugId !== \"undefined\") this.debugId = properties.debugId;\n\t\tif (typeof properties.rangeMappings !== \"undefined\") {\n\t\t\tlet shouldOutputRangeMapping = false;\n\t\t\tfor (const line of properties.rangeMappings) if (line.length !== 0) {\n\t\t\t\tshouldOutputRangeMapping = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldOutputRangeMapping) this.rangeMappings = encodeRangeMappings(properties.rangeMappings);\n\t\t}\n\t}\n\t/**\n\t* Returns the equivalent of `JSON.stringify(map)`\n\t*/\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\t/**\n\t* Returns a DataURI containing the sourcemap. Useful for doing this sort of thing:\n\t* `generateMap(options?: SourceMapOptions): SourceMap;`\n\t*/\n\ttoUrl() {\n\t\treturn `data:application/json;charset=utf-8;base64,${btoa(this.toString())}`;\n\t}\n};\n//#endregion\n//#region src/utils/getLocator.ts\nfunction getLocator(source) {\n\tconst lineOffsets = [0];\n\tfor (let i = source.indexOf(\"\\n\"); i !== -1; i = source.indexOf(\"\\n\", i + 1)) lineOffsets.push(i + 1);\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = i + j >> 1;\n\t\t\tif (index < lineOffsets[m]) j = m;\n\t\t\telse i = m + 1;\n\t\t}\n\t\tconst line = i - 1;\n\t\treturn {\n\t\t\tline,\n\t\t\tcolumn: index - lineOffsets[line]\n\t\t};\n\t};\n}\n//#endregion\n//#region src/utils/getRelativePath.ts\nfunction getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\tfromParts.pop();\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = \"..\";\n\t}\n\treturn fromParts.concat(toParts).join(\"/\");\n}\n//#endregion\n//#region src/utils/guessIndent.ts\nfunction guessIndent(code) {\n\tconst lines = code.split(\"\\n\");\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\tif (tabbed.length === 0 && spaced.length === 0) return null;\n\tif (tabbed.length >= spaced.length) return \"\t\";\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\treturn \" \".repeat(min);\n}\n//#endregion\n//#region src/utils/isObject.ts\nconst toString = Object.prototype.toString;\nfunction isObject(thing) {\n\treturn toString.call(thing) === \"[object Object]\";\n}\nconst BASE64_CHARS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nconst intToChar = /* #__PURE__ */ (() => {\n\tconst chars = /* @__PURE__ */ new Uint8Array(64);\n\tfor (let i = 0; i < 64; i++) chars[i] = BASE64_CHARS.charCodeAt(i);\n\treturn chars;\n})();\nconst COMMA = 44;\nconst SEMICOLON = 59;\nconst BUFFER_SIZE = 16384;\nconst FLUSH_THRESHOLD = 16348;\nconst scratch = /* #__PURE__ */ new Uint8Array(BUFFER_SIZE);\nfunction writeVlq(pos, num) {\n\tnum = num < 0 ? -num << 1 | 1 : num << 1;\n\tdo {\n\t\tlet clamped = num & 31;\n\t\tnum >>>= 5;\n\t\tif (num > 0) clamped |= 32;\n\t\tscratch[pos++] = intToChar[clamped];\n\t} while (num > 0);\n\treturn pos;\n}\nconst decoder = /* #__PURE__ */ new TextDecoder();\nvar MappingsEncoder = class {\n\tconstructor() {\n\t\tthis.out = \"\";\n\t\tthis.pos = 0;\n\t\tthis.lines = [];\n\t\tthis.buffered = 0;\n\t\tthis.needsComma = false;\n\t\tthis.prevGenColumn = 0;\n\t\tthis.prevSourceIndex = 0;\n\t\tthis.prevSourceLine = 0;\n\t\tthis.prevSourceColumn = 0;\n\t\tthis.prevNameIndex = 0;\n\t}\n\tendLine(segments) {\n\t\tthis.lines.push(segments);\n\t\tthis.buffered += segments.length + 1;\n\t\tif (this.buffered >= 4096) this.drain(null);\n\t}\n\tsegments(segments) {\n\t\tthis.drain(segments);\n\t}\n\tfinish(segments) {\n\t\tthis.drain(segments);\n\t\tthis.flush();\n\t\treturn this.out;\n\t}\n\tdrain(trailing) {\n\t\tconst lines = this.lines;\n\t\tconst lineCount = lines.length;\n\t\tfor (let l = 0; l <= lineCount; l++) {\n\t\t\tconst line = l < lineCount ? lines[l] : trailing;\n\t\t\tif (line === null) break;\n\t\t\tfor (let i = 0; i < line.length; i++) {\n\t\t\t\tif (this.pos > FLUSH_THRESHOLD) this.flush();\n\t\t\t\tconst segment = line[i];\n\t\t\t\tif (this.needsComma) scratch[this.pos++] = COMMA;\n\t\t\t\tthis.needsComma = true;\n\t\t\t\tthis.pos = writeVlq(this.pos, segment[0] - this.prevGenColumn);\n\t\t\t\tthis.prevGenColumn = segment[0];\n\t\t\t\tthis.pos = writeVlq(this.pos, segment[1] - this.prevSourceIndex);\n\t\t\t\tthis.prevSourceIndex = segment[1];\n\t\t\t\tthis.pos = writeVlq(this.pos, segment[2] - this.prevSourceLine);\n\t\t\t\tthis.prevSourceLine = segment[2];\n\t\t\t\tthis.pos = writeVlq(this.pos, segment[3] - this.prevSourceColumn);\n\t\t\t\tthis.prevSourceColumn = segment[3];\n\t\t\t\tif (segment.length === 5) {\n\t\t\t\t\tthis.pos = writeVlq(this.pos, segment[4] - this.prevNameIndex);\n\t\t\t\t\tthis.prevNameIndex = segment[4];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (l < lineCount) {\n\t\t\t\tif (this.pos > FLUSH_THRESHOLD) this.flush();\n\t\t\t\tscratch[this.pos++] = SEMICOLON;\n\t\t\t\tthis.needsComma = false;\n\t\t\t\tthis.prevGenColumn = 0;\n\t\t\t}\n\t\t}\n\t\tlines.length = 0;\n\t\tthis.buffered = 0;\n\t\tthis.flush();\n\t}\n\tflush() {\n\t\tthis.out += decoder.decode(scratch.subarray(0, this.pos));\n\t\tthis.pos = 0;\n\t}\n};\n//#endregion\n//#region src/utils/Mappings.ts\nconst NEWLINE_CHAR$1 = 10;\nfunction isWordCode(code) {\n\treturn code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 95;\n}\nvar Mappings = class {\n\tconstructor(hires, encoder = null) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.rawRangeMappings = [];\n\t\tthis.rawRangeMappingsIndices = this.rawRangeMappings[this.generatedCodeLine] = [];\n\t\tthis.encoder = encoder;\n\t}\n\tnextLine() {\n\t\tif (this.encoder === null) {\n\t\t\tthis.generatedCodeLine += 1;\n\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t} else {\n\t\t\tthis.encoder.endLine(this.rawSegments);\n\t\t\tthis.rawSegments = [];\n\t\t\tthis.generatedCodeLine += 1;\n\t\t}\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.rawRangeMappings[this.generatedCodeLine] = this.rawRangeMappingsIndices = [];\n\t}\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf(\"\\n\", 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [\n\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tloc.line,\n\t\t\t\t\tloc.column\n\t\t\t\t];\n\t\t\t\tif (nameIndex >= 0) segment.push(nameIndex);\n\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\tthis.nextLine();\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf(\"\\n\", contentLineEnd + 1);\n\t\t\t}\n\t\t\tconst segment = [\n\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\tsourceIndex,\n\t\t\t\tloc.line,\n\t\t\t\tloc.column\n\t\t\t];\n\t\t\tif (nameIndex >= 0) segment.push(nameIndex);\n\t\t\tthis.rawSegments.push(segment);\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t}\n\t}\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tconst end = chunk.end;\n\t\tlet i = chunk.start;\n\t\tif (this.hires) {\n\t\t\tconst boundary = this.hires === \"boundary\";\n\t\t\tconst experimentalRange = this.hires === \"experimental-range\";\n\t\t\tconst encoder = experimentalRange ? null : this.encoder;\n\t\t\tlet charInHiresBoundary = false;\n\t\t\twhile (i < end) {\n\t\t\t\tif (encoder !== null && this.rawSegments.length >= 4096) {\n\t\t\t\t\tencoder.segments(this.rawSegments);\n\t\t\t\t\tthis.rawSegments.length = 0;\n\t\t\t\t}\n\t\t\t\tif (experimentalRange && i + 1 >= end) this.rawSegments.push([\n\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tloc.line,\n\t\t\t\t\tloc.column\n\t\t\t\t]);\n\t\t\t\tconst code = original.charCodeAt(i);\n\t\t\t\tif (code === NEWLINE_CHAR$1) {\n\t\t\t\t\tloc.line += 1;\n\t\t\t\t\tloc.column = 0;\n\t\t\t\t\tthis.nextLine();\n\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t} else {\n\t\t\t\t\tif (boundary) {\n\t\t\t\t\t\tif (isWordCode(code)) {\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push([\n\t\t\t\t\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\t\t\tloc.line,\n\t\t\t\t\t\t\t\t\tloc.column\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.rawSegments.push([\n\t\t\t\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\t\tloc.line,\n\t\t\t\t\t\t\t\tloc.column\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (experimentalRange) {\n\t\t\t\t\t\tif (i === chunk.start) {\n\t\t\t\t\t\t\tthis.rawRangeMappingsIndices.push(this.rawSegments.length);\n\t\t\t\t\t\t\tthis.rawSegments.push([\n\t\t\t\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\t\tloc.line,\n\t\t\t\t\t\t\t\tloc.column\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else this.rawSegments.push([\n\t\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\tloc.line,\n\t\t\t\t\t\tloc.column\n\t\t\t\t\t]);\n\t\t\t\t\tloc.column += 1;\n\t\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\t}\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t} else {\n\t\t\tconst bits = sourcemapLocations.bits;\n\t\t\twhile (i < end) {\n\t\t\t\tlet newline = original.indexOf(\"\\n\", i);\n\t\t\t\tif (newline === -1 || newline > end) newline = end;\n\t\t\t\tif (newline > i) {\n\t\t\t\t\tthis.rawSegments.push([\n\t\t\t\t\t\tthis.generatedCodeColumn,\n\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\tloc.line,\n\t\t\t\t\t\tloc.column\n\t\t\t\t\t]);\n\t\t\t\t\tfor (let w = i + 1 >> 5, last = newline - 1 >> 5; w <= last; w++) {\n\t\t\t\t\t\tlet word = bits[w];\n\t\t\t\t\t\tif (!word) continue;\n\t\t\t\t\t\tconst base = w << 5;\n\t\t\t\t\t\twhile (word) {\n\t\t\t\t\t\t\tconst lowest = word & -word;\n\t\t\t\t\t\t\tconst index = base + 31 - Math.clz32(lowest);\n\t\t\t\t\t\t\tif (index > i && index < newline) {\n\t\t\t\t\t\t\t\tconst offset = index - i;\n\t\t\t\t\t\t\t\tthis.rawSegments.push([\n\t\t\t\t\t\t\t\t\tthis.generatedCodeColumn + offset,\n\t\t\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\t\t\tloc.line,\n\t\t\t\t\t\t\t\t\tloc.column + offset\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tword ^= lowest;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tloc.column += newline - i;\n\t\t\t\t\tthis.generatedCodeColumn += newline - i;\n\t\t\t\t}\n\t\t\t\tif (newline === end) break;\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.nextLine();\n\t\t\t\ti = newline + 1;\n\t\t\t}\n\t\t}\n\t}\n\tadvance(str) {\n\t\tif (!str) return;\n\t\tconst lastNewline = str.lastIndexOf(\"\\n\");\n\t\tfor (let i = str.indexOf(\"\\n\"); i !== -1; i = str.indexOf(\"\\n\", i + 1)) this.nextLine();\n\t\tthis.generatedCodeColumn += str.length - lastNewline - 1;\n\t}\n};\n//#endregion\n//#region src/MagicString.ts\nconst n = \"\\n\";\nconst NEWLINE_CHAR = \"\\n\".charCodeAt(0);\nconst CR_CHAR = \"\\r\".charCodeAt(0);\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false\n};\n/**\n* Expands the `$` substitution patterns that `String.prototype.replace` accepts\n* in a string replacement.\n* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n*\n* `captures` holds the capture groups in order, so `captures[0]` is `$1`.\n* `namedCaptures` is `undefined` when the pattern has no named groups, and\n* `$<name>` is then literal text - which is also the case for a string search\n* value, where there are no groups of either kind.\n*/\nfunction expandReplacement(replacement, matched, position, str, captures, namedCaptures) {\n\tif (!replacement.includes(\"$\")) return replacement;\n\tlet result = \"\";\n\tlet index = 0;\n\twhile (index < replacement.length) {\n\t\tconst dollar = replacement.indexOf(\"$\", index);\n\t\tif (dollar === -1) {\n\t\t\tresult += replacement.slice(index);\n\t\t\tbreak;\n\t\t}\n\t\tresult += replacement.slice(index, dollar);\n\t\tconst char = replacement[dollar + 1];\n\t\tlet expansion = \"$\";\n\t\tlet consumed = 1;\n\t\tif (char === \"$\") consumed = 2;\n\t\telse if (char === \"&\") {\n\t\t\texpansion = matched;\n\t\t\tconsumed = 2;\n\t\t} else if (char === \"`\") {\n\t\t\texpansion = str.slice(0, position);\n\t\t\tconsumed = 2;\n\t\t} else if (char === \"'\") {\n\t\t\texpansion = str.slice(position + matched.length);\n\t\t\tconsumed = 2;\n\t\t} else if (char === \"<\" && namedCaptures !== void 0) {\n\t\t\tconst close = replacement.indexOf(\">\", dollar + 2);\n\t\t\tif (close !== -1) {\n\t\t\t\texpansion = namedCaptures[replacement.slice(dollar + 2, close)] ?? \"\";\n\t\t\t\tconsumed = close + 1 - dollar;\n\t\t\t}\n\t\t} else if (char >= \"0\" && char <= \"9\") {\n\t\t\tconst second = replacement[dollar + 2];\n\t\t\tconst double = second >= \"0\" && second <= \"9\" ? Number(char + second) : NaN;\n\t\t\tconst single = Number(char);\n\t\t\tif (double >= 1 && double <= captures.length) {\n\t\t\t\texpansion = captures[double - 1] ?? \"\";\n\t\t\t\tconsumed = 3;\n\t\t\t} else if (single >= 1 && single <= captures.length) {\n\t\t\t\texpansion = captures[single - 1] ?? \"\";\n\t\t\t\tconsumed = 2;\n\t\t\t}\n\t\t}\n\t\tresult += expansion;\n\t\tindex = dollar + consumed;\n\t}\n\treturn result;\n}\nvar MagicString = class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: string\n\t\t\t},\n\t\t\toutro: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: \"\"\n\t\t\t},\n\t\t\tintro: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: \"\"\n\t\t\t},\n\t\t\tfirstChunk: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: chunk\n\t\t\t},\n\t\t\tlastChunk: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: chunk\n\t\t\t},\n\t\t\tlastSearchedChunk: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: chunk\n\t\t\t},\n\t\t\tbyStart: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: /* @__PURE__ */ new Map([[0, chunk]])\n\t\t\t},\n\t\t\tbyEnd: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: /* @__PURE__ */ new Map([[string.length, chunk]])\n\t\t\t},\n\t\t\tfilename: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: options.filename\n\t\t\t},\n\t\t\tindentExclusionRanges: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: options.indentExclusionRanges\n\t\t\t},\n\t\t\tsourcemapLocations: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: new BitSet()\n\t\t\t},\n\t\t\tstoredNames: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: {}\n\t\t\t},\n\t\t\tindentStr: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: void 0\n\t\t\t},\n\t\t\tignoreList: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: options.ignoreList\n\t\t\t},\n\t\t\toffset: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: options.offset || 0\n\t\t\t},\n\t\t\thasMovedChunks: {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: false\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.\n\t*/\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\t/**\n\t* Appends the specified content to the end of the string.\n\t*/\n\tappend(content) {\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\t/**\n\t* Appends the specified content at the index in the original string.\n\t* If a range *ending* with index is subsequently moved, the insert will be moved with it.\n\t* See also `s.prependLeft(...)`.\n\t*/\n\tappendLeft(index, content) {\n\t\tindex = index + this.offset;\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tthis._split(index);\n\t\tconst chunk = this.byEnd.get(index);\n\t\tif (chunk) chunk.appendLeft(content);\n\t\telse this.intro += content;\n\t\treturn this;\n\t}\n\t/**\n\t* Appends the specified content at the index in the original string.\n\t* If a range *starting* with index is subsequently moved, the insert will be moved with it.\n\t* See also `s.prependRight(...)`.\n\t*/\n\tappendRight(index, content) {\n\t\tindex = index + this.offset;\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tthis._split(index);\n\t\tconst chunk = this.byStart.get(index);\n\t\tif (chunk) chunk.appendRight(content);\n\t\telse this.outro += content;\n\t\treturn this;\n\t}\n\t/**\n\t* Does what you'd expect.\n\t*/\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, {\n\t\t\tfilename: this.filename,\n\t\t\tignoreList: this.ignoreList,\n\t\t\toffset: this.offset\n\t\t});\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart.set(clonedChunk.start, clonedChunk);\n\t\t\tcloned.byEnd.set(clonedChunk.end, clonedChunk);\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\t\tcloned.lastChunk = clonedChunk;\n\t\tif (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\t\tcloned.storedNames = { ...this.storedNames };\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\t\tcloned.hasMovedChunks = this.hasMovedChunks;\n\t\treturn cloned;\n\t}\n\t/**\n\t* Generates a sourcemap object with raw mappings in array form, rather than encoded as a string.\n\t* Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead.\n\t*/\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\t\tconst mappings = new Mappings(options.hires);\n\t\tconst names = this._generateMappings(mappings);\n\t\treturn {\n\t\t\t...this._mapProperties(options, names),\n\t\t\tmappings: mappings.raw,\n\t\t\trangeMappings: mappings.rawRangeMappings\n\t\t};\n\t}\n\t/**\n\t* Generates a version 3 sourcemap.\n\t*/\n\tgenerateMap(options) {\n\t\toptions = options || {};\n\t\tconst encoder = new MappingsEncoder();\n\t\tconst mappings = new Mappings(options.hires, encoder);\n\t\tconst names = this._generateMappings(mappings);\n\t\treturn new SourceMap({\n\t\t\t...this._mapProperties(options, names),\n\t\t\tmappings: encoder.finish(mappings.rawSegments),\n\t\t\trangeMappings: mappings.rawRangeMappings\n\t\t});\n\t}\n\t/** @internal */\n\t_generateMappings(mappings) {\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst locate = getLocator(this.original);\n\t\tif (this.intro) mappings.advance(this.intro);\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\t\t\tif (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);\n\t\t\telse mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\t\tif (this.outro) mappings.advance(this.outro);\n\t\treturn names;\n\t}\n\t/** @internal */\n\t_mapProperties(options, names) {\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : void 0,\n\t\t\tsources: [options.source ? getRelativePath(options.file || \"\", options.source) : options.file || \"\"],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : void 0,\n\t\t\tnames,\n\t\t\tx_google_ignoreList: this.ignoreList ? [0] : void 0\n\t\t};\n\t}\n\t/** @internal */\n\t_ensureindentStr() {\n\t\tif (this.indentStr === void 0) this.indentStr = guessIndent(this.original);\n\t}\n\t/** @internal */\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? \"\t\" : this.indentStr;\n\t}\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = void 0;\n\t\t}\n\t\tif (indentStr === void 0) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || \"\t\";\n\t\t}\n\t\tif (indentStr === \"\") return this;\n\t\tconst resolvedIndentStr = indentStr;\n\t\toptions = options || {};\n\t\tconst isExcluded = {};\n\t\tif (options.exclude) (typeof options.exclude[0] === \"number\" ? [options.exclude] : options.exclude).forEach((exclusion) => {\n\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded[i] = true;\n\t\t});\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst indentPiece = (str) => {\n\t\t\tif (str === \"\") return str;\n\t\t\tconst indented = str.replace(pattern, (match, offset) => offset > 0 || shouldIndentNextCharacter ? `${resolvedIndentStr}${match}` : match);\n\t\t\tshouldIndentNextCharacter = str[str.length - 1] === \"\\n\";\n\t\t\treturn indented;\n\t\t};\n\t\tthis.intro = indentPiece(this.intro);\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\t\tconst indentAt = (index) => {\n\t\t\tshouldIndentNextCharacter = false;\n\t\t\tif (index === chunk.start) chunk.appendRight(resolvedIndentStr);\n\t\t\telse {\n\t\t\t\tthis._splitChunk(chunk, index);\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.prependRight(resolvedIndentStr);\n\t\t\t}\n\t\t};\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\t\t\tif (!isExcluded[chunk.start]) chunk.intro = indentPiece(chunk.intro);\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) chunk.content = indentPiece(chunk.content);\n\t\t\t} else if (options.exclude) {\n\t\t\t\tcharIndex = chunk.start;\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original.charCodeAt(charIndex);\n\t\t\t\t\t\tif (char === NEWLINE_CHAR) shouldIndentNextCharacter = true;\n\t\t\t\t\t\telse if (char !== CR_CHAR && shouldIndentNextCharacter) indentAt(charIndex);\n\t\t\t\t\t}\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!shouldIndentNextCharacter) {\n\t\t\t\t\t\tconst nextLine = this.original.indexOf(n, charIndex);\n\t\t\t\t\t\tif (nextLine === -1 || nextLine >= end) break;\n\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\tcharIndex = nextLine + 1;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst char = this.original.charCodeAt(charIndex);\n\t\t\t\t\tif (char === NEWLINE_CHAR || char === CR_CHAR) {\n\t\t\t\t\t\tcharIndex += 1;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tindentAt(charIndex);\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isExcluded[chunk.end - 1]) chunk.outro = indentPiece(chunk.outro);\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\tthis.outro = indentPiece(this.outro);\n\t\treturn this;\n\t}\n\t/** @internal */\n\tinsert() {\n\t\tthrow new MagicStringError(\"insert() is deprecated, use appendLeft() or prependRight()\");\n\t}\n\t/** @internal */\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\"magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead\");\n\t\t\twarned.insertLeft = true;\n\t\t}\n\t\treturn this.appendLeft(index, content);\n\t}\n\t/** @internal */\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\"magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead\");\n\t\t\twarned.insertRight = true;\n\t\t}\n\t\treturn this.prependRight(index, content);\n\t}\n\t/**\n\t* Moves the characters from `start` and `end` to `index`.\n\t*\n\t* `affinity` controls where the range is anchored at `index`. With the\n\t* default `'right'`, it is inserted before the content that starts at `index`;\n\t* with `'left'`, it is inserted after the content that ends at `index`. The\n\t* two differ only when other content has already been moved to that boundary,\n\t* mirroring the `appendLeft`/`appendRight` distinction.\n\t*/\n\tmove(start, end, index, affinity = \"right\") {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tindex = index + this.offset;\n\t\tif (start === end) return this;\n\t\tif (index >= start && index <= end) throw new MagicStringError(\"cannot move a selection inside itself\");\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\t\tconst first = this.byStart.get(start);\n\t\tconst last = this.byEnd.get(end);\n\t\tif (this.hasMovedChunks) {\n\t\t\tlet cursor = first;\n\t\t\twhile (cursor !== last) {\n\t\t\t\tcursor = cursor.next;\n\t\t\t\tif (!cursor || cursor.start < start || cursor.end > end) throw new MagicStringError(`cannot move ${start} to ${end} because an earlier move split that range`);\n\t\t\t}\n\t\t}\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\t\tlet newLeft;\n\t\tlet newRight;\n\t\tif (affinity === \"left\") {\n\t\t\tnewLeft = this.byEnd.get(index) ?? null;\n\t\t\tif (!newLeft) {\n\t\t\t\tif (first === this.firstChunk) return this;\n\t\t\t\tnewRight = this.firstChunk;\n\t\t\t} else {\n\t\t\t\tif (newLeft.next === first) return this;\n\t\t\t\tnewRight = newLeft.next;\n\t\t\t}\n\t\t} else {\n\t\t\tnewRight = this.byStart.get(index) ?? null;\n\t\t\tif (!newRight) {\n\t\t\t\tif (last === this.lastChunk) return this;\n\t\t\t\tnewLeft = this.lastChunk;\n\t\t\t} else {\n\t\t\t\tif (newRight.previous === last) return this;\n\t\t\t\tnewLeft = newRight.previous;\n\t\t\t}\n\t\t}\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\t\tthis.hasMovedChunks = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in\n\t* that range. The same restrictions as `s.remove()` apply.\n\t*\n\t* The fourth argument is optional. It can have a storeName property - if true, the original name will be stored\n\t* for later inclusion in a sourcemap's names array - and a contentOnly property which determines whether only\n\t* the content is overwritten, or anything that was appended/prepended to the range as well.\n\t*\n\t* It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content.\n\t*/\n\toverwrite(start, end, content, options) {\n\t\tconst optionObject = typeof options === \"object\" && options ? options : {};\n\t\treturn this.update(start, end, content, {\n\t\t\t...optionObject,\n\t\t\toverwrite: !optionObject.contentOnly\n\t\t});\n\t}\n\t/**\n\t* Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply.\n\t*\n\t* The fourth argument is optional. It can have a storeName property - if true, the original name will be stored\n\t* for later inclusion in a sourcemap's names array - and an overwrite property which determines whether only\n\t* the content is overwritten, or anything that was appended/prepended to the range as well.\n\t*/\n\tupdate(start, end, content, options) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tif (this.original.length !== 0) {\n\t\t\tif (start < 0) start = Math.max(0, start + this.original.length);\n\t\t\tif (end < 0) end = Math.max(0, end + this.original.length);\n\t\t}\n\t\tif (start < 0) throw new MagicStringError(`start ${start} is out of bounds`);\n\t\tif (end > this.original.length) throw new MagicStringError(`end ${end} is out of bounds`);\n\t\tif (start === end) throw new MagicStringError(`cannot overwrite a zero-length range at ${start}, use appendLeft() or prependRight()`);\n\t\tif (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\"The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string\");\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst optionObject = typeof options === \"object\" && options ? options : {};\n\t\tconst storeName = optionObject.storeName || false;\n\t\tconst overwrite = optionObject.overwrite || false;\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true\n\t\t\t});\n\t\t}\n\t\tconst first = this.byStart.get(start);\n\t\tconst last = this.byEnd.get(end);\n\t\t/* v8 ignore else -- unreachable: a valid start/end always yields a `first` chunk */\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart.get(chunk.end)) throw new MagicStringError(\"cannot overwrite across a split point\");\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit(\"\", false);\n\t\t\t}\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\tconst newChunk = new Chunk(start, end, \"\").edit(content, storeName);\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t* Prepends the string with the specified content.\n\t*/\n\tprepend(content) {\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\t/**\n\t* Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index\n\t*/\n\tprependLeft(index, content) {\n\t\tindex = index + this.offset;\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tthis._split(index);\n\t\tconst chunk = this.byEnd.get(index);\n\t\tif (chunk) chunk.prependLeft(content);\n\t\telse this.intro = content + this.intro;\n\t\treturn this;\n\t}\n\t/**\n\t* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`\n\t*/\n\tprependRight(index, content) {\n\t\tindex = index + this.offset;\n\t\tif (typeof content !== \"string\") throw new MagicStringError(`content must be a string, got ${typeof content}`);\n\t\tthis._split(index);\n\t\tconst chunk = this.byStart.get(index);\n\t\tif (chunk) chunk.prependRight(content);\n\t\telse this.outro = content + this.outro;\n\t\treturn this;\n\t}\n\t/**\n\t* Removes the characters from `start` to `end` (of the original string, **not** the generated string).\n\t* Content appended or prepended at positions strictly inside the range is removed with it, while\n\t* content attached at `start` or `end` is preserved — use `s.overwrite(start, end, '')` to remove\n\t* the range including its edge inserts.\n\t* Removing the same content twice, or making removals that partially overlap, will cause an error.\n\t*/\n\tremove(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tif (this.original.length !== 0) {\n\t\t\tif (start < 0) start = Math.max(0, start + this.original.length);\n\t\t\tif (end < 0) end = Math.max(0, end + this.original.length);\n\t\t}\n\t\tif (start === end) return this;\n\t\tif (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);\n\t\tif (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tlet chunk = this.byStart.get(start);\n\t\twhile (chunk) {\n\t\t\tif (chunk.start > start) chunk.intro = \"\";\n\t\t\tif (chunk.end < end) chunk.outro = \"\";\n\t\t\tchunk.edit(\"\", false, true);\n\t\t\tchunk = end > chunk.end ? this.byStart.get(chunk.end) : null;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t* Reset the modified characters from `start` to `end` (of the original string, **not** the generated string).\n\t*/\n\treset(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tif (this.original.length !== 0) {\n\t\t\tif (start < 0) start = Math.max(0, start + this.original.length);\n\t\t\tif (end < 0) end = Math.max(0, end + this.original.length);\n\t\t}\n\t\tif (start === end) return this;\n\t\tif (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);\n\t\tif (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tlet chunk = this.byStart.get(start);\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\t\t\tchunk = end > chunk.end ? this.byStart.get(chunk.end) : null;\n\t\t}\n\t\treturn this;\n\t}\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn \"\";\n\t}\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\t/**\n\t* Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string.\n\t* Throws error if the indices are for characters that were already removed.\n\t*/\n\tslice(start = 0, end = this.original.length - this.offset) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tif (this.original.length !== 0) {\n\t\t\tif (start < 0) start = Math.max(0, start + this.original.length);\n\t\t\tif (end < 0) end = Math.max(0, end + this.original.length);\n\t\t}\n\t\tlet result = \"\";\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\tif (chunk.start < end && chunk.end >= end || end === 0 && chunk.start === 0) return result;\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\tif (chunk && chunk.edited && chunk.start !== start) throw new MagicStringError(`cannot use edited character ${start} as slice start anchor`);\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (end === 0 && chunk.start === 0) break;\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro;\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end) throw new MagicStringError(`cannot use edited character ${end} as slice end anchor`);\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) result += chunk.outro;\n\t\t\tif (containsEnd) break;\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed.\n\t*/\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\t\treturn clone;\n\t}\n\t/** @internal */\n\t_split(index) {\n\t\tif (this.byStart.get(index) || this.byEnd.get(index)) return;\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tlet previousChunk = chunk;\n\t\tconst searchForward = index > chunk.end;\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\t\t\tchunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);\n\t\t\tif (chunk === previousChunk) return;\n\t\t\tpreviousChunk = chunk;\n\t\t}\n\t}\n\t/** @internal */\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new MagicStringError(`cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`);\n\t\t}\n\t\tconst newChunk = chunk.split(index);\n\t\tthis.byEnd.set(index, chunk);\n\t\tthis.byStart.set(index, newChunk);\n\t\tthis.byEnd.set(newChunk.end, newChunk);\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\t\tthis.lastSearchedChunk = chunk;\n\t\treturn true;\n\t}\n\t/**\n\t* Returns the generated string.\n\t*/\n\ttoString() {\n\t\tlet str = this.intro;\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\treturn str + this.outro;\n\t}\n\t/**\n\t* Returns true if the resulting source is empty (disregarding white space).\n\t*/\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false;\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\tif (this.outro.length && this.outro.trim()) return false;\n\t\treturn true;\n\t}\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\twhile (chunk) {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\treturn length;\n\t}\n\t/**\n\t* Removes empty lines from the start and end.\n\t*/\n\ttrimLines() {\n\t\treturn this.trim(\"[\\\\r\\\\n]\");\n\t}\n\t/**\n\t* Trims content matching `charType` (defaults to `\\s`, i.e. whitespace) from the start and end.\n\t*/\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\t/** @internal */\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp(`${charType || \"\\\\s\"}+$`);\n\t\tthis.outro = this.outro.replace(rx, \"\");\n\t\tif (this.outro.length) return true;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) this.lastChunk = chunk.next;\n\t\t\t\tthis.byEnd.set(chunk.end, chunk);\n\t\t\t\tthis.byStart.set(chunk.next.start, chunk.next);\n\t\t\t\tthis.byEnd.set(chunk.next.end, chunk.next);\n\t\t\t}\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\t\tthis.intro = this.intro.replace(rx, \"\");\n\t\treturn this.intro.length > 0;\n\t}\n\t/**\n\t* Trims content matching `charType` (defaults to `\\s`, i.e. whitespace) from the end.\n\t*/\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\t/** @internal */\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp(`^${charType || \"\\\\s\"}+`);\n\t\tthis.intro = this.intro.replace(rx, \"\");\n\t\tif (this.intro.length) return true;\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\t\t\t\tthis.byEnd.set(chunk.end, chunk);\n\t\t\t\tthis.byStart.set(chunk.next.start, chunk.next);\n\t\t\t\tthis.byEnd.set(chunk.next.end, chunk.next);\n\t\t\t}\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\t\tthis.outro = this.outro.replace(rx, \"\");\n\t\treturn this.outro.length > 0;\n\t}\n\t/**\n\t* Trims content matching `charType` (defaults to `\\s`, i.e. whitespace) from the start.\n\t*/\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\t/**\n\t* Indicates if the string has been changed.\n\t*/\n\thasChanged() {\n\t\tif (this.intro || this.outro) return true;\n\t\tlet outputIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro || chunk.outro) return true;\n\t\t\tif (!chunk.edited && chunk.start === outputIndex) outputIndex = chunk.end;\n\t\t\telse {\n\t\t\t\tif (!this.original.startsWith(chunk.content, outputIndex)) return true;\n\t\t\t\toutputIndex += chunk.content.length;\n\t\t\t}\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\treturn outputIndex !== this.original.length;\n\t}\n\t/**\n\t* Whether the original range [start, end) has had any of its characters\n\t* removed. `replace`/`replaceAll` search `original`, so a match can land on\n\t* text that is no longer in the output - overwriting it would resurrect the\n\t* removed characters, so such matches are skipped instead.\n\t*\n\t* @internal\n\t*/\n\t_hasRemovedContent(start, end) {\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.content === \"\" && chunk.start < end && chunk.end > start) return true;\n\t\t\tchunk = chunk.next;\n\t\t}\n\t\treturn false;\n\t}\n\t/** @internal */\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === \"string\") return expandReplacement(replacement, match[0], match.index, str, match.slice(1), match.groups);\n\t\t\telse return match.groups === void 0 ? replacement(match[0], ...match.slice(1), match.index, str) : replacement(match[0], ...match.slice(1), match.index, str, match.groups);\n\t\t}\n\t\tconst replaceMatch = (match) => {\n\t\t\t/* v8 ignore next 2 -- `match.index` is always defined for matches from `matchAll` */\n\t\t\tif (match.index == null) return false;\n\t\t\tif (this._hasRemovedContent(match.index, match.index + match[0].length)) return false;\n\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\tif (replacement === match[0]) return true;\n\t\t\tif (match[0].length === 0) this.appendRight(match.index, replacement);\n\t\t\telse this.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\treturn true;\n\t\t};\n\t\tif (searchValue.global) {\n\t\t\tsearchValue.lastIndex = 0;\n\t\t\tfor (const match of this.original.matchAll(searchValue)) replaceMatch(match);\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && !replaceMatch(match)) {\n\t\t\t\tconst global = new RegExp(searchValue.source, `${searchValue.flags}g`);\n\t\t\t\tfor (const next of this.original.matchAll(global)) if (replaceMatch(next)) break;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\t/** @internal */\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tlet index = original.indexOf(string);\n\t\twhile (index !== -1) {\n\t\t\tif (this._hasRemovedContent(index, index + string.length)) {\n\t\t\t\tindex = original.indexOf(string, index + string.length);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof replacement === \"function\") replacement = replacement(string, index, original);\n\t\t\telse replacement = expandReplacement(replacement, string, index, original, [], void 0);\n\t\t\tif (string !== replacement) {\n\t\t\t\tif (string.length === 0) this.appendRight(index, replacement);\n\t\t\t\telse this.overwrite(index, index + string.length, replacement);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t* String replacement with RegExp or string.\n\t*/\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === \"string\") return this._replaceString(searchValue, replacement);\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\t/** @internal */\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tif (stringLength === 0) {\n\t\t\tfor (let index = 0; index <= original.length; index += 1) {\n\t\t\t\tconst _replacement = typeof replacement === \"function\" ? replacement(\"\", index, original) : expandReplacement(replacement, \"\", index, original, [], void 0);\n\t\t\t\tif (_replacement !== \"\") this.appendRight(index, _replacement);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tfor (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {\n\t\t\tif (this._hasRemovedContent(index, index + stringLength)) continue;\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tconst _replacement = typeof replacement === \"function\" ? replacement(previous, index, original) : expandReplacement(replacement, previous, index, original, [], void 0);\n\t\t\tif (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t* Same as `s.replace`, but replace all matched strings instead of just one.\n\t*/\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === \"string\") return this._replaceAllString(searchValue, replacement);\n\t\tif (!searchValue.global) throw new MagicStringError(\"replaceAll() requires a global RegExp\");\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n};\n//#endregion\n//#region src/Bundle.ts\nconst hasOwnProp = Object.prototype.hasOwnProperty;\nvar Bundle = class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || \"\";\n\t\tthis.separator = options.separator !== void 0 ? options.separator : \"\\n\";\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\t/**\n\t* Adds the specified source to the bundle, which can either be a `MagicString` object directly,\n\t* or an options object that holds a magic string `content` property and optionally provides\n\t* a `filename` for the source within the bundle, as well as an optional `ignoreList` hint\n\t* (which defaults to `false`). The `filename` is used when constructing the source map for the\n\t* bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint\n\t* is used to populate the `x_google_ignoreList` extension field in the source map, which is a\n\t* mechanism for tools to signal to debuggers that certain sources should be ignored by default\n\t* (depending on user preferences).\n\t*/\n\taddSource(source) {\n\t\tif (source instanceof MagicString) return this.addSource({\n\t\t\tcontent: source,\n\t\t\tfilename: source.filename,\n\t\t\tseparator: this.separator\n\t\t});\n\t\tif (!isObject(source) || !source.content) throw new MagicStringError(\"addSource() requires a `content` property that is a MagicString\");\n\t\t[\n\t\t\t\"filename\",\n\t\t\t\"ignoreList\",\n\t\t\t\"indentExclusionRanges\",\n\t\t\t\"separator\"\n\t\t].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\t\tif (source.separator === void 0) source.separator = this.separator;\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({\n\t\t\t\t\tfilename: source.filename,\n\t\t\t\t\tcontent: source.content.original\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) throw new MagicStringError(`duplicate filename \"${source.filename}\" with different content, use unique filenames`);\n\t\t\t}\n\t\t}\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: options && options.separator || \"\"\n\t\t});\n\t\treturn this;\n\t}\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator\n\t\t});\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tignoreList: source.ignoreList,\n\t\t\t\tindentExclusionRanges: source.indentExclusionRanges,\n\t\t\t\tseparator: source.separator\n\t\t\t});\n\t\t});\n\t\treturn bundle;\n\t}\n\t/**\n\t* Flattens the bundle into a single `MagicString`, so the concatenated result can be\n\t* processed further with the full `MagicString` API. The returned string's `original`\n\t* is the concatenation of every source's `original`, and all existing edits, inserts,\n\t* intros, outros and separators are preserved as inserted content, so its `toString()`\n\t* equals the bundle's `toString()` and its sourcemap maps back to that combined original.\n\t*\n\t* Because a `MagicString` maps to a single source, per-source `filename`s are not carried\n\t* over; generate the bundle's map before flattening if you need the multi-source mapping.\n\t*/\n\ttoMagicString() {\n\t\tconst combined = new MagicString(this.sources.map((source) => source.content.original).join(\"\"));\n\t\tlet offset = 0;\n\t\tlet pending = this.intro;\n\t\tlet first = null;\n\t\tlet last = null;\n\t\tconst byStart = /* @__PURE__ */ new Map();\n\t\tconst byEnd = /* @__PURE__ */ new Map();\n\t\tlet hasMovedChunks = false;\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst magicString = source.content;\n\t\t\tconst separator = i > 0 ? source.separator !== void 0 ? source.separator : this.separator : \"\";\n\t\t\tif (magicString.original.length === 0) {\n\t\t\t\tpending += separator + magicString.toString();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpending += separator + magicString.intro;\n\t\t\tlet sourceFirst = null;\n\t\t\tlet previous = null;\n\t\t\tlet originalChunk = magicString.firstChunk;\n\t\t\twhile (originalChunk) {\n\t\t\t\tconst chunk = originalChunk.clone();\n\t\t\t\tchunk.start += offset;\n\t\t\t\tchunk.end += offset;\n\t\t\t\tchunk.previous = previous;\n\t\t\t\tchunk.next = null;\n\t\t\t\tif (previous) previous.next = chunk;\n\t\t\t\tbyStart.set(chunk.start, chunk);\n\t\t\t\tbyEnd.set(chunk.end, chunk);\n\t\t\t\tsourceFirst ??= chunk;\n\t\t\t\tprevious = chunk;\n\t\t\t\toriginalChunk = originalChunk.next;\n\t\t\t}\n\t\t\tconst sourceLast = previous;\n\t\t\tsourceFirst.intro = pending + sourceFirst.intro;\n\t\t\tpending = \"\";\n\t\t\tsourceLast.outro += magicString.outro;\n\t\t\tif (last) {\n\t\t\t\tlast.next = sourceFirst;\n\t\t\t\tsourceFirst.previous = last;\n\t\t\t} else first = sourceFirst;\n\t\t\tlast = sourceLast;\n\t\t\tfor (let index = 0; index < magicString.original.length; index += 1) if (magicString.sourcemapLocations.has(index)) combined.sourcemapLocations.add(index + offset);\n\t\t\tObject.keys(magicString.storedNames).forEach((name) => {\n\t\t\t\tObject.defineProperty(combined.storedNames, name, {\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: true,\n\t\t\t\t\tenumerable: true\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (magicString.hasMovedChunks) hasMovedChunks = true;\n\t\t\toffset += magicString.original.length;\n\t\t});\n\t\tif (!first) {\n\t\t\tcombined.intro = pending;\n\t\t\treturn combined;\n\t\t}\n\t\tif (pending) last.outro += pending;\n\t\tcombined.firstChunk = first;\n\t\tcombined.lastChunk = last;\n\t\tcombined.lastSearchedChunk = first;\n\t\tcombined.byStart = byStart;\n\t\tcombined.byEnd = byEnd;\n\t\tcombined.hasMovedChunks = hasMovedChunks;\n\t\treturn combined;\n\t}\n\tgenerateDecodedMap(options = {}) {\n\t\tconst mappings = new Mappings(options.hires);\n\t\tconst { names, x_google_ignoreList } = this._generateMappings(mappings);\n\t\treturn {\n\t\t\t...this._mapProperties(options, names, x_google_ignoreList),\n\t\t\tmappings: mappings.raw,\n\t\t\trangeMappings: mappings.rawRangeMappings\n\t\t};\n\t}\n\tgenerateMap(options = {}) {\n\t\tconst encoder = new MappingsEncoder();\n\t\tconst mappings = new Mappings(options.hires, encoder);\n\t\tconst { names, x_google_ignoreList } = this._generateMappings(mappings);\n\t\treturn new SourceMap({\n\t\t\t...this._mapProperties(options, names, x_google_ignoreList),\n\t\t\tmappings: encoder.finish(mappings.rawSegments),\n\t\t\trangeMappings: mappings.rawRangeMappings\n\t\t});\n\t}\n\t/** @internal */\n\t_generateMappings(mappings) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!names.includes(name)) names.push(name);\n\t\t\t});\n\t\t});\n\t\tif (this.intro) mappings.advance(this.intro);\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0)\n /* v8 ignore next -- addSource always normalizes source.separator */\n\t\t\tmappings.advance(source.separator !== void 0 ? source.separator : this.separator);\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\t\t\tif (magicString.intro) mappings.advance(magicString.intro);\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);\n\t\t\t\t\telse mappings.addUneditedChunk(sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations);\n\t\t\t\t} else mappings.advance(chunk.content);\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\t\t\tif (magicString.outro) mappings.advance(magicString.outro);\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === void 0) x_google_ignoreList = [];\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tnames,\n\t\t\tx_google_ignoreList\n\t\t};\n\t}\n\t/** @internal */\n\t_mapProperties(options, names, x_google_ignoreList) {\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : void 0,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn (typeof options.includeContent === \"function\" ? options.includeContent(source) : options.includeContent) ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tx_google_ignoreList\n\t\t};\n\t}\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\t\t\tif (indentStr === null) return;\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\t\treturn Object.keys(indentStringCounts).sort((a, b) => {\n\t\t\treturn indentStringCounts[b] - indentStringCounts[a];\n\t\t})[0] || \"\t\";\n\t}\n\tindent(indentStr) {\n\t\tif (!arguments.length) indentStr = this.getIndentString();\n\t\tif (indentStr === \"\") return this;\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === \"\\n\";\n\t\tthis.sources.forEach((source, i) => {\n\t\t\t/* v8 ignore next -- addSource always normalizes source.separator */\n\t\t\tconst separator = source.separator !== void 0 ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || i > 0 && /\\r?\\n$/.test(separator);\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart\n\t\t\t});\n\t\t\ttrailingNewline = source.content.lastChar() === \"\\n\";\n\t\t});\n\t\tif (this.intro) this.intro = indentStr + this.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t});\n\t\treturn this;\n\t}\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\ttoString() {\n\t\tconst body = this.sources.map((source, i) => {\n\t\t\t/* v8 ignore next -- addSource always normalizes source.separator */\n\t\t\tconst separator = source.separator !== void 0 ? source.separator : this.separator;\n\t\t\treturn (i > 0 ? separator : \"\") + source.content.toString();\n\t\t}).join(\"\");\n\t\treturn this.intro + body;\n\t}\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source, i) => {\n\t\t\t/* v8 ignore next -- addSource always normalizes source.separator */\n\t\t\tconst separator = source.separator !== void 0 ? source.separator : this.separator;\n\t\t\treturn i > 0 && separator.trim() !== \"\" || !source.content.isEmpty();\n\t\t})) return false;\n\t\treturn true;\n\t}\n\tlength() {\n\t\treturn this.sources.reduce((length, source, i) => {\n\t\t\t/* v8 ignore next -- addSource always normalizes source.separator */\n\t\t\tconst separator = source.separator !== void 0 ? source.separator : this.separator;\n\t\t\treturn length + (i > 0 ? separator.length : 0) + source.content.toString().length;\n\t\t}, this.intro.length);\n\t}\n\ttrimLines() {\n\t\treturn this.trim(\"[\\\\r\\\\n]\");\n\t}\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp(`^${charType || \"\\\\s\"}+`);\n\t\tthis.intro = this.intro.replace(rx, \"\");\n\t\tif (!this.intro) for (let i = 0; i < this.sources.length; i += 1) {\n\t\t\tconst source = this.sources[i];\n\t\t\tif (i > 0) {\n\t\t\t\tsource.separator = (source.separator !== void 0 ? source.separator : this.separator).replace(rx, \"\");\n\t\t\t\tif (source.separator) break;\n\t\t\t}\n\t\t\tif (source.content.trimStartAborted(charType)) break;\n\t\t}\n\t\treturn this;\n\t}\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp(`${charType || \"\\\\s\"}+$`);\n\t\tfor (let i = this.sources.length - 1; i >= 0; i -= 1) {\n\t\t\tconst source = this.sources[i];\n\t\t\tif (source.content.trimEndAborted(charType)) return this;\n\t\t\tif (i > 0) {\n\t\t\t\tsource.separator = (source.separator !== void 0 ? source.separator : this.separator).replace(rx, \"\");\n\t\t\t\tif (source.separator) return this;\n\t\t\t}\n\t\t}\n\t\tthis.intro = this.intro.replace(rx, \"\");\n\t\treturn this;\n\t}\n};\n//#endregion\nexport { Bundle, MagicString, MagicString as default, MagicString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AS,EAAS,OAAQ,GAAS,EAAG,CACzD,IAAM,EAAe,OAAO,GAAgB,WAAa,EAAY,GAAI,EAAO,CAAQ,EAAI,EAAkB,EAAa,GAAI,EAAO,EAAU,CAAC,EAAG,IAAK,EAAC,EACtJ,IAAiB,IAAI,KAAK,YAAY,EAAO,CAAY,CAC9D,CACA,OAAO,IACR,CACA,IAAK,IAAI,EAAQ,EAAS,QAAQ,CAAM,EAAG,IAAU,GAAI,EAAQ,EAAS,QAAQ,EAAQ,EAAQ,CAAY,EAAG,CAChH,GAAI,KAAK,mBAAmB,EAAO,EAAQ,CAAY,EAAG,SAC1D,IAAM,EAAW,EAAS,MAAM,EAAO,EAAQ,CAAY,EACrD,EAAe,OAAO,GAAgB,WAAa,EAAY,EAAU,EAAO,CAAQ,EAAI,EAAkB,EAAa,EAAU,EAAO,EAAU,CAAC,EAAG,IAAK,EAAC,EAClK,IAAa,GAAc,KAAK,UAAU,EAAO,EAAQ,EAAc,CAAY,CACxF,CACA,OAAO,IACR,CAIA,WAAW,EAAa,EAAa,CACpC,GAAI,OAAO,GAAgB,SAAU,OAAO,KAAK,kBAAkB,EAAa,CAAW,EAC3F,GAAI,CAAC,EAAY,OAAQ,MAAM,IAAI,EAAiB,uCAAuC,EAC3F,OAAO,KAAK,eAAe,EAAa,CAAW,CACpD,CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castlabs/ui",
3
- "version": "8.4.1",
3
+ "version": "8.5.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/castlabs/ui-styleguide.git"
@@ -15,8 +15,8 @@
15
15
  "build-lib": "vite build && npm run gulp dist",
16
16
  "build-only": "vite build",
17
17
  "package": "vite build && npm run gulp dist && npm pack",
18
- "test": "vitest run --environment jsdom --root tests/unit/",
19
- "test:unit": "vitest run --no-color --environment jsdom --root tests/unit/",
18
+ "test": "vitest run --environment jsdom --root tests/unit/ --config ../../vitest.config.mjs",
19
+ "test:unit": "vitest run --no-color --environment jsdom --root tests/unit/ --config ../../vitest.config.mjs",
20
20
  "lint": "npm-run-all lint:stylelint lint:eslint lint:type-check",
21
21
  "lint:eslint": "eslint .",
22
22
  "lint:stylelint": "stylelint \"**/*.{css,scss}\" --ignore-path .gitignore",
@@ -42,18 +42,17 @@
42
42
  "simplebar": "6.3.3"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@rollup/rollup-linux-x64-gnu": "4.63.1"
45
+ "@rollup/rollup-linux-x64-gnu": "4.63.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@castlabs/ui-editor": "file:../castlabs-ui-editor",
49
49
  "@tsconfig/node24": "24.0.5",
50
- "@types/jsdom": "30.0.0",
51
50
  "@types/node": "26.5.0",
52
- "@vitejs/plugin-vue": "6.0.8",
51
+ "@vitejs/plugin-vue": "6.0.9",
53
52
  "@vitest/eslint-plugin": "1.6.27",
54
53
  "@vue/eslint-config-prettier": "10.2.0",
55
54
  "@vue/eslint-config-typescript": "14.9.0",
56
- "@vue/test-utils": "2.5.0",
55
+ "@vue/test-utils": "2.5.1",
57
56
  "@vue/tsconfig": "0.9.1",
58
57
  "core-js": "3.50.0",
59
58
  "dree": "5.1.5",
@@ -64,18 +63,18 @@
64
63
  "gulp": "5.0.1",
65
64
  "gulp-concat": "2.6.1",
66
65
  "gulp-replace": "1.1.4",
67
- "jsdom": "30.0.1",
66
+ "jsdom": "^30.0.1",
68
67
  "npm-run-all": "4.1.5",
69
- "prettier": "3.9.6",
70
- "sass": "1.104.0",
68
+ "prettier": "3.9.7",
69
+ "sass": "1.104.1",
71
70
  "stylelint-config-sass-guidelines": "13.0.0",
72
71
  "stylelint-config-standard": "40.0.0",
73
72
  "stylelint-config-standard-vue": "2.0.0",
74
73
  "stylelint-order": "8.1.1",
75
- "stylelint-scss": "7.2.0",
74
+ "stylelint-scss": "7.3.0",
76
75
  "typescript": "6.0.3",
77
- "vite": "8.2.2",
78
- "vitest": "4.1.11",
76
+ "vite": "8.3.0",
77
+ "vitest": "5.0.1",
79
78
  "vue": "3.5.42",
80
79
  "vue-eslint-parser": "10.4.1",
81
80
  "vue-router": "5.3.1",
@@ -1,3 +1,3 @@
1
1
  :root {
2
- #{'--cl-version'}: 'v8.4.1';
2
+ #{'--cl-version'}: 'v8.5.0';
3
3
  }
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { App, DefineComponent } from 'vue'
2
- import type { Router, RouteLocationNormalizedLoadedGeneric } from 'vue-router'
2
+ import type { Router } from 'vue-router'
3
3
 
4
4
  declare function install (Vue: App): void
5
5
  export default install
@@ -159,7 +159,7 @@ export function clRefFocus (ref: unknown): void
159
159
  export function clRefHTMLElement (ref: unknown): HTMLElement
160
160
  export function clBackOrGoto (router: unknown, routeName: string): void
161
161
  export function clQuerystringGet (
162
- route: RouteLocationNormalizedLoadedGeneric,
162
+ route: any, // there are multiple $route types depending on caller scope
163
163
  params: { [key: string]: string[] },
164
164
  target?: { [key: string]: any }
165
165
  ): any
@@ -1,11 +0,0 @@
1
- var e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,t=new Uint8Array(64),n=new Uint8Array(128);for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t[r]=i,n[i]=r}function r(e,n){do{let r=n&31;n>>>=5,n>0&&(r|=32),e.write(t[r])}while(n>0)}function i(e){return e<0?-e<<1|1:e<<1}var a=16384,o=typeof TextDecoder<`u`?new TextDecoder:typeof Buffer<`u`?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},s=class{constructor(){this.pos=0,this.out=``,this.buffer=new Uint8Array(a)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===a&&(this.out+=o.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+o.decode(e.subarray(0,n)):t}};function c(e){let t=new s,n=0,a=0,o=0,c=0;for(let s=0;s<e.length;s++){let l=e[s];if(s>0&&t.write(59),l.length===0)continue;let u=0;for(let e=0;e<l.length;e++){let s=l[e];e>0&&t.write(44),r(t,i(s[0]-u)),u=s[0],s.length!==1&&(r(t,i(s[1]-n)),r(t,i(s[2]-a)),r(t,i(s[3]-o)),n=s[1],a=s[2],o=s[3],s.length!==4&&(r(t,i(s[4]-c)),c=s[4]))}}return t.flush()}var l=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}},u=class e{constructor(e,t,n){this.start=e,this.end=t,this.original=n,this.intro=``,this.outro=``,this.content=n,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro+=e}clone(){let t=new e(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}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;for(;t;)e(t),t=t.next}eachPrevious(e){let t=this;for(;t;)e(t),t=t.previous}edit(e,t,n){return this.content=e,n||(this.intro=``,this.outro=``),this.storeName=t,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro=``,this.outro=``,this.edited&&=(this.content=this.original,this.storeName=!1,!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),i=this.original.slice(n);this.original=r;let a=new e(t,this.end,i);return a.outro=this.outro,this.outro=``,this.end=t,this.edited?(a.edit(``,!1),this.content=``):this.content=r,a.next=this.next,a.next&&(a.next.previous=a),a.previous=this,this.next=a,a}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,``),this.outro.length)return!0;let t=this.content.replace(e,``);if(t.length)return t!==this.content&&(this.split(this.start+t.length).edit(``,void 0,!0),this.edited&&this.edit(t,this.storeName,!0)),!0;if(this.edit(``,void 0,!0),this.intro=this.intro.replace(e,``),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,``),this.intro.length)return!0;let t=this.content.replace(e,``);if(t.length){if(t!==this.content){let e=this.split(this.end-t.length);this.edited&&e.edit(t,this.storeName,!0),this.edit(``,void 0,!0)}return!0}if(this.edit(``,void 0,!0),this.outro=this.outro.replace(e,``),this.outro.length)return!0}};function d(){return typeof globalThis<`u`&&typeof globalThis.btoa==`function`?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer==`function`?e=>Buffer.from(e,`utf-8`).toString(`base64`):()=>{throw Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}var f=d(),p=class{constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=c(e.mappings),e.x_google_ignoreList!==void 0&&(this.x_google_ignoreList=e.x_google_ignoreList),e.debugId!==void 0&&(this.debugId=e.debugId)}toString(){return JSON.stringify(this)}toUrl(){return`data:application/json;charset=utf-8;base64,`+f(this.toString())}};function m(e){let t=e.split(`
2
- `),n=t.filter(e=>/^\t+/.test(e)),r=t.filter(e=>/^ {2,}/.test(e));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return` `;let i=r.reduce((e,t)=>{let n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return Array(i+1).join(` `)}function h(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let e=n.length;for(;e--;)n[e]=`..`}return n.concat(r).join(`/`)}var g=Object.prototype.toString;function _(e){return g.call(e)===`[object Object]`}function v(e){let t=e.split(`
3
- `),n=[];for(let e=0,r=0;e<t.length;e++)n.push(r),r+=t[e].length+1;return function(e){let t=0,r=n.length;for(;t<r;){let i=t+r>>1;e<n[i]?r=i:t=i+1}let i=t-1;return{line:i,column:e-n[i]}}}var y=/\w/,b=class{constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,t,n,r){if(t.length){let i=t.length-1,a=t.indexOf(`
4
- `,0),o=-1;for(;a>=0&&i>a;){let i=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&i.push(r),this.rawSegments.push(i),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=a,a=t.indexOf(`
5
- `,a+1)}let s=[this.generatedCodeColumn,e,n.line,n.column];r>=0&&s.push(r),this.rawSegments.push(s),this.advance(t.slice(o+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(t));this.pending=null}addUneditedChunk(e,t,n,r,i){let a=t.start,o=!0,s=!1;for(;a<t.end;){if(n[a]===`
6
- `)r.line+=1,r.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=!0,s=!1;else{if(this.hires||o||i.has(a)){let t=[this.generatedCodeColumn,e,r.line,r.column];this.hires===`boundary`?y.test(n[a])?s||=(this.rawSegments.push(t),!0):(this.rawSegments.push(t),s=!1):this.rawSegments.push(t)}r.column+=1,this.generatedCodeColumn+=1,o=!1}a+=1}this.pending=null}advance(e){if(!e)return;let t=e.split(`
7
- `);if(t.length>1){for(let e=0;e<t.length-1;e++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}},x=`
8
- `,S={insertLeft:!1,insertRight:!1,storeName:!1},C=class e{constructor(e,t={}){let n=new u(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:``},intro:{writable:!0,value:``},firstChunk:{writable:!0,value:n},lastChunk:{writable:!0,value:n},lastSearchedChunk:{writable:!0,value:n},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:t.filename},indentExclusionRanges:{writable:!0,value:t.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new l},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:t.ignoreList},offset:{writable:!0,value:t.offset||0}}),this.byStart[0]=n,this.byEnd[e.length]=n}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=`string`)throw TypeError(`outro content must be a string`);return this.outro+=e,this}appendLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byEnd[e];return n?n.appendLeft(t):this.intro+=t,this}appendRight(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byStart[e];return n?n.appendRight(t):this.outro+=t,this}clone(){let t=new e(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart[r.start]=r,t.byEnd[r.end]=r;let e=n.next,i=e&&e.clone();i&&(r.next=i,i.previous=r,r=i),n=e}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new l(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(e){e||={};let t=Object.keys(this.storedNames),n=new b(e.hires),r=v(this.original);return this.intro&&n.advance(this.intro),this.firstChunk.eachNext(e=>{let i=r(e.start);e.intro.length&&n.advance(e.intro),e.edited?n.addEdit(0,e.content,i,e.storeName?t.indexOf(e.original):-1):n.addUneditedChunk(0,e,this.original,i,this.sourcemapLocations),e.outro.length&&n.advance(e.outro)}),this.outro&&n.advance(this.outro),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?h(e.file||``,e.source):e.file||``],sourcesContent:e.includeContent?[this.original]:void 0,names:t,mappings:n.raw,x_google_ignoreList:this.ignoreList?[0]:void 0}}generateMap(e){return new p(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=m(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?` `:this.indentStr}indent(e,t){let n=/^[^\r\n]/gm;if(_(e)&&(t=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||` `),e===``)return this;t||={};let r={};t.exclude&&(typeof t.exclude[0]==`number`?[t.exclude]:t.exclude).forEach(e=>{for(let t=e[0];t<e[1];t+=1)r[t]=!0});let i=t.indentStart!==!1,a=t=>i?`${e}${t}`:(i=!0,t);this.intro=this.intro.replace(n,a);let o=0,s=this.firstChunk;for(;s;){let t=s.end;if(s.edited)r[o]||(s.content=s.content.replace(n,a),s.content.length&&(i=s.content[s.content.length-1]===`
9
- `));else for(o=s.start;o<t;){if(!r[o]){let t=this.original[o];t===`
10
- `?i=!0:t!==`\r`&&i&&(i=!1,o===s.start?s.prependRight(e):(this._splitChunk(s,o),s=s.next,s.prependRight(e)))}o+=1}o=s.end,s=s.next}return this.outro=this.outro.replace(n,a),this}insert(){throw Error(`magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)`)}insertLeft(e,t){return S.insertLeft||=(console.warn(`magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead`),!0),this.appendLeft(e,t)}insertRight(e,t){return S.insertRight||=(console.warn(`magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead`),!0),this.prependRight(e,t)}move(e,t,n){if(e+=this.offset,t+=this.offset,n+=this.offset,n>=e&&n<=t)throw Error(`Cannot move a selection inside itself`);this._split(e),this._split(t),this._split(n);let r=this.byStart[e],i=this.byEnd[t],a=r.previous,o=i.next,s=this.byStart[n];if(!s&&i===this.lastChunk)return this;let c=s?s.previous:this.lastChunk;return a&&(a.next=o),o&&(o.previous=a),c&&(c.next=r),s&&(s.previous=i),r.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=c,i.next=s||null,c||(this.firstChunk=r),s||(this.lastChunk=i),this}overwrite(e,t,n,r){return r||={},this.update(e,t,n,{...r,overwrite:!r.contentOnly})}update(e,t,n,r){if(e+=this.offset,t+=this.offset,typeof n!=`string`)throw TypeError(`replacement content must be a string`);if(this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(t>this.original.length)throw Error(`end is out of bounds`);if(e===t)throw Error(`Cannot overwrite a zero-length range – use appendLeft or prependRight instead`);this._split(e),this._split(t),r===!0&&(S.storeName||=(console.warn(`The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string`),!0),r={storeName:!0});let i=r!==void 0&&r.storeName,a=r!==void 0&&r.overwrite;if(i){let n=this.original.slice(e,t);Object.defineProperty(this.storedNames,n,{writable:!0,value:!0,enumerable:!0})}let o=this.byStart[e],s=this.byEnd[t];if(o){let e=o;for(;e!==s;){if(e.next!==this.byStart[e.end])throw Error(`Cannot overwrite across a split point`);e=e.next,e.edit(``,!1)}o.edit(n,i,!a)}else{let r=new u(e,t,``).edit(n,i);s.next=r,r.previous=s}return this}prepend(e){if(typeof e!=`string`)throw TypeError(`outro content must be a string`);return this.intro=e+this.intro,this}prependLeft(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byEnd[e];return n?n.prependLeft(t):this.intro=t+this.intro,this}prependRight(e,t){if(e+=this.offset,typeof t!=`string`)throw TypeError(`inserted content must be a string`);this._split(e);let n=this.byStart[e];return n?n.prependRight(t):this.outro=t+this.outro,this}remove(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(e===t)return this;if(e<0||t>this.original.length)throw Error(`Character is out of bounds`);if(e>t)throw Error(`end must be greater than start`);this._split(e),this._split(t);let n=this.byStart[e];for(;n;)n.intro=``,n.outro=``,n.edit(``),n=t>n.end?this.byStart[n.end]:null;return this}reset(e,t){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}if(e===t)return this;if(e<0||t>this.original.length)throw Error(`Character is out of bounds`);if(e>t)throw Error(`end must be greater than start`);this._split(e),this._split(t);let n=this.byStart[e];for(;n;)n.reset(),n=t>n.end?this.byStart[n.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:``}lastLine(){let e=this.outro.lastIndexOf(x);if(e!==-1)return this.outro.substr(e+1);let t=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(e=n.outro.lastIndexOf(x),e!==-1)return n.outro.substr(e+1)+t;t=n.outro+t}if(n.content.length>0){if(e=n.content.lastIndexOf(x),e!==-1)return n.content.substr(e+1)+t;t=n.content+t}if(n.intro.length>0){if(e=n.intro.lastIndexOf(x),e!==-1)return n.intro.substr(e+1)+t;t=n.intro+t}}while(n=n.previous);return e=this.intro.lastIndexOf(x),e===-1?this.intro+t:this.intro.substr(e+1)+t}slice(e=0,t=this.original.length-this.offset){if(e+=this.offset,t+=this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length}let n=``,r=this.firstChunk;for(;r&&(r.start>e||r.end<=e);){if(r.start<t&&r.end>=t)return n;r=r.next}if(r&&r.edited&&r.start!==e)throw Error(`Cannot use replaced character ${e} as slice start anchor.`);let i=r;for(;r;){r.intro&&(i!==r||r.start===e)&&(n+=r.intro);let a=r.start<t&&r.end>=t;if(a&&r.edited&&r.end!==t)throw Error(`Cannot use replaced character ${t} as slice end anchor.`);let o=i===r?e-r.start:0,s=a?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,s),r.outro&&(!a||r.end===t)&&(n+=r.outro),a)break;r=r.next}return n}snip(e,t){let n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk,n=t,r=e>t.end;for(;t;){if(t.contains(e))return this._splitChunk(t,e);if(t=r?this.byStart[t.end]:this.byEnd[t.start],t===n)return;n=t}}_splitChunk(e,t){if(e.edited&&e.content.length){let n=v(this.original)(t);throw Error(`Cannot split a chunk that has already been edited (${n.line}:${n.column} – "${e.original}")`)}let n=e.split(t);return this.byEnd[t]=e,this.byStart[t]=n,this.byEnd[n.end]=n,e===this.lastChunk&&(this.lastChunk=n),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,t=this.firstChunk;for(;t;)e+=t.toString(),t=t.next;return e+this.outro}isEmpty(){let e=this.firstChunk;do if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1;while(e=e.next);return!0}length(){let e=this.firstChunk,t=0;do t+=e.intro.length+e.content.length+e.outro.length;while(e=e.next);return t}trimLines(){return this.trim(`[\\r\\n]`)}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){let t=RegExp((e||`\\s`)+`+$`);if(this.outro=this.outro.replace(t,``),this.outro.length)return!0;let n=this.lastChunk;do{let e=n.end,r=n.trimEnd(t);if(n.end!==e&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.previous}while(n);return!1}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){let t=RegExp(`^`+(e||`\\s`)+`+`);if(this.intro=this.intro.replace(t,``),this.intro.length)return!0;let n=this.firstChunk;do{let e=n.end,r=n.trimStart(t);if(n.end!==e&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.next}while(n);return!1}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function n(e,n){return typeof t==`string`?t.replace(/\$(\$|&|\d+)/g,(t,n)=>n===`$`?`$`:n===`&`?e[0]:+n<e.length?e[+n]:`$${n}`):t(...e,e.index,n,e.groups)}function r(e,t){let n,r=[];for(;n=e.exec(t);)r.push(n);return r}if(e.global)r(e,this.original).forEach(e=>{if(e.index!=null){let t=n(e,this.original);t!==e[0]&&this.overwrite(e.index,e.index+e[0].length,t)}});else{let t=this.original.match(e);if(t&&t.index!=null){let e=n(t,this.original);e!==t[0]&&this.overwrite(t.index,t.index+t[0].length,e)}}return this}_replaceString(e,t){let{original:n}=this,r=n.indexOf(e);return r!==-1&&(typeof t==`function`&&(t=t(e,r,n)),e!==t&&this.overwrite(r,r+e.length,t)),this}replace(e,t){return typeof e==`string`?this._replaceString(e,t):this._replaceRegexp(e,t)}_replaceAllString(e,t){let{original:n}=this,r=e.length;for(let i=n.indexOf(e);i!==-1;i=n.indexOf(e,i+r)){let e=n.slice(i,i+r),a=t;typeof t==`function`&&(a=t(e,i,n)),e!==a&&this.overwrite(i,i+r,a)}return this}replaceAll(e,t){if(typeof e==`string`)return this._replaceAllString(e,t);if(!e.global)throw TypeError(`MagicString.prototype.replaceAll called with a non-global RegExp argument`);return this._replaceRegexp(e,t)}};exports.default=C;
11
- //# sourceMappingURL=magic-string.es-3690a1eb.js.map