json-conflict-resolver
Version:
A rules-based JSON conflict resolver that parses Git conflict markers, reconstructs ours/theirs, and merges with deterministic strategies — beyond line-based merges.
14 lines • 310 kB
JavaScript
"use strict";var vh=Object.create;var Wn=Object.defineProperty;var _h=Object.getOwnPropertyDescriptor;var Ch=Object.getOwnPropertyNames;var Ih=Object.getPrototypeOf,Oh=Object.prototype.hasOwnProperty;var $h=(e,t,n)=>t in e?Wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ba=(e,t)=>()=>(e&&(t=e(e=0)),t);var Vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ah=(e,t)=>{for(var n in t)Wn(e,n,{get:t[n],enumerable:!0})},Mh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ch(t))!Oh.call(e,o)&&o!==n&&Wn(e,o,{get:()=>t[o],enumerable:!(r=_h(t,o))||r.enumerable});return e};var Un=(e,t,n)=>(n=e!=null?vh(Ih(e)):{},Mh(t||!e||!e.__esModule?Wn(n,"default",{value:e,enumerable:!0}):n,e));var J=(e,t,n)=>$h(e,typeof t!="symbol"?t+"":t,n);var _u=Vt((A0,vu)=>{"use strict";var Eu,Kr,Gr,Yr,Hr,Zr,On,bs,An,Qr,xu,eo,$n,to,no,ro,zt,Tu,oo,io,$g;to=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;$n=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;Kr=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;ro=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;eo=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;zt=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;io=/[\t\v\f\ufeff\p{Zs}]+/yu;An=/\r?\n|[\r\u2028\u2029]/y;Qr=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;no=/\/\/.*/y;Eu=/^#!.*/;Yr=/[<>.:={}]|\/(?![\/*])/y;Gr=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;Hr=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;Zr=/[^<>{}]+/y;oo=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;Tu=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;On=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;bs=/^(?:return|throw|yield)$/;xu=RegExp(An.source);vu.exports=$g=function*(e,{jsx:t=!1}={}){var n,r,o,i,s,a,c,l,u,f,p,h,m,d;for({length:a}=e,i=0,s="",d=[{tag:"JS"}],n=[],p=0,h=!1,(c=Eu.exec(e))&&(yield{type:"HashbangComment",value:c[0]},i=c[0].length);i<a;){switch(l=d[d.length-1],l.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(e[i]==="/"&&(oo.test(s)||On.test(s))&&(to.lastIndex=i,c=to.exec(e))){i=to.lastIndex,s=c[0],h=!0,yield{type:"RegularExpressionLiteral",value:c[0],closed:c[1]!==void 0&&c[1]!=="\\"};continue}if($n.lastIndex=i,c=$n.exec(e)){switch(m=c[0],u=$n.lastIndex,f=m,m){case"(":s==="?NonExpressionParenKeyword"&&d.push({tag:"JSNonExpressionParen",nesting:p}),p++,h=!1;break;case")":p--,h=!0,l.tag==="JSNonExpressionParen"&&p===l.nesting&&(d.pop(),f="?NonExpressionParenEnd",h=!1);break;case"{":$n.lastIndex=0,o=!Tu.test(s)&&(oo.test(s)||On.test(s)),n.push(o),h=!1;break;case"}":switch(l.tag){case"InterpolationInTemplate":if(n.length===l.nesting){zt.lastIndex=i,c=zt.exec(e),i=zt.lastIndex,s=c[0],c[1]==="${"?(s="?InterpolationInTemplate",h=!1,yield{type:"TemplateMiddle",value:c[0]}):(d.pop(),h=!0,yield{type:"TemplateTail",value:c[0],closed:c[1]==="`"});continue}break;case"InterpolationInJSX":if(n.length===l.nesting){d.pop(),i+=1,s="}",yield{type:"JSXPunctuator",value:"}"};continue}}h=n.pop(),f=h?"?ExpressionBraceEnd":"}";break;case"]":h=!0;break;case"++":case"--":f=h?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(t&&(oo.test(s)||On.test(s))){d.push({tag:"JSXTag"}),i+=1,s="<",yield{type:"JSXPunctuator",value:m};continue}h=!1;break;default:h=!1}i=u,s=f,yield{type:"Punctuator",value:m};continue}if(Kr.lastIndex=i,c=Kr.exec(e)){switch(i=Kr.lastIndex,f=c[0],c[0]){case"for":case"if":case"while":case"with":s!=="."&&s!=="?."&&(f="?NonExpressionParenKeyword")}s=f,h=!On.test(c[0]),yield{type:c[1]==="#"?"PrivateIdentifier":"IdentifierName",value:c[0]};continue}if(ro.lastIndex=i,c=ro.exec(e)){i=ro.lastIndex,s=c[0],h=!0,yield{type:"StringLiteral",value:c[0],closed:c[2]!==void 0};continue}if(eo.lastIndex=i,c=eo.exec(e)){i=eo.lastIndex,s=c[0],h=!0,yield{type:"NumericLiteral",value:c[0]};continue}if(zt.lastIndex=i,c=zt.exec(e)){i=zt.lastIndex,s=c[0],c[1]==="${"?(s="?InterpolationInTemplate",d.push({tag:"InterpolationInTemplate",nesting:n.length}),h=!1,yield{type:"TemplateHead",value:c[0]}):(h=!0,yield{type:"NoSubstitutionTemplate",value:c[0],closed:c[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(Yr.lastIndex=i,c=Yr.exec(e)){switch(i=Yr.lastIndex,f=c[0],c[0]){case"<":d.push({tag:"JSXTag"});break;case">":d.pop(),s==="/"||l.tag==="JSXTagEnd"?(f="?JSX",h=!0):d.push({tag:"JSXChildren"});break;case"{":d.push({tag:"InterpolationInJSX",nesting:n.length}),f="?InterpolationInJSX",h=!1;break;case"/":s==="<"&&(d.pop(),d[d.length-1].tag==="JSXChildren"&&d.pop(),d.push({tag:"JSXTagEnd"}))}s=f,yield{type:"JSXPunctuator",value:c[0]};continue}if(Gr.lastIndex=i,c=Gr.exec(e)){i=Gr.lastIndex,s=c[0],yield{type:"JSXIdentifier",value:c[0]};continue}if(Hr.lastIndex=i,c=Hr.exec(e)){i=Hr.lastIndex,s=c[0],yield{type:"JSXString",value:c[0],closed:c[2]!==void 0};continue}break;case"JSXChildren":if(Zr.lastIndex=i,c=Zr.exec(e)){i=Zr.lastIndex,s=c[0],yield{type:"JSXText",value:c[0]};continue}switch(e[i]){case"<":d.push({tag:"JSXTag"}),i++,s="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":d.push({tag:"InterpolationInJSX",nesting:n.length}),i++,s="?InterpolationInJSX",h=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(io.lastIndex=i,c=io.exec(e)){i=io.lastIndex,yield{type:"WhiteSpace",value:c[0]};continue}if(An.lastIndex=i,c=An.exec(e)){i=An.lastIndex,h=!1,bs.test(s)&&(s="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:c[0]};continue}if(Qr.lastIndex=i,c=Qr.exec(e)){i=Qr.lastIndex,xu.test(c[0])&&(h=!1,bs.test(s)&&(s="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:c[0],closed:c[1]!==void 0};continue}if(no.lastIndex=i,c=no.exec(e)){i=no.lastIndex,h=!1,yield{type:"SingleLineComment",value:c[0]};continue}r=String.fromCodePoint(e.codePointAt(i)),i+=r.length,s=r,h=!1,yield{type:l.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:r}}}});function Nn(e,t,n){let r=t-n;r=r<0?-r<<1|1:r<<1;do{let o=r&31;r>>>=5,r>0&&(o|=32),e.write(of[o])}while(r>0);return t}function sf(e){let t=new yy,n=0,r=0,o=0,i=0;for(let s=0;s<e.length;s++){let a=e[s];if(s>0&&t.write(my),a.length===0)continue;let c=0;for(let l=0;l<a.length;l++){let u=a[l];l>0&&t.write(py),c=Nn(t,u[0],c),u.length!==1&&(n=Nn(t,u[1],n),r=Nn(t,u[2],r),o=Nn(t,u[3],o),u.length!==4&&(i=Nn(t,u[4],i)))}}return t.flush()}var py,my,tf,of,gy,nf,rf,yy,af=ba(()=>{"use strict";py=44,my=59,tf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",of=new Uint8Array(64),gy=new Uint8Array(128);for(let e=0;e<tf.length;e++){let t=tf.charCodeAt(e);of[e]=t,gy[t]=e}nf=1024*16,rf=typeof TextDecoder!="undefined"?new TextDecoder:typeof Buffer!="undefined"?{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}},yy=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(nf)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===nf&&(this.out+=rf.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+rf.decode(e.subarray(0,n)):t}}});var ff={};Ah(ff,{Bundle:()=>ks,SourceMap:()=>Rn,default:()=>Fn});function by(){return typeof globalThis!="undefined"&&typeof globalThis.btoa=="function"?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer=="function"?e=>Buffer.from(e,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}function Sy(e){let t=e.split(`
`),n=t.filter(i=>/^\t+/.test(i)),r=t.filter(i=>/^ {2,}/.test(i));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return" ";let o=r.reduce((i,s)=>{let a=/^ +/.exec(s)[0].length;return Math.min(a,i)},1/0);return new Array(o+1).join(" ")}function lf(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let o=n.length;for(;o--;)n[o]=".."}return n.concat(r).join("/")}function uf(e){return Ey.call(e)==="[object Object]"}function Ps(e){let t=e.split(`
`),n=[];for(let r=0,o=0;r<t.length;r++)n.push(o),o+=t[r].length+1;return function(o){let i=0,s=n.length;for(;i<s;){let l=i+s>>1;o<n[l]?s=l:i=l+1}let a=i-1,c=o-n[a];return{line:a,column:c}}}var ho,po,wy,Rn,Ey,xy,mo,jn,rn,Fn,cf,ks,hf=ba(()=>{"use strict";af();ho=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}},po=class e{constructor(t,n,r){this.start=t,this.end=n,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}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(t){return this.start<t&&t<this.end}eachNext(t){let n=this;for(;n;)t(n),n=n.next}eachPrevious(t){let n=this;for(;n;)t(n),n=n.previous}edit(t,n,r){return this.content=t,r||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),o=this.original.slice(n);this.original=r;let i=new e(t,this.end,o);return i.outro=this.outro,this.outro="",this.end=t,this.edited?(i.edit("",!1),this.content=""):this.content=r,i.next=this.next,i.next&&(i.next.previous=i),i.previous=this,this.next=i,i}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let n=this.content.replace(t,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let n=this.content.replace(t,"");if(n.length){if(n!==this.content){let r=this.split(this.end-n.length);this.edited&&r.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}};wy=by(),Rn=class{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=sf(t.mappings),typeof t.x_google_ignoreList!="undefined"&&(this.x_google_ignoreList=t.x_google_ignoreList),typeof t.debugId!="undefined"&&(this.debugId=t.debugId)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+wy(this.toString())}};Ey=Object.prototype.toString;xy=/\w/,mo=class{constructor(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(t,n,r,o){if(n.length){let i=n.length-1,s=n.indexOf(`
`,0),a=-1;for(;s>=0&&i>s;){let l=[this.generatedCodeColumn,t,r.line,r.column];o>=0&&l.push(o),this.rawSegments.push(l),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=s,s=n.indexOf(`
`,s+1)}let c=[this.generatedCodeColumn,t,r.line,r.column];o>=0&&c.push(o),this.rawSegments.push(c),this.advance(n.slice(a+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(t,n,r,o,i){let s=n.start,a=!0,c=!1;for(;s<n.end;){if(r[s]===`
`)o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=!0,c=!1;else{if(this.hires||a||i.has(s)){let l=[this.generatedCodeColumn,t,o.line,o.column];this.hires==="boundary"?xy.test(r[s])?c||(this.rawSegments.push(l),c=!0):(this.rawSegments.push(l),c=!1):this.rawSegments.push(l)}o.column+=1,this.generatedCodeColumn+=1,a=!1}s+=1}this.pending=null}advance(t){if(!t)return;let n=t.split(`
`);if(n.length>1){for(let r=0;r<n.length-1;r++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}},jn=`
`,rn={insertLeft:!1,insertRight:!1,storeName:!1},Fn=class e{constructor(t,n={}){let r=new po(0,t.length,t);Object.defineProperties(this,{original:{writable:!0,value:t},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:r},lastChunk:{writable:!0,value:r},lastSearchedChunk:{writable:!0,value:r},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new ho},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList},offset:{writable:!0,value:n.offset||0}}),this.byStart[0]=r,this.byEnd[t.length]=r}addSourcemapLocation(t){this.sourcemapLocations.add(t)}append(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.outro+=t,this}appendLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.appendLeft(n):this.intro+=n,this}appendRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.appendRight(n):this.outro+=n,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 o=n.next,i=o&&o.clone();i&&(r.next=i,i.previous=r,r=i),n=o}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new ho(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(t){t=t||{};let n=0,r=Object.keys(this.storedNames),o=new mo(t.hires),i=Ps(this.original);return this.intro&&o.advance(this.intro),this.firstChunk.eachNext(s=>{let a=i(s.start);s.intro.length&&o.advance(s.intro),s.edited?o.addEdit(n,s.content,a,s.storeName?r.indexOf(s.original):-1):o.addUneditedChunk(n,s,this.original,a,this.sourcemapLocations),s.outro.length&&o.advance(s.outro)}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:[t.source?lf(t.file||"",t.source):t.file||""],sourcesContent:t.includeContent?[this.original]:void 0,names:r,mappings:o.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(t){return new Rn(this.generateDecodedMap(t))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=Sy(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(t,n){let r=/^[^\r\n]/gm;if(uf(t)&&(n=t,t=void 0),t===void 0&&(this._ensureindentStr(),t=this.indentStr||" "),t==="")return this;n=n||{};let o={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(u=>{for(let f=u[0];f<u[1];f+=1)o[f]=!0});let i=n.indentStart!==!1,s=l=>i?`${t}${l}`:(i=!0,l);this.intro=this.intro.replace(r,s);let a=0,c=this.firstChunk;for(;c;){let l=c.end;if(c.edited)o[a]||(c.content=c.content.replace(r,s),c.content.length&&(i=c.content[c.content.length-1]===`
`));else for(a=c.start;a<l;){if(!o[a]){let u=this.original[a];u===`
`?i=!0:u!=="\r"&&i&&(i=!1,a===c.start||(this._splitChunk(c,a),c=c.next),c.prependRight(t))}a+=1}a=c.end,c=c.next}return this.outro=this.outro.replace(r,s),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(t,n){return rn.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),rn.insertLeft=!0),this.appendLeft(t,n)}insertRight(t,n){return rn.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),rn.insertRight=!0),this.prependRight(t,n)}move(t,n,r){if(t=t+this.offset,n=n+this.offset,r=r+this.offset,r>=t&&r<=n)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(n),this._split(r);let o=this.byStart[t],i=this.byEnd[n],s=o.previous,a=i.next,c=this.byStart[r];if(!c&&i===this.lastChunk)return this;let l=c?c.previous:this.lastChunk;return s&&(s.next=a),a&&(a.previous=s),l&&(l.next=o),c&&(c.previous=i),o.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=o.previous,this.lastChunk.next=null),o.previous=l,i.next=c||null,l||(this.firstChunk=o),c||(this.lastChunk=i),this}overwrite(t,n,r,o){return o=o||{},this.update(t,n,r,{...o,overwrite:!o.contentOnly})}update(t,n,r,o){if(t=t+this.offset,n=n+this.offset,typeof r!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(n>this.original.length)throw new Error("end is out of bounds");if(t===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(t),this._split(n),o===!0&&(rn.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),rn.storeName=!0),o={storeName:!0});let i=o!==void 0?o.storeName:!1,s=o!==void 0?o.overwrite:!1;if(i){let l=this.original.slice(t,n);Object.defineProperty(this.storedNames,l,{writable:!0,value:!0,enumerable:!0})}let a=this.byStart[t],c=this.byEnd[n];if(a){let l=a;for(;l!==c;){if(l.next!==this.byStart[l.end])throw new Error("Cannot overwrite across a split point");l=l.next,l.edit("",!1)}a.edit(r,i,!s)}else{let l=new po(t,n,"").edit(r,i);c.next=l,l.previous=c}return this}prepend(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this}prependLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.prependLeft(n):this.intro=n+this.intro,this}prependRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.prependRight(n):this.outro=n+this.outro,this}remove(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.intro="",r.outro="",r.edit(""),r=n>r.end?this.byStart[r.end]:null;return this}reset(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.reset(),r=n>r.end?this.byStart[r.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let t=this.outro.lastIndexOf(jn);if(t!==-1)return this.outro.substr(t+1);let n=this.outro,r=this.lastChunk;do{if(r.outro.length>0){if(t=r.outro.lastIndexOf(jn),t!==-1)return r.outro.substr(t+1)+n;n=r.outro+n}if(r.content.length>0){if(t=r.content.lastIndexOf(jn),t!==-1)return r.content.substr(t+1)+n;n=r.content+n}if(r.intro.length>0){if(t=r.intro.lastIndexOf(jn),t!==-1)return r.intro.substr(t+1)+n;n=r.intro+n}}while(r=r.previous);return t=this.intro.lastIndexOf(jn),t!==-1?this.intro.substr(t+1)+n:this.intro+n}slice(t=0,n=this.original.length-this.offset){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}let r="",o=this.firstChunk;for(;o&&(o.start>t||o.end<=t);){if(o.start<n&&o.end>=n)return r;o=o.next}if(o&&o.edited&&o.start!==t)throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);let i=o;for(;o;){o.intro&&(i!==o||o.start===t)&&(r+=o.intro);let s=o.start<n&&o.end>=n;if(s&&o.edited&&o.end!==n)throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);let a=i===o?t-o.start:0,c=s?o.content.length+n-o.end:o.content.length;if(r+=o.content.slice(a,c),o.outro&&(!s||o.end===n)&&(r+=o.outro),s)break;o=o.next}return r}snip(t,n){let r=this.clone();return r.remove(0,t),r.remove(n,r.original.length),r}_split(t){if(this.byStart[t]||this.byEnd[t])return;let n=this.lastSearchedChunk,r=n,o=t>n.end;for(;n;){if(n.contains(t))return this._splitChunk(n,t);if(n=o?this.byStart[n.end]:this.byEnd[n.start],n===r)return;r=n}}_splitChunk(t,n){if(t.edited&&t.content.length){let o=Ps(this.original)(n);throw new Error(`Cannot split a chunk that has already been edited (${o.line}:${o.column} \u2013 "${t.original}")`)}let r=t.split(n);return this.byEnd[n]=t,this.byStart[n]=r,this.byEnd[r.end]=r,t===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=t,!0}toString(){let t=this.intro,n=this.firstChunk;for(;n;)t+=n.toString(),n=n.next;return t+this.outro}isEmpty(){let t=this.firstChunk;do if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1;while(t=t.next);return!0}length(){let t=this.firstChunk,n=0;do n+=t.intro.length+t.content.length+t.outro.length;while(t=t.next);return n}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimEndAborted(t){let n=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(n,""),this.outro.length)return!0;let r=this.lastChunk;do{let o=r.end,i=r.trimEnd(n);if(r.end!==o&&(this.lastChunk===r&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),i)return!0;r=r.previous}while(r);return!1}trimEnd(t){return this.trimEndAborted(t),this}trimStartAborted(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),this.intro.length)return!0;let r=this.firstChunk;do{let o=r.end,i=r.trimStart(n);if(r.end!==o&&(r===this.lastChunk&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),i)return!0;r=r.next}while(r);return!1}trimStart(t){return this.trimStartAborted(t),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(t,n){function r(i,s){return typeof n=="string"?n.replace(/\$(\$|&|\d+)/g,(a,c)=>c==="$"?"$":c==="&"?i[0]:+c<i.length?i[+c]:`$${c}`):n(...i,i.index,s,i.groups)}function o(i,s){let a,c=[];for(;a=i.exec(s);)c.push(a);return c}if(t.global)o(t,this.original).forEach(s=>{if(s.index!=null){let a=r(s,this.original);a!==s[0]&&this.overwrite(s.index,s.index+s[0].length,a)}});else{let i=this.original.match(t);if(i&&i.index!=null){let s=r(i,this.original);s!==i[0]&&this.overwrite(i.index,i.index+i[0].length,s)}}return this}_replaceString(t,n){let{original:r}=this,o=r.indexOf(t);return o!==-1&&this.overwrite(o,o+t.length,n),this}replace(t,n){return typeof t=="string"?this._replaceString(t,n):this._replaceRegexp(t,n)}_replaceAllString(t,n){let{original:r}=this,o=t.length;for(let i=r.indexOf(t);i!==-1;i=r.indexOf(t,i+o))r.slice(i,i+o)!==n&&this.overwrite(i,i+o,n);return this}replaceAll(t,n){if(typeof t=="string")return this._replaceAllString(t,n);if(!t.global)throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(t,n)}},cf=Object.prototype.hasOwnProperty,ks=class e{constructor(t={}){this.intro=t.intro||"",this.separator=t.separator!==void 0?t.separator:`
`,this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(t){if(t instanceof Fn)return this.addSource({content:t,filename:t.filename,separator:this.separator});if(!uf(t)||!t.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","ignoreList","indentExclusionRanges","separator"].forEach(n=>{cf.call(t,n)||(t[n]=t.content[n])}),t.separator===void 0&&(t.separator=this.separator),t.filename)if(!cf.call(this.uniqueSourceIndexByFilename,t.filename))this.uniqueSourceIndexByFilename[t.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:t.filename,content:t.content.original});else{let n=this.uniqueSources[this.uniqueSourceIndexByFilename[t.filename]];if(t.content.original!==n.content)throw new Error(`Illegal source: same filename (${t.filename}), different contents`)}return this.sources.push(t),this}append(t,n){return this.addSource({content:new Fn(t),separator:n&&n.separator||""}),this}clone(){let t=new e({intro:this.intro,separator:this.separator});return this.sources.forEach(n=>{t.addSource({filename:n.filename,content:n.content.clone(),separator:n.separator})}),t}generateDecodedMap(t={}){let n=[],r;this.sources.forEach(i=>{Object.keys(i.content.storedNames).forEach(s=>{~n.indexOf(s)||n.push(s)})});let o=new mo(t.hires);return this.intro&&o.advance(this.intro),this.sources.forEach((i,s)=>{s>0&&o.advance(this.separator);let a=i.filename?this.uniqueSourceIndexByFilename[i.filename]:-1,c=i.content,l=Ps(c.original);c.intro&&o.advance(c.intro),c.firstChunk.eachNext(u=>{let f=l(u.start);u.intro.length&&o.advance(u.intro),i.filename?u.edited?o.addEdit(a,u.content,f,u.storeName?n.indexOf(u.original):-1):o.addUneditedChunk(a,u,c.original,f,c.sourcemapLocations):o.advance(u.content),u.outro.length&&o.advance(u.outro)}),c.outro&&o.advance(c.outro),i.ignoreList&&a!==-1&&(r===void 0&&(r=[]),r.push(a))}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:this.uniqueSources.map(i=>t.file?lf(t.file,i.filename):i.filename),sourcesContent:this.uniqueSources.map(i=>t.includeContent?i.content:null),names:n,mappings:o.raw,x_google_ignoreList:r}}generateMap(t){return new Rn(this.generateDecodedMap(t))}getIndentString(){let t={};return this.sources.forEach(n=>{let r=n.content._getRawIndentString();r!==null&&(t[r]||(t[r]=0),t[r]+=1)}),Object.keys(t).sort((n,r)=>t[n]-t[r])[0]||" "}indent(t){if(arguments.length||(t=this.getIndentString()),t==="")return this;let n=!this.intro||this.intro.slice(-1)===`
`;return this.sources.forEach((r,o)=>{let i=r.separator!==void 0?r.separator:this.separator,s=n||o>0&&/\r?\n$/.test(i);r.content.indent(t,{exclude:r.indentExclusionRanges,indentStart:s}),n=r.content.lastChar()===`
`}),this.intro&&(this.intro=t+this.intro.replace(/^[^\n]/gm,(r,o)=>o>0?t+r:r)),this}prepend(t){return this.intro=t+this.intro,this}toString(){let t=this.sources.map((n,r)=>{let o=n.separator!==void 0?n.separator:this.separator;return(r>0?o:"")+n.content.toString()}).join("");return this.intro+t}isEmpty(){return!(this.intro.length&&this.intro.trim()||this.sources.some(t=>!t.content.isEmpty()))}length(){return this.sources.reduce((t,n)=>t+n.content.length(),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimStart(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),!this.intro){let r,o=0;do if(r=this.sources[o++],!r)break;while(!r.content.trimStartAborted(t))}return this}trimEnd(t){let n=new RegExp((t||"\\s")+"+$"),r,o=this.sources.length-1;do if(r=this.sources[o--],!r){this.intro=this.intro.replace(n,"");break}while(!r.content.trimEndAborted(t));return this}}});var mh=Vt(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0})});var yh=Vt(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var rx=Symbol("inverted"),ox=Symbol("expectNull"),ix=Symbol("expectUndefined"),sx=Symbol("expectNumber"),ax=Symbol("expectString"),cx=Symbol("expectBoolean"),lx=Symbol("expectVoid"),ux=Symbol("expectFunction"),fx=Symbol("expectObject"),hx=Symbol("expectArray"),dx=Symbol("expectSymbol"),px=Symbol("expectAny"),mx=Symbol("expectUnknown"),gx=Symbol("expectNever"),yx=Symbol("expectNullable"),bx=Symbol("expectBigInt")});var wh=Vt(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0})});var Eh=Vt(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var Ex=Symbol("secret"),xx=Symbol("mismatch"),Tx=Symbol("avalue")});var xh=Vt(be=>{"use strict";var kw=be&&be.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),_o=be&&be.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&kw(t,e,n)};Object.defineProperty(be,"__esModule",{value:!0});be.expectTypeOf=void 0;_o(mh(),be);_o(yh(),be);_o(wh(),be);_o(Eh(),be);var we=()=>!0,Nw=e=>{let t=["parameters","returns","resolves","not","items","constructorParameters","thisParameter","instance","guards","asserts","branded"],n={toBeAny:we,toBeUnknown:we,toBeNever:we,toBeFunction:we,toBeObject:we,toBeArray:we,toBeString:we,toBeNumber:we,toBeBoolean:we,toBeVoid:we,toBeSymbol:we,toBeNull:we,toBeUndefined:we,toBeNullable:we,toBeBigInt:we,toMatchTypeOf:we,toEqualTypeOf:we,toBeConstructibleWith:we,toMatchObjectType:we,toExtend:we,map:be.expectTypeOf,toBeCallableWith:be.expectTypeOf,extract:be.expectTypeOf,exclude:be.expectTypeOf,pick:be.expectTypeOf,omit:be.expectTypeOf,toHaveProperty:be.expectTypeOf,parameter:be.expectTypeOf};return t.forEach(o=>Object.defineProperty(n,o,{get:()=>(0,be.expectTypeOf)({})})),n};be.expectTypeOf=Nw});var Ph={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},kh=Object.entries(Ph);function $o(e){return String(e)}$o.open="";$o.close="";function wa(e=!1){let t=typeof process!="undefined"?process:void 0,n=(t==null?void 0:t.env)||{},r=(t==null?void 0:t.argv)||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||(t==null?void 0:t.platform)==="win32"||e&&n.TERM!=="dumb"||"CI"in n)||typeof window!="undefined"&&!!window.chrome}function Sa(e=!1){let t=wa(e),n=(s,a,c,l)=>{let u="",f=0;do u+=s.substring(f,l)+c,f=l+a.length,l=s.indexOf(a,f);while(~l);return u+s.substring(f)},r=(s,a,c=s)=>{let l=u=>{let f=String(u),p=f.indexOf(a,s.length);return~p?s+n(f,a,c,p)+a:s+f+a};return l.open=s,l.close=a,l},o={isColorSupported:t},i=s=>`\x1B[${s}m`;for(let[s,a]of kh)o[s]=t?r(i(a[0]),i(a[1]),a[2]):$o;return o}var Ea=require("tty"),Nh=process.env.FORCE_TTY!==void 0||(0,Ea.isatty)(1);var he=Sa(Nh);function Ra(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function jh(e,t){let n=Object.keys(e),r=t===null?n:n.sort(t);if(Object.getOwnPropertySymbols)for(let o of Object.getOwnPropertySymbols(e))Object.getOwnPropertyDescriptor(e,o).enumerable&&r.push(o);return r}function fn(e,t,n,r,o,i,s=": "){let a="",c=0,l=e.next();if(!l.done){a+=t.spacingOuter;let u=n+t.indent;for(;!l.done;){if(a+=u,c++===t.maxWidth){a+="\u2026";break}let f=i(l.value[0],t,u,r,o),p=i(l.value[1],t,u,r,o);a+=f+s+p,l=e.next(),l.done?t.min||(a+=","):a+=`,${t.spacingInner}`}a+=t.spacingOuter+n}return a}function Po(e,t,n,r,o,i){let s="",a=0,c=e.next();if(!c.done){s+=t.spacingOuter;let l=n+t.indent;for(;!c.done;){if(s+=l,a++===t.maxWidth){s+="\u2026";break}s+=i(c.value,t,l,r,o),c=e.next(),c.done?t.min||(s+=","):s+=`,${t.spacingInner}`}s+=t.spacingOuter+n}return s}function Gn(e,t,n,r,o,i){let s="";e=e instanceof ArrayBuffer?new DataView(e):e;let a=l=>l instanceof DataView,c=a(e)?e.byteLength:e.length;if(c>0){s+=t.spacingOuter;let l=n+t.indent;for(let u=0;u<c;u++){if(s+=l,u===t.maxWidth){s+="\u2026";break}(a(e)||u in e)&&(s+=i(a(e)?e.getInt8(u):e[u],t,l,r,o)),u<c-1?s+=`,${t.spacingInner}`:t.min||(s+=",")}s+=t.spacingOuter+n}return s}function ko(e,t,n,r,o,i){let s="",a=jh(e,t.compareKeys);if(a.length>0){s+=t.spacingOuter;let c=n+t.indent;for(let l=0;l<a.length;l++){let u=a[l],f=i(u,t,c,r,o),p=i(e[u],t,c,r,o);s+=`${c+f}: ${p}`,l<a.length-1?s+=`,${t.spacingInner}`:t.min||(s+=",")}s+=t.spacingOuter+n}return s}var Rh=typeof Symbol=="function"&&Symbol.for?Symbol.for("jest.asymmetricMatcher"):1267621,Jn=" ",Fh=(e,t,n,r,o,i)=>{let s=e.toString();if(s==="ArrayContaining"||s==="ArrayNotContaining")return++r>t.maxDepth?`[${s}]`:`${s+Jn}[${Gn(e.sample,t,n,r,o,i)}]`;if(s==="ObjectContaining"||s==="ObjectNotContaining")return++r>t.maxDepth?`[${s}]`:`${s+Jn}{${ko(e.sample,t,n,r,o,i)}}`;if(s==="StringMatching"||s==="StringNotMatching"||s==="StringContaining"||s==="StringNotContaining")return s+Jn+i(e.sample,t,n,r,o);if(typeof e.toAsymmetricMatcher!="function")throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);return e.toAsymmetricMatcher()},Lh=e=>e&&e.$$typeof===Rh,Dh={serialize:Fh,test:Lh},Bh=" ",Fa=new Set(["DOMStringMap","NamedNodeMap"]),qh=/^(?:HTML\w*Collection|NodeList)$/;function zh(e){return Fa.has(e)||qh.test(e)}var Wh=e=>e&&e.constructor&&!!e.constructor.name&&zh(e.constructor.name);function Uh(e){return e.constructor.name==="NamedNodeMap"}var Jh=(e,t,n,r,o,i)=>{let s=e.constructor.name;return++r>t.maxDepth?`[${s}]`:(t.min?"":s+Bh)+(Fa.has(s)?`{${ko(Uh(e)?[...e].reduce((a,c)=>(a[c.name]=c.value,a),{}):{...e},t,n,r,o,i)}}`:`[${Gn([...e],t,n,r,o,i)}]`)},Vh={serialize:Jh,test:Wh};function La(e){return e.replaceAll("<","<").replaceAll(">",">")}function No(e,t,n,r,o,i,s){let a=r+n.indent,c=n.colors;return e.map(l=>{let u=t[l],f=s(u,n,a,o,i);return typeof u!="string"&&(f.includes(`
`)&&(f=n.spacingOuter+a+f+n.spacingOuter+r),f=`{${f}}`),`${n.spacingInner+r+c.prop.open+l+c.prop.close}=${c.value.open}${f}${c.value.close}`}).join("")}function jo(e,t,n,r,o,i){return e.map(s=>t.spacingOuter+n+(typeof s=="string"?Da(s,t):i(s,t,n,r,o))).join("")}function Da(e,t){let n=t.colors.content;return n.open+La(e)+n.close}function Xh(e,t){let n=t.colors.comment;return`${n.open}<!--${La(e)}-->${n.close}`}function Ro(e,t,n,r,o){let i=r.colors.tag;return`${i.open}<${e}${t&&i.close+t+r.spacingOuter+o+i.open}${n?`>${i.close}${n}${r.spacingOuter}${o}${i.open}</${e}`:`${t&&!r.min?"":" "}/`}>${i.close}`}function Fo(e,t){let n=t.colors.tag;return`${n.open}<${e}${n.close} \u2026${n.open} />${n.close}`}var Kh=1,Ba=3,qa=8,za=11,Gh=/^(?:(?:HTML|SVG)\w*)?Element$/;function Yh(e){try{return typeof e.hasAttribute=="function"&&e.hasAttribute("is")}catch{return!1}}function Hh(e){let t=e.constructor.name,{nodeType:n,tagName:r}=e,o=typeof r=="string"&&r.includes("-")||Yh(e);return n===Kh&&(Gh.test(t)||o)||n===Ba&&t==="Text"||n===qa&&t==="Comment"||n===za&&t==="DocumentFragment"}var Zh=e=>{var t;return(e==null||(t=e.constructor)===null||t===void 0?void 0:t.name)&&Hh(e)};function Qh(e){return e.nodeType===Ba}function ed(e){return e.nodeType===qa}function Ao(e){return e.nodeType===za}var td=(e,t,n,r,o,i)=>{if(Qh(e))return Da(e.data,t);if(ed(e))return Xh(e.data,t);let s=Ao(e)?"DocumentFragment":e.tagName.toLowerCase();return++r>t.maxDepth?Fo(s,t):Ro(s,No(Ao(e)?[]:Array.from(e.attributes,a=>a.name).sort(),Ao(e)?{}:[...e.attributes].reduce((a,c)=>(a[c.name]=c.value,a),{}),t,n+t.indent,r,o,i),jo(Array.prototype.slice.call(e.childNodes||e.children),t,n+t.indent,r,o,i),t,n)},nd={serialize:td,test:Zh},rd="@@__IMMUTABLE_ITERABLE__@@",od="@@__IMMUTABLE_LIST__@@",id="@@__IMMUTABLE_KEYED__@@",sd="@@__IMMUTABLE_MAP__@@",xa="@@__IMMUTABLE_ORDERED__@@",ad="@@__IMMUTABLE_RECORD__@@",cd="@@__IMMUTABLE_SEQ__@@",ld="@@__IMMUTABLE_SET__@@",ud="@@__IMMUTABLE_STACK__@@",Xt=e=>`Immutable.${e}`,Hn=e=>`[${e}]`,un=" ",Ta="\u2026";function fd(e,t,n,r,o,i,s){return++r>t.maxDepth?Hn(Xt(s)):`${Xt(s)+un}{${fn(e.entries(),t,n,r,o,i)}}`}function hd(e){let t=0;return{next(){if(t<e._keys.length){let n=e._keys[t++];return{done:!1,value:[n,e.get(n)]}}return{done:!0,value:void 0}}}}function dd(e,t,n,r,o,i){let s=Xt(e._name||"Record");return++r>t.maxDepth?Hn(s):`${s+un}{${fn(hd(e),t,n,r,o,i)}}`}function pd(e,t,n,r,o,i){let s=Xt("Seq");return++r>t.maxDepth?Hn(s):e[id]?`${s+un}{${e._iter||e._object?fn(e.entries(),t,n,r,o,i):Ta}}`:`${s+un}[${e._iter||e._array||e._collection||e._iterable?Po(e.values(),t,n,r,o,i):Ta}]`}function Mo(e,t,n,r,o,i,s){return++r>t.maxDepth?Hn(Xt(s)):`${Xt(s)+un}[${Po(e.values(),t,n,r,o,i)}]`}var md=(e,t,n,r,o,i)=>e[sd]?fd(e,t,n,r,o,i,e[xa]?"OrderedMap":"Map"):e[od]?Mo(e,t,n,r,o,i,"List"):e[ld]?Mo(e,t,n,r,o,i,e[xa]?"OrderedSet":"Set"):e[ud]?Mo(e,t,n,r,o,i,"Stack"):e[cd]?pd(e,t,n,r,o,i):dd(e,t,n,r,o,i),gd=e=>e&&(e[rd]===!0||e[ad]===!0),yd={serialize:md,test:gd};function Wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vn={exports:{}},ce={};var va;function bd(){if(va)return ce;va=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function m(d){if(typeof d=="object"&&d!==null){var b=d.$$typeof;switch(b){case e:switch(d=d.type,d){case n:case o:case r:case c:case l:case p:return d;default:switch(d=d&&d.$$typeof,d){case s:case a:case f:case u:return d;case i:return d;default:return b}}case t:return b}}}return ce.ContextConsumer=i,ce.ContextProvider=s,ce.Element=e,ce.ForwardRef=a,ce.Fragment=n,ce.Lazy=f,ce.Memo=u,ce.Portal=t,ce.Profiler=o,ce.StrictMode=r,ce.Suspense=c,ce.SuspenseList=l,ce.isContextConsumer=function(d){return m(d)===i},ce.isContextProvider=function(d){return m(d)===s},ce.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===e},ce.isForwardRef=function(d){return m(d)===a},ce.isFragment=function(d){return m(d)===n},ce.isLazy=function(d){return m(d)===f},ce.isMemo=function(d){return m(d)===u},ce.isPortal=function(d){return m(d)===t},ce.isProfiler=function(d){return m(d)===o},ce.isStrictMode=function(d){return m(d)===r},ce.isSuspense=function(d){return m(d)===c},ce.isSuspenseList=function(d){return m(d)===l},ce.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===n||d===o||d===r||d===c||d===l||typeof d=="object"&&d!==null&&(d.$$typeof===f||d.$$typeof===u||d.$$typeof===s||d.$$typeof===i||d.$$typeof===a||d.$$typeof===h||d.getModuleId!==void 0)},ce.typeOf=m,ce}var le={};var _a;function wd(){return _a||(_a=1,process.env.NODE_ENV!=="production"&&(function(){function e(d){if(typeof d=="object"&&d!==null){var b=d.$$typeof;switch(b){case t:switch(d=d.type,d){case r:case i:case o:case l:case u:case h:return d;default:switch(d=d&&d.$$typeof,d){case a:case c:case p:case f:return d;case s:return d;default:return b}}case n:return b}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");le.ContextConsumer=s,le.ContextProvider=a,le.Element=t,le.ForwardRef=c,le.Fragment=r,le.Lazy=p,le.Memo=f,le.Portal=n,le.Profiler=i,le.StrictMode=o,le.Suspense=l,le.SuspenseList=u,le.isContextConsumer=function(d){return e(d)===s},le.isContextProvider=function(d){return e(d)===a},le.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===t},le.isForwardRef=function(d){return e(d)===c},le.isFragment=function(d){return e(d)===r},le.isLazy=function(d){return e(d)===p},le.isMemo=function(d){return e(d)===f},le.isPortal=function(d){return e(d)===n},le.isProfiler=function(d){return e(d)===i},le.isStrictMode=function(d){return e(d)===o},le.isSuspense=function(d){return e(d)===l},le.isSuspenseList=function(d){return e(d)===u},le.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===r||d===i||d===o||d===l||d===u||typeof d=="object"&&d!==null&&(d.$$typeof===p||d.$$typeof===f||d.$$typeof===a||d.$$typeof===s||d.$$typeof===c||d.$$typeof===m||d.getModuleId!==void 0)},le.typeOf=e})()),le}var Ca;function Sd(){return Ca||(Ca=1,process.env.NODE_ENV==="production"?Vn.exports=bd():Vn.exports=wd()),Vn.exports}var Ua=Sd(),Ed=Wa(Ua),xd=Ra({__proto__:null,default:Ed},[Ua]),Xn={exports:{}},ie={};var Ia;function Td(){if(Ia)return ie;Ia=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function d(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){case e:switch(b=b.type,b){case n:case o:case r:case l:case u:return b;default:switch(b=b&&b.$$typeof,b){case a:case s:case c:case p:case f:case i:return b;default:return S}}case t:return S}}}return ie.ContextConsumer=s,ie.ContextProvider=i,ie.Element=e,ie.ForwardRef=c,ie.Fragment=n,ie.Lazy=p,ie.Memo=f,ie.Portal=t,ie.Profiler=o,ie.StrictMode=r,ie.Suspense=l,ie.SuspenseList=u,ie.isAsyncMode=function(){return!1},ie.isConcurrentMode=function(){return!1},ie.isContextConsumer=function(b){return d(b)===s},ie.isContextProvider=function(b){return d(b)===i},ie.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},ie.isForwardRef=function(b){return d(b)===c},ie.isFragment=function(b){return d(b)===n},ie.isLazy=function(b){return d(b)===p},ie.isMemo=function(b){return d(b)===f},ie.isPortal=function(b){return d(b)===t},ie.isProfiler=function(b){return d(b)===o},ie.isStrictMode=function(b){return d(b)===r},ie.isSuspense=function(b){return d(b)===l},ie.isSuspenseList=function(b){return d(b)===u},ie.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===o||b===r||b===l||b===u||b===h||typeof b=="object"&&b!==null&&(b.$$typeof===p||b.$$typeof===f||b.$$typeof===i||b.$$typeof===s||b.$$typeof===c||b.$$typeof===m||b.getModuleId!==void 0)},ie.typeOf=d,ie}var se={};var Oa;function vd(){return Oa||(Oa=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=!1,d=!1,b=!1,S=!1,v=!1,I;I=Symbol.for("react.module.reference");function $(B){return!!(typeof B=="string"||typeof B=="function"||B===n||B===o||v||B===r||B===l||B===u||S||B===h||m||d||b||typeof B=="object"&&B!==null&&(B.$$typeof===p||B.$$typeof===f||B.$$typeof===i||B.$$typeof===s||B.$$typeof===c||B.$$typeof===I||B.getModuleId!==void 0))}function A(B){if(typeof B=="object"&&B!==null){var x=B.$$typeof;switch(x){case e:var C=B.type;switch(C){case n:case o:case r:case l:case u:return C;default:var P=C&&C.$$typeof;switch(P){case a:case s:case c:case p:case f:case i:return P;default:return x}}case t:return x}}}var j=s,M=i,O=e,k=c,U=n,_=p,z=f,oe=t,V=o,H=r,N=l,G=u,F=!1,fe=!1;function Te(B){return F||(F=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function qe(B){return fe||(fe=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Ie(B){return A(B)===s}function Ae(B){return A(B)===i}function Ge(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function Fe(B){return A(B)===c}function Me(B){return A(B)===n}function Pe(B){return A(B)===p}function mt(B){return A(B)===f}function Ue(B){return A(B)===t}function At(B){return A(B)===o}function ve(B){return A(B)===r}function Ye(B){return A(B)===l}function zn(B){return A(B)===u}se.ContextConsumer=j,se.ContextProvider=M,se.Element=O,se.ForwardRef=k,se.Fragment=U,se.Lazy=_,se.Memo=z,se.Portal=oe,se.Profiler=V,se.StrictMode=H,se.Suspense=N,se.SuspenseList=G,se.isAsyncMode=Te,se.isConcurrentMode=qe,se.isContextConsumer=Ie,se.isContextProvider=Ae,se.isElement=Ge,se.isForwardRef=Fe,se.isFragment=Me,se.isLazy=Pe,se.isMemo=mt,se.isPortal=Ue,se.isProfiler=At,se.isStrictMode=ve,se.isSuspense=Ye,se.isSuspenseList=zn,se.isValidElementType=$,se.typeOf=A})()),se}var $a;function _d(){return $a||($a=1,process.env.NODE_ENV==="production"?Xn.exports=Td():Xn.exports=vd()),Xn.exports}var Ja=_d(),Cd=Wa(Ja),Id=Ra({__proto__:null,default:Cd},[Ja]),Od=["isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isSuspenseList","isValidElementType"],Mt=Object.fromEntries(Od.map(e=>[e,t=>Id[e](t)||xd[e](t)]));function Va(e,t=[]){if(Array.isArray(e))for(let n of e)Va(n,t);else e!=null&&e!==!1&&e!==""&&t.push(e);return t}function Aa(e){let t=e.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Unknown";if(Mt.isFragment(e))return"React.Fragment";if(Mt.isSuspense(e))return"React.Suspense";if(typeof t=="object"&&t!==null){if(Mt.isContextProvider(e))return"Context.Provider";if(Mt.isContextConsumer(e))return"Context.Consumer";if(Mt.isForwardRef(e)){if(t.displayName)return t.displayName;let n=t.render.displayName||t.render.name||"";return n===""?"ForwardRef":`ForwardRef(${n})`}if(Mt.isMemo(e)){let n=t.displayName||t.type.displayName||t.type.name||"";return n===""?"Memo":`Memo(${n})`}}return"UNDEFINED"}function $d(e){let{props:t}=e;return Object.keys(t).filter(n=>n!=="children"&&t[n]!==void 0).sort()}var Ad=(e,t,n,r,o,i)=>++r>t.maxDepth?Fo(Aa(e),t):Ro(Aa(e),No($d(e),e.props,t,n+t.indent,r,o,i),jo(Va(e.props.children),t,n+t.indent,r,o,i),t,n),Md=e=>e!=null&&Mt.isElement(e),Pd={serialize:Ad,test:Md},kd=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function Nd(e){let{props:t}=e;return t?Object.keys(t).filter(n=>t[n]!==void 0).sort():[]}var jd=(e,t,n,r,o,i)=>++r>t.maxDepth?Fo(e.type,t):Ro(e.type,e.props?No(Nd(e),e.props,t,n+t.indent,r,o,i):"",e.children?jo(e.children,t,n+t.indent,r,o,i):"",t,n),Rd=e=>e&&e.$$typeof===kd,Fd={serialize:jd,test:Rd},Xa=Object.prototype.toString,Ld=Date.prototype.toISOString,Dd=Error.prototype.toString,Ma=RegExp.prototype.toString;function Kn(e){return typeof e.constructor=="function"&&e.constructor.name||"Object"}function Bd(e){return typeof window!="undefined"&&e===window}var qd=/^Symbol\((.*)\)(.*)$/,zd=/\n/g,Yn=class extends Error{constructor(t,n){super(t),this.stack=n,this.name=this.constructor.name}};function Wd(e){return e==="[object Array]"||e==="[object ArrayBuffer]"||e==="[object DataView]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object Int8Array]"||e==="[object Int16Array]"||e==="[object Int32Array]"||e==="[object Uint8Array]"||e==="[object Uint8ClampedArray]"||e==="[object Uint16Array]"||e==="[object Uint32Array]"}function Ud(e){return Object.is(e,-0)?"-0":String(e)}function Jd(e){return`${e}n`}function Pa(e,t){return t?`[Function ${e.name||"anonymous"}]`:"[Function]"}function ka(e){return String(e).replace(qd,"Symbol($1)")}function Na(e){return`[${Dd.call(e)}]`}function Ka(e,t,n,r){if(e===!0||e===!1)return`${e}`;if(e===void 0)return"undefined";if(e===null)return"null";let o=typeof e;if(o==="number")return Ud(e);if(o==="bigint")return Jd(e);if(o==="string")return r?`"${e.replaceAll(/"|\\/g,"\\$&")}"`:`"${e}"`;if(o==="function")return Pa(e,t);if(o==="symbol")return ka(e);let i=Xa.call(e);return i==="[object WeakMap]"?"WeakMap {}":i==="[object WeakSet]"?"WeakSet {}":i==="[object Function]"||i==="[object GeneratorFunction]"?Pa(e,t):i==="[object Symbol]"?ka(e):i==="[object Date]"?Number.isNaN(+e)?"Date { NaN }":Ld.call(e):i==="[object Error]"?Na(e):i==="[object RegExp]"?n?Ma.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"