isomorphic-git 1.44.6 → 1.44.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/index.cjs +79 -16
- package/index.js +79 -16
- package/index.umd.min.js +1 -1
- package/index.umd.min.js.map +1 -1
- package/managers/index.cjs +65 -11
- package/managers/index.js +65 -11
- package/managers/index.umd.min.js +1 -1
- package/managers/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/index.umd.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see index.umd.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.git=e():t.git=e()}(self,()=>(()=>{var t={41:(t,e,r)=>{"use strict";var i=r(655),n=r(8068),a=r(9675),o=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,d=arguments.length>6&&arguments[6],l=!!o&&o(t,e);if(i)i(t,e,{configurable:null===f&&l?l.configurable:!f,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===c&&l?l.writable:!c});else{if(!d&&(s||c||f))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},76:t=>{"use strict";t.exports=Function.prototype.call},251:(t,e)=>{e.read=function(t,e,r,i,n){var a,o,s=8*n-i-1,c=(1<<s)-1,f=c>>1,d=-7,l=r?n-1:0,h=r?-1:1,u=t[e+l];for(l+=h,a=u&(1<<-d)-1,u>>=-d,d+=s;d>0;a=256*a+t[e+l],l+=h,d-=8);for(o=a&(1<<-d)-1,a>>=-d,d+=i;d>0;o=256*o+t[e+l],l+=h,d-=8);if(0===a)a=1-f;else{if(a===c)return o?NaN:1/0*(u?-1:1);o+=Math.pow(2,i),a-=f}return(u?-1:1)*o*Math.pow(2,a-i)},e.write=function(t,e,r,i,n,a){var o,s,c,f=8*a-n-1,d=(1<<f)-1,l=d>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,u=i?0:a-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=d?(s=0,o=d):o+l>=1?(s=(e*c-1)*Math.pow(2,n),o+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;t[r+u]=255&s,u+=p,s/=256,n-=8);for(o=o<<n|s,f+=n;f>0;t[r+u]=255&o,u+=p,o/=256,f-=8);t[r+u-p]|=128*g}},392:(t,e,r)=>{"use strict";var i=r(8188).Buffer,n=r(5377);function a(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a.prototype.update=function(t,e){t=n(t,e||"utf8");for(var r=this._block,i=this._blockSize,a=t.length,o=this._len,s=0;s<a;){for(var c=o%i,f=Math.min(a-s,i-c),d=0;d<f;d++)r[c+d]=t[s+d];s+=f,(o+=f)%i===0&&this._update(r)}return this._len+=a,this},a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},414:t=>{"use strict";t.exports=Math.round},453:(t,e,r)=>{"use strict";var i,n=r(9612),a=r(9383),o=r(1237),s=r(9290),c=r(9538),f=r(8068),d=r(9675),l=r(5345),h=r(1514),u=r(8968),p=r(6188),g=r(8002),w=r(5880),m=r(414),y=r(3093),b=Function,_=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},v=r(5795),x=r(655),k=function(){throw new d},E=v?function(){try{return k}catch(t){try{return v(arguments,"callee").get}catch(t){return k}}}():k,A=r(4039)(),S=r(3628),B=r(1064),$=r(8648),R=r(1002),P=r(76),I={},O="undefined"!=typeof Uint8Array&&S?S(Uint8Array):i,j={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":A&&S?S([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":I,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&S?S(S([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&S?S((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&S?S((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&S?S(""[Symbol.iterator]()):i,"%Symbol%":A?Symbol:i,"%SyntaxError%":f,"%ThrowTypeError%":E,"%TypedArray%":O,"%TypeError%":d,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":R,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":B,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":p,"%Math.min%":g,"%Math.pow%":w,"%Math.round%":m,"%Math.sign%":y,"%Reflect.getPrototypeOf%":$};if(S)try{null.error}catch(t){var U=S(S(t));j["%Error.prototype%"]=U}var C=function t(e){var r;if("%AsyncFunction%"===e)r=_("async function () {}");else if("%GeneratorFunction%"===e)r=_("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=_("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&S&&(r=S(n.prototype))}return j[e]=r,r},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=r(6743),D=r(9957),N=M.call(P,Array.prototype.concat),F=M.call(R,Array.prototype.splice),z=M.call(P,String.prototype.replace),L=M.call(P,String.prototype.slice),H=M.call(P,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(t,e){var r,i=t;if(D(T,i)&&(i="%"+(r=T[i])[0]+"%"),D(j,i)){var n=j[i];if(n===I&&(n=C(i)),void 0===n&&!e)throw new d("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new f("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new d("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new d('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,t))throw new f("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=L(t,0,1),r=L(t,-1);if("%"===e&&"%"!==r)throw new f("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new f("invalid intrinsic syntax, expected opening `%`");var i=[];return z(t,W,function(t,e,r,n){i[i.length]=r?z(n,G,"$1"):e||t}),i}(t),i=r.length>0?r[0]:"",n=q("%"+i+"%",e),a=n.name,o=n.value,s=!1,c=n.alias;c&&(i=c[0],F(r,N([0,1],c)));for(var l=1,h=!0;l<r.length;l+=1){var u=r[l],p=L(u,0,1),g=L(u,-1);if(('"'===p||"'"===p||"`"===p||'"'===g||"'"===g||"`"===g)&&p!==g)throw new f("property names with quotes must have matching quotes");if("constructor"!==u&&h||(s=!0),D(j,a="%"+(i+="."+u)+"%"))o=j[a];else if(null!=o){if(!(u in o)){if(!e)throw new d("base intrinsic for "+t+" exists, but the property is not available.");return}if(v&&l+1>=r.length){var w=v(o,u);o=(h=!!w)&&"get"in w&&!("originalValue"in w.get)?w.get:o[u]}else h=D(o,u),o=o[u];h&&!s&&(j[a]=o)}}return o}},487:(t,e,r)=>{"use strict";var i=r(6897),n=r(655),a=r(3126),o=r(2205);t.exports=function(t){var e=a(arguments),r=t.length-(arguments.length-1);return i(e,1+(r>0?r:0),!0)},n?n(t.exports,"apply",{value:o}):t.exports.apply=o},592:(t,e,r)=>{"use strict";var i=r(655),n=function(){return!!i};n.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch(t){return!0}},t.exports=n},655:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},809:t=>{"use strict";var e=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if("undefined"==typeof process||void 0===process.domain)throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||e.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||e.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||e.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=e.DEFAULT_MAX_PENDING};e.DEFAULT_TIMEOUT=0,e.DEFAULT_MAX_OCCUPATION_TIME=0,e.DEFAULT_MAX_EXECUTION_TIME=0,e.DEFAULT_MAX_PENDING=1e3,e.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if("function"!=typeof e)throw new Error("You must pass a function to execute");var n=null,a=null,o=null;"function"!=typeof r&&(i=r,r=null,o=new this.Promise(function(t,e){n=t,a=e})),i=i||{};var s=!1,c=null,f=null,d=null,l=this,h=function(e,i,c){f&&(clearTimeout(f),f=null),d&&(clearTimeout(d),d=null),e&&(l.queues[t]&&0===l.queues[t].length&&delete l.queues[t],l.domainReentrant&&delete l.domains[t]),s||(o?i?a(i):n(c):"function"==typeof r&&r(i,c),s=!0),e&&l.queues[t]&&l.queues[t].length>0&&l.queues[t].shift()()},u=function(r){if(s)return h(r);c&&(clearTimeout(c),c=null),l.domainReentrant&&r&&(l.domains[t]=process.domain);var n=i.maxExecutionTime||l.maxExecutionTime;if(n&&(d=setTimeout(function(){l.queues[t]&&h(r,new Error("Maximum execution time is exceeded "+t))},n)),1===e.length){var a=!1;try{e(function(t,e){a||(a=!0,h(r,t,e))})}catch(t){a||(a=!0,h(r,t))}}else l._promiseTry(function(){return e()}).then(function(t){h(r,void 0,t)},function(t){h(r,t)})};l.domainReentrant&&process.domain&&(u=process.domain.bind(u));var p=i.maxPending||l.maxPending;if(l.queues[t])if(l.domainReentrant&&process.domain&&process.domain===l.domains[t])u(!1);else if(l.queues[t].length>=p)h(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){u(!0)};i.skipQueue?l.queues[t].unshift(g):l.queues[t].push(g);var w=i.timeout||l.timeout;w&&(c=setTimeout(function(){c=null,h(!1,new Error("async-lock timed out in queue "+t))},w))}else l.queues[t]=[],u(!0);var m=i.maxOccupationTime||l.maxOccupationTime;return m&&(f=setTimeout(function(){l.queues[t]&&h(!1,new Error("Maximum occupation time is exceeded in queue "+t))},m)),o||void 0},e.prototype._acquireBatch=function(t,e,r,i){"function"!=typeof r&&(i=r,r=null);var n=this,a=t.reduceRight(function(t,e){return function(t,e){return function(r){n.acquire(t,e,r,i)}}(e,t)},e);if("function"!=typeof r)return new this.Promise(function(t,e){1===a.length?a(function(r,i){r?e(r):t(i)}):t(a())});a(r)},e.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0},e.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(t){return this.Promise.reject(t)}},t.exports=e},945:(t,e,r)=>{var i=r(8287),n=i.Buffer;function a(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(a(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),a(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},1002:t=>{"use strict";t.exports=Function.prototype.apply},1064:(t,e,r)=>{"use strict";var i=r(9612);t.exports=i.getPrototypeOf||null},1237:t=>{"use strict";t.exports=EvalError},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(t,e);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},1447:(t,e,r)=>{"use strict";var i=r(9805),n=r(3269),a=r(4823),o=r(7293),s=r(1998),c=-2,f=12,d=30;function l(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):c}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):c}function g(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?c:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,p(t))):c}function w(t,e){var r,i;return t?(i=new h,t.state=i,i.window=null,0!==(r=g(t,e))&&(t.state=null),r):c}var m,y,b=!0;function _(t){if(b){var e;for(m=new i.Buf32(512),y=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,y,0,t.work,{bits:5}),b=!1}t.lencode=m,t.lenbits=9,t.distcode=y,t.distbits=5}function v(t,e,r,n){var a,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new i.Buf8(o.wsize)),n>=o.wsize?(i.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>n&&(a=n),i.arraySet(o.window,e,r-n,a,o.wnext),(n-=a)?(i.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}e.inflateReset=p,e.inflateReset2=g,e.inflateResetKeep=u,e.inflateInit=function(t){return w(t,15)},e.inflateInit2=w,e.inflate=function(t,e){var r,h,u,p,g,w,m,y,b,x,k,E,A,S,B,$,R,P,I,O,j,U,C,T,M=0,D=new i.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return c;(r=t.state).mode===f&&(r.mode=13),g=t.next_out,u=t.output,m=t.avail_out,p=t.next_in,h=t.input,w=t.avail_in,y=r.hold,b=r.bits,x=w,k=m,U=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(2&r.wrap&&35615===y){r.check=0,D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0),y=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=d;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=d;break}if(b-=4,j=8+(15&(y>>>=4)),0===r.wbits)r.wbits=j;else if(j>r.wbits){t.msg="invalid window size",r.mode=d;break}r.dmax=1<<j,t.adler=r.check=1,r.mode=512&y?10:f,y=0,b=0;break;case 2:for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(r.flags=y,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=d;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=d;break}r.head&&(r.head.text=y>>8&1),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.head&&(r.head.time=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,D[2]=y>>>16&255,D[3]=y>>>24&255,r.check=a(r.check,D,4,0)),y=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((E=r.length)>w&&(E=w),E&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,h,p,E,j)),512&r.flags&&(r.check=a(r.check,h,E,p)),w-=E,p+=E,r.length-=E),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===w)break t;E=0;do{j=h[p+E++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&E<w);if(512&r.flags&&(r.check=a(r.check,h,E,p)),w-=E,p+=E,j)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===w)break t;E=0;do{j=h[p+E++],r.head&&j&&r.length<65536&&(r.head.comment+=String.fromCharCode(j))}while(j&&E<w);if(512&r.flags&&(r.check=a(r.check,h,E,p)),w-=E,p+=E,j)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(y!==(65535&r.check)){t.msg="header crc mismatch",r.mode=d;break}y=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=f;break;case 10:for(;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}t.adler=r.check=l(y),y=0,b=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=w,r.hold=y,r.bits=b,2;t.adler=r.check=1,r.mode=f;case f:if(5===e||6===e)break t;case 13:if(r.last){y>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}switch(r.last=1&y,b-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6===e){y>>>=2,b-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=d}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if((65535&y)!=(y>>>16^65535)){t.msg="invalid stored block lengths",r.mode=d;break}if(r.length=65535&y,y=0,b=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(E=r.length){if(E>w&&(E=w),E>m&&(E=m),0===E)break t;i.arraySet(u,h,p,E,g),w-=E,p+=E,m-=E,g+=E,r.length-=E;break}r.mode=f;break;case 17:for(;b<14;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(r.nlen=257+(31&y),y>>>=5,b-=5,r.ndist=1+(31&y),y>>>=5,b-=5,r.ncode=4+(15&y),y>>>=4,b-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=d;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.lens[N[r.have++]]=7&y,y>>>=3,b-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},U=s(0,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,U){t.msg="invalid code lengths set",r.mode=d;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;$=(M=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,R=65535&M,!((B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(R<16)y>>>=B,b-=B,r.lens[r.have++]=R;else{if(16===R){for(T=B+2;b<T;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(y>>>=B,b-=B,0===r.have){t.msg="invalid bit length repeat",r.mode=d;break}j=r.lens[r.have-1],E=3+(3&y),y>>>=2,b-=2}else if(17===R){for(T=B+3;b<T;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}b-=B,j=0,E=3+(7&(y>>>=B)),y>>>=3,b-=3}else{for(T=B+7;b<T;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}b-=B,j=0,E=11+(127&(y>>>=B)),y>>>=7,b-=7}if(r.have+E>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=d;break}for(;E--;)r.lens[r.have++]=j}}if(r.mode===d)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=d;break}if(r.lenbits=9,C={bits:r.lenbits},U=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,U){t.msg="invalid literal/lengths set",r.mode=d;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},U=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,U){t.msg="invalid distances set",r.mode=d;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(w>=6&&m>=258){t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=w,r.hold=y,r.bits=b,o(t,k),g=t.next_out,u=t.output,m=t.avail_out,p=t.next_in,h=t.input,w=t.avail_in,y=r.hold,b=r.bits,r.mode===f&&(r.back=-1);break}for(r.back=0;$=(M=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,R=65535&M,!((B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if($&&!(240&$)){for(P=B,I=$,O=R;$=(M=r.lencode[O+((y&(1<<P+I)-1)>>P)])>>>16&255,R=65535&M,!(P+(B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}y>>>=P,b-=P,r.back+=P}if(y>>>=B,b-=B,r.back+=B,r.length=R,0===$){r.mode=26;break}if(32&$){r.back=-1,r.mode=f;break}if(64&$){t.msg="invalid literal/length code",r.mode=d;break}r.extra=15&$,r.mode=22;case 22:if(r.extra){for(T=r.extra;b<T;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.length+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;$=(M=r.distcode[y&(1<<r.distbits)-1])>>>16&255,R=65535&M,!((B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(!(240&$)){for(P=B,I=$,O=R;$=(M=r.distcode[O+((y&(1<<P+I)-1)>>P)])>>>16&255,R=65535&M,!(P+(B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}y>>>=P,b-=P,r.back+=P}if(y>>>=B,b-=B,r.back+=B,64&$){t.msg="invalid distance code",r.mode=d;break}r.offset=R,r.extra=15&$,r.mode=24;case 24:if(r.extra){for(T=r.extra;b<T;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.offset+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=d;break}r.mode=25;case 25:if(0===m)break t;if(E=k-m,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=d;break}E>r.wnext?(E-=r.wnext,A=r.wsize-E):A=r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=u,A=g-r.offset,E=r.length;E>m&&(E=m),m-=E,r.length-=E;do{u[g++]=S[A++]}while(--E);0===r.length&&(r.mode=21);break;case 26:if(0===m)break t;u[g++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===w)break t;w--,y|=h[p++]<<b,b+=8}if(k-=m,t.total_out+=k,r.total+=k,k&&(t.adler=r.check=r.flags?a(r.check,u,k,g-k):n(r.check,u,k,g-k)),k=m,(r.flags?y:l(y))!==r.check){t.msg="incorrect data check",r.mode=d;break}y=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(y!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=d;break}y=0,b=0}r.mode=29;case 29:U=1;break t;case d:U=-3;break t;case 31:return-4;default:return c}return t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=w,r.hold=y,r.bits=b,(r.wsize||k!==t.avail_out&&r.mode<d&&(r.mode<27||4!==e))&&v(t,t.output,t.next_out,k-t.avail_out)?(r.mode=31,-4):(x-=t.avail_in,k-=t.avail_out,t.total_in+=x,t.total_out+=k,r.total+=k,r.wrap&&k&&(t.adler=r.check=r.flags?a(r.check,u,k,t.next_out-k):n(r.check,u,k,t.next_out-k)),t.data_type=r.bits+(r.last?64:0)+(r.mode===f?128:0)+(20===r.mode||15===r.mode?256:0),(0===x&&0===k||4===e)&&0===U&&(U=-5),U)},e.inflateEnd=function(t){if(!t||!t.state)return c;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var r;return t&&t.state&&2&(r=t.state).wrap?(r.head=e,e.done=!1,0):c},e.inflateSetDictionary=function(t,e){var r,i=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?c:11===r.mode&&n(1,e,i,0)!==r.check?-3:v(t,e,i,i)?(r.mode=31,-4):(r.havedict=1,0):c},e.inflateInfo="pako inflate (from Nodeca project)"},1514:t=>{"use strict";t.exports=Math.abs},1668:(t,e,r)=>{"use strict";var i={};(0,r(9805).assign)(i,r(3303),r(7083),r(9681)),t.exports=i},1996:(t,e,r)=>{"use strict";var i=r(9805),n=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var o=new i.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function c(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",o=0;o<e;o++)r+=String.fromCharCode(t[o]);return r}o[254]=o[254]=1,e.string2buf=function(t){var e,r,n,a,o,s=t.length,c=0;for(a=0;a<s;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),c+=r<128?1:r<2048?2:r<65536?3:4;for(e=new i.Buf8(c),o=0,a=0;o<c;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},e.buf2binstring=function(t){return c(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,i,n,a,s=e||t.length,f=new Array(2*s);for(i=0,r=0;r<s;)if((n=t[r++])<128)f[i++]=n;else if((a=o[n])>4)f[i++]=65533,r+=a-1;else{for(n&=2===a?31:3===a?15:7;a>1&&r<s;)n=n<<6|63&t[r++],a--;a>1?f[i++]=65533:n<65536?f[i++]=n:(n-=65536,f[i++]=55296|n>>10&1023,f[i++]=56320|1023&n)}return c(f,i)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},1998:(t,e,r)=>{"use strict";var i=r(9805),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,r,c,f,d,l,h){var u,p,g,w,m,y,b,_,v,x=h.bits,k=0,E=0,A=0,S=0,B=0,$=0,R=0,P=0,I=0,O=0,j=null,U=0,C=new i.Buf16(16),T=new i.Buf16(16),M=null,D=0;for(k=0;k<=15;k++)C[k]=0;for(E=0;E<c;E++)C[e[r+E]]++;for(B=x,S=15;S>=1&&0===C[S];S--);if(B>S&&(B=S),0===S)return f[d++]=20971520,f[d++]=20971520,h.bits=1,0;for(A=1;A<S&&0===C[A];A++);for(B<A&&(B=A),P=1,k=1;k<=15;k++)if(P<<=1,(P-=C[k])<0)return-1;if(P>0&&(0===t||1!==S))return-1;for(T[1]=0,k=1;k<15;k++)T[k+1]=T[k]+C[k];for(E=0;E<c;E++)0!==e[r+E]&&(l[T[e[r+E]]++]=E);if(0===t?(j=M=l,y=19):1===t?(j=n,U-=257,M=a,D-=257,y=256):(j=o,M=s,y=-1),O=0,E=0,k=A,m=d,$=B,R=0,g=-1,w=(I=1<<B)-1,1===t&&I>852||2===t&&I>592)return 1;for(;;){b=k-R,l[E]<y?(_=0,v=l[E]):l[E]>y?(_=M[D+l[E]],v=j[U+l[E]]):(_=96,v=0),u=1<<k-R,A=p=1<<$;do{f[m+(O>>R)+(p-=u)]=b<<24|_<<16|v}while(0!==p);for(u=1<<k-1;O&u;)u>>=1;if(0!==u?(O&=u-1,O+=u):O=0,E++,0===--C[k]){if(k===S)break;k=e[r+l[E]]}if(k>B&&(O&w)!==g){for(0===R&&(R=B),m+=A,P=1<<($=k-R);$+R<S&&!((P-=C[$+R])<=0);)$++,P<<=1;if(I+=1<<$,1===t&&I>852||2===t&&I>592)return 1;f[g=O&w]=B<<24|$<<16|m-d}}return 0!==O&&(f[m+O]=k-R<<24|64<<16),h.bits=B,0}},2205:(t,e,r)=>{"use strict";var i=r(6743),n=r(1002),a=r(3144);t.exports=function(){return a(i,n,arguments)}},2535:t=>{function e(t){return Array.isArray(t)?t:[t]}const r=/^\s+$/,i=/(?:[^\\]|^)\\$/,n=/^\\!/,a=/^\\#/,o=/\r?\n/g,s=/^\.*\/|^\.+$/;let c="node-ignore";"undefined"!=typeof Symbol&&(c=Symbol.for("node-ignore"));const f=c,d=/([0-z])-([0-z])/g,l=()=>!1,h=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(0===r.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(t,e)=>{const{length:r}=e;return e.slice(0,r-r%2)+" "}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>e+r.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>"\\"===e?`\\[${r}${(t=>{const{length:e}=t;return t.slice(0,e-e%2)})(i)}${n}`:"]"===n&&i.length%2==0?`[${(t=>t.replace(d,(t,e,r)=>e.charCodeAt(0)<=r.charCodeAt(0)?t:""))(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>(e?`${e}[^/]+`:"[^/]*")+"(?=$|\\/$)"]],u=Object.create(null),p=t=>"string"==typeof t;class g{constructor(t,e,r,i){this.origin=t,this.pattern=e,this.negative=r,this.regex=i}}const w=(t,e)=>{throw new e(t)},m=(t,e,r)=>p(t)?t?!m.isNotRelative(t)||r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),y=t=>s.test(t);m.isNotRelative=y,m.convert=t=>t;class b{constructor({ignorecase:t=!0,ignoreCase:e=t,allowRelativePaths:r=!1}={}){var i;i=f,Object.defineProperty(this,i,{value:true}),this._rules=[],this._ignoreCase=e,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[f])return this._rules=this._rules.concat(t._rules),void(this._added=!0);if((t=>t&&p(t)&&!r.test(t)&&!i.test(t)&&0!==t.indexOf("#"))(t)){const e=((t,e)=>{const r=t;let i=!1;0===t.indexOf("!")&&(i=!0,t=t.substr(1));const o=((t,e)=>{let r=u[t];return r||(r=h.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),u[t]=r),e?new RegExp(r,"i"):new RegExp(r)})(t=t.replace(n,"!").replace(a,"#"),e);return new g(r,t,i,o)})(t,this._ignoreCase);this._added=!0,this._rules.push(e)}}add(t){return this._added=!1,e(p(t)?(t=>t.split(o))(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,e){let r=!1,i=!1;return this._rules.forEach(n=>{const{negative:a}=n;i===a&&r!==i||a&&!r&&!i&&!e||n.regex.test(t)&&(r=!a,i=a)}),{ignored:r,unignored:i}}_test(t,e,r,i){const n=t&&m.convert(t);return m(n,t,this._allowRelativePaths?l:w),this._t(n,e,r,i)}_t(t,e,r,i){if(t in e)return e[t];if(i||(i=t.split("/")),i.pop(),!i.length)return e[t]=this._testOne(t,r);const n=this._t(i.join("/")+"/",e,r,i);return e[t]=n.ignored?n:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return e(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const _=t=>new b(t);if(_.isPathValid=t=>m(t&&m.convert(t),t,l),_.default=_,t.exports=_,"undefined"!=typeof process&&(process.env&&process.env.IGNORE_TEST_WIN32||"win32"===process.platform)){const t=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");m.convert=t;const e=/^[a-z]:\//i;m.isNotRelative=t=>e.test(t)||y(t)}},2566:(t,e)=>{var r;r=function(t){t.version="1.2.2";var e=function(){for(var t=0,e=new Array(256),r=0;256!=r;++r)t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=r)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1,e[r]=t;return"undefined"!=typeof Int32Array?new Int32Array(e):e}(),r=function(t){var e=0,r=0,i=0,n="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(i=0;256!=i;++i)n[i]=t[i];for(i=0;256!=i;++i)for(r=t[i],e=256+i;e<4096;e+=256)r=n[e]=r>>>8^t[255&r];var a=[];for(i=1;16!=i;++i)a[i-1]="undefined"!=typeof Int32Array?n.subarray(256*i,256*i+256):n.slice(256*i,256*i+256);return a}(e),i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],f=r[6],d=r[7],l=r[8],h=r[9],u=r[10],p=r[11],g=r[12],w=r[13],m=r[14];t.table=e,t.bstr=function(t,r){for(var i=-1^r,n=0,a=t.length;n<a;)i=i>>>8^e[255&(i^t.charCodeAt(n++))];return~i},t.buf=function(t,r){for(var y=-1^r,b=t.length-15,_=0;_<b;)y=m[t[_++]^255&y]^w[t[_++]^y>>8&255]^g[t[_++]^y>>16&255]^p[t[_++]^y>>>24]^u[t[_++]]^h[t[_++]]^l[t[_++]]^d[t[_++]]^f[t[_++]]^c[t[_++]]^s[t[_++]]^o[t[_++]]^a[t[_++]]^n[t[_++]]^i[t[_++]]^e[t[_++]];for(b+=15;_<b;)y=y>>>8^e[255&(y^t[_++])];return~y},t.str=function(t,r){for(var i=-1^r,n=0,a=t.length,o=0,s=0;n<a;)(o=t.charCodeAt(n++))<128?i=i>>>8^e[255&(i^o)]:o<2048?i=(i=i>>>8^e[255&(i^(192|o>>6&31))])>>>8^e[255&(i^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),s=1023&t.charCodeAt(n++),i=(i=(i=(i=i>>>8^e[255&(i^(240|o>>8&7))])>>>8^e[255&(i^(128|o>>2&63))])>>>8^e[255&(i^(128|s>>6&15|(3&o)<<4))])>>>8^e[255&(i^(128|63&s))]):i=(i=(i=i>>>8^e[255&(i^(224|o>>12&15))])>>>8^e[255&(i^(128|o>>6&63))])>>>8^e[255&(i^(128|63&o))];return~i}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(e):r({})},2682:(t,e,r)=>{"use strict";var i=r(9600),n=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!i(e))throw new TypeError("iterator must be a function");var o,s;arguments.length>=3&&(o=r),s=t,"[object Array]"===n.call(s)?function(t,e,r){for(var i=0,n=t.length;i<n;i++)a.call(t,i)&&(null==r?e(t[i],i,t):e.call(r,t[i],i,t))}(t,e,o):"string"==typeof t?function(t,e,r){for(var i=0,n=t.length;i<n;i++)null==r?e(t.charAt(i),i,t):e.call(r,t.charAt(i),i,t)}(t,e,o):function(t,e,r){for(var i in t)a.call(t,i)&&(null==r?e(t[i],i,t):e.call(r,t[i],i,t))}(t,e,o)}},3093:(t,e,r)=>{"use strict";var i=r(4459);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},3126:(t,e,r)=>{"use strict";var i=r(6743),n=r(9675),a=r(76),o=r(3144);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return o(i,a,t)}},3144:(t,e,r)=>{"use strict";var i=r(6743),n=r(1002),a=r(76),o=r(7119);t.exports=o||i.call(a,n)},3269:t=>{"use strict";t.exports=function(t,e,r,i){for(var n=65535&t,a=t>>>16&65535,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(n=n+e[i++]|0)|0}while(--o);n%=65521,a%=65521}return n|a<<16}},3303:(t,e,r)=>{"use strict";var i=r(8411),n=r(9805),a=r(1996),o=r(4674),s=r(4442),c=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(o[r]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var d;if(d="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=i.deflateSetDictionary(this.strm,d)))throw new Error(o[r]);this._dict_set=!0}}function d(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||o[r.err];return r.result}f.prototype.push=function(t,e){var r,o,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=a.string2buf(t):"[object ArrayBuffer]"===c.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new n.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=i.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=i.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=f,e.deflate=d,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,d(t,e)}},3548:t=>{t.exports=function(t,e){var r,i,n=t,a=e,o=n.length,s=a.length,c=!1,f=null,d=o+1,l=[],h=[],u=[],p="",g=function(t,e,r){return{x:t,y:e,k:r}},w=function(t,e){return{elem:t,t:e}},m=function(t,e,r){var i,c,f;for(i=e>r?l[t-1+d]:l[t+1+d],c=(f=Math.max(e,r))-t;c<o&&f<s&&n[c]===a[f];)++c,++f;return l[t+d]=h.length,h[h.length]=new g(c,f,i),f};return o>=s&&(r=n,i=o,n=a,a=r,o=s,s=i,c=!0,d=o+1),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return f},getlcs:function(){return p},getses:function(){return u},compose:function(){var t,e,r,i,y,b,_,v;for(t=s-o,e=o+s+3,r={},_=0;_<e;++_)r[_]=-1,l[_]=-1;i=-1;do{for(v=-++i;v<=t-1;++v)r[v+d]=m(v,r[v-1+d]+1,r[v+1+d]);for(v=t+i;v>=t+1;--v)r[v+d]=m(v,r[v-1+d]+1,r[v+1+d]);r[t+d]=m(t,r[t-1+d]+1,r[t+1+d])}while(r[t+d]!==s);for(f=t+2*i,y=l[t+d],b=[];-1!==y;)b[b.length]=new g(h[y].x,h[y].y,null),y=h[y].k;!function(t){var e,r,i;for(e=r=0,i=t.length-1;i>=0;--i)for(;e<t[i].x||r<t[i].y;)t[i].y-t[i].x>r-e?(u[u.length]=new w(a[r],c?-1:1),++r):t[i].y-t[i].x<r-e?(u[u.length]=new w(n[e],c?1:-1),++e):(u[u.length]=new w(n[e],0),p+=n[e],++e,++r)}(b)}}}},3628:(t,e,r)=>{"use strict";var i=r(8648),n=r(1064),a=r(7176);t.exports=i?function(t){return i(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return n(t)}:a?function(t){return a(t)}:null},3665:(t,e,r)=>{"use strict";var i=r(9805);function n(t){for(var e=t.length;--e>=0;)t[e]=0}var a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);n(f);var d=new Array(60);n(d);var l=new Array(512);n(l);var h=new Array(256);n(h);var u=new Array(29);n(u);var p,g,w,m=new Array(30);function y(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?l[t]:l[256+(t>>>7)]}function v(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function x(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,v(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function k(t,e,r){x(t,r[2*e],r[2*e+1])}function E(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function A(t,e,r){var i,n,a=new Array(16),o=0;for(i=1;i<=15;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var s=t[2*n+1];0!==s&&(t[2*n]=E(a[s]++,s))}}function S(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function B(t){t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function $(t,e,r,i){var n=2*e,a=2*r;return t[n]<t[a]||t[n]===t[a]&&i[e]<=i[r]}function R(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&$(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!$(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}function P(t,e,r){var i,n,s,c,f=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*f]<<8|t.pending_buf[t.d_buf+2*f+1],n=t.pending_buf[t.l_buf+f],f++,0===i?k(t,n,e):(k(t,(s=h[n])+256+1,e),0!==(c=a[s])&&x(t,n-=u[s],c),k(t,s=_(--i),r),0!==(c=o[s])&&x(t,i-=m[s],c))}while(f<t.last_lit);k(t,256,e)}function I(t,e){var r,i,n,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,c=e.stat_desc.elems,f=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<c;r++)0!==a[2*r]?(t.heap[++t.heap_len]=f=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)a[2*(n=t.heap[++t.heap_len]=f<2?++f:0)]=1,t.depth[n]=0,t.opt_len--,s&&(t.static_len-=o[2*n+1]);for(e.max_code=f,r=t.heap_len>>1;r>=1;r--)R(t,a,r);n=c;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,a[2*n]=a[2*r]+a[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,a[2*r+1]=a[2*i+1]=n,t.heap[1]=n++,R(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,a,o,s,c=e.dyn_tree,f=e.max_code,d=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(a=c[2*c[2*(i=t.heap[r])+1]+1]+1)>p&&(a=p,g++),c[2*i+1]=a,i>f||(t.bl_count[a]++,o=0,i>=u&&(o=h[i-u]),s=c[2*i],t.opt_len+=s*(a+o),l&&(t.static_len+=s*(d[2*i+1]+o)));if(0!==g){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(i=t.bl_count[a];0!==i;)(n=t.heap[--r])>f||(c[2*n+1]!==a&&(t.opt_len+=(a-c[2*n+1])*c[2*n],c[2*n+1]=a),i--)}}(t,e),A(a,f,t.bl_count)}function O(t,e,r){var i,n,a=-1,o=e[1],s=0,c=7,f=4;for(0===o&&(c=138,f=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++s<c&&n===o||(s<f?t.bl_tree[2*n]+=s:0!==n?(n!==a&&t.bl_tree[2*n]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,a=n,0===o?(c=138,f=3):n===o?(c=6,f=3):(c=7,f=4))}function j(t,e,r){var i,n,a=-1,o=e[1],s=0,c=7,f=4;for(0===o&&(c=138,f=3),i=0;i<=r;i++)if(n=o,o=e[2*(i+1)+1],!(++s<c&&n===o)){if(s<f)do{k(t,n,t.bl_tree)}while(0!==--s);else 0!==n?(n!==a&&(k(t,n,t.bl_tree),s--),k(t,16,t.bl_tree),x(t,s-3,2)):s<=10?(k(t,17,t.bl_tree),x(t,s-3,3)):(k(t,18,t.bl_tree),x(t,s-11,7));s=0,a=n,0===o?(c=138,f=3):n===o?(c=6,f=3):(c=7,f=4)}}n(m);var U=!1;function C(t,e,r,n){x(t,0+(n?1:0),3),function(t,e,r){B(t),v(t,r),v(t,~r),i.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r)}e._tr_init=function(t){U||(function(){var t,e,r,i,n,c=new Array(16);for(r=0,i=0;i<28;i++)for(u[i]=r,t=0;t<1<<a[i];t++)h[r++]=i;for(h[r-1]=i,n=0,i=0;i<16;i++)for(m[i]=n,t=0;t<1<<o[i];t++)l[n++]=i;for(n>>=7;i<30;i++)for(m[i]=n<<7,t=0;t<1<<o[i]-7;t++)l[256+n++]=i;for(e=0;e<=15;e++)c[e]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,c[8]++;for(;t<=255;)f[2*t+1]=9,t++,c[9]++;for(;t<=279;)f[2*t+1]=7,t++,c[7]++;for(;t<=287;)f[2*t+1]=8,t++,c[8]++;for(A(f,287,c),t=0;t<30;t++)d[2*t+1]=5,d[2*t]=E(t,5);p=new y(f,a,257,286,15),g=new y(d,o,0,30,15),w=new y(new Array(0),s,0,19,7)}(),U=!0),t.l_desc=new b(t.dyn_ltree,p),t.d_desc=new b(t.dyn_dtree,g),t.bl_desc=new b(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,S(t)},e._tr_stored_block=C,e._tr_flush_block=function(t,e,r,i){var n,a,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),o=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*c[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==e?C(t,e,r,i):4===t.strategy||a===n?(x(t,2+(i?1:0),3),P(t,f,d)):(x(t,4+(i?1:0),3),function(t,e,r,i){var n;for(x(t,e-257,5),x(t,r-1,5),x(t,i-4,4),n=0;n<i;n++)x(t,t.bl_tree[2*c[n]+1],3);j(t,t.dyn_ltree,e-1),j(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),P(t,t.dyn_ltree,t.dyn_dtree)),S(t),i&&B(t)},e._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(h[r]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){x(t,2,3),k(t,256,f),function(t){16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},3737:(t,e,r)=>{"use strict";var i=r(6698),n=r(392),a=r(8188).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,n.call(this,64,56)}function f(t){return t<<1|t>>>31}function d(t){return t<<5|t>>>27}function l(t){return t<<30|t>>>2}function h(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,n=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)e[c]=t.readInt32BE(4*c);for(;c<80;++c)e[c]=f(e[c-3]^e[c-8]^e[c-14]^e[c-16]);for(var u=0;u<80;++u){var p=~~(u/20),g=d(r)+h(p,i,n,a)+s+e[u]+o[p]|0;s=a,a=n,n=l(i),i=r,r=g}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var t=a.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},4039:(t,e,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,n=r(1333);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}},4372:(t,e,r)=>{"use strict";var i=r(9675),n=r(6556)("TypedArray.prototype.buffer",!0),a=r(5680);t.exports=n||function(t){if(!a(t))throw new i("Not a Typed Array");return t.buffer}},4442:t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},4459:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},4674:t=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},4823:t=>{"use strict";var e=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,r,i,n){var a=e,o=n+i;t^=-1;for(var s=n;s<o;s++)t=t>>>8^a[255&(t^r[s])];return-1^t}},5345:t=>{"use strict";t.exports=URIError},5377:(t,e,r)=>{"use strict";var i=r(945).Buffer,n=r(4634),a=r(4372),o=ArrayBuffer.isView||function(t){try{return a(t),!0}catch(t){return!1}},s="undefined"!=typeof Uint8Array,c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,f=c&&(i.prototype instanceof Uint8Array||i.TYPED_ARRAY_SUPPORT);t.exports=function(t,e){if(t instanceof i)return t;if("string"==typeof t)return i.from(t,e);if(c&&o(t)){if(0===t.byteLength)return i.alloc(0);if(f){var r=i.from(t.buffer,t.byteOffset,t.byteLength);if(r.byteLength===t.byteLength)return r}var a=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),d=i.from(a);if(d.length===t.byteLength)return d}if(s&&t instanceof Uint8Array)return i.from(t);var l=n(t);if(l)for(var h=0;h<t.length;h+=1){var u=t[h];if("number"!=typeof u||u<0||u>255||~~u!==u)throw new RangeError("Array items must be numbers in the range 0-255.")}if(l||i.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return i.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},5680:(t,e,r)=>{"use strict";var i=r(5767);t.exports=function(t){return!!i(t)}},5767:(t,e,r)=>{"use strict";var i=r(2682),n=r(9209),a=r(487),o=r(6556),s=r(5795),c=r(3628),f=o("Object.prototype.toString"),d=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=n(),u=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},g={__proto__:null};i(h,d&&s&&c?function(t){var e=new l[t];if(Symbol.toStringTag in e&&c){var r=c(e),i=s(r,Symbol.toStringTag);if(!i&&r){var n=c(r);i=s(n,Symbol.toStringTag)}g["$"+t]=a(i.get)}}:function(t){var e=new l[t],r=e.slice||e.set;r&&(g["$"+t]=a(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!d){var e=u(f(t),8,-1);return p(h,e)>-1?e:"Object"===e&&function(t){var e=!1;return i(g,function(r,i){if(!e)try{r(t),e=u(i,1)}catch(t){}}),e}(t)}return s?function(t){var e=!1;return i(g,function(r,i){if(!e)try{"$"+r(t)===i&&(e=u(i,1))}catch(t){}}),e}(t):null}},5795:(t,e,r)=>{"use strict";var i=r(6549);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},5880:t=>{"use strict";t.exports=Math.pow},6188:t=>{"use strict";t.exports=Math.max},6219:t=>{"use strict";function e(t,e,r){return e=e instanceof RegExp?e:new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),t.replace(e,r)}var r={clean:function(t){if("string"!=typeof t)throw new Error("Expected a string, received: "+t);return t=e(t,"./","/"),t=e(t,"..","."),t=e(t," ","-"),t=e(t,/^[~^:?*\\\-]/g,""),t=e(t,/[~^:?*\\]/g,"-"),t=e(t,/[~^:?*\\\-]$/g,""),t=e(t,"@{","-"),t=e(t,/\.$/g,""),t=e(t,/\/$/g,""),e(t,/\.lock$/g,"")}};t.exports=r},6549:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},6556:(t,e,r)=>{"use strict";var i=r(453),n=r(3126),a=n([i("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?n([r]):r}},6578:t=>{"use strict";t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6698:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},6743:(t,e,r)=>{"use strict";var i=r(9353);t.exports=Function.prototype.bind||i},6867:t=>{"use strict";const e=(t,e)=>function(...r){return new(0,e.promiseModule)((i,n)=>{e.multiArgs?r.push((...t)=>{e.errorFirst?t[0]?n(t):(t.shift(),i(t)):i(t)}):e.errorFirst?r.push((t,e)=>{t?n(t):i(e)}):r.push(i),t.apply(this,r)})};t.exports=(t,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const i=typeof t;if(null===t||"object"!==i&&"function"!==i)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":i}\``);const n=t=>{const e=e=>"string"==typeof e?t===e:e.test(t);return r.include?r.include.some(e):!r.exclude.some(e)};let a;a="function"===i?function(...i){return r.excludeMain?t(...i):e(t,r).apply(this,i)}:Object.create(Object.getPrototypeOf(t));for(const i in t){const o=t[i];a[i]="function"==typeof o&&n(i)?e(o,r):o}return a}},6895:(t,e,r)=>{var i=r(3548);function n(t,e){for(var r=[],n=t.length,a=e.length,o=function(t,e){var r=new i(t,e);r.compose();for(var n,a,o=r.getses(),s=t.length-1,c=e.length-1,f=o.length-1;f>=0;--f)o[f].t===r.SES_COMMON?(a?(a.chain={file1index:s,file2index:c,chain:null},a=a.chain):a=n={file1index:s,file2index:c,chain:null},s--,c--):o[f].t===r.SES_DELETE?s--:o[f].t===r.SES_ADD&&c--;var d={file1index:-1,file2index:-1,chain:null};return a?(a.chain=d,n):d}(t,e);null!==o;o=o.chain){var s=n-o.file1index-1,c=a-o.file2index-1;n=o.file1index,a=o.file2index,(s||c)&&r.push({file1:[n+1,s],file2:[a+1,c]})}return r.reverse(),r}t.exports=function(t,e,r){var i=[],a=[t,e,r],o=function(t,e,r){var i,a=n(e,t),o=n(e,r),s=[];function c(t,e){s.push([t.file1[0],e,t.file1[1],t.file2[0],t.file2[1]])}for(i=0;i<a.length;i++)c(a[i],0);for(i=0;i<o.length;i++)c(o[i],2);s.sort(function(t,e){return t[0]-e[0]});var f=[],d=0;function l(t){t>d&&(f.push([1,d,t-d]),d=t)}for(var h=0;h<s.length;h++){for(var u=h,p=s[h],g=p[0],w=g+p[2];h<s.length-1;){var m=s[h+1],y=m[0];if(y>w)break;w=Math.max(w,y+m[2]),h++}if(l(g),u==h)p[4]>0&&f.push([p[1],p[3],p[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=u;i<=h;i++){var _=b[(p=s[i])[1]],v=p[0],x=v+p[2],k=p[3],E=k+p[4];_[0]=Math.min(k,_[0]),_[1]=Math.max(E,_[1]),_[2]=Math.min(v,_[2]),_[3]=Math.max(x,_[3])}var A=b[0][0]+(g-b[0][2]),S=b[0][1]+(w-b[0][3]),B=b[2][0]+(g-b[2][2]),$=b[2][1]+(w-b[2][3]);f.push([-1,A,S-A,g,w-g,B,$-B])}d=w}return l(e.length),f}(t,e,r),s=[];function c(){s.length&&i.push({ok:s}),s=[]}function f(t){for(var e=0;e<t.length;e++)s.push(t[e])}function d(e){if(e[2]!=e[6])return!0;for(var i=e[1],n=e[5],a=0;a<e[2];a++)if(t[a+i]!=r[a+n])return!0;return!1}for(var l=0;l<o.length;l++){var h=o[l],u=h[0];-1==u?d(h)?(c(),i.push({conflict:{a:t.slice(h[1],h[1]+h[2]),aIndex:h[1],o:e.slice(h[3],h[3]+h[4]),oIndex:h[3],b:r.slice(h[5],h[5]+h[6]),bIndex:h[5]}})):f(a[0].slice(h[1],h[1]+h[2])):f(a[u].slice(h[1],h[1]+h[2]))}return c(),i}},6897:(t,e,r)=>{"use strict";var i=r(453),n=r(41),a=r(592)(),o=r(5795),s=r(9675),c=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,f=!0;if("length"in t&&o){var d=o(t,"length");d&&!d.configurable&&(i=!1),d&&!d.writable&&(f=!1)}return(i||f||!r)&&(a?n(t,"length",e,!0,!0):n(t,"length",e)),t}},7083:(t,e,r)=>{"use strict";var i=r(1447),n=r(9805),a=r(1996),o=r(9681),s=r(4674),c=r(4442),f=r(7414),d=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,e.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new f,i.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===d.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=i.inflateSetDictionary(this.strm,e.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(t,e){var r=new l(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}l.prototype.push=function(t,e){var r,s,c,f,l,h=this.strm,u=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?h.input=a.binstring2buf(t):"[object ArrayBuffer]"===d.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new n.Buf8(u),h.next_out=0,h.avail_out=u),(r=i.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=i.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===g&&(r=o.Z_OK,g=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(c=a.utf8border(h.output,h.next_out),f=h.next_out-c,l=a.buf2string(h.output,c),h.next_out=f,h.avail_out=u-f,f&&n.arraySet(h.output,h.output,c,f,0),this.onData(l)):this.onData(n.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=l,e.inflate=h,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},e.ungzip=h},7119:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(t,e,r)=>{"use strict";var i,n=r(3126),a=r(5795);try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!i&&a&&a(Object.prototype,"__proto__"),s=Object,c=s.getPrototypeOf;t.exports=o&&"function"==typeof o.get?n([o.get]):"function"==typeof c&&function(t){return c(null==t?t:s(t))}},7293:t=>{"use strict";t.exports=function(t,e){var r,i,n,a,o,s,c,f,d,l,h,u,p,g,w,m,y,b,_,v,x,k,E,A,S;r=t.state,i=t.next_in,A=t.input,n=i+(t.avail_in-5),a=t.next_out,S=t.output,o=a-(e-t.avail_out),s=a+(t.avail_out-257),c=r.dmax,f=r.wsize,d=r.whave,l=r.wnext,h=r.window,u=r.hold,p=r.bits,g=r.lencode,w=r.distcode,m=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;t:do{p<15&&(u+=A[i++]<<p,p+=8,u+=A[i++]<<p,p+=8),b=g[u&m];e:for(;;){if(u>>>=_=b>>>24,p-=_,0==(_=b>>>16&255))S[a++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}b=g[(65535&b)+(u&(1<<_)-1)];continue e}for(v=65535&b,(_&=15)&&(p<_&&(u+=A[i++]<<p,p+=8),v+=u&(1<<_)-1,u>>>=_,p-=_),p<15&&(u+=A[i++]<<p,p+=8,u+=A[i++]<<p,p+=8),b=w[u&y];;){if(u>>>=_=b>>>24,p-=_,16&(_=b>>>16&255)){if(x=65535&b,p<(_&=15)&&(u+=A[i++]<<p,(p+=8)<_&&(u+=A[i++]<<p,p+=8)),(x+=u&(1<<_)-1)>c){t.msg="invalid distance too far back",r.mode=30;break t}if(u>>>=_,p-=_,x>(_=a-o)){if((_=x-_)>d&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,E=h,0===l){if(k+=f-_,_<v){v-=_;do{S[a++]=h[k++]}while(--_);k=a-x,E=S}}else if(l<_){if(k+=f+l-_,(_-=l)<v){v-=_;do{S[a++]=h[k++]}while(--_);if(k=0,l<v){v-=_=l;do{S[a++]=h[k++]}while(--_);k=a-x,E=S}}}else if(k+=l-_,_<v){v-=_;do{S[a++]=h[k++]}while(--_);k=a-x,E=S}for(;v>2;)S[a++]=E[k++],S[a++]=E[k++],S[a++]=E[k++],v-=3;v&&(S[a++]=E[k++],v>1&&(S[a++]=E[k++]))}else{k=a-x;do{S[a++]=S[k++],S[a++]=S[k++],S[a++]=S[k++],v-=3}while(v>2);v&&(S[a++]=S[k++],v>1&&(S[a++]=S[k++]))}break}if(64&_){t.msg="invalid distance code",r.mode=30;break t}b=w[(65535&b)+(u&(1<<_)-1)]}}break}}while(i<n&&a<s);i-=v=p>>3,u&=(1<<(p-=v<<3))-1,t.next_in=i,t.next_out=a,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=a<s?s-a+257:257-(a-s),r.hold=u,r.bits=p}},7414:t=>{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,a=s(t),o=a[0],c=a[1],f=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,c)),d=0,l=c>0?o-4:o;for(r=0;r<l;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[d++]=e>>16&255,f[d++]=e>>8&255,f[d++]=255&e;return 2===c&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[d++]=255&e),1===c&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[d++]=e>>8&255,f[d++]=255&e),f},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,a=[],o=16383,s=0,c=i-n;s<c;s+=o)a.push(f(t,s,s+o>c?c:s+o));return 1===n?(e=t[i-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],i[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function f(t,e,r){for(var i,n=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),n.push(c(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8002:t=>{"use strict";t.exports=Math.min},8068:t=>{"use strict";t.exports=SyntaxError},8188:(t,e,r)=>{var i=r(8287),n=i.Buffer;function a(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(a(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),a(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},8287:(t,e,r)=>{"use strict";const i=r(7526),n=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let i=s(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return u(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return u(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return u(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return c.from(i,e,r);const n=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return d(t),s(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function u(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,c.prototype),i}function p(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return i?-1:q(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return $(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){let a,o=1,s=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,s/=2,c/=2,r/=2}function f(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(a=r;a<s;a++)if(f(t,a)===f(e,-1===i?0:a-i)){if(-1===i&&(i=a),a-i+1===c)return i*o}else-1!==i&&(a-=a-i),i=-1}else for(r+c>s&&(r=s-c),a=r;a>=0;a--){let r=!0;for(let i=0;i<c;i++)if(f(t,a+i)!==f(e,i)){r=!1;break}if(r)return a}return-1}function _(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const a=e.length;let o;for(i>a/2&&(i=a/2),o=0;o<i;++o){const i=parseInt(e.substr(2*o,2),16);if(Y(i))return o;t[r+o]=i}return o}function v(t,e,r,i){return K(q(e,t.length-r),t,r,i)}function x(t,e,r,i){return K(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function k(t,e,r,i){return K(Z(e),t,r,i)}function E(t,e,r,i){return K(function(t,e){let r,i,n;const a=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,a.push(n),a.push(i);return a}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let a=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,s,c;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[n+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(a=c));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(c=(15&e)<<12|(63&r)<<6|63&i,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=t[n+1],i=t[n+2],s=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&s)&&(c=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&s,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),n+=o}return function(t){const e=t.length;if(e<=B)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=B));return r}(i)}e.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return d(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},c.allocUnsafe=function(t){return l(t)},c.allocUnsafeSlow=function(t){return l(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,a=Math.min(r,i);n<a;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=c.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(V(e,Uint8Array))n+e.length>i.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):w.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(t,e,r,i,n){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const s=Math.min(a,o),f=this.slice(i,n),d=t.slice(e,r);for(let t=0;t<s;++t)if(f[t]!==d[t]){a=f[t],o=d[t];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},c.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return x(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const B=4096;function $(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function R(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function P(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=X[t[i]];return n}function I(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function O(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,i,n,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<a)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function U(t,e,r,i,n){L(e,i,n,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function C(t,e,r,i,n){L(e,i,n,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function T(t,e,r,i,n,a){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,i,a){return e=+e,r>>>=0,a||T(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function D(t,e,r,i,a){return e=+e,r>>>=0,a||T(t,0,r,8),n.write(t,e,r,i,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,c.prototype),i},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=this[t],n=1,a=0;for(;++a<e&&(n*=256);)i+=this[t+a]*n;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=this[t],n=1,a=0;for(;++a<e&&(n*=256);)i+=this[t+a]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=e,n=1,a=this[t+--i];for(;i>0&&(n*=256);)a+=this[t+--i]*n;return n*=128,a>=n&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),c.prototype.readBigInt64BE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),n.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),n.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),n.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),n.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,a=0;for(this[e]=255&t;++a<r&&(n*=256);)this[e+a]=t/n&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,a=1;for(this[e+n]=255&t;--n>=0&&(a*=256);)this[e+n]=t/a&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=J(function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=0,a=1,o=0;for(this[e]=255&t;++n<r&&(a*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/a|0)-o&255;return e+r},c.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=r-1,a=1,o=0;for(this[e+n]=255&t;--n>=0&&(a*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/a|0)-o&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=J(function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},c.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const a=c.isBuffer(t)?t:c.from(t,i),o=a.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=a[n%o]}return this};const N={};function F(t,e,r){N[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function z(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function L(t,e,r,i,n,a){if(t>r||t<e){const i="bigint"==typeof e?"n":"";let n;throw n=a>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(a+1)}${i}`:`>= -(2${i} ** ${8*(a+1)-1}${i}) and < 2 ** ${8*(a+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new N.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||W(e,t.length-(r+1))}(i,n,a)}function H(t,e){if("number"!=typeof t)throw new N.ERR_INVALID_ARG_TYPE(e,"number",t)}function W(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new N.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),F("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=z(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=z(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const i=t.length;let n=null;const a=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Z(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function J(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},8411:(t,e,r)=>{"use strict";var i,n=r(9805),a=r(3665),o=r(3269),s=r(4823),c=r(4674),f=-2,d=258,l=262,h=103,u=113,p=666;function g(t,e){return t.msg=c[e],e}function w(t){return(t<<1)-(t>4?9:0)}function m(t){for(var e=t.length;--e>=0;)t[e]=0}function y(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function b(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,y(t.strm)}function _(t,e){t.pending_buf[t.pending++]=e}function v(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function x(t,e,r,i){var a=t.avail_in;return a>i&&(a=i),0===a?0:(t.avail_in-=a,n.arraySet(e,t.input,t.next_in,a,r),1===t.state.wrap?t.adler=o(t.adler,e,a,r):2===t.state.wrap&&(t.adler=s(t.adler,e,a,r)),t.next_in+=a,t.total_in+=a,a)}function k(t,e){var r,i,n=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,c=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,f=t.window,h=t.w_mask,u=t.prev,p=t.strstart+d,g=f[a+o-1],w=f[a+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+o]===w&&f[r+o-1]===g&&f[r]===f[a]&&f[++r]===f[a+1]){a+=2,r++;do{}while(f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&a<p);if(i=d-(p-a),a=p-d,i>o){if(t.match_start=e,o=i,i>=s)break;g=f[a+o-1],w=f[a+o]}}}while((e=u[e&h])>c&&0!==--n);return o<=t.lookahead?o:t.lookahead}function E(t){var e,r,i,a,o,s=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-l)){n.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=r=t.hash_size;do{i=t.head[--e],t.head[e]=i>=s?i-s:0}while(--r);e=r=s;do{i=t.prev[--e],t.prev[e]=i>=s?i-s:0}while(--r);a+=s}if(0===t.strm.avail_in)break;if(r=x(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=r,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<l&&0!==t.strm.avail_in)}function A(t,e){for(var r,i;;){if(t.lookahead<l){if(E(t),t.lookahead<l&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-l&&(t.match_length=k(t,r)),t.match_length>=3)if(i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function S(t,e){for(var r,i,n;;){if(t.lookahead<l){if(E(t),t.lookahead<l&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-l&&(t.match_length=k(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(b(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=a._tr_tally(t,0,t.window[t.strstart-1]))&&b(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function B(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function $(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function R(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:u,t.adler=2===e.wrap?0:1,e.last_flush=0,a._tr_init(e),0):g(t,f)}function P(t){var e,r=R(t);return 0===r&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r}function I(t,e,r,i,a,o){if(!t)return f;var s=1;if(-1===e&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>9||8!==r||i<8||i>15||e<0||e>9||o<0||o>4)return g(t,f);8===i&&(i=9);var c=new $;return t.state=c,c.strm=t,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new n.Buf8(2*c.w_size),c.head=new n.Buf16(c.hash_size),c.prev=new n.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new n.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=e,c.strategy=o,c.method=r,P(t)}i=[new B(0,0,0,0,function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(E(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(b(t,!1),t.strm.avail_out),1)}),new B(4,4,8,4,A),new B(4,5,16,8,A),new B(4,6,32,32,A),new B(4,4,16,16,S),new B(8,16,32,32,S),new B(8,16,128,128,S),new B(8,32,128,256,S),new B(32,128,258,1024,S),new B(32,258,258,4096,S)],e.deflateInit=function(t,e){return I(t,e,8,15,8,0)},e.deflateInit2=I,e.deflateReset=P,e.deflateResetKeep=R,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?f:(t.state.gzhead=e,0):f},e.deflate=function(t,e){var r,n,o,c;if(!t||!t.state||e>5||e<0)return t?g(t,f):f;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||n.status===p&&4!==e)return g(t,0===t.avail_out?-5:f);if(n.strm=t,r=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,_(n,31),_(n,139),_(n,8),n.gzhead?(_(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),_(n,255&n.gzhead.time),_(n,n.gzhead.time>>8&255),_(n,n.gzhead.time>>16&255),_(n,n.gzhead.time>>24&255),_(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),_(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(_(n,255&n.gzhead.extra.length),_(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=s(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(_(n,0),_(n,0),_(n,0),_(n,0),_(n,0),_(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),_(n,3),n.status=u);else{var l=8+(n.w_bits-8<<4)<<8;l|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(l|=32),l+=31-l%31,n.status=u,v(n,l),0!==n.strstart&&(v(n,t.adler>>>16),v(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),y(t),o=n.pending,n.pending!==n.pending_buf_size));)_(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),y(t),o=n.pending,n.pending===n.pending_buf_size)){c=1;break}c=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,_(n,c)}while(0!==c);n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),0===c&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),y(t),o=n.pending,n.pending===n.pending_buf_size)){c=1;break}c=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,_(n,c)}while(0!==c);n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),0===c&&(n.status=h)}else n.status=h;if(n.status===h&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&y(t),n.pending+2<=n.pending_buf_size&&(_(n,255&t.adler),_(n,t.adler>>8&255),t.adler=0,n.status=u)):n.status=u),0!==n.pending){if(y(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&w(e)<=w(r)&&4!==e)return g(t,-5);if(n.status===p&&0!==t.avail_in)return g(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&n.status!==p){var x=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(E(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,o,s=t.window;;){if(t.lookahead<=d){if(E(t),t.lookahead<=d&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[n=t.strstart-1])===s[++n]&&i===s[++n]&&i===s[++n]){o=t.strstart+d;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=d-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==x&&4!==x||(n.status=p),1===x||3===x)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===x&&(1===e?a._tr_align(n):5!==e&&(a._tr_stored_block(n,0,0,!1),3===e&&(m(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),y(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(_(n,255&t.adler),_(n,t.adler>>8&255),_(n,t.adler>>16&255),_(n,t.adler>>24&255),_(n,255&t.total_in),_(n,t.total_in>>8&255),_(n,t.total_in>>16&255),_(n,t.total_in>>24&255)):(v(n,t.adler>>>16),v(n,65535&t.adler)),y(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==h&&e!==u&&e!==p?g(t,f):(t.state=null,e===u?g(t,-3):0):f},e.deflateSetDictionary=function(t,e){var r,i,a,s,c,d,l,h,u=e.length;if(!t||!t.state)return f;if(2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return f;for(1===s&&(t.adler=o(t.adler,e,u,0)),r.wrap=0,u>=r.w_size&&(0===s&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new n.Buf8(r.w_size),n.arraySet(h,e,u-r.w_size,r.w_size,0),e=h,u=r.w_size),c=t.avail_in,d=t.next_in,l=t.input,t.avail_in=u,t.next_in=0,t.input=e,E(r);r.lookahead>=3;){i=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+3-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--a);r.strstart=i,r.lookahead=2,E(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=d,t.input=l,t.avail_in=c,r.wrap=s,0},e.deflateInfo="pako deflate (from Nodeca project)"},8465:(t,e,r)=>{"use strict";t.exports=r(809)},8648:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8968:t=>{"use strict";t.exports=Math.floor},9092:(t,e,r)=>{"use strict";var i=r(1333);t.exports=function(){return i()&&!!Symbol.toStringTag}},9209:(t,e,r)=>{"use strict";var i=r(6578),n="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<i.length;e++)"function"==typeof n[i[e]]&&(t[t.length]=i[e]);return t}},9290:t=>{"use strict";t.exports=RangeError},9353:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var n=0;n<e.length;n+=1)r[n+t.length]=e[n];return r};t.exports=function(t){var n=this;if("function"!=typeof n||"[object Function]"!==e.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var a,o=function(t){for(var e=[],r=1,i=0;r<t.length;r+=1,i+=1)e[i]=t[r];return e}(arguments),s=r(0,n.length-o.length),c=[],f=0;f<s;f++)c[f]="$"+f;if(a=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(c)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var e=n.apply(this,i(o,arguments));return Object(e)===e?e:this}return n.apply(t,i(o,arguments))}),n.prototype){var d=function(){};d.prototype=n.prototype,a.prototype=new d,d.prototype=null}return a}},9383:t=>{"use strict";t.exports=Error},9538:t=>{"use strict";t.exports=ReferenceError},9600:t=>{"use strict";var e,r,i=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},n(function(){throw 42},null,e)}catch(t){t!==r&&(n=null)}else n=null;var a=/^\s*class\b/,o=function(t){try{var e=i.call(t);return a.test(e)}catch(t){return!1}},s=function(t){try{return!o(t)&&(i.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),l=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(l=function(t){if((d||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=n?function(t){if(l(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{n(t,null,e)}catch(t){if(t!==r)return!1}return!o(t)&&s(t)}:function(t){if(l(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(f)return s(t);if(o(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},9612:t=>{"use strict";t.exports=Object},9675:t=>{"use strict";t.exports=TypeError},9681:t=>{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},9805:(t,e)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(var a=0;a<i;a++)t[n+a]=e[r+a]},flattenChunks:function(t){var e,r,i,n,a,o;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(o=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)a=t[e],o.set(a,n),n+=a.length;return o}},a={arraySet:function(t,e,r,i,n){for(var a=0;a<i;a++)t[n+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(r)},9957:(t,e,r)=>{"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,a=r(6743);t.exports=a.call(i,n)}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,r),a.exports}r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{Errors:()=>t,STAGE:()=>j,TREE:()=>qt,WORKDIR:()=>Kt,abortMerge:()=>ue,add:()=>ve,addNote:()=>He,addRemote:()=>Ge,annotatedTag:()=>qe,branch:()=>Ze,checkout:()=>tr,cherryPick:()=>pr,clone:()=>ti,commit:()=>ei,currentBranch:()=>ri,default:()=>Hn,deleteBranch:()=>ii,deleteRef:()=>ni,deleteRemote:()=>ai,deleteTag:()=>oi,expandOid:()=>ci,expandRef:()=>fi,fastForward:()=>pi,fetch:()=>gi,findMergeBase:()=>wi,findRoot:()=>yi,getConfig:()=>bi,getConfigAll:()=>_i,getRemoteInfo:()=>xi,getRemoteInfo2:()=>Ei,hashBlob:()=>Ai,indexPack:()=>Si,init:()=>Bi,isDescendent:()=>Pi,isIgnored:()=>Ii,listBranches:()=>Oi,listFiles:()=>Ci,listNotes:()=>Ti,listRefs:()=>Mi,listRemotes:()=>Di,listServerRefs:()=>Ni,listTags:()=>Fi,log:()=>qi,merge:()=>Zi,packObjects:()=>Yi,pull:()=>Xi,push:()=>en,readBlob:()=>an,readCommit:()=>on,readNote:()=>sn,readObject:()=>cn,readTag:()=>fn,readTree:()=>dn,remove:()=>ln,removeNote:()=>hn,renameBranch:()=>un,resetIndex:()=>gn,resolveRef:()=>wn,setConfig:()=>mn,stash:()=>Rn,status:()=>Pn,statusMatrix:()=>On,tag:()=>jn,updateIndex:()=>Un,version:()=>Cn,walk:()=>Tn,writeBlob:()=>Mn,writeCommit:()=>Dn,writeObject:()=>Nn,writeRef:()=>Fn,writeTag:()=>zn,writeTree:()=>Ln});var t={};r.r(t),r.d(t,{AlreadyExistsError:()=>Le,AmbiguousError:()=>si,CheckoutConflictError:()=>Ke,CherryPickLocalChangesError:()=>er,CherryPickMergeCommitError:()=>rr,CherryPickRootCommitError:()=>ir,CommitNotFetchedError:()=>Ve,DecompressionError:()=>Bt,EmptyCommitError:()=>ke,EmptyServerResponseError:()=>Ir,FastForwardError:()=>li,GitPushError:()=>Qi,HttpError:()=>vr,IndexResetError:()=>Qt,InternalError:()=>a,InvalidFilepathError:()=>Te,InvalidOidError:()=>M,InvalidRefNameError:()=>D,MaxDepthError:()=>$i,MergeConflictError:()=>nr,MergeNotSupportedError:()=>ar,MissingNameError:()=>Ee,MissingParameterError:()=>fe,MultipleGitError:()=>pe,NoCommitError:()=>Ae,NoRefspecError:()=>N,NotFoundError:()=>U,ObjectTypeError:()=>C,ParseError:()=>Or,PushRejectedError:()=>tn,RemoteCapabilityError:()=>yr,SmartHttpError:()=>xr,UnknownTransportError:()=>br,UnmergedPathsError:()=>n,UnsafeFilepathError:()=>o,UrlParseError:()=>_r,UserCanceledError:()=>kr});class e extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const r=new e(t.message),i=r;return i.code=t.code,i.data=t.data,r.caller=t.caller,r.stack=t.stack,r}get isIsomorphicGitError(){return!0}}class n extends e{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=n.code,this.data={filepaths:t}}}n.code="UnmergedPathsError";class a extends e{constructor(t){super(`An internal error caused this command to fail.\n\nIf you're using an application that depends on isomorphic-git, please report this error to that application's developers.\n\nIf you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${t}`),this.code=this.name=a.code,this.data={message:t}}}a.code="InternalError";class o extends e{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=o.code,this.data={filepath:t}}}o.code="UnsafeFilepathError";class s{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const e=this.buffer.slice(this._start,this._start+t);return this._start+=t,e}toString(t,e){const r=this.buffer.toString(t,this._start,this._start+e);return this._start+=e,r}write(t,e,r){const i=this.buffer.write(t,this._start,e,r);return this._start+=e,i}copy(t,e,r){const i=t.copy(this.buffer,this._start,e,r);return this._start+=i,i}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const e=this.buffer.writeUInt8(t,this._start);return this._start+=1,e}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const e=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,e}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const e=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,e}}const c=/[\ud800-]/;function f(t,e,r){if(r<55296||r>57343)return!1;if(r<56320){const r=e+1<t.length?t.charCodeAt(e+1):0;return r<56320||r>57343}const i=e>0?t.charCodeAt(e-1):0;return i<55296||i>56319}function d(t,e){if(!c.test(t)&&!c.test(e))return-(t<e)||+(t>e);const r=Math.min(t.length,e.length);for(let i=0;i<r;i++){let r=t.charCodeAt(i),n=e.charCodeAt(i);if(r!==n){if(f(t,i,r)&&(r=65533),f(e,i,n)&&(n=65533),r===n)continue;return r>=55296&&n>=55296&&(r+=r>=57344?-2048:8192,n+=n>=57344?-2048:8192),r<n?-1:1}}return t.length<e.length?-1:t.length>e.length?1:0}function l(t,e){return d(t.path,e.path)}function h(t){let e=t>0?t>>12:0;4!==e&&8!==e&&10!==e&&14!==e&&(e=8);let r=511&t;return r=73&r?493:420,8!==e&&(r=0),(e<<12)+r}const u=2**32;function p(t,e,r,i){if(void 0!==t&&void 0!==e)return[t,e];void 0===r&&(r=i.valueOf());const n=Math.floor(r/1e3);return[n,1e6*(r-1e3*n)]}function g(t){const[e,r]=p(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=p(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%u,ctimeNanoseconds:r%u,mtimeSeconds:i%u,mtimeNanoseconds:n%u,dev:t.dev%u,ino:t.ino%u,mode:h(t.mode%u),uid:t.uid%u,gid:t.gid%u,size:t.size>-1?t.size%u:0}}var w=r(3737);let m=null;async function y(t){return null===m&&(m=await async function(){try{return"da39a3ee5e6b4b0d3255bfef95601890afd80709"===await b(new Uint8Array([]))}catch(t){}return!1}()),m?b(t):function(t){return(new w).update(t).digest("hex")}(t)}async function b(t){return function(t){let e="";for(const r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}(await crypto.subtle.digest("SHA-1",t))}function _(t){return{assumeValid:Boolean(32768&t),extended:Boolean(16384&t),stage:(12288&t)>>12,nameLength:4095&t}}class v{constructor(t,e){this._dirty=!1,this._unmergedPaths=e||new Set,this._entries=t||new Map}_addEntry(t){if(0===t.flags.stage)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let e=this._entries.get(t.path);e||(this._entries.set(t.path,t),e=t),e.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return v.fromBuffer(t);if(null===t)return new v(null);throw new a("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(0===t.length)throw new a("Index file is empty (.git/index)");const e=new v,r=new s(t),i=r.toString("utf8",4);if("DIRC"!==i)throw new a(`Invalid dircache magic file number: ${i}`);const n=await y(t.slice(0,-20)),c=t.slice(-20).toString("hex");if(c!==n)throw new a(`Invalid checksum in GitIndex buffer: expected ${c} but saw ${n}`);const f=r.readUInt32BE();if(2!==f)throw new a(`Unsupported dircache version: ${f}`);const d=r.readUInt32BE();let l=0;for(;!r.eof()&&l<d;){const i={};i.ctimeSeconds=r.readUInt32BE(),i.ctimeNanoseconds=r.readUInt32BE(),i.mtimeSeconds=r.readUInt32BE(),i.mtimeNanoseconds=r.readUInt32BE(),i.dev=r.readUInt32BE(),i.ino=r.readUInt32BE(),i.mode=r.readUInt32BE(),i.uid=r.readUInt32BE(),i.gid=r.readUInt32BE(),i.size=r.readUInt32BE(),i.oid=r.slice(20).toString("hex");const n=r.readUInt16BE();i.flags=_(n);const s=t.indexOf(0,r.tell()+1)-r.tell();if(s<1)throw new a(`Got a path length of: ${s}`);if(i.path=r.toString("utf8",s),i.path.includes("..\\")||i.path.includes("../"))throw new o(i.path);let c=8-(r.tell()-12)%8;for(0===c&&(c=8);c--;){const t=r.readUInt8();if(0!==t)throw new a(`Expected 1-8 null characters but got '${t}' after ${i.path}`);if(r.eof())throw new a("Unexpected end of file")}i.stages=[],e._addEntry(i),l++}return e}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(l)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(t=>t):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:e,oid:r,stage:i=0}){e||(e={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),e=g(e);const n=Buffer.from(t),a={ctimeSeconds:e.ctimeSeconds,ctimeNanoseconds:e.ctimeNanoseconds,mtimeSeconds:e.mtimeSeconds,mtimeNanoseconds:e.mtimeNanoseconds,dev:e.dev,ino:e.ino,mode:e.mode||33188,uid:e.uid,gid:e.gid,size:e.size,path:t,oid:r,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:n.length<4095?n.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const e of this._entries.keys())e.startsWith(t+"/")&&this._entries.delete(e);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join("\n")}static async _entryToBuffer(t){const e=Buffer.from(t.path),r=8*Math.ceil((62+e.length+1)/8),i=Buffer.alloc(r),n=new s(i),a=g(t);return n.writeUInt32BE(a.ctimeSeconds),n.writeUInt32BE(a.ctimeNanoseconds),n.writeUInt32BE(a.mtimeSeconds),n.writeUInt32BE(a.mtimeNanoseconds),n.writeUInt32BE(a.dev),n.writeUInt32BE(a.ino),n.writeUInt32BE(a.mode),n.writeUInt32BE(a.uid),n.writeUInt32BE(a.gid),n.writeUInt32BE(a.size),n.write(t.oid,20,"hex"),n.writeUInt16BE(function(t){const e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((3&e.stage)<<12)+(4095&e.nameLength)}(t)),n.write(t.path,e.length,"utf8"),i}async toObject(){const t=Buffer.alloc(12),e=new s(t);e.write("DIRC",4,"utf8"),e.writeUInt32BE(2),e.writeUInt32BE(this.entriesFlat.length);let r=[];for(const t of this.entries)if(r.push(v._entryToBuffer(t)),t.stages.length>1)for(const e of t.stages)e&&e!==t&&r.push(v._entryToBuffer(e));r=await Promise.all(r);const i=Buffer.concat(r),n=Buffer.concat([t,i]),a=await y(n);return Buffer.concat([n,Buffer.from(a,"hex")])}}function x(t,e,r=!0,i=!0){const n=g(t),a=g(e);return r&&n.mode!==a.mode||n.mtimeSeconds!==a.mtimeSeconds||n.ctimeSeconds!==a.ctimeSeconds||n.uid!==a.uid||n.gid!==a.gid||i&&n.ino!==a.ino||n.size!==a.size}var k=r(8465);let E;function A(t,e){return(void 0===E&&(E=new k({maxPending:1/0})),E).acquire(t,e)}const S=Symbol("IndexCache");class B{static async acquire({fs:t,gitdir:e,cache:r,allowUnmerged:i=!0},a){r[S]||(r[S]={map:new Map,stats:new Map});const o=`${e}/index`;let s,c=[];return await A(o,async()=>{const e=r[S];await async function(t,e,r){const i=r.stats.get(e);if(void 0===i)return!0;if(null===i)return!1;const n=await t.lstat(e);if(null===n)return!1;if(x(i,n))return!0;const a=g(i),o=g(n);return a.mtimeNanoseconds!==o.mtimeNanoseconds||a.ctimeNanoseconds!==o.ctimeNanoseconds}(t,o,e)&&await async function(t,e,r){const[i,n]=await Promise.all([t.lstat(e),t.read(e)]),a=await v.from(n);r.map.set(e,a),r.stats.set(e,i)}(t,o,e);const f=e.map.get(o);if(c=f.unmergedPaths,c.length&&!i)throw new n(c);if(s=await a(f),f._dirty){const r=await f.toObject();await t.write(o,r),e.stats.set(o,await t.lstat(o)),f._dirty=!1}}),s}}function $(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function R(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return-1===e?".":0===e?"/":t.slice(0,e)}function P(t){const e=new Map,r=function(t){if(!e.has(t)){const i={type:"tree",fullpath:t,basename:$(t),metadata:{},children:[]};e.set(t,i),i.parent=r(R(t)),i.parent&&i.parent!==i&&i.parent.children.push(i)}return e.get(t)},i=function(t,i){if(!e.has(t)){const n={type:"blob",fullpath:t,basename:$(t),metadata:i,parent:r(R(t)),children:[]};n.parent&&n.parent.children.push(n),e.set(t,n)}return e.get(t)};r(".");for(const e of t)i(e.path,e);return e}class I{constructor({fs:t,gitdir:e,cache:r}){this.treePromise=B.acquire({fs:t,gitdir:e,cache:r},async function(t){return P(t.entries)});const i=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const e=t._fullpath,r=(await this.treePromise).get(e);if(!r)return null;if("blob"===r.type)return null;if("tree"!==r.type)throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);const i=r.children.map(t=>t.fullpath);return i.sort(d),i}async type(t){return!1===t._type&&await t.stat(),t._type}async mode(t){return!1===t._mode&&await t.stat(),t._mode}async stat(t){if(!1===t._stat){const e=(await this.treePromise).get(t._fullpath);if(!e)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const r="tree"===e.type?{}:g(e.metadata);t._type="tree"===e.type?"tree":function(t){switch(t){case 16384:return"tree";case 33188:case 33261:case 40960:return"blob";case 57344:return"commit"}throw new a(`Unexpected GitTree entry mode: ${t.toString(8)}`)}(r.mode),t._mode=r.mode,"tree"===e.type?t._stat=void 0:t._stat=r}return t._stat}async content(t){}async oid(t){if(!1===t._oid){const e=(await this.treePromise).get(t._fullpath);t._oid=e.metadata.oid}return t._oid}}const O=Symbol("GitWalkSymbol");function j(){const t=Object.create(null);return Object.defineProperty(t,O,{value:function({fs:t,gitdir:e,cache:r}){return new I({fs:t,gitdir:e,cache:r})}}),Object.freeze(t),t}class U extends e{constructor(t){super(`Could not find ${t}.`),this.code=this.name=U.code,this.data={what:t}}}U.code="NotFoundError";class C extends e{constructor(t,e,r,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${r} but it is a ${e}.`),this.code=this.name=C.code,this.data={oid:t,actual:e,expected:r,filepath:i}}}C.code="ObjectTypeError";var T=r(6219);class M extends e{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=M.code,this.data={value:t}}}M.code="InvalidOidError";class D extends e{constructor(t,e){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${e}".)`),this.code=this.name=D.code,this.data={ref:t,suggestion:e}}}D.code="InvalidRefNameError";class N extends e{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:\n[remote "${t}"]\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n`),this.code=this.name=N.code,this.data={remote:t}}}N.code="NoRefspecError";class F{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let e=null;this.parsedConfig=t.trim().split("\n").map(t=>{if(/^\s*#/.test(t))return{line:t,comment:!0};const r=t.indexOf(" ");if(t.startsWith("^")){const r=t.slice(1);return this.refs.set(e+"^{}",r),{line:t,ref:e,peeled:r}}{const i=t.slice(0,r);return e=t.slice(r+1),this.refs.set(e,i),{line:t,ref:e,oid:i}}})}return this}static from(t){return new F(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(e=>e.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join("\n")+"\n"}}class z{constructor({remotePath:t,localPath:e,force:r,matchPrefix:i}){Object.assign(this,{remotePath:t,localPath:e,force:r,matchPrefix:i})}static from(t){const[e,r,i,n,o]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s="+"===e,c="*"===i;if(c!==("*"===o))throw new a("Invalid refspec");return new z({remotePath:r,localPath:n,force:s,matchPrefix:c})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class L{constructor(t=[]){this.rules=t}static from(t){const e=[];for(const r of t)e.push(z.from(r));return new L(e)}add(t){const e=z.from(t);this.rules.push(e)}translate(t){const e=[];for(const r of this.rules)for(const i of t){const t=r.translate(i);t&&e.push([i,t])}return e}translateOne(t){let e=null;for(const r of this.rules){const i=r.translate(t);i&&(e=i)}return e}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function H(t,e){const r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(r<i)||+(r>i);return 0===n?t.endsWith("^{}")?1:-1:n}const W=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function G(t,e){if("string"!=typeof t)throw new TypeError("Reference name must be a string");return!W.test(t)&&(!!e||t.includes("/"))}function q(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const i=t[r].replace(/\\/g,"/");0!==i.length&&(/^[a-zA-Z]:\//.test(i)||void 0===e?e=i:e+="/"+i)}return void 0===e?".":function(t){if(!t.length)return".";const e=function(t){return t.length>=2&&/^[a-zA-Z]:/.test(t)?t.slice(0,2):null}(t=t.replace(/\\/g,"/")),r="/"===t[0]||null!==e&&"/"===t[2],i="/"===t.at(-1);let n=function(t,e){let r="",i=0,n=-1,a=0,o="\0";for(let s=0;s<=t.length;++s){if(s<t.length)o=t[s];else{if("/"===o)break;o="/"}if("/"===o){if(n===s-1||1===a);else if(2===a){if(r.length<2||2!==i||"."!==r.at(-1)||"."!==r.at(-2)){if(r.length>2){const t=r.lastIndexOf("/");-1===t?(r="",i=0):(r=r.slice(0,t),i=r.length-1-r.lastIndexOf("/")),n=s,a=0;continue}if(0!==r.length){r="",i=0,n=s,a=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,s):r=t.slice(n+1,s),i=s-n-1;n=s,a=0}else"."===o&&-1!==a?++a:a=-1}return r}(e?t.slice(2):t,!r);if(!n.length){const t=e?r?e+"/":e:r?"/":".";return i&&!r?t+"/":t}return i&&(n+="/"),e?r?`${e}/${n}`:`${e}${n}`:r?`/${n}`:n}(e)}const Z=t=>{if("boolean"==typeof t)return t;if("true"===(t=t.trim().toLowerCase())||"yes"===t||"on"===t)return!0;if("false"===t||"no"===t||"off"===t)return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},K={core:{filemode:Z,bare:Z,logallrefupdates:Z,symlinks:Z,ignorecase:Z,bigFileThreshold:t=>{if("number"==typeof t)return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1048576),t.endsWith("g")&&(e*=1073741824),e}}},V=/^\[([A-Za-z0-9-.]+)(?:[ \t]+"((?:[^"\\]|\\.)*)")?\][ \t]*(?:[#;].*)?$/,Y=/^[A-Za-z0-9-.]+$/,X=/^([A-Za-z][A-Za-z0-9-]*)(?:\s*=\s*(.*))?$/,J=/^[A-Za-z][A-Za-z0-9-]*$/,Q=new Map([["t","\t"],["b","\b"],["n","\n"],["\\","\\"],['"','"']]),tt=t=>{let e="",r="",i=!1;for(let n=0;n<t.length;n++){const a=t[n];if(i||!/[ \t\r\v\f]/.test(a)){if(!i&&("#"===a||";"===a))break;e+=r,r="","\\"===a&&Q.has(t[n+1])?e+=Q.get(t[++n]):'"'===a?i=!i:e+=a}else""!==e&&(r+=a)}return e},et=t=>null!=t?t.toLowerCase():null,rt=(t,e,r)=>[et(t),e,et(r)].filter(t=>null!=t).join("."),it=t=>{const e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:rt(r,n,i),sectionPath:rt(r,n,null),isSection:!!r}};class nt{constructor(t){let e=null,r=null;this.parsedConfig=t?t.split("\n").map(t=>{let i=null,n=null;const a=t.trim(),o=(t=>{const e=V.exec(t);if(null!=e){const[t,r]=e.slice(1);return[t,r&&r.replace(/\\(.)/g,"$1")]}return null})(a),s=null!=o;if(s)[e,r]=o;else{const t=(t=>{const e=X.exec(t);if(null!=e){const[t,r="true"]=e.slice(1);return[t,tt(r)]}return null})(a);null!=t&&([i,n]=t)}const c=rt(e,r,i);return{line:t,isSection:s,section:e,subsection:r,name:i,value:n,path:c}}):[]}static from(t){return new nt(t)}async get(t,e=!1){const r=it(t).path,i=this.parsedConfig.filter(t=>t.path===r).map(({section:t,name:e,value:r})=>{const i=K[t]&&K[t][e];return i?i(r):r});return e?i:i.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(e=>e.isSection&&e.section===t).map(t=>t.subsection)}async deleteSection(t,e){this.parsedConfig=this.parsedConfig.filter(r=>!(r.section===t&&r.subsection===e))}async append(t,e){return this.set(t,e,!0)}async set(t,e,r=!1){const{section:i,subsection:n,name:a,path:o,sectionPath:s,isSection:c}=it(t),f=(d=this.parsedConfig,l=t=>t.path===o,d.reduce((t,e,r)=>l(e)?r:t,-1));var d,l;if(null==e)-1!==f&&this.parsedConfig.splice(f,1);else if(-1!==f){const t=this.parsedConfig[f],i=Object.assign({},t,{name:a,value:e,modified:!0});r?this.parsedConfig.splice(f+1,0,i):this.parsedConfig[f]=i}else{const t=this.parsedConfig.findIndex(t=>t.path===s),r={section:i,subsection:n,name:a,value:e,modified:!0,path:o};if(Y.test(i)&&J.test(a))if(t>=0)this.parsedConfig.splice(t+1,0,r);else{const t={isSection:c,section:i,subsection:n,modified:!0,path:s};this.parsedConfig.push(t,r)}}}toString(){return this.parsedConfig.map(({line:t,section:e,subsection:r,name:i,value:n,modified:a=!1})=>a?null!=i&&null!=n?`\t${i} = ${(t=>{if("string"!=typeof t)return t;const e=t.startsWith(" ")||t.endsWith(" ")||/[#;]/.test(t)?'"':"";return`${e}${t.replace(/[\\"\n\t]/g,t=>"\n"===t?"\\n":"\t"===t?"\\t":`\\${t}`)}${e}`})(n)}`:null!=r?`[${e} "${r}"]`:`[${e}]`:t).join("\n")}}class at{static async get({fs:t,gitdir:e}){const r=await t.read(`${e}/config`,{encoding:"utf8"});return nt.from(r)}static async save({fs:t,gitdir:e,config:r}){await t.write(`${e}/config`,r.toString(),{encoding:"utf8"})}}const ot=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],st=["config","description","index","shallow","commondir"];function ct(t){if(st.includes(t))throw new D(t,`refs/heads/${t}`);if(!G(t,!0))throw new D(t,T.clean(t))}class ft{static async updateRemoteRefs({fs:t,gitdir:e,remote:r,refs:i,symrefs:n,tags:a,refspecs:o,prune:s=!1,pruneTags:c=!1}){for(const t of i.values())if(!t.match(/[0-9a-f]{40}/))throw new M(t);const f=await at.get({fs:t,gitdir:e});if(!o){if(0===(o=await f.getall(`remote.${r}.fetch`)).length)throw new N(r);o.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}const d=L.from(o),l=new Map,h=d.translate([...i.keys()]),u=[];for(const[t,e]of d.translate([...n.keys()])){const r=d.translateOne(n.get(t));r&&(ct(r),u.push([e,`ref: ${r}`]))}const p=a?[...i.keys()].filter(t=>t.startsWith("refs/tags")&&!t.endsWith("^{}")):[];for(const[,t]of h)ct(t);for(const[t]of u)ct(t);if(p.forEach(ct),c){const r=await ft.listRefs({fs:t,gitdir:e,filepath:"refs/tags"});await ft.deleteRefs({fs:t,gitdir:e,refs:r.map(t=>`refs/tags/${t}`)})}for(const r of p)if(!await ft.exists({fs:t,gitdir:e,ref:r})){const t=i.get(r);l.set(r,t)}for(const[t,e]of h){const r=i.get(t);l.set(e,r)}for(const[t,e]of u)l.set(t,e);const g=[];if(s){for(const r of d.localNamespaces()){const i=(await ft.listRefs({fs:t,gitdir:e,filepath:r})).map(t=>`${r}/${t}`);for(const t of i)l.has(t)||g.push(t)}g.length>0&&await ft.deleteRefs({fs:t,gitdir:e,refs:g})}for(const[r,i]of l)await A(r,async()=>t.write(q(e,r),`${i.trim()}\n`,"utf8"));return{pruned:g}}static async writeRef({fs:t,gitdir:e,ref:r,value:i}){if(ct(r),!i.match(/[0-9a-f]{40}/))throw new M(i);await A(r,async()=>t.write(q(e,r),`${i.trim()}\n`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:e,ref:r,value:i}){ct(r),await A(r,async()=>t.write(q(e,r),`ref: ${i.trim()}\n`,"utf8"))}static async deleteRef({fs:t,gitdir:e,ref:r}){return ft.deleteRefs({fs:t,gitdir:e,refs:[r]})}static async deleteRefs({fs:t,gitdir:e,refs:r}){r.forEach(ct),await Promise.all(r.map(r=>t.rm(q(e,r))));let i=await A("packed-refs",async()=>t.read(`${e}/packed-refs`,{encoding:"utf8"}));const n=F.from(i),a=n.refs.size;for(const t of r)n.refs.has(t)&&n.delete(t);n.refs.size<a&&(i=n.toString(),await A("packed-refs",async()=>t.write(`${e}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:e,ref:r,depth:i,visited:n=new Set}){if(void 0!==i&&-1===--i)return r;if(r.startsWith("ref: "))return r=r.slice(5),ft.resolve({fs:t,gitdir:e,ref:r,depth:i,visited:n});if(40===r.length&&/[0-9a-f]{40}/.test(r))return r;const o=await ft.packedRefs({fs:t,gitdir:e}),s=ot(r).filter(t=>!st.includes(t));for(const r of s){const s=await A(r,async()=>await t.read(`${e}/${r}`,{encoding:"utf8"})||o.get(r));if(s){if(n.has(r))throw new a(`Circular reference detected while resolving ref "${r}"`);return n.add(r),ft.resolve({fs:t,gitdir:e,ref:s.trim(),depth:i,visited:n})}}throw new U(r)}static async isUnbornBranch({fs:t,gitdir:e,ref:r}){let i;try{i=await ft.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2})}catch(t){if(t instanceof U)return!1;throw t}return!!i.startsWith("refs/heads/")&&("HEAD"===r||ot(r).includes(i))}static async exists({fs:t,gitdir:e,ref:r}){try{return await ft.expand({fs:t,gitdir:e,ref:r}),!0}catch(t){if(t instanceof U)return!1;throw t}}static async expand({fs:t,gitdir:e,ref:r}){if(40===r.length&&/[0-9a-f]{40}/.test(r))return r;const i=await ft.packedRefs({fs:t,gitdir:e}),n=ot(r).filter(t=>!st.includes(t));for(const r of n){if(await A(r,async()=>t.exists(`${e}/${r}`)))return r;if(i.has(r))return r}throw new U(r)}static async expandAgainstMap({ref:t,map:e}){const r=ot(t);for(const t of r)if(await e.has(t))return t;throw new U(t)}static resolveAgainstMap({ref:t,fullref:e=t,depth:r,map:i}){if(void 0!==r&&-1===--r)return{fullref:e,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),ft.resolveAgainstMap({ref:t,fullref:e,depth:r,map:i});if(40===t.length&&/[0-9a-f]{40}/.test(t))return{fullref:e,oid:t};const n=ot(t);for(const t of n){const e=i.get(t);if(e)return ft.resolveAgainstMap({ref:e.trim(),fullref:t,depth:r,map:i})}throw new U(t)}static async packedRefs({fs:t,gitdir:e}){const r=await A("packed-refs",async()=>t.read(`${e}/packed-refs`,{encoding:"utf8"}));return F.from(r).refs}static async listRefs({fs:t,gitdir:e,filepath:r}){const i=await ft.packedRefs({fs:t,gitdir:e});let n=null;try{n=await t.readdirDeep(`${e}/${r}`),n=n.map(t=>t.replace(`${e}/${r}/`,""))}catch(t){n=[]}for(let t of i.keys())t.startsWith(r)&&(t=t.replace(r+"/",""),n.includes(t)||n.push(t));return n.sort(H),n}static async listBranches({fs:t,gitdir:e,remote:r}){return r?ft.listRefs({fs:t,gitdir:e,filepath:`refs/remotes/${r}`}):ft.listRefs({fs:t,gitdir:e,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:e}){return(await ft.listRefs({fs:t,gitdir:e,filepath:"refs/tags"})).filter(t=>!t.endsWith("^{}"))}}function dt(t,e){return d(lt(t),lt(e))}function lt(t){return"040000"===t.mode?t.path+"/":t.path}function ht(t){switch(t){case"040000":return"tree";case"100644":case"100755":case"120000":return"blob";case"160000":return"commit"}throw new a(`Unexpected GitTree entry mode: ${t}`)}function ut(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=function(t){if("number"==typeof t&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new a(`Could not understand file mode: ${t}`)}(t.mode),t.type||(t.type=ht(t.mode)),t}class pt{constructor(t){if(Buffer.isBuffer(t))this._entries=function(t){const e=[];let r=0;for(;r<t.length;){const i=t.indexOf(32,r);if(-1===i)throw new a(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);const n=t.indexOf(0,r);if(-1===n)throw new a(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let s=t.slice(r,i).toString("utf8");"40000"===s&&(s="040000");const c=ht(s),f=t.slice(i+1,n).toString("utf8"),d=f.replace(/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/g,""),l=d.split(":")[0].toLowerCase().replace(/[. ]+$/,"");if(f.includes("\\")||f.includes("/")||"."===d||".."===d||".git"===l||/^\.?git~[1-9]$/.test(l))throw new o(f);const h=t.slice(n+1,n+21).toString("hex");r=n+21,e.push({mode:s,path:f,oid:h,type:c})}return e}(t);else{if(!Array.isArray(t))throw new a("invalid type passed to GitTree constructor");this._entries=t.map(ut)}this._entries.sort(l)}static from(t){return new pt(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join("\n")}toObject(){const t=[...this._entries];return t.sort(dt),Buffer.concat(t.map(t=>{const e=Buffer.from(t.mode.replace(/^0/,"")),r=Buffer.from(" "),i=Buffer.from(t.path,"utf8"),n=Buffer.from([0]),a=Buffer.from(t.oid,"hex");return Buffer.concat([e,r,i,n,a])}))}entries(){return this._entries}*[Symbol.iterator](){for(const t of this._entries)yield t}}class gt{static wrap({type:t,object:e}){const r=`${t} ${e.length}\0`,i=r.length,n=i+e.length,a=new Uint8Array(n);for(let t=0;t<i;t++)a[t]=r.charCodeAt(t);return a.set(e,i),a}static unwrap(t){const e=t.indexOf(32),r=t.indexOf(0),i=t.slice(0,e).toString("utf8"),n=t.slice(e+1,r).toString("utf8"),o=t.length-(r+1);if(parseInt(n)!==o)throw new a(`Length mismatch: expected ${n} bytes but got ${o} instead.`);return{type:i,object:Buffer.from(t.slice(r+1))}}}async function wt({fs:t,gitdir:e,oid:r}){const i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}var mt=r(2566);function yt(t,e){const r=new s(t),i=bt(r);if(i!==e.byteLength)throw new a(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);const n=bt(r);let o;const c=vt(r,e);if(c.byteLength===n)o=c;else{const t=[c];let i=c.byteLength;for(;!r.eof();){const n=vt(r,e);t.push(n),i+=n.byteLength}if(n!==i)throw new a(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${i} bytes`);o=Buffer.concat(t,n)}return o}function bt(t){let e=0,r=0,i=null;do{i=t.readUInt8(),e|=(127&i)<<r,r+=7}while(128&i);return e}function _t(t,e,r){let i=0,n=0;for(;r--;)1&e&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}function vt(t,e){const r=t.readUInt8();if(128&r){const i=_t(t,15&r,4);let n=_t(t,(112&r)>>4,3);return 0===n&&(n=65536),e.slice(i,i+n)}return t.slice(r)}var xt=r(1668);function kt(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:function(t){let e=[t];return{next:()=>Promise.resolve({done:0===e.length,value:e.pop()}),return:()=>(e=[],{}),[Symbol.asyncIterator](){return this}}}(t)}class Et{constructor(t){if("undefined"==typeof Buffer)throw new Error("Missing Buffer dependency");this.stream=kt(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),this.cursor!==this.buffer.length||(await this._loadnext(),!this._ended)))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),this.cursor!==this.buffer.length||(await this._loadnext(),!this._ended)))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:e}=await this.stream.next();return t&&(this._ended=!0,!e)?Buffer.alloc(0):(e&&(e=Buffer.from(e)),e)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;const e=[this.buffer];for(;this.cursor+t>At(e);){const t=await this._next();if(this._ended)break;e.push(t)}this.buffer=Buffer.concat(e)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}}function At(t){return t.reduce((t,e)=>t+e.length,0)}async function St(t){let e=await t.byte();const r=e>>4&7;let i,n,a=15&e;if(128&e){let r=4;do{e=await t.byte(),a|=(127&e)<<r,r+=7}while(128&e)}if(6===r){let r=0;i=0;const a=[];do{e=await t.byte(),i|=(127&e)<<r,r+=7,a.push(e)}while(128&e);n=Buffer.from(a)}return 7===r&&(n=await t.read(20)),{type:r,length:a,ofs:i,reference:n}}class Bt extends e{constructor(t){super(`Invalid compressed buffer: ${t}`),this.code=this.name=Bt.code,this.data={message:t}}}Bt.code="DecompressionError";let $t=!1;async function Rt(t){null===$t&&($t=function(){try{if(new DecompressionStream("deflate"))return!0}catch(t){}return!1}());try{return $t?await async function(t){const e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);try{return new Uint8Array(await new Response(r).arrayBuffer())}catch(t){if(t&&"TypeError"===t.name&&""===t.message)throw new Bt("decompression failed");throw t}}(t):xt.inflate(t)}catch(t){if("string"==typeof t)throw new Bt(t);throw t}}function Pt(t){const e=[];let r=0,i=0;do{r=t.readUInt8();const n=127&r;e.push(n),i=128&r}while(i);return e.reduce((t,e)=>t+1<<7|e,-1)}class It{constructor(t){this.maxBytes=t,this.bytes=0,this.map=new Map}get(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){const r=e.object.byteLength;if(!(r>this.maxBytes/4)){this.map.set(t,e),this.bytes+=r;for(const[t,e]of this.map){if(this.bytes<=this.maxBytes)break;this.map.delete(t),this.bytes-=e.object.byteLength}}}}class Ot{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:e}){const r=new s(t);if("ff744f63"!==r.slice(4).toString("hex"))return;const i=r.readUInt32BE();if(2!==i)throw new a(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2147483648)throw new a("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");r.seek(r.tell()+1020);const n=r.readUInt32BE(),o=[];for(let t=0;t<n;t++){const e=r.slice(20).toString("hex");o[t]=e}r.seek(r.tell()+4*n);const c=new Map;for(let t=0;t<n;t++)c.set(o[t],r.readUInt32BE());const f=r.slice(20).toString("hex");return new Ot({hashes:o,crcs:{},offsets:c,packfileSha:f,getExternalRefDelta:e})}static async fromPack({pack:t,getExternalRefDelta:e,onProgress:r}){const i={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},n={},o=t.slice(-20).toString("hex"),c=[],f={},d=new Map;let l=null,h=null;const u=new It(33554432),p=new Map;await async function(t,e){const r=new Et(t);let i=await r.read(4);if(i=i.toString("utf8"),"PACK"!==i)throw new a(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),2!==n)throw new a(`Invalid packfile version: ${n}`);let o=await r.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!r.eof()&&o--;){const t=r.tell(),{type:i,length:n,ofs:s,reference:c}=await St(r),f=new xt.Inflate;for(;!f.result;){const d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new a(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==n)throw new a("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);const l=r.tell();await e({data:f.result,type:i,num:o,offset:t,end:l,reference:c,ofs:s})}}}}([t],async({data:t,type:e,reference:o,offset:c,num:f})=>{null===l&&(l=f);const d=Math.floor(100*(l-f)/l);d!==h&&r&&await r({phase:"Receiving objects",loaded:l-f,total:l}),h=d,(["commit","tree","blob","tag"].includes(e=i[e])||"ofs-delta"===e||"ref-delta"===e)&&(n[c]={type:e,offset:c});const g=n[c];if(!g)return;const w=function({type:t,data:e,reference:r,offset:i},n,o){const c=Buffer.from(e.buffer,e.byteOffset,e.byteLength);if("ofs-delta"!==t&&"ref-delta"!==t)return{type:t,object:c};const f="ofs-delta"===t?i-Pt(new s(r)):o.get(r.toString("hex")),d=n.get(f);if(!d)return null;try{return{type:d.type,object:Buffer.from(yt(c,d.object))}}catch(t){if(t instanceof a||t instanceof RangeError)return null;throw t}}({type:e,data:t,reference:o,offset:c},u,p);w&&(g.oid=await y(gt.wrap(w)),p.set(g.oid,c),u.set(c,w))});const g=Object.keys(n).map(Number);for(const[e,r]of g.entries()){const i=e+1===g.length?t.byteLength-20:g[e+1],a=n[r],o=mt.buf(t.slice(r,i))>>>0;a.end=i,a.crc=o}const w=new Ot({pack:Promise.resolve(t),packfileSha:o,crcs:f,hashes:c,offsets:d,getExternalRefDelta:e});h=null;let m=0;const b=[0,0,0,0,0,0,0,0,0,0,0,0];for(let t in n){t=Number(t);const e=Math.floor(100*m/l);e!==h&&r&&await r({phase:"Resolving deltas",loaded:m,total:l}),m++,h=e;const i=n[t];if(!i.oid)try{w.readDepth=0,w.externalReadDepth=0;const{type:e,object:r}=await w.readSlice({start:t});b[w.readDepth]+=1,i.oid=await y(gt.wrap({type:e,object:r}))}catch(t){continue}c.push(i.oid),d.set(i.oid,t),f[i.oid]=i.crc}return c.sort(),w}async toBuffer(){const t=[],e=(e,r)=>{t.push(Buffer.from(e,r))};e("ff744f63","hex"),e("00000002","hex");const r=new s(Buffer.alloc(1024));for(let t=0;t<256;t++){let e=0;for(const r of this.hashes)parseInt(r.slice(0,2),16)<=t&&e++;r.writeUInt32BE(e)}t.push(r.buffer);for(const t of this.hashes)e(t,"hex");const i=new s(Buffer.alloc(4*this.hashes.length));for(const t of this.hashes)i.writeUInt32BE(this.crcs[t]);t.push(i.buffer);const n=new s(Buffer.alloc(4*this.hashes.length));for(const t of this.hashes)n.writeUInt32BE(this.offsets.get(t));t.push(n.buffer),e(this.packfileSha,"hex");const a=Buffer.concat(t),o=await y(a),c=Buffer.alloc(20);return c.write(o,"hex"),Buffer.concat([a,c])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new a(`Could not read object ${t} from packfile`)}const e=this.offsets.get(t);return this.readSlice({start:e})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;const e=await this.pack;if(!e)throw new a("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");const r=e.slice(t),i=new s(r),n=i.readUInt8(),o=112&n;let c={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"}[o];if(void 0===c)throw new a("Unrecognized type: 0b"+o.toString(2));const f=15&n;let d=f;128&n&&(d=function(t,e){let r=e,i=4,n=null;do{n=t.readUInt8(),r|=(127&n)<<i,i+=7}while(128&n);return r}(i,f));let l=null,h=null;if("ofs_delta"===c){const e=t-Pt(i);({object:l,type:c}=await this.readSlice({start:e}))}if("ref_delta"===c){const t=i.slice(20).toString("hex");({object:l,type:c}=await this.read({oid:t}))}const u=r.slice(i.tell());if(h=Buffer.from(await Rt(u)),h.byteLength!==d)throw new a(`Packfile told us object would have length ${d} but it had length ${h.byteLength}`);return l&&(h=Buffer.from(yt(h,l))),this.readDepth>3&&(this.offsetCache[t]={type:c,object:h}),{type:c,format:"content",object:h}}}const jt=Symbol("PackfileCache");function Ut({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:a}){e[jt]||(e[jt]=new Map);let o=e[jt].get(r);return o||(o=async function({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){const a=await t.read(e);return Ot.fromIdx({idx:a,getExternalRefDelta:r})}({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:a}),e[jt].set(r,o),o.catch(()=>{e[jt].get(r)===o&&e[jt].delete(r)})),o}async function Ct(t,e){const r=t.subarray(-20),i=Array.from(r).map(t=>t.toString(16).padStart(2,"0")).join("");if(i!==e)throw new a(`Packfile trailer mismatch: expected ${e}, got ${i}. The packfile may be corrupted.`);const n=await async function(t,{start:e=0,end:r=t.length}={}){return y(t.subarray(e,r))}(t,{start:0,end:t.length-20});if(n!==e)throw new a(`Packfile payload corrupted: calculated ${n} but expected ${e}. The packfile may have been tampered with.`)}async function Tt({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){if(!["deflated","wrapped","content"].includes(n))throw new a(`invalid requested format "${n}"`);const o=i=>Tt({fs:t,cache:e,gitdir:r,oid:i});let s;if("4b825dc642cb6eb9a060e54bf8d69288fbee4904"===i&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await wt({fs:t,gitdir:r,oid:i})),!s){if(s=await async function({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:o}){let s=await t.readdir(q(r,"objects/pack"));s=s.filter(t=>t.endsWith(".idx"));for(const n of s){const s=`${r}/objects/pack/${n}`,c=await Ut({fs:t,cache:e,filename:s,getExternalRefDelta:o});if(c.error)throw new a(c.error);if(c.offsets.has(i)){const e=s.replace(/idx$/,"pack");if(!c.pack){const r=t.read(e);c.pack=r,r.catch(()=>{c.pack===r&&(c.pack=null)})}const r=await c.pack;if(!r)throw c.pack=null,new a(`Could not read packfile at ${e}. The file may be missing, corrupted, or too large to read into memory.`);c._checksumVerification||(c._checksumVerification=Ct(r,c.packfileSha)),await c._checksumVerification;const f=await c.read({oid:i,getExternalRefDelta:o});return f.format="content",f.source=`objects/pack/${n.replace(/idx$/,"pack")}`,f}}return null}({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o}),!s)throw new U(i);return s}if("deflated"===n)return s;if("deflated"===s.format&&(s.object=Buffer.from(await Rt(s.object)),s.format="wrapped"),"wrapped"===n)return s;const c=await y(s.object);if(c!==i)throw new a(`SHA check failed! Expected ${i}, computed ${c}`);const{object:f,type:d}=gt.unwrap(s.object);return s.type=d,s.object=f,s.format="content",s}function Mt({name:t,email:e,timestamp:r,timezoneOffset:i}){return`${t} <${e}> ${r} ${i=function(t){const e=function(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}(0===(r=t)?r:-r);var r;t=Math.abs(t);const i=Math.floor(t/60);t-=60*i;let n=String(i),a=String(t);return n.length<2&&(n="0"+n),a.length<2&&(a="0"+a),(-1===e?"-":"+")+n+a}(i)}`}function Dt(t){return(t=(t=t.replace(/\r/g,"")).replace(/^\n+/,"")).replace(/\n+$/,"")+"\n"}function Nt(t){const[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:Ft(n)}}function Ft(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=("+"===e?1:-1)*(60*Number(r)+Number(i)),0===(n=i)?n:-n;var n}class zt{constructor(t){if("string"==typeof t)this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else{if("object"!=typeof t)throw new a("invalid type passed to GitAnnotatedTag constructor");this._tag=zt.render(t)}}static from(t){return new zt(t)}static render(t){return`object ${t.object}\ntype ${t.type}\ntag ${t.tag}\ntagger ${Mt(t.tagger)}\n\n${t.message}\n${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf("\n\n"))}message(){const t=this.withoutSignature();return t.slice(t.indexOf("\n\n")+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){const t=this.justHeaders().split("\n"),e=[];for(const r of t)" "===r[0]?e[e.length-1]+="\n"+r.slice(1):e.push(r);const r={};for(const t of e){const e=t.slice(0,t.indexOf(" ")),i=t.slice(t.indexOf(" ")+1);Array.isArray(r[e])?r[e].push(i):r[e]=i}return r.tagger&&(r.tagger=Nt(r.tagger)),r.committer&&(r.committer=Nt(r.committer)),r}withoutSignature(){const t=Dt(this._tag);return-1===t.indexOf("\n-----BEGIN PGP SIGNATURE-----")?t:t.slice(0,t.lastIndexOf("\n-----BEGIN PGP SIGNATURE-----"))}gpgsig(){if(-1!==this._tag.indexOf("\n-----BEGIN PGP SIGNATURE-----"))return Dt(this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27))}payload(){return this.withoutSignature()+"\n"}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,e,r){const i=t.payload();let{signature:n}=await e({payload:i,secretKey:r});n=Dt(n);const a=i+n;return zt.from(a)}}function Lt(t){return t.trim().split("\n").map(t=>" "+t).join("\n")+"\n"}class Ht{constructor(t){if("string"==typeof t)this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else{if("object"!=typeof t)throw new a("invalid type passed to GitCommit constructor");this._commit=Ht.render(t)}}static fromPayloadSignature({payload:t,signature:e}){const r=Ht.justHeaders(t),i=Ht.justMessage(t),n=Dt(r+"\ngpgsig"+Lt(e)+"\n"+i);return new Ht(n)}static from(t){return new Ht(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return Ht.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Dt(t.slice(t.indexOf("\n\n")+2))}static justHeaders(t){return t.slice(0,t.indexOf("\n\n"))}parseHeaders(){const t=Ht.justHeaders(this._commit).split("\n"),e=[];for(const r of t)" "===r[0]?e[e.length-1]+="\n"+r.slice(1):e.push(r);const r={parent:[]};for(const t of e){const e=t.slice(0,t.indexOf(" ")),i=t.slice(t.indexOf(" ")+1);Array.isArray(r[e])?r[e].push(i):r[e]=i}return r.author&&(r.author=Nt(r.author)),r.committer&&(r.committer=Nt(r.committer)),r}static renderHeaders(t){let e="";if(t.tree?e+=`tree ${t.tree}\n`:e+="tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\n",t.parent){if(void 0===t.parent.length)throw new a("commit 'parent' property should be an array");for(const r of t.parent)e+=`parent ${r}\n`}return e+=`author ${Mt(t.author)}\n`,e+=`committer ${Mt(t.committer||t.author)}\n`,t.gpgsig&&(e+="gpgsig"+Lt(t.gpgsig)),e}static render(t){return Ht.renderHeaders(t)+"\n"+Dt(t.message)}render(){return this._commit}withoutSignature(){const t=Dt(this._commit);return-1===t.indexOf("\ngpgsig")?t:Dt(t.slice(0,t.indexOf("\ngpgsig"))+"\n"+t.slice(t.indexOf("-----END PGP SIGNATURE-----\n")+28))}isolateSignature(){return this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27).split("\n").map(t=>t.replace(/^ /,"")).join("\n")}static async sign(t,e,r){const i=t.withoutSignature(),n=Ht.justMessage(t._commit);let{signature:a}=await e({payload:i,secretKey:r});a=Dt(a);const o=Ht.justHeaders(t._commit)+"\ngpgsig"+Lt(a)+"\n"+n;return Ht.from(o)}}async function Wt({fs:t,cache:e,gitdir:r,oid:i}){if("4b825dc642cb6eb9a060e54bf8d69288fbee4904"===i)return{tree:pt.from([]),oid:i};const{type:n,object:a}=await Tt({fs:t,cache:e,gitdir:r,oid:i});if("tag"===n)return Wt({fs:t,cache:e,gitdir:r,oid:i=zt.from(a).parse().object});if("commit"===n)return Wt({fs:t,cache:e,gitdir:r,oid:i=Ht.from(a).parse().tree});if("tree"!==n)throw new C(i,n,"tree");return{tree:pt.from(a),oid:i}}class Gt{constructor({fs:t,gitdir:e,ref:r,cache:i}){this.fs=t,this.cache=i,this.gitdir=e,this.mapPromise=(async()=>{const i=new Map;let n;try{n=await ft.resolve({fs:t,gitdir:e,ref:r})}catch(i){if(!(i instanceof U&&await ft.isUnbornBranch({fs:t,gitdir:e,ref:r})))throw i;n="4b825dc642cb6eb9a060e54bf8d69288fbee4904"}const a=await Wt({fs:t,cache:this.cache,gitdir:e,oid:n});return a.type="tree",a.mode="40000",i.set(".",a),i})();const n=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(t){const e=t._fullpath,{fs:r,cache:i,gitdir:n}=this,a=await this.mapPromise,o=a.get(e);if(!o)throw new Error(`No obj for ${e}`);const s=o.oid;if(!s)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if("tree"!==o.type)return null;const{type:c,object:f}=await Tt({fs:r,cache:i,gitdir:n,oid:s});if(c!==o.type)throw new C(s,c,o.type);const d=pt.from(f);for(const t of d)a.set(q(e,t.path),t);return d.entries().map(t=>q(e,t.path))}async type(t){if(!1===t._type){const e=await this.mapPromise,{type:r}=e.get(t._fullpath);t._type=r}return t._type}async mode(t){if(!1===t._mode){const e=await this.mapPromise,{mode:r}=e.get(t._fullpath);t._mode=h(parseInt(r,8))}return t._mode}async stat(t){}async content(t){if(!1===t._content){const e=await this.mapPromise,{fs:r,cache:i,gitdir:n}=this,a=e.get(t._fullpath).oid,{type:o,object:s}=await Tt({fs:r,cache:i,gitdir:n,oid:a});t._content="blob"!==o?void 0:new Uint8Array(s)}return t._content}async oid(t){if(!1===t._oid){const e=(await this.mapPromise).get(t._fullpath);t._oid=e.oid}return t._oid}}function qt({ref:t="HEAD"}={}){const e=Object.create(null);return Object.defineProperty(e,O,{value:function({fs:e,gitdir:r,cache:i}){return new Gt({fs:e,gitdir:r,ref:t,cache:i})}}),Object.freeze(e),e}class Zt{constructor({fs:t,dir:e,gitdir:r,cache:i,refresh:n=!0}){this.fs=t,this.cache=i,this.dir=e,this.gitdir=r,this.refresh=n,this.refreshQueue=[],this.flushed=!1,this.config=null;const a=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){if("tree"!==await t.type())return null;const e=t._fullpath,{fs:r,dir:i}=this,n=await r.readdir(q(i,e));return null===n?null:n.map(t=>q(e,t))}async type(t){return!1===t._type&&await t.stat(),t._type}async mode(t){return!1===t._mode&&await t.stat(),t._mode}async stat(t){if(!1===t._stat){const{fs:e,dir:r}=this;let i=await e.lstat(`${r}/${t._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let n=i.isDirectory()?"tree":"blob";"blob"!==n||i.isFile()||i.isSymbolicLink()||(n="special"),t._type=n,i=g(i),t._mode=i.mode,-1===i.size&&t._actualSize&&(i.size=t._actualSize),t._stat=i}return t._stat}async content(t){if(!1===t._content){const{fs:e,dir:r,gitdir:i}=this;if("tree"===await t.type())t._content=void 0;else{let n;if(await t.mode()>>12==10)n=await e.readlink(`${r}/${t._fullpath}`);else{const a=await this._getGitConfig(e,i),o=await a.get("core.autocrlf");n=await e.read(`${r}/${t._fullpath}`,{autocrlf:o})}t._actualSize=n.length,t._stat&&-1===t._stat.size&&(t._stat.size=t._actualSize),t._content=new Uint8Array(n)}}return t._content}async oid(t){if(!1===t._oid){const e=this,{fs:r,gitdir:i,cache:n}=this;let a;await B.acquire({fs:r,gitdir:i,cache:n},async function(n){const o=n.entriesMap.get(t._fullpath),s=await t.stat(),c=await e._getGitConfig(r,i),f=await c.get("core.filemode"),d="undefined"==typeof process||!("win32"===process.platform);if(!o||x(s,o,f,d)){const r=await t.content();void 0===r?a=void 0:(a=await y(gt.wrap({type:"blob",object:r})),e.refresh&&o&&a===o.oid&&(!f||s.mode===o.mode)&&x(s,o,f,d)&&(e.flushed?n.insert({filepath:t._fullpath,stats:s,oid:a}):e.refreshQueue.push({filepath:t._fullpath,stage:o,stats:s,oid:a})))}else a=o.oid}),t._oid=a}return t._oid}async flush(){const{fs:t,gitdir:e,cache:r,refreshQueue:i}=this;this.refreshQueue=[],this.flushed=!0,0!==i.length&&await B.acquire({fs:t,gitdir:e,cache:r},async t=>{for(const{filepath:e,stage:r,stats:n,oid:a}of i)t.entriesMap.get(e)===r&&t.insert({filepath:e,stats:n,oid:a})})}async _getGitConfig(t,e){return this.config||(this.config=await at.get({fs:t,gitdir:e})),this.config}}function Kt({refresh:t=!0}={}){const e=Object.create(null);return Object.defineProperty(e,O,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new Zt({fs:e,dir:r,gitdir:i,cache:n,refresh:t})}}),Object.freeze(e),e}const Vt=void 0===Array.prototype.flat?t=>t.reduce((t,e)=>t.concat(e),[]):t=>t.flat();class Yt{constructor(){this.value=null}consider(t){null!=t&&(null===this.value||t<this.value)&&(this.value=t)}reset(){this.value=null}}function*Xt(t){const e=new Yt;let r;const i=[],n=t.length;for(let r=0;r<n;r++)i[r]=t[r].next().value,void 0!==i[r]&&e.consider(i[r]);if(null!==e.value)for(;;){const a=[];r=e.value,e.reset();for(let o=0;o<n;o++)void 0!==i[o]&&i[o]===r?(a[o]=i[o],i[o]=t[o].next().value):a[o]=null,void 0!==i[o]&&e.consider(i[o]);if(yield a,null===e.value)return}}async function Jt({fs:t,cache:e,dir:r,gitdir:i,trees:n,map:a=async(t,e)=>e,reduce:o=async(t,e)=>{const r=Vt(e);return void 0!==t&&r.unshift(t),r},iterate:s=(t,e)=>Promise.all([...e].map(t))}){const c=n.map(n=>n[O]({fs:t,dir:r,gitdir:i,cache:e})),f=new Array(c.length).fill("."),d=function(t,e){const r=e-0;return Array.from({length:r},(t,e)=>0+e)}(0,c.length),l=async t=>{const{entries:e,children:r}=await(async t=>{d.forEach(e=>{const r=t[e];t[e]=r&&new c[e].ConstructEntry(r)});const e=(await Promise.all(d.map(e=>{const r=t[e];return r?c[e].readdir(r):[]}))).map(t=>(null===t?[]:t)[Symbol.iterator]());return{entries:t,children:Xt(e)}})(t),i=e.find(t=>t&&t._fullpath)._fullpath,n=await a(i,e);if(null!==n){let t=await s(l,r);return t=t.filter(t=>void 0!==t),o(n,t)}},h=await l(f);for(const t of c)t.flush&&await t.flush();return h}class Qt extends e{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=Qt.code,this.data={filepath:t}}}Qt.code="IndexResetError";var te=r(6867);async function ee(t,e,r=10){try{await t(e)}catch(i){if(null===i)return;if("EEXIST"===i.code)return;if("ENOENT"!==i.code)throw i;const n=R(e);if("."===n||"/"===n||n===e)throw i;await ee(t,n,r);for(let i=0;;i++)try{return void await t(e)}catch(t){if(null===t||"EEXIST"===t.code)return;if("ENOENT"===t.code&&i<r){await new Promise(t=>setTimeout(t,0));continue}throw t}}}async function re(t,e){const r=await t.readdir(e);null==r?await t.rm(e):r.length?await Promise.all(r.map(r=>{const i=q(e,r);return t.lstat(i).then(e=>{if(e)return e.isDirectory()?re(t,i):t.rm(i)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function ie(t){return"function"==typeof t}function ne(t){const e=t.code;return"string"==typeof e&&("ENOENT"===e||"ENOTDIR"===e||e.includes("ENS"))}function ae(t){return function(t){return t&&"object"==typeof t}(e=(t=>{try{return t.readFile().catch(t=>t)}catch(t){return t}})(t))&&ie(e.then)&&ie(e.catch);var e}const oe=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function se(t,e){if(ae(e))for(const r of oe)t[`_${r}`]=e[r].bind(e);else for(const r of oe)t[`_${r}`]=te(e[r].bind(e));ae(e)?(e.cp&&(t._cp=e.cp.bind(e)),e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=re.bind(null,t)):(e.cp&&(t._cp=te(e.cp.bind(e))),e.rm?t._rm=te(e.rm.bind(e)):e.rmdir.length>2?t._rm=te(e.rmdir.bind(e)):t._rm=re.bind(null,t))}class ce{constructor(t){if(void 0!==t._original_unwrapped_fs)return t;const e=Object.getOwnPropertyDescriptor(t,"promises");e&&e.enumerable?se(this,t.promises):se(this,t),this._original_unwrapped_fs=t}async exists(t,e={}){try{return await this._stat(t),!0}catch(t){if(ne(t))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',t),t}}async read(t,e={}){let r;try{r=await this._readFile(t,e)}catch(t){if(ne(t)||"EISDIR"===t.code)return null;throw t}if(null==r)return null;if("true"===e.autocrlf)try{r=new TextDecoder("utf8",{fatal:!0}).decode(r),r=r.replace(/\r\n/g,"\n"),r=(new TextEncoder).encode(r)}catch(t){}return"string"!=typeof r&&(r=Buffer.from(r)),r}async write(t,e,r={}){try{await this._writeFile(t,e,r)}catch(i){await this.mkdir(R(t)),await this._writeFile(t,e,r)}}async mkdir(t){await ee(this._mkdir,t)}async rm(t){try{await this._unlink(t)}catch(t){if("ENOENT"!==t.code)throw t}}async rmdir(t,e){try{e&&e.recursive?await this._rm(t,e):await this._rmdir(t)}catch(t){if("ENOENT"!==t.code)throw t}}async readdir(t){let e;try{e=await this._readdir(t)}catch(t){if("ENOTDIR"===t.code)return null;if(ne(t))return[];throw t}return e.sort(d),e}async readdirDeep(t){const e=await this._readdir(t);return(await Promise.all(e.map(async e=>{const r=t+"/"+e;return(await this._stat(r)).isDirectory()?this.readdirDeep(r):r}))).reduce((t,e)=>t.concat(e),[])}async lstat(t){try{return await this._lstat(t)}catch(t){if(ne(t))return null;throw t}}async readlink(t,e={encoding:"buffer"}){try{const r=await this._readlink(t,e);return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(t){if(ne(t))return null;throw t}}async writelink(t,e){return this._symlink(e.toString("utf8"),t)}}class fe extends e{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=fe.code,this.data={parameter:t}}}function de(t,e){if(void 0===e)throw new fe(t)}async function le({fsp:t,dotgit:e}){de("fsp",t),de("dotgit",e);const r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(t=>t.trimRight().substr(8)).then(t=>{return(r=t).startsWith("/")||/^[a-zA-Z]:[\\/]/.test(r)?t:q(R(e),t);var r}):e}async function he(t,e){return!(!t&&!e||(!t||e)&&(t||!e)&&("tree"===await t.type()&&"tree"===await e.type()||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid()))}async function ue({fs:t,dir:e,gitdir:r=q(e,".git"),commit:i="HEAD",cache:n={}}){try{de("fs",t),de("dir",e),de("gitdir",r);const a=new ce(t),o=[qt({ref:i}),Kt(),j()];let s=[];const c=await le({fsp:a,dotgit:r});await B.acquire({fs:a,gitdir:c,cache:n},async function(t){s=t.unmergedPaths});const f=await Jt({fs:a,cache:n,dir:e,gitdir:c,trees:o,map:async function(t,[e,r,i]){const n=!await he(r,i),a=s.includes(t),o=!await he(i,e);if(n||a)return e?{path:t,mode:await e.mode(),oid:await e.oid(),type:await e.type(),content:await e.content()}:void 0;if(o)return!1;throw new Qt(t)}});await B.acquire({fs:a,gitdir:c,cache:n},async function(t){for(const r of f)if(!1!==r)if(r){if("blob"===r.type){const i=(new TextDecoder).decode(r.content);await a.write(`${e}/${r.path}`,i,{mode:r.mode}),t.insert({filepath:r.path,oid:r.oid,stage:0})}}else await a.rmdir(`${e}/${r.path}`,{recursive:!0}),t.delete({filepath:r.path})})}catch(t){throw t.caller="git.abortMerge",t}}fe.code="MissingParameterError";class pe extends e{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=pe.code,this.data={errors:t},this.errors=t}}pe.code="MultipleGitError";var ge=r(2535);class we{static async isIgnored({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i}){if(".git"===$(i))return!0;if("."===i)return!1;let n="";const a=q(r,"info","exclude");await t.exists(a)&&(n=await t.read(a,"utf8"));const o=[{gitignore:q(e,".gitignore"),filepath:i}],s=i.split("/").filter(Boolean);for(let t=1;t<s.length;t++){const r=s.slice(0,t).join("/"),i=s.slice(t).join("/");o.push({gitignore:q(e,r,".gitignore"),filepath:i})}let c=!1;for(const[e,r]of o.entries()){const i=await t.read(r.gitignore,"utf8"),a=ge();0===e&&a.add(n),a.add(i);const o=R(r.filepath);if("."!==o&&a.ignores(o))return!0;c=c?!a.test(r.filepath).unignored:a.test(r.filepath).ignored}return c}}let me=null;async function ye(t){return null===me&&(me=function(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(t){return!1}}()),me?async function(t){const e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}(t):xt.deflate(t)}async function be({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:o,dryRun:s=!1}){return"deflated"!==n&&("wrapped"!==n&&(i=gt.wrap({type:r,object:i})),o=await y(i),i=Buffer.from(await ye(i))),s||await async function({fs:t,gitdir:e,object:r,format:i,oid:n}){if("deflated"!==i)throw new a("GitObjectStoreLoose expects objects to write to be in deflated format");const o=`${e}/objects/${n.slice(0,2)}/${n.slice(2)}`;await t.exists(o)||await t.write(o,r)}({fs:t,gitdir:e,object:i,format:"deflated",oid:o}),o}function _e(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}async function ve({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i,cache:n={},force:a=!1,parallel:o=!0}){try{de("fs",t),de("dir",e),de("gitdir",r),de("filepath",i);const s=new ce(t),c=await le({fsp:s,dotgit:r});await B.acquire({fs:s,gitdir:c,cache:n},async t=>{const r=await at.get({fs:s,gitdir:c}),n=await r.get("core.autocrlf");return xe({dir:e,gitdir:c,fs:s,filepath:i,index:t,force:a,parallel:o,autocrlf:n})})}catch(t){throw t.caller="git.add",t}}async function xe({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:a,parallel:o,autocrlf:s}){const c=(i=Array.isArray(i)?i:[i]).map(async i=>{if(!a&&!function(t,e){if(t.has({filepath:e}))return!0;const r=`${e}/`;for(const e of t.entriesMap.keys())if(e.startsWith(r))return!0;return!1}(n,i)&&await we.isIgnored({fs:r,dir:t,gitdir:e,filepath:i}))return;const c=await r.lstat(q(t,i));if(!c)throw new U(i);if(c.isDirectory()){const c=await r.readdir(q(t,i));if(o){const f=c.map(c=>xe({dir:t,gitdir:e,fs:r,filepath:[q(i,c)],index:n,force:a,parallel:o,autocrlf:s}));await Promise.all(f)}else for(const f of c)await xe({dir:t,gitdir:e,fs:r,filepath:[q(i,f)],index:n,force:a,parallel:o,autocrlf:s})}else{const a=c.isSymbolicLink()?await r.readlink(q(t,i)).then(_e):await r.read(q(t,i),{autocrlf:s});if(null===a)throw new U(i);const o=await be({fs:r,gitdir:e,type:"blob",object:a});n.insert({filepath:i,stats:c,oid:o})}}),f=await Promise.allSettled(c),d=f.filter(t=>"rejected"===t.status).map(t=>t.reason);if(d.length>1)throw new pe(d);if(1===d.length)throw d[0];return f.filter(t=>"fulfilled"===t.status&&t.value).map(t=>t.value)}class ke extends e{constructor(){super("Cannot create an empty commit when disallowEmpty is true."),this.code=this.name=ke.code,this.data={}}}ke.code="EmptyCommitError";class Ee extends e{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=Ee.code,this.data={role:t}}}Ee.code="MissingNameError";class Ae extends e{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Ae.code,this.data={ref:t}}}async function Se({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=await async function({fs:t,gitdir:e,oid:r}){const i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}({fs:t,gitdir:r,oid:i});return o||(o=await async function({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let o=await t.readdir(q(r,"objects/pack"));o=o.filter(t=>t.endsWith(".idx"));for(const s of o){const o=`${r}/objects/pack/${s}`,c=await Ut({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(c.error)throw new a(c.error);if(c.offsets.has(i))return!0}return!1}({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:i=>Tt({fs:t,cache:e,gitdir:r,oid:i})})),o}async function Be({fs:t,gitdir:e,path:r}){return(await at.get({fs:t,gitdir:e})).get(r)}function $e(t,...e){for(const r of e)if(r)for(const e of Object.keys(r)){const i=r[e];void 0!==i&&(t[e]=i)}return t}async function Re({fs:t,gitdir:e,author:r,commit:i}){const n=Math.floor(Date.now()/1e3),a=$e({},{name:await Be({fs:t,gitdir:e,path:"user.name"}),email:await Be({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(1e3*n).getTimezoneOffset()},i?i.author:void 0,r);if(void 0!==a.name)return a}async function Pe({fs:t,gitdir:e,author:r,committer:i,commit:n}){const a=Math.floor(Date.now()/1e3),o=$e({},{name:await Be({fs:t,gitdir:e,path:"user.name"}),email:await Be({fs:t,gitdir:e,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(1e3*a).getTimezoneOffset()},n?n.committer:void 0,r,i);if(void 0!==o.name)return o}async function Ie({fs:t,cache:e,gitdir:r,oid:i}){const{type:n,object:a}=await Tt({fs:t,cache:e,gitdir:r,oid:i});if("tag"===n)return Ie({fs:t,cache:e,gitdir:r,oid:i=zt.from(a).parse().object});if("commit"!==n)throw new C(i,n,"commit");return{commit:Ht.from(a),oid:i}}async function Oe({fs:t,cache:e,gitdir:r,oid:i}){const{commit:n,oid:a}=await Ie({fs:t,cache:e,gitdir:r,oid:i});return{oid:a,commit:n.parse(),payload:n.withoutSignature()}}Ae.code="NoCommitError";const je="4b825dc642cb6eb9a060e54bf8d69288fbee4904";async function Ue({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:f=!1,noUpdateBranch:d=!1,disallowEmpty:l=!1,ref:h,parent:u,tree:p}){let g,w,m=!1,y=!1;if(!h){const e=await t.read(`${i}/HEAD`,{encoding:"utf8"});y=!e.startsWith("ref:"),h=await ft.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2})}try{g=await ft.resolve({fs:t,gitdir:i,ref:h})}catch(t){if(!(t instanceof U))throw t;m=!0}if(m||!c&&!l||(w=await Oe({fs:t,gitdir:i,oid:g,cache:e})),c&&m)throw new Ae(h);const b=c?await Re({fs:t,gitdir:i,author:a,commit:w.commit}):await Re({fs:t,gitdir:i,author:a});if(!b)throw new Ee("author");const _=c?await Pe({fs:t,gitdir:i,author:b,committer:o,commit:w.commit}):await Pe({fs:t,gitdir:i,author:b,committer:o});if(!_)throw new Ee("committer");return B.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(a){const o=P(a.entries).get(".");if(p||(p=await Ce({fs:t,gitdir:i,inode:o,dryRun:f})),u=u?await Promise.all(u.map(async r=>{let n=await ft.resolve({fs:t,gitdir:i,ref:r});for(;await Se({fs:t,cache:e,gitdir:i,oid:n});){const{type:r,object:a}=await Tt({fs:t,cache:e,gitdir:i,oid:n});if("commit"===r)break;if("tag"!==r)throw new C(n,r,"commit");n=zt.from(a).parse().object}return n})):c?w.commit.parent:g?[g]:[],l&&!c&&(m&&p===je||!m&&p===w.commit.tree))throw new ke;if(!n){if(!c)throw new fe("message");n=w.commit.message}let v=Ht.from({tree:p,parent:u,author:b,committer:_,message:n});s&&(v=await Ht.sign(v,r,s));const x=await be({fs:t,gitdir:i,type:"commit",object:v.toObject(),dryRun:f});return d||f||await ft.writeRef({fs:t,gitdir:i,ref:y?"HEAD":h,value:x}),x})}async function Ce({fs:t,gitdir:e,inode:r,dryRun:i}){const n=r.children;for(const r of n)"tree"===r.type&&(r.metadata.mode="040000",r.metadata.oid=await Ce({fs:t,gitdir:e,inode:r,dryRun:i}));const a=n.map(t=>({mode:t.metadata.mode,path:t.basename,oid:t.metadata.oid,type:t.type})),o=pt.from(a);return await be({fs:t,gitdir:e,type:"tree",object:o.toObject(),dryRun:i})}class Te extends e{constructor(t){let e="invalid filepath";"leading-slash"===t||"trailing-slash"===t?e='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':"directory"===t&&(e='"filepath" should not be a directory.'),super(e),this.code=this.name=Te.code,this.data={reason:t}}}async function Me({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){return(await De({fs:t,cache:e,gitdir:r,oid:i,filepath:n})).oid}async function De({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Te("leading-slash");if(n.endsWith("/"))throw new Te("trailing-slash");const a=i,o=await Wt({fs:t,cache:e,gitdir:r,oid:i}),s=o.tree;return""===n?{mode:"040000",oid:o.oid,path:"",type:"tree"}:Ne({fs:t,cache:e,gitdir:r,tree:s,pathArray:n.split("/"),oid:a,filepath:n})}async function Ne({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:a,filepath:o}){const s=n.shift();for(const c of i)if(c.path===s){if(0===n.length)return c;{const{type:s,object:f}=await Tt({fs:t,cache:e,gitdir:r,oid:c.oid});if("tree"!==s)throw new C(a,s,"tree",o);return Ne({fs:t,cache:e,gitdir:r,tree:i=pt.from(f),pathArray:n,oid:a,filepath:o})}}throw new U(`file or directory found at "${a}:${o}"`)}async function Fe({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){void 0!==n&&(i=await Me({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));const{tree:a,oid:o}=await Wt({fs:t,cache:e,gitdir:r,oid:i});return{oid:o,tree:a.entries()}}async function ze({fs:t,gitdir:e,tree:r}){const i=pt.from(r).toObject();return await be({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}Te.code="InvalidFilepathError";class Le extends e{constructor(t,e,r=!0){super(`Failed to create ${t} at ${e} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=Le.code,this.data={noun:t,where:e,canForce:r}}}async function He({fs:t,onSign:e,dir:r,gitdir:i=q(r,".git"),ref:n="refs/notes/commits",oid:a,note:o,force:s,author:c,committer:f,signingKey:d,cache:l={}}){try{de("fs",t),de("gitdir",i),de("oid",a),de("note",o),d&&de("onSign",e);const r=new ce(t),h=await Re({fs:r,gitdir:i,author:c});if(!h)throw new Ee("author");const u=await Pe({fs:r,gitdir:i,author:h,committer:f});if(!u)throw new Ee("committer");const p=await le({fsp:r,dotgit:i});return await async function({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:a,note:o,force:s,author:c,committer:f,signingKey:d}){let l;try{l=await ft.resolve({gitdir:i,fs:t,ref:n})}catch(t){if(!(t instanceof U))throw t}let h=(await Fe({fs:t,cache:e,gitdir:i,oid:l||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(s)h=h.filter(t=>t.path!==a);else for(const t of h)if(t.path===a)throw new Le("note",a);"string"==typeof o&&(o=Buffer.from(o,"utf8"));const u=await be({fs:t,gitdir:i,type:"blob",object:o,format:"content"});h.push({mode:"100644",path:a,oid:u,type:"blob"});const p=await ze({fs:t,gitdir:i,tree:h});return await Ue({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:p,parent:l&&[l],message:"Note added by 'isomorphic-git addNote'\n",author:c,committer:f,signingKey:d})}({fs:r,cache:l,onSign:e,gitdir:p,ref:n,oid:a,note:o,force:s,author:h,committer:u,signingKey:d})}catch(t){throw t.caller="git.addNote",t}}async function We({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!G(r,!0))throw new D(r,T.clean(r));const a=await at.get({fs:t,gitdir:e});if(!n&&(await a.getSubsections("remote")).includes(r)&&i!==await a.get(`remote.${r}.url`))throw new Le("remote",r);await a.set(`remote.${r}.url`,i),await a.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await at.save({fs:t,gitdir:e,config:a})}async function Ge({fs:t,dir:e,gitdir:r=q(e,".git"),remote:i,url:n,force:a=!1}){try{de("fs",t),de("gitdir",r),de("remote",i),de("url",n);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await We({fs:e,gitdir:o,remote:i,url:n,force:a})}catch(t){throw t.caller="git.addRemote",t}}async function qe({fs:t,onSign:e,dir:r,gitdir:i=q(r,".git"),ref:n,tagger:a,message:o=n,gpgsig:s,object:c,signingKey:f,force:d=!1,cache:l={}}){try{de("fs",t),de("gitdir",i),de("ref",n),f&&de("onSign",e);const r=new ce(t),h=await le({fsp:r,dotgit:i}),u=await Re({fs:r,gitdir:h,author:a});if(!u)throw new Ee("tagger");return await async function({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:a,message:o=n,gpgsig:s,object:c,signingKey:f,force:d=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!d&&await ft.exists({fs:t,gitdir:i,ref:n}))throw new Le("tag",n);const l=await ft.resolve({fs:t,gitdir:i,ref:c||"HEAD"}),{type:h}=await Tt({fs:t,cache:e,gitdir:i,oid:l});let u=zt.from({object:l,type:h,tag:n.replace("refs/tags/",""),tagger:a,message:o,gpgsig:s});f&&(u=await zt.sign(u,r,f));const p=await be({fs:t,gitdir:i,type:"tag",object:u.toObject()});await ft.writeRef({fs:t,gitdir:i,ref:n,value:p})}({fs:r,cache:l,onSign:e,gitdir:h,ref:n,tagger:u,message:o,gpgsig:s,object:c,signingKey:f,force:d})}catch(t){throw t.caller="git.annotatedTag",t}}async function Ze({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i,object:n,checkout:a=!1,force:o=!1}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new ce(t),s=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:a=!1}){if(!G(r,!0))throw new D(r,T.clean(r));const o=`refs/heads/${r}`;if(!a&&await ft.exists({fs:t,gitdir:e,ref:o}))throw new Le("branch",r,!1);let s;try{s=await ft.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(t){if(!(t instanceof U))throw t}s&&(s=(await Ie({fs:t,cache:{},gitdir:e,oid:s})).oid,await ft.writeRef({fs:t,gitdir:e,ref:o,value:s})),n&&await ft.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:o})}({fs:e,gitdir:s,ref:i,object:n,checkout:a,force:o})}catch(t){throw t.caller="git.branch",t}}Le.code="AlreadyExistsError";class Ke extends e{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=Ke.code,this.data={filepaths:t}}}Ke.code="CheckoutConflictError";class Ve extends e{constructor(t,e){super(`Failed to checkout "${t}" because commit ${e} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Ve.code,this.data={ref:t,oid:e}}}async function Ye(t,e,r){const i=r.split("/");i.pop();let n=e;for(const e of i){if(""===e||"."===e)continue;n=`${n}/${e}`;const i=await t.lstat(n);if(i&&i.isSymbolicLink())throw new o(r)}}Ve.code="CommitNotFetchedError";const Xe=(t,e)=>{if("."===t||null==e||0===e.length||"."===e)return!0;const r=e.endsWith("/")?e.slice(0,-1):e;return"."===r||(r.length>=t.length?r===t||r.startsWith(`${t}/`):t.startsWith(`${r}/`))};async function Je({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:o,remote:s,ref:c,filepaths:f,noCheckout:d,noUpdateHead:l,dryRun:h,force:u,track:p=!0,restoreFromIndex:g=!1,nonBlocking:w=!1,batchSize:m=100}){let y,b;if(i)try{y=await ft.resolve({fs:t,gitdir:o,ref:"HEAD"})}catch(t){y="0000000000000000000000000000000000000000"}try{b=await ft.resolve({fs:t,gitdir:o,ref:c})}catch(e){if("HEAD"===c||!(e instanceof U))throw e;const r=`${s}/${c}`;if(b=await ft.resolve({fs:t,gitdir:o,ref:r}),p){const e=await at.get({fs:t,gitdir:o});await e.set(`branch.${c}.remote`,s),await e.set(`branch.${c}.merge`,`refs/heads/${c}`),await at.save({fs:t,gitdir:o,config:e})}await ft.writeRef({fs:t,gitdir:o,ref:`refs/heads/${c}`,value:b})}if(!l)try{b=(await Ie({fs:t,cache:e,gitdir:o,oid:b})).oid}catch(t){if(t instanceof U)throw new Ve(c,t.data.what);throw t}if(!d){let s;try{s=await async function({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:a,force:o,filepaths:s,restoreFromIndex:c}){let f=0;return Jt({fs:t,cache:e,dir:i,gitdir:n,trees:[c?j():qt({ref:a}),Kt(),j()],map:async function(t,[e,i,n]){if("."!==t){if(s&&!s.some(e=>Xe(t,e)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++f}),[!!n,!!e,!!i].map(Number).join("")){case"000":return;case"001":return!c&&o&&s&&s.includes(t)?["delete",t]:void 0;case"010":switch(await e.type()){case"tree":return["mkdir",t];case"blob":return["create",t,await e.oid(),await e.mode()];case"commit":return["mkdir-index",t,await e.oid(),await e.mode()];default:return["error",`new entry Unhandled type ${await e.type()}`]}case"011":switch(`${await e.type()}-${await i.type()}`){case"tree-tree":case"commit-tree":return;case"tree-blob":case"blob-tree":case"commit-blob":return["conflict",t];case"blob-blob":return await e.oid()!==await i.oid()?o?["update",t,await e.oid(),await e.mode(),await e.mode()!==await i.mode()]:["conflict",t]:await e.mode()!==await i.mode()?o?["update",t,await e.oid(),await e.mode(),!0]:["conflict",t]:["create-index",t,await e.oid(),await e.mode()];default:return["error",`new entry Unhandled type ${e.type}`]}case"100":return["delete-index",t];case"101":switch(await n.type()){case"tree":case"commit":return["rmdir-index",t];case"blob":return await n.oid()!==await i.oid()?o?["delete",t]:["conflict",t]:["delete",t];default:return["error",`delete entry Unhandled type ${await n.type()}`]}case"110":case"111":switch(`${await n.type()}-${await e.type()}`){case"tree-tree":return;case"blob-blob":if(await n.oid()===await e.oid()&&await n.mode()===await e.mode()&&!o)return;if(i){if(await i.oid()!==await n.oid()&&await i.oid()!==await e.oid())return o?["update",t,await e.oid(),await e.mode(),await e.mode()!==await i.mode()]:["conflict",t]}else if(o)return["update",t,await e.oid(),await e.mode(),await e.mode()!==await n.mode()];return await e.mode()!==await n.mode()?["update",t,await e.oid(),await e.mode(),!0]:await e.oid()!==await n.oid()?["update",t,await e.oid(),await e.mode(),!1]:void 0;case"tree-blob":return["update-dir-to-blob",t,await e.oid()];case"blob-tree":return["update-blob-to-tree",t];case"commit-commit":return["mkdir-index",t,await e.oid(),await e.mode()];default:return["error",`update entry Unhandled type ${await n.type()}-${await e.type()}`]}}}},reduce:async function(t,e){return e=Vt(e),t?t&&"rmdir"===t[0]?(e.push(t),e):(e.unshift(t),e):e}})}({fs:t,cache:e,onProgress:r,dir:n,gitdir:o,ref:c,force:u,filepaths:f,restoreFromIndex:g})}catch(t){throw t instanceof U&&t.data.what===b?new Ve(c,b):t}const d=s.filter(([t])=>"conflict"===t).map(([t,e])=>e);if(d.length>0)throw new Ke(d);const l=s.filter(([t])=>"error"===t).map(([t,e])=>e);if(l.length>0)throw new a(l.join(", "));if(h)return void(i&&await i({previousHead:y,newHead:b,type:null!=f&&f.length>0?"file":"branch"}));let p=0;const _=s.length;if(await B.acquire({fs:t,gitdir:o,cache:e},async function(e){await Promise.all(s.filter(([t])=>"delete"===t||"delete-index"===t).map(async function([i,a]){const o=`${n}/${a}`;"delete"===i&&await t.rm(o),e.delete({filepath:a}),r&&await r({phase:"Updating workdir",loaded:++p,total:_})}))}),await B.acquire({fs:t,gitdir:o,cache:e},async function(e){for(const[i,a]of s)if("rmdir"===i||"rmdir-index"===i){const o=`${n}/${a}`;try{"rmdir"===i&&await t.rmdir(o),e.delete({filepath:a}),r&&await r({phase:"Updating workdir",loaded:++p,total:_})}catch(t){if("ENOTEMPTY"!==t.code)throw t;console.log(`Did not delete ${a} because directory is not empty`)}}}),await Promise.all(s.filter(([t])=>"mkdir"===t||"mkdir-index"===t).map(async function([e,i]){const a=`${n}/${i}`;await Ye(t,n,i),await t.mkdir(a),r&&await r({phase:"Updating workdir",loaded:++p,total:_})})),w){const i=s.filter(([t])=>"create"===t||"create-index"===t||"update"===t||"mkdir-index"===t),c=await Qe("Update Working Dir",i.map(([r,i,s,c,f])=>()=>async function({fs:t,cache:e,gitdir:r,dir:i},[n,o,s,c,f]){const d=`${i}/${o}`;if("create-index"!==n&&"mkdir-index"!==n){await Ye(t,i,o);const{object:n}=await Tt({fs:t,cache:e,gitdir:r,oid:s});if(f&&await t.rm(d),33188===c)await t.write(d,n);else if(33261===c)await t.write(d,n,{mode:511});else{if(40960!==c)throw new a(`Invalid mode 0o${c.toString(8)} detected in blob ${s}`);await t.writelink(d,n)}}const l=await t.lstat(d);return 33261===c&&(l.mode=493),"mkdir-index"===n&&(l.mode=57344),[o,s,l]}({fs:t,cache:e,gitdir:o,dir:n},[r,i,s,c,f])),r,m);await B.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(t){await Qe("Update Index",c.map(([e,r,i])=>()=>async function({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(t){console.warn(`Error inserting ${e} into index:`,t)}}({index:t,fullpath:e,oid:r,stats:i})),r,m)})}else await B.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(i){const c=await Promise.allSettled(s.filter(([t])=>"create"===t||"create-index"===t||"update"===t||"mkdir-index"===t).map(async function([s,c,f,d,l]){const h=`${n}/${c}`;if("create-index"!==s&&"mkdir-index"!==s){await Ye(t,n,c);const{object:r}=await Tt({fs:t,cache:e,gitdir:o,oid:f});if(l&&await t.rm(h),33188===d)await t.write(h,r);else if(33261===d)await t.write(h,r,{mode:511});else{if(40960!==d)throw new a(`Invalid mode 0o${d.toString(8)} detected in blob ${f}`);await t.writelink(h,r)}}const u=await t.lstat(h);33261===d&&(u.mode=493),"mkdir-index"===s&&(u.mode=57344),i.insert({filepath:c,stats:u,oid:f}),r&&await r({phase:"Updating workdir",loaded:++p,total:_})})),f=[];for(const t of c)"rejected"===t.status&&(f.push(t.reason),console.error("[isomorphic-git checkout] task rejected:",t.reason?.stack??t.reason));if(f.length>0)throw new pe(f)});i&&await i({previousHead:y,newHead:b,type:null!=f&&f.length>0?"file":"branch"})}if(!l){const e=await ft.expand({fs:t,gitdir:o,ref:c});e.startsWith("refs/heads")?await ft.writeSymbolicRef({fs:t,gitdir:o,ref:"HEAD",value:e}):await ft.writeRef({fs:t,gitdir:o,ref:"HEAD",value:b})}}async function Qe(t,e,r,i){const n=[],a=[];for(let o=0;o<e.length;o+=i){const s=e.slice(o,o+i).map(t=>t());(await Promise.allSettled(s)).forEach(e=>{"fulfilled"===e.status?n.push(e.value):(a.push(e.reason),console.error(`[isomorphic-git ${t}] task rejected:`,e.reason?.stack??e.reason))}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:e.length})}if(a.length>0)throw new pe(a);return n}async function tr({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=q(i,".git"),remote:a="origin",ref:o,filepaths:s,noCheckout:c=!1,noUpdateHead:f=void 0===o,dryRun:d=!1,force:l=!1,track:h=!0,cache:u={},nonBlocking:p=!1,batchSize:g=100}){try{de("fs",t),de("dir",i),de("gitdir",n);const w=o||"HEAD",m=void 0===o&&null!=s&&s.length>0,y=new ce(t),b=await le({fsp:y,dotgit:n});return await Je({fs:y,cache:u,onProgress:e,onPostCheckout:r,dir:i,gitdir:b,remote:a,ref:w,filepaths:s,noCheckout:c,noUpdateHead:f,dryRun:d,force:l,track:h,restoreFromIndex:m,nonBlocking:p,batchSize:g})}catch(t){throw t.caller="git.checkout",t}}class er extends e{constructor(t){super(`Your local changes to the following files would be overwritten by cherry-pick: ${t.join(", ")}`),this.code=this.name=er.code,this.data={filepaths:t}}}er.code="CherryPickLocalChangesError";class rr extends e{constructor(t,e){super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${e} parents and require specifying which parent to use as the base.`),this.code=this.name=rr.code,this.data={oid:t,parentCount:e}}}rr.code="CherryPickMergeCommitError";class ir extends e{constructor(t){super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`),this.code=this.name=ir.code,this.data={oid:t}}}ir.code="CherryPickRootCommitError";class nr extends e{constructor(t,e,r,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=nr.code,this.data={filepaths:t,bothModified:e,deleteByUs:r,deleteByTheirs:i}}}nr.code="MergeConflictError";class ar extends e{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=ar.code,this.data={}}}ar.code="MergeNotSupportedError";var or=r(6895);const sr=/^.*(\r?\n|$)/gm;function cr({branches:t,contents:e}){const r=t[1],i=t[2],n=e[0],a=e[1],o=e[2],s=a.match(sr),c=n.match(sr),f=o.match(sr),d=or(s,c,f);let l="",h=!0;for(const t of d)t.ok&&(l+=t.ok.join("")),t.conflict&&(h=!1,l+=`${"<".repeat(7)} ${r}\n`,l+=t.conflict.a.join(""),l+=`${"=".repeat(7)}\n`,l+=t.conflict.b.join(""),l+=`${">".repeat(7)} ${i}\n`);return{cleanMerge:h,mergedText:l}}async function fr({fs:t,cache:e,dir:r,gitdir:i=q(r,".git"),index:n,ourOid:a,baseOid:o,theirOid:s,ourName:c="ours",baseName:f="base",theirName:d="theirs",dryRun:l=!1,abortOnConflict:h=!0,mergeDriver:u}){const p=qt({ref:a}),g=qt({ref:o}),w=qt({ref:s}),m=[],y=[],b=[],_=[],v=await Jt({fs:t,cache:e,dir:r,gitdir:i,trees:[p,g,w],map:async function(e,[r,a,o]){const s=$(e);switch(`${await he(r,a)}-${await he(o,a)}`){case"false-false":return{mode:await a.mode(),path:s,oid:await a.oid(),type:await a.type()};case"false-true":return o||"tree"!==await r.type()?o?{mode:await o.mode(),path:s,oid:await o.oid(),type:await o.type()}:void 0:{mode:await r.mode(),path:s,oid:await r.oid(),type:await r.type()};case"true-false":return r||"tree"!==await o.type()?r?{mode:await r.mode(),path:s,oid:await r.oid(),type:await r.type()}:void 0:{mode:await o.mode(),path:s,oid:await o.oid(),type:await o.type()};case"true-true":if(r&&o&&"tree"===await r.type()&&"tree"===await o.type())return{mode:await r.mode(),path:s,oid:await r.oid(),type:"tree"};if(r&&o&&"blob"===await r.type()&&"blob"===await o.type())return async function({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:a,ourName:o,theirName:s,baseName:c,dryRun:f,mergeDriver:d=cr}){const l="blob";let h="100755",u="",p="";n&&"blob"===await n.type()&&(h=await n.mode(),u=await n.oid(),p=Buffer.from(await n.content()).toString("utf8"));const g=h===await i.mode()?await a.mode():await i.mode();if(await i.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:l}};if(await i.oid()===u)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await a.oid(),type:l}};if(await a.oid()===u)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:l}};const w=Buffer.from(await i.content()).toString("utf8"),m=Buffer.from(await a.content()).toString("utf8"),{mergedText:y,cleanMerge:b}=await d({branches:[c,o,s],contents:[p,w,m],path:r});return{cleanMerge:b,mergeResult:{mode:g,path:r,oid:await be({fs:t,gitdir:e,type:"blob",object:Buffer.from(y,"utf8"),dryRun:f}),type:l}}}({fs:t,gitdir:i,path:s,ours:r,base:a,theirs:o,ourName:c,baseName:f,theirName:d,mergeDriver:u}).then(async t=>{if(t.cleanMerge)h||n.insert({filepath:e,oid:t.mergeResult.oid,stage:0});else if(m.push(e),y.push(e),!h){let t="";a&&"blob"===await a.type()&&(t=await a.oid());const i=await r.oid(),s=await o.oid();n.delete({filepath:e}),t&&n.insert({filepath:e,oid:t,stage:1}),n.insert({filepath:e,oid:i,stage:2}),n.insert({filepath:e,oid:s,stage:3})}return t.mergeResult});if(a&&!r&&o&&"blob"===await a.type()&&"blob"===await o.type()){if(m.push(e),b.push(e),!h){const t=await a.oid(),r=await o.oid();n.delete({filepath:e}),n.insert({filepath:e,oid:t,stage:1}),n.insert({filepath:e,oid:r,stage:3})}return{mode:await o.mode(),oid:await o.oid(),type:"blob",path:s}}if(a&&r&&!o&&"blob"===await a.type()&&"blob"===await r.type()){if(m.push(e),_.push(e),!h){const t=await a.oid(),i=await r.oid();n.delete({filepath:e}),n.insert({filepath:e,oid:t,stage:1}),n.insert({filepath:e,oid:i,stage:2})}return{mode:await r.mode(),oid:await r.oid(),type:"blob",path:s}}if(a&&!r&&!o&&("blob"===await a.type()||"tree"===await a.type()))return;throw new ar}},reduce:0===m.length||r&&!h?async(e,r)=>{const n=r.filter(Boolean);if(e&&(!e||"tree"!==e.type||0!==n.length||"."===e.path)){if(n.length>0||"."===e.path&&0===n.length){const r=new pt(n).toObject(),a=await be({fs:t,gitdir:i,type:"tree",object:r,dryRun:l});e.oid=a}return e}}:void 0});return 0!==m.length?(r&&!h&&await Jt({fs:t,cache:e,dir:r,gitdir:i,trees:[qt({ref:v.oid})],map:async function(e,[i]){const n=`${r}/${e}`;if("blob"===await i.type()){const e=await i.mode(),r=await i.content();await t.write(n,r,{mode:e})}return!0}}),new nr(m,y,b,_)):v.oid}const dr={stage:j,workdir:Kt};async function lr({fs:t,dir:e,gitdir:r,treePair:i}){const n="stage"===i[1],o=i.map(t=>"string"==typeof t?dr[t]():t),s=[],c=await Jt({fs:t,cache:{},dir:e,gitdir:r,trees:o,map:async(i,[n,a])=>{if("."!==i&&!await we.isIgnored({fs:t,dir:e,gitdir:r,filepath:i}))return a?((!n||await n.oid()!==await a.oid()&&void 0!==await a.oid())&&s.push([n,a]),{mode:await a.mode(),path:i,oid:await a.oid(),type:await a.type()}):void 0},reduce:async(t,e)=>(e=e.filter(Boolean),t?(t.children=e,t):e.length>0?e:void 0),iterate:async(r,i)=>{const a=[];for(const r of i){const[i,o]=r;n?o&&(await t.exists(`${e}/${o.toString()}`)?a.push(r):s.push([null,o])):i&&(o?a.push(r):s.push([i,null]))}return a.length?Promise.all(a.map(r)):[]}});if(0===s.length||0===c.length)return null;const f=(await async function({fs:t,dir:e,gitdir:r,entries:i}){return Promise.all(i.map(async function i(n){if("tree"===n.type){if(!n.oid){const e=await Promise.all(n.children.map(i));n.oid=await ze({fs:t,gitdir:r,tree:e}),n.mode=16384}}else"blob"===n.type&&(n.oid=await async function(t,e,r,i,n=null){const o=q(r,i),s=await t.lstat(o);if(!s)throw new U(o);if(s.isDirectory())throw new a(`${o}: file expected, but found directory`);const c=n?await wt({fs:t,gitdir:e,oid:n}):void 0;let f=c?n:void 0;return c||await A(o,async()=>{const r=s.isSymbolicLink()?await t.readlink(o).then(_e):await t.read(o);if(null===r)throw new U(o);f=await be({fs:t,gitdir:e,type:"blob",object:r})}),f}(t,r,e,n.path,n.oid),n.mode=33188);return n.path=n.path.split("/").pop(),n}))}({fs:t,dir:e,gitdir:r,entries:c})).filter(Boolean).map(t=>({mode:t.mode,path:t.path,oid:t.oid,type:t.type}));return ze({fs:t,gitdir:r,tree:f})}async function hr({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:a}){const o=[],s=[],c=await Jt({fs:t,cache:{},dir:e,gitdir:r,trees:[qt({ref:n}),qt({ref:i})],map:async(i,[n,c])=>{if("."===i||await we.isIgnored({fs:t,dir:e,gitdir:r,filepath:i}))return;const f=c?await c.type():await n.type();if("tree"!==f&&"blob"!==f)return;if(!c&&n){const t="tree"===f?"rmdir":"rm";return"tree"===f&&o.push(i),"blob"===f&&a&&s.push({filepath:i,oid:await n.oid()}),{method:t,filepath:i}}const d=await c.oid();return n&&await n.oid()===d?void 0:"tree"===f?{method:"mkdir",filepath:i}:(a&&s.push({filepath:i,oid:d,stats:await t.lstat(q(e,i))}),{method:"write",filepath:i,oid:d})}});await A(r,async()=>{for(const i of c){const n=q(e,i.filepath);switch(i.method){case"rmdir":await t.rmdir(n);break;case"mkdir":await Ye(t,e,i.filepath),await t.mkdir(n);break;case"rm":await t.rm(n);break;case"write":if(!o.some(t=>n.startsWith(t))){await Ye(t,e,i.filepath);const{object:a}=await Tt({fs:t,cache:{},gitdir:r,oid:i.oid});await t.exists(n)&&await t.rm(n),await t.write(n,a)}}}}),await B.acquire({fs:t,gitdir:r,cache:{}},async t=>{s.forEach(({filepath:e,stats:r,oid:i})=>{t.insert({filepath:e,stats:r,oid:i})})})}async function ur({fs:t,cache:e,dir:r,gitdir:i,oid:n,dryRun:a=!1,noUpdateBranch:o=!1,abortOnConflict:s=!0,committer:c,mergeDriver:f}){const{commit:d,oid:l}=await Oe({fs:t,cache:e,gitdir:i,oid:n});if(d.parent.length>1)throw new rr(l,d.parent.length);if(0===d.parent.length)throw new ir(l);const h=await ft.resolve({fs:t,gitdir:i,ref:"HEAD"}),{commit:u}=await Oe({fs:t,cache:e,gitdir:i,oid:h}),p=d.parent[0],{commit:g}=await Oe({fs:t,cache:e,gitdir:i,oid:p});if(r&&(!a&&!o||!s)){const n=await async function({fs:t,cache:e,dir:r,gitdir:i,headTree:n,baseTree:a,theirTree:o,allTracked:s}){const c=await Jt({fs:t,cache:e,dir:r,gitdir:i,trees:[qt({ref:a}),qt({ref:o})],map:async(t,[e,r])=>{if("."!==t)return e&&r&&await e.oid()===await r.oid()?null:[e?await e.type():void 0,r?await r.type():void 0].includes("blob")?t:void 0}});return 0!==c.length||s?Jt({fs:t,cache:e,dir:r,gitdir:i,trees:[qt({ref:n}),j(),Kt()],map:async(t,[e,r,i])=>{if("."===t)return;if(!s&&!c.some(e=>Xe(t,e)))return null;const n=e&&"blob"===await e.type()?await e.oid():void 0;return c.includes(t)||s&&n?(r?await r.oid():void 0)!==n?t:i?n&&"blob"===await i.type()&&await i.oid()===n?void 0:t:void 0:void 0}}):[]}({fs:t,cache:e,dir:r,gitdir:i,headTree:u.tree,baseTree:g.tree,theirTree:d.tree,allTracked:!s});if(n.length>0)throw new er(n)}const w=await B.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async n=>fr({fs:t,cache:e,dir:r,gitdir:i,index:n,ourOid:u.tree,baseOid:g.tree,theirOid:d.tree,ourName:"HEAD",baseName:`parent of ${l.slice(0,7)}`,theirName:l.slice(0,7),dryRun:a,abortOnConflict:s,mergeDriver:f}));if(w instanceof nr)throw w;const m=await Ue({fs:t,cache:e,gitdir:i,message:d.message,tree:w,parent:[h],author:d.author,committer:c,dryRun:a,noUpdateBranch:o});return!r||a||o||await hr({fs:t,dir:r,gitdir:i,stashCommit:m,parentCommit:h,wasStaged:!0}),m}async function pr({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,cache:n={},committer:a,dryRun:o=!1,noUpdateBranch:s=!1,abortOnConflict:c=!0,mergeDriver:f}){try{de("fs",t),de("gitdir",r),de("oid",i);const d=new ce(t),l=await le({fsp:d,dotgit:r}),{commit:h}=await Oe({fs:d,cache:n,gitdir:l,oid:i});if(h.parent&&h.parent.length>1)return await ur({fs:d,cache:n,dir:e,gitdir:l,oid:i,dryRun:o,noUpdateBranch:s,abortOnConflict:c,committer:void 0,mergeDriver:f});const u=await Pe({fs:d,gitdir:l,committer:a});if(!u)throw new Ee("committer");return await ur({fs:d,cache:n,dir:e,gitdir:l,oid:i,dryRun:o,noUpdateBranch:s,abortOnConflict:c,committer:u,mergeDriver:f})}catch(t){throw t.caller="git.cherryPick",t}}const gr=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function wr(t){const e=gr.exec(t);return e?"remotes/"===e[1]&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function mr({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){const n=await ft.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await ft.resolve({fs:t,gitdir:e,ref:n})}catch(t){if(t instanceof U)return;throw t}if(n.startsWith("refs/"))return r?n:wr(n)}class yr extends e{constructor(t,e){super(`Remote does not support the "${t}" so the "${e}" parameter cannot be used.`),this.code=this.name=yr.code,this.data={capability:t,parameter:e}}}yr.code="RemoteCapabilityError";class br extends e{constructor(t,e,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${e}"`),this.code=this.name=br.code,this.data={url:t,transport:e,suggestion:r}}}br.code="UnknownTransportError";class _r extends e{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=_r.code,this.data={url:t}}}_r.code="UrlParseError";class vr extends e{constructor(t,e,r){super(`HTTP Error: ${t} ${e}`),this.code=this.name=vr.code,this.data={statusCode:t,statusMessage:e,response:r}}}vr.code="HttpError";class xr extends e{constructor(t,e){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=xr.code,this.data={preview:t,response:e}}}xr.code="SmartHttpError";class kr extends e{constructor(){super("The operation was canceled."),this.code=this.name=kr.code,this.data={}}}function Er({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}async function Ar(t,e){const r=kt(t);for(;;){const{value:t,done:i}=await r.next();if(t&&await e(t),i)break}r.return&&r.return()}async function Sr(t){let e=0;const r=[];await Ar(t,t=>{r.push(t),e+=t.byteLength});const i=new Uint8Array(e);let n=0;for(const t of r)i.set(t,n),n+=t.byteLength;return i}kr.code="UserCanceledError";const Br=/^(https?:\/\/)([^/?#]+)@/i;function $r(t){const e=t.match(Br);return null==e?{url:t,auth:{}}:{url:t.replace(Br,"$1"),auth:Rr(t,e[2])}}function Rr(t,e){const r=function(t){if("function"!=typeof URL)return null;try{return new URL(t)}catch(t){return null}}(t),i=-1!==e.indexOf(":");if(null!==r)return{username:Pr(r.username),password:i?Pr(r.password):void 0};const n=e.indexOf(":");return{username:i?e.slice(0,n):e,password:i?e.slice(n+1):void 0}}function Pr(t){try{return decodeURIComponent(t)}catch(e){return t}}class Ir extends e{constructor(){super("Empty response from git server."),this.code=this.name=Ir.code,this.data={}}}Ir.code="EmptyServerResponseError";class Or extends e{constructor(t,e){super(`Expected "${t}" but received "${e}".`),this.code=this.name=Or.code,this.data={expected:t,actual:e}}}function jr(t,e){const r=e.toString(16);return"0".repeat(t-r.length)+r}Or.code="ParseError";class Ur{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){"string"==typeof t&&(t=Buffer.from(t));const e=jr(4,t.length+4);return Buffer.concat([Buffer.from(e,"utf8"),t])}static streamReader(t){const e=new Et(t);return async function(){try{let t=await e.read(4);if(null==t)return!0;if(t=parseInt(t.toString("utf8"),16),0===t)return null;if(1===t)return null;const r=await e.read(t-4);return null==r||r}catch(e){return t.error=e,!0}}}}async function Cr(t){const e={};let r;for(;r=await t(),!0!==r;){if(null===r)continue;r=r.toString("utf8").replace(/\n$/,"");const t=r.indexOf("=");if(t>-1){const i=r.slice(0,t),n=r.slice(t+1);e[i]=n}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}async function Tr(t,{service:e}){const r=new Set,i=new Map,n=new Map,a=Ur.streamReader(t);let o=await a();for(;null===o;)o=await a();if(!0===o)throw new Ir;if(o.includes("version 2"))return Cr(a);if(o.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Or(`# service=${e}\\n`,o.toString("utf8"));let s=await a();for(;null===s;)s=await a();if(!0===s)return{capabilities:r,refs:i,symrefs:n};if(s=s.toString("utf8"),s.includes("version 2"))return Cr(a);const[c,f]=Mr(s,"\0","\\x00");if(f.split(" ").map(t=>r.add(t)),"0000000000000000000000000000000000000000 capabilities^{}"!==c){const[t,e]=Mr(c," "," ");for(i.set(e,t);;){const t=await a();if(!0===t)break;if(null!==t){const[e,r]=Mr(t.toString("utf8")," "," ");i.set(r,e)}}}for(const t of r)if(t.startsWith("symref=")){const e=t.match(/symref=([^:]+):(.*)/);3===e.length&&n.set(e[1],e[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}function Mr(t,e,r){const i=t.trim().split(e);if(2!==i.length)throw new Or(`Two strings separated by '${r}'`,t.toString("utf8"));return i}const Dr=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,Nr=(t,e)=>{(e.username||e.password)&&(t.Authorization=Er(e)),e.headers&&Object.assign(t,e.headers)},Fr=async t=>{try{const e=Buffer.from(await Sr(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch(t){return{}}};class zr{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:e,onAuth:r,onAuthSuccess:i,onAuthFailure:n,corsProxy:a,service:o,url:s,headers:c,signal:f,protocolVersion:d}){let{url:l,auth:h}=$r(s);const u=a?Dr(a,l):l;let p,g;(h.username||h.password)&&(c.Authorization=Er(h)),2===d&&(c["Git-Protocol"]="version=2");let w=!1;do{if(p=await t.request({onProgress:e,method:"GET",url:`${u}/info/refs?service=${o}`,headers:c,signal:f}),g=!1,401===p.statusCode||203===p.statusCode){const t=w?n:r;if(t){if(h=await t(l,{...h,headers:{...c}}),h&&h.cancel)throw new kr;h&&(Nr(c,h),w=!0,g=!0)}}else 200===p.statusCode&&w&&i&&await i(l,h)}while(g);if(200!==p.statusCode){const{response:t}=await Fr(p);throw new vr(p.statusCode,p.statusMessage,t)}if(p.headers["content-type"]===`application/x-${o}-advertisement`){const t=await Tr(p.body,{service:o});return t.auth=h,t}{const{preview:t,response:e,data:r}=await Fr(p);try{const t=await Tr([r],{service:o});return t.auth=h,t}catch(r){throw new xr(t,e)}}}static async connect({http:t,onProgress:e,corsProxy:r,service:i,url:n,auth:a,body:o,headers:s,signal:c}){const f=$r(n);f&&(n=f.url),r&&(n=Dr(r,n)),s["content-type"]=`application/x-${i}-request`,s.accept=`application/x-${i}-result`,Nr(s,a);const d=await t.request({onProgress:e,method:"POST",url:`${n}/${i}`,body:o,headers:s,signal:c});if(200!==d.statusCode){const{response:t}=Fr(d);throw new vr(d.statusCode,d.statusMessage,t)}return d}}class Lr{static getRemoteHelperFor({url:t}){const e=new Map;e.set("http",zr),e.set("https",zr);const r=function({url:t}){if(Hr.test(t))return{transport:"ssh",address:t};const e=t.match(/(\w+)(:\/\/|::)(.*)/);return null!==e?"://"===e[2]?{transport:e[1],address:e[0]}:"::"===e[2]?{transport:e[1],address:e[3]}:void 0:void 0}({url:t});if(!r)throw new _r(t);if(e.has(r.transport))return e.get(r.transport);throw new br(t,r.transport,"ssh"===r.transport?function(t){return(t=t.replace(/^[^/@:]+@([^/@:]+):/,"https://$1/")).replace(/^ssh:\/\//,"https://")}(t):void 0)}}const Hr=/^[^/@:]+@[^/@:]+:/;class Wr{static async read({fs:t,gitdir:e}){const r=q(e,"shallow"),i=new Set;return await A(r,async function(){const e=await t.read(r,{encoding:"utf8"});return null===e||""===e.trim()?i:void e.trim().split("\n").map(t=>i.add(t))}),i}static async write({fs:t,gitdir:e,oids:r}){const i=q(e,"shallow");if(r.size>0){const e=[...r].join("\n")+"\n";await A(i,async function(){await t.write(i,e,{encoding:"utf8"})})}else await A(i,async function(){await t.rm(i)})}}function Gr({config:t,onAuth:e}){return e?async(r,i)=>{const n=i.username||await t.get(`credential.${r}.username`);return e(r,n?{...i,username:n}:i)}:e}function qr(t,e){const r=t.map(t=>t.split("=",1)[0]);return e.filter(t=>{const e=t.split("=",1)[0];return r.includes(e)})}const Zr={name:"isomorphic-git",version:"1.44.6",agent:"git/isomorphic-git@1.44.6"};class Kr{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){const e=this._waiting;this._waiting=null,e({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){const t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}}function Vr(t){const e=t.indexOf("\r"),r=t.indexOf("\n");return-1===e&&-1===r?-1:-1===e?r+1:-1===r?e+1:r===e+1?r+1:Math.min(e,r)+1}function Yr(t){const e=new Kr;let r="";return(async()=>{await Ar(t,t=>{for(t=t.toString("utf8"),r+=t;;){const t=Vr(r);if(-1===t)break;if(t===r.length&&"\r"===r[t-1])break;e.write(r.slice(0,t)),r=r.slice(t)}}),r.length>0&&e.write(r),e.end()})(),e}class Xr{static demux(t){const e=Ur.streamReader(t),r=new Kr,i=new Kr,n=new Kr,a=async function(){const o=await e();if(null===o)return a();if(!0===o)return r.end(),n.end(),void(t.error?i.destroy(t.error):i.end());switch(o[0]){case 1:i.write(o.slice(1));break;case 2:n.write(o.slice(1));break;case 3:{const t=o.slice(1);return n.write(t),r.end(),n.end(),void i.destroy(new Error(t.toString("utf8")))}default:r.write(o)}a()};return a(),{packetlines:r,packfile:i,progress:n}}}async function Jr({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:c,ref:f,remoteRef:d,remote:l,url:h,corsProxy:u,depth:p=null,since:g=null,exclude:w=[],relative:m=!1,tags:y=!1,singleBranch:b=!1,headers:_={},prune:v=!1,pruneTags:x=!1}){const k=f||await mr({fs:t,gitdir:c,test:!0}),E=await at.get({fs:t,gitdir:c}),A=l||k&&await E.get(`branch.${k}.remote`)||"origin",S=h||await E.get(`remote.${A}.url`);if(void 0===S)throw new fe("remote OR url");const B=d||k&&await E.get(`branch.${k}.merge`)||f||"HEAD";void 0===u&&(u=await E.get("http.corsProxy"));const $=Lr.getRemoteHelperFor({url:S}),R=await $.discover({http:r,onAuth:Gr({config:E,onAuth:a}),onAuthSuccess:o,onAuthFailure:Gr({config:E,onAuth:s}),corsProxy:u,service:"git-upload-pack",url:S,headers:_,protocolVersion:1}),P=R.auth,I=R.refs;if(0===I.size)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(null!==p&&!R.capabilities.has("shallow"))throw new yr("shallow","depth");if(null!==g&&!R.capabilities.has("deepen-since"))throw new yr("deepen-since","since");if(w.length>0&&!R.capabilities.has("deepen-not"))throw new yr("deepen-not","exclude");if(!0===m&&!R.capabilities.has("deepen-relative"))throw new yr("deepen-relative","relative");const{oid:O,fullref:j}=ft.resolveAgainstMap({ref:B,map:I});for(const t of I.keys())t===j||"HEAD"===t||t.startsWith("refs/heads/")||y&&t.startsWith("refs/tags/")||I.delete(t);const U=qr([...R.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Zr.agent}`]);m&&U.push("deepen-relative");const C=b?[O]:I.values(),T=b?[k]:await ft.listRefs({fs:t,gitdir:c,filepath:"refs"});let D=[];for(let r of T)try{r=await ft.expand({fs:t,gitdir:c,ref:r});const i=await ft.resolve({fs:t,gitdir:c,ref:r});await Se({fs:t,cache:e,gitdir:c,oid:i})&&D.push(i)}catch(t){}D=[...new Set(D)];const N=await Wr.read({fs:t,gitdir:c}),F=function({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:a=null,exclude:o=[]}){const s=[];e=[...new Set(e)];let c=` ${t.join(" ")}`;for(const t of e)s.push(Ur.encode(`want ${t}${c}\n`)),c="";for(const t of i)s.push(Ur.encode(`shallow ${t}\n`));null!==n&&s.push(Ur.encode(`deepen ${n}\n`)),null!==a&&s.push(Ur.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)}\n`));for(const t of o)s.push(Ur.encode(`deepen-not ${t}\n`));s.push(Ur.flush());for(const t of r)s.push(Ur.encode(`have ${t}\n`));return s.push(Ur.encode("done\n")),s}({capabilities:U,wants:C,haves:D,shallows:R.capabilities.has("shallow")?[...N]:[],depth:p,since:g,exclude:w}),z=Buffer.from(await Sr(F)),L=await $.connect({http:r,onProgress:i,corsProxy:u,service:"git-upload-pack",url:S,auth:P,body:[z],headers:_}),H=await async function(t){const{packetlines:e,packfile:r,progress:i}=Xr.demux(t),n=[],a=[],o=[];let s=!1,c=!1;return new Promise((f,d)=>{Ar(e,e=>{const l=e.toString("utf8").trim();if(l.startsWith("shallow")){const t=l.slice(-41).trim();40!==t.length&&d(new M(t)),n.push(t)}else if(l.startsWith("unshallow")){const t=l.slice(-41).trim();40!==t.length&&d(new M(t)),a.push(t)}else if(l.startsWith("ACK")){const[,t,e]=l.split(" ");o.push({oid:t,status:e}),e||(c=!0)}else l.startsWith("NAK")?(s=!0,c=!0):(c=!0,s=!0);c&&(t.error?d(t.error):f({shallows:n,unshallows:a,acks:o,nak:s,packfile:r,progress:i}))}).finally(()=>{c||(t.error?d(t.error):f({shallows:n,unshallows:a,acks:o,nak:s,packfile:r,progress:i}))})})}(L.body);L.headers&&(H.headers=L.headers);for(const r of H.shallows)if(!N.has(r))try{const{object:i}=await Tt({fs:t,cache:e,gitdir:c,oid:r}),n=new Ht(i),a=await Promise.all(n.headers().parent.map(r=>Se({fs:t,cache:e,gitdir:c,oid:r})));0===a.length||a.every(t=>t)||N.add(r)}catch(t){N.add(r)}for(const t of H.unshallows)N.delete(t);if(await Wr.write({fs:t,gitdir:c,oids:N}),b){const e=new Map([[j,O]]),r=new Map;let i=10,n=j;for(;i--;){const t=R.symrefs.get(n);if(void 0===t)break;r.set(n,t),n=t}const a=I.get(n);a&&e.set(n,a);const{pruned:o}=await ft.updateRemoteRefs({fs:t,gitdir:c,remote:A,refs:e,symrefs:r,tags:y,prune:v});v&&(H.pruned=o)}else{const{pruned:e}=await ft.updateRemoteRefs({fs:t,gitdir:c,remote:A,refs:I,symrefs:R.symrefs,tags:y,prune:v,pruneTags:x});v&&(H.pruned=e)}if(H.HEAD=R.symrefs.get("HEAD"),void 0===H.HEAD){const{oid:t}=ft.resolveAgainstMap({ref:"HEAD",map:I});for(const[e,r]of I.entries())if("HEAD"!==e&&r===t){H.HEAD=e;break}}const W=j.startsWith("refs/tags")?"tag":"branch";H.FETCH_HEAD={oid:O,description:`${W} '${wr(j)}' of ${S}`},(i||n)&&Ar(Yr(H.progress),async t=>{if(n&&await n(t),i){const e=t.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);e&&await i({phase:e[1].trim(),loaded:parseInt(e[2],10),total:parseInt(e[3],10)})}});const G=Buffer.from(await Sr(H.packfile));if(L.body.error)throw L.body.error;const Z=G.slice(-20).toString("hex"),K={defaultBranch:H.HEAD,fetchHead:H.FETCH_HEAD.oid,fetchHeadDescription:H.FETCH_HEAD.description};if(H.headers&&(K.headers=H.headers),v&&(K.pruned=H.pruned),""!==Z&&"5041434b0000000200000000"!==G.slice(0,12).toString("hex")){K.packfile=`objects/pack/pack-${Z}.pack`;const r=q(c,K.packfile);await t.write(r,G);const n=r=>Tt({fs:t,cache:e,gitdir:c,oid:r}),a=await Ot.fromPack({pack:G,getExternalRefDelta:n,onProgress:i});await t.write(r.replace(/\.pack$/,".idx"),await a.toBuffer())}return K}async function Qr({fs:t,bare:e=!1,dir:r,gitdir:i=(e?r:q(r,".git")),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(t=>i+"/"+t);for(const e of a)await t.mkdir(e);await t.write(i+"/config",`[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = ${e}\n`+(e?"":"\tlogallrefupdates = true\n")+"\tsymlinks = false\n\tignorecase = true\n"),await t.write(i+"/HEAD",`ref: refs/heads/${n}\n`)}async function ti({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:c,gitdir:f=q(c,".git"),url:d,corsProxy:l,ref:h,remote:u="origin",depth:p,since:g,exclude:w=[],relative:m=!1,singleBranch:y=!1,noCheckout:b=!1,noTags:_=!1,headers:v={},cache:x={},nonBlocking:k=!1,batchSize:E=100}){try{de("fs",t),de("http",e),de("gitdir",f),b||de("dir",c),de("url",d);const A=new ce(t),S=await le({fsp:A,dotgit:f});return await async function({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:c,dir:f,gitdir:d,url:l,corsProxy:h,ref:u,remote:p,depth:g,since:w,exclude:m,relative:y,singleBranch:b,noCheckout:_,noTags:v,headers:x,nonBlocking:k,batchSize:E=100}){try{if(await Qr({fs:t,gitdir:d}),await We({fs:t,gitdir:d,remote:p,url:l,force:!1}),h){const e=await at.get({fs:t,gitdir:d});await e.set("http.corsProxy",h),await at.save({fs:t,gitdir:d,config:e})}const{defaultBranch:A,fetchHead:S}=await Jr({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:d,ref:u,remote:p,corsProxy:h,depth:g,since:w,exclude:m,relative:y,singleBranch:b,headers:x,tags:!v});if(null===S)return;u=(u=u||A).replace("refs/heads/",""),await Je({fs:t,cache:e,onProgress:i,onPostCheckout:c,dir:f,gitdir:d,ref:u,remote:p,noCheckout:_,nonBlocking:k,batchSize:E})}catch(e){throw await t.rmdir(d,{recursive:!0,maxRetries:10}).catch(()=>{}),e}}({fs:A,cache:x,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:c,gitdir:S,url:d,corsProxy:l,ref:h,remote:u,depth:p,since:g,exclude:w,relative:m,singleBranch:y,noCheckout:b,noTags:_,headers:v,nonBlocking:k,batchSize:E})}catch(t){throw t.caller="git.clone",t}}async function ei({fs:t,onSign:e,dir:r,gitdir:i=q(r,".git"),message:n,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:f=!1,noUpdateBranch:d=!1,disallowEmpty:l=!1,ref:h,parent:u,tree:p,cache:g={}}){try{de("fs",t),c||de("message",n),s&&de("onSign",e);const r=new ce(t),w=await le({fsp:r,dotgit:i});return await Ue({fs:r,cache:g,onSign:e,gitdir:w,message:n,author:a,committer:o,signingKey:s,amend:c,dryRun:f,noUpdateBranch:d,disallowEmpty:l,ref:h,parent:u,tree:p})}catch(t){throw t.caller="git.commit",t}}async function ri({fs:t,dir:e,gitdir:r=q(e,".git"),fullname:i=!1,test:n=!1}){try{de("fs",t),de("gitdir",r);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await mr({fs:e,gitdir:a,fullname:i,test:n})}catch(t){throw t.caller="git.currentBranch",t}}async function ii({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i}){try{de("fs",t),de("ref",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await ft.exists({fs:t,gitdir:e,ref:r}))throw new U(r);const i=await ft.expand({fs:t,gitdir:e,ref:r});if(i===await mr({fs:t,gitdir:e,fullname:!0})){const r=await ft.resolve({fs:t,gitdir:e,ref:i});await ft.writeRef({fs:t,gitdir:e,ref:"HEAD",value:r})}await ft.deleteRef({fs:t,gitdir:e,ref:i});const n=wr(r),a=await at.get({fs:t,gitdir:e});await a.deleteSection("branch",n),await at.save({fs:t,gitdir:e,config:a})}({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.deleteBranch",t}}async function ni({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i}){try{de("fs",t),de("ref",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});await ft.deleteRef({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.deleteRef",t}}async function ai({fs:t,dir:e,gitdir:r=q(e,".git"),remote:i}){try{de("fs",t),de("remote",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,remote:r}){const i=await at.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await at.save({fs:t,gitdir:e,config:i})}({fs:e,gitdir:n,remote:i})}catch(t){throw t.caller="git.deleteRemote",t}}async function oi({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i}){try{de("fs",t),de("ref",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await ft.deleteRef({fs:t,gitdir:e,ref:r})}({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.deleteTag",t}}class si extends e{constructor(t,e,r){super(`Found multiple ${t} matching "${e}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=si.code,this.data={nouns:t,short:e,matches:r}}}async function ci({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,oid:i}){const n=await async function({fs:t,gitdir:e,oid:r}){const i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(t=>`${i}${t}`).filter(t=>t.startsWith(r))}({fs:t,gitdir:r,oid:i}),o=await async function({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){const o=[];let s=await t.readdir(q(r,"objects/pack"));s=s.filter(t=>t.endsWith(".idx"));for(const c of s){const s=`${r}/objects/pack/${c}`,f=await Ut({fs:t,cache:e,filename:s,getExternalRefDelta:n});if(f.error)throw new a(f.error);for(const t of f.offsets.keys())t.startsWith(i)&&o.push(t)}return o}({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:i=>Tt({fs:t,cache:e,gitdir:r,oid:i})});for(const t of o)-1===n.indexOf(t)&&n.push(t);if(1===n.length)return n[0];if(n.length>1)throw new si("oids",i,n);throw new U(`an object matching "${i}"`)}({fs:e,cache:n,gitdir:o,oid:i})}catch(t){throw t.caller="git.expandOid",t}}async function fi({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await ft.expand({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.expandRef",t}}async function di({fs:t,cache:e,gitdir:r,oids:i}){const n={},a=i.length,o=new Set,s=new Map,c=await Wr.read({fs:t,gitdir:r}),f=async i=>{if(s.has(i))return s.get(i);const{object:n,type:a}=await Tt({fs:t,cache:e,gitdir:r,oid:i});if("commit"!==a)throw new C(i,a,"commit");const o=Ht.from(n),{parent:f}=o.parseHeaders(),d=c.has(i)?[]:f;return s.set(i,d),d};let d=i.map((t,e)=>({index:e,oid:t}));for(;d.length;){for(const{oid:t,index:e}of d)await f(t),n[t]||(n[t]=new Set),n[t].add(e),n[t].size===a&&o.add(t);const t=new Map;for(const{oid:e,index:r}of d)if(!o.has(e))for(const i of await f(e))n[i]&&n[i].has(r)||t.set(i+":"+r,{oid:i,index:r});d=Array.from(t.values())}if(o.size<2)return[...o];const l=new Set;for(const t of o){const e=[...await f(t)],r=new Set;for(;e.length;){const t=e.pop();r.has(t)||(r.add(t),o.has(t)?l.add(t):e.push(...await f(t)))}}return[...o].filter(t=>!l.has(t))}si.code="AmbiguousError";class li extends e{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=li.code,this.data={}}}async function hi({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:f=!1,abortOnConflict:d=!0,message:l,author:h,committer:u,signingKey:p,onSign:g,mergeDriver:w,allowUnrelatedHistories:m=!1}){void 0===n&&(n=await mr({fs:t,gitdir:i,fullname:!0})),n=await ft.expand({fs:t,gitdir:i,ref:n}),a=await ft.expand({fs:t,gitdir:i,ref:a});const y=await ft.resolve({fs:t,gitdir:i,ref:n}),{oid:b}=await Ie({fs:t,cache:e,gitdir:i,oid:await ft.resolve({fs:t,gitdir:i,ref:a})}),_=await di({fs:t,cache:e,gitdir:i,oids:[y,b]});if(1!==_.length){if(0!==_.length||!m)throw new ar;_.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904")}const v=_[0];if(v===b)return{oid:y,alreadyMerged:!0};if(o&&v===y)return c||f||await ft.writeRef({fs:t,gitdir:i,ref:n,value:b}),{oid:b,fastForward:!0};{if(s)throw new li;const o=await B.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async o=>fr({fs:t,cache:e,dir:r,gitdir:i,index:o,ourOid:y,theirOid:b,baseOid:v,ourName:wr(n),baseName:"base",theirName:wr(a),dryRun:c,abortOnConflict:d,mergeDriver:w}));if(o instanceof nr)throw o;return l||(l=`Merge branch '${wr(a)}' into ${wr(n)}`),{oid:await Ue({fs:t,cache:e,gitdir:i,message:l,ref:n,tree:o,parent:[y,b],author:h,committer:u,signingKey:p,onSign:g,dryRun:c,noUpdateBranch:f}),tree:o,mergeCommit:!0}}}async function ui({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,dir:c,gitdir:f,ref:d,url:l,remote:h,remoteRef:u,prune:p,pruneTags:g,fastForward:w,fastForwardOnly:m,corsProxy:y,singleBranch:b,headers:_,author:v,committer:x,signingKey:k}){try{if(!d){const e=await mr({fs:t,gitdir:f});if(!e)throw new fe("ref");d=e}const{fetchHead:E,fetchHeadDescription:A}=await Jr({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:f,corsProxy:y,ref:d,url:l,remote:h,remoteRef:u,singleBranch:b,headers:_,prune:p,pruneTags:g});await hi({fs:t,cache:e,gitdir:f,ours:d,theirs:E,fastForward:w,fastForwardOnly:m,message:`Merge ${A}`,author:v,committer:x,signingKey:k,dryRun:!1,noUpdateBranch:!1}),await Je({fs:t,cache:e,onProgress:i,dir:c,gitdir:f,ref:d,remote:h,noCheckout:!1})}catch(t){throw t.caller="git.pull",t}}async function pi({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=q(s,".git"),ref:f,url:d,remote:l,remoteRef:h,corsProxy:u,singleBranch:p,headers:g={},cache:w={}}){try{de("fs",t),de("http",e),de("gitdir",c);const m={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},y=new ce(t),b=await le({fsp:y,dotgit:c});return await ui({fs:y,cache:w,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:b,ref:f,url:d,remote:l,remoteRef:h,fastForwardOnly:!0,corsProxy:u,singleBranch:p,headers:g,author:m,committer:m})}catch(t){throw t.caller="git.fastForward",t}}async function gi({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=q(s,".git"),ref:f,remote:d,remoteRef:l,url:h,corsProxy:u,depth:p=null,since:g=null,exclude:w=[],relative:m=!1,tags:y=!1,singleBranch:b=!1,headers:_={},prune:v=!1,pruneTags:x=!1,cache:k={}}){try{de("fs",t),de("http",e),de("gitdir",c);const s=new ce(t),E=await le({fsp:s,dotgit:c});return await Jr({fs:s,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,gitdir:E,ref:f,remote:d,remoteRef:l,url:h,corsProxy:u,depth:p,since:g,exclude:w,relative:m,tags:y,singleBranch:b,headers:_,prune:v,pruneTags:x})}catch(t){throw t.caller="git.fetch",t}}async function wi({fs:t,dir:e,gitdir:r=q(e,".git"),oids:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oids",i);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await di({fs:e,cache:n,gitdir:a,oids:i})}catch(t){throw t.caller="git.findMergeBase",t}}async function mi({fs:t,filepath:e}){if(await t.exists(q(e,".git")))return e;{const r=R(e);if(r===e)throw new U(`git root for ${e}`);return mi({fs:t,filepath:r})}}async function yi({fs:t,filepath:e}){try{return de("fs",t),de("filepath",e),await mi({fs:new ce(t),filepath:e})}catch(t){throw t.caller="git.findRoot",t}}async function bi({fs:t,dir:e,gitdir:r=q(e,".git"),path:i}){try{de("fs",t),de("gitdir",r),de("path",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await Be({fs:e,gitdir:n,path:i})}catch(t){throw t.caller="git.getConfig",t}}async function _i({fs:t,dir:e,gitdir:r=q(e,".git"),path:i}){try{de("fs",t),de("gitdir",r),de("path",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,path:r}){return(await at.get({fs:t,gitdir:e})).getall(r)}({fs:e,gitdir:n,path:i})}catch(t){throw t.caller="git.getConfigAll",t}}function vi(t,e,r){const i=e.split("/"),n=i.pop();if("__proto__"===n||i.includes("__proto__"))return;let a=t;for(const t of i)Object.prototype.hasOwnProperty.call(a,t)||(a[t]={}),a=a[t];a[n]=r}async function xi({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:a,headers:o={},forPush:s=!1}){try{de("http",t),de("url",a);const c=Lr.getRemoteHelperFor({url:a}),f=await c.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:1}),d={capabilities:[...f.capabilities]};for(const[t,e]of f.refs)vi(d,t,e);for(const[t,e]of f.symrefs)vi(d,t,e);return d}catch(t){throw t.caller="git.getRemoteInfo",t}}function ki(t,e,r,i){const n=[];for(const[a,o]of t.refs){if(e&&!a.startsWith(e))continue;if(a.endsWith("^{}")){if(i){const t=a.replace("^{}",""),e=n[n.length-1],r=e?.ref===t?e:n.find(e=>e.ref===t);void 0!==r&&(r.peeled=o)}continue}const s={ref:a,oid:o};r&&t.symrefs.has(a)&&(s.target=t.symrefs.get(a)),n.push(s)}return n}async function Ei({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:a,headers:o={},forPush:s=!1,protocolVersion:c=2}){try{de("http",t),de("url",a);const f=Lr.getRemoteHelperFor({url:a}),d=await f.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:c});if(2===d.protocolVersion)return{protocolVersion:d.protocolVersion,capabilities:d.capabilities2};const l={};for(const t of d.capabilities){const[e,r]=t.split("=");l[e]=r||!0}return{protocolVersion:1,capabilities:l,refs:ki(d,void 0,!0,!0)}}catch(t){throw t.caller="git.getRemoteInfo2",t}}async function Ai({object:t}){try{de("object",t),"string"==typeof t?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));const e="blob",{oid:r,object:i}=await async function({type:t,object:e,format:r="content",oid:i}){return"deflated"!==r&&("wrapped"!==r&&(e=gt.wrap({type:t,object:e})),i=await y(e)),{oid:i,object:e}}({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function Si({fs:t,onProgress:e,dir:r,gitdir:i=q(r,".git"),filepath:n,cache:a={}}){try{de("fs",t),de("dir",r),de("gitdir",r),de("filepath",n);const o=new ce(t),s=await le({fsp:o,dotgit:i});return await async function({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:a}){try{a=q(i,a);const o=await t.read(a),s=r=>Tt({fs:t,cache:e,gitdir:n,oid:r}),c=await Ot.fromPack({pack:o,getExternalRefDelta:s,onProgress:r});return await t.write(a.replace(/\.pack$/,".idx"),await c.toBuffer()),{oids:[...c.hashes]}}catch(t){throw t.caller="git.indexPack",t}}({fs:o,cache:a,onProgress:e,dir:r,gitdir:s,filepath:n})}catch(t){throw t.caller="git.indexPack",t}}async function Bi({fs:t,bare:e=!1,dir:r,gitdir:i=(e?r:q(r,".git")),defaultBranch:n="master"}){try{de("fs",t),de("gitdir",i),e||de("dir",r);const a=new ce(t),o=await le({fsp:a,dotgit:i});return await Qr({fs:a,bare:e,dir:r,gitdir:o,defaultBranch:n})}catch(t){throw t.caller="git.init",t}}li.code="FastForwardError";class $i extends e{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=$i.code,this.data={depth:t}}}async function Ri({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:a}){const o=await Wr.read({fs:t,gitdir:r});if(!i)throw new fe("oid");if(!n)throw new fe("ancestor");if(i===n)return!1;const s=[i],c=new Set;let f=0;for(;s.length;){if(f++===a)throw new $i(a);const i=s.shift(),{type:d,object:l}=await Tt({fs:t,cache:e,gitdir:r,oid:i});if("commit"!==d)throw new C(i,d,"commit");const h=Ht.from(l).parse();for(const t of h.parent)if(t===n)return!0;if(!o.has(i))for(const t of h.parent)c.has(t)||(s.push(t),c.add(t))}return!1}async function Pi({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,ancestor:n,depth:a=-1,cache:o={}}){try{de("fs",t),de("gitdir",r),de("oid",i),de("ancestor",n);const e=new ce(t),s=await le({fsp:e,dotgit:r});return await Ri({fs:e,cache:o,gitdir:s,oid:i,ancestor:n,depth:a})}catch(t){throw t.caller="git.isDescendent",t}}async function Ii({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i}){try{de("fs",t),de("dir",e),de("gitdir",r),de("filepath",i);const n=new ce(t),a=await le({fsp:n,dotgit:r});return we.isIgnored({fs:n,dir:e,gitdir:a,filepath:i})}catch(t){throw t.caller="git.isIgnored",t}}async function Oi({fs:t,dir:e,gitdir:r=q(e,".git"),remote:i}){try{de("fs",t),de("gitdir",r);const e=new ce(t),n=await le({fsp:e,dotgit:r});return ft.listBranches({fs:e,gitdir:n,remote:i})}catch(t){throw t.caller="git.listBranches",t}}async function ji({fs:t,gitdir:e,ref:r,cache:i}){if(r){const n=await ft.resolve({gitdir:e,fs:t,ref:r}),a=[];return await Ui({fs:t,cache:i,gitdir:e,oid:n,filenames:a,prefix:""}),a}return B.acquire({fs:t,gitdir:e,cache:i},async function(t){return t.entries.map(t=>t.path)})}async function Ui({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:a}){const{tree:o}=await Fe({fs:t,cache:e,gitdir:r,oid:i});for(const i of o)"tree"===i.type?await Ui({fs:t,cache:e,gitdir:r,oid:i.oid,filenames:n,prefix:q(a,i.path)}):n.push(q(a,i.path))}async function Ci({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i,cache:n={}}){try{de("fs",t),de("gitdir",r);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await ji({fs:e,cache:n,gitdir:a,ref:i})}catch(t){throw t.caller="git.listFiles",t}}async function Ti({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await ft.resolve({gitdir:r,fs:t,ref:i})}catch(t){if(t instanceof U)return[];throw t}return(await Fe({fs:t,cache:e,gitdir:r,oid:n})).tree.map(t=>({target:t.path,note:t.oid}))}({fs:e,cache:n,gitdir:a,ref:i})}catch(t){throw t.caller="git.listNotes",t}}async function Mi({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i}){try{de("fs",t),de("gitdir",r);const e=new ce(t),n=await le({fsp:e,dotgit:r});return ft.listRefs({fs:e,gitdir:n,filepath:i})}catch(t){throw t.caller="git.listRefs",t}}async function Di({fs:t,dir:e,gitdir:r=q(e,".git")}){try{de("fs",t),de("gitdir",r);const e=new ce(t),i=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e}){const r=await at.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async t=>({remote:t,url:await r.get(`remote.${t}.url`)})))}({fs:e,gitdir:i})}catch(t){throw t.caller="git.listRemotes",t}}async function Ni({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:a,headers:o={},forPush:s=!1,protocolVersion:c=2,prefix:f,symrefs:d,peelTags:l}){try{de("http",t),de("url",a);const h=await zr.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:c});if(1===h.protocolVersion)return ki(h,f,d,l);const u=await async function({prefix:t,symrefs:e,peelTags:r}){const i=[];return i.push(Ur.encode("command=ls-refs\n")),i.push(Ur.encode(`agent=${Zr.agent}\n`)),(r||e||t)&&i.push(Ur.delim()),r&&i.push(Ur.encode("peel")),e&&i.push(Ur.encode("symrefs")),t&&i.push(Ur.encode(`ref-prefix ${t}`)),i.push(Ur.flush()),i}({prefix:f,symrefs:d,peelTags:l});return async function(t){const e=Ur.streamReader(t),r=[];let i;for(;i=await e(),!0!==i;){if(null===i)continue;i=i.toString("utf8").replace(/\n$/,"");const[t,e,...n]=i.split(" "),a={ref:e,oid:t};for(const t of n){const[e,r]=t.split(":");"symref-target"===e?a.target=r:"peeled"===e&&(a.peeled=r)}r.push(a)}return r}((await zr.connect({http:t,auth:h.auth,headers:o,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,body:u})).body)}catch(t){throw t.caller="git.listServerRefs",t}}async function Fi({fs:t,dir:e,gitdir:r=q(e,".git")}){try{de("fs",t),de("gitdir",r);const e=new ce(t),i=await le({fsp:e,dotgit:r});return ft.listTags({fs:e,gitdir:i})}catch(t){throw t.caller="git.listTags",t}}function zi(t,e){return t.committer.timestamp-e.committer.timestamp}$i.code="MaxDepthError";const Li="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function Hi({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===Li)return;const a=i;let o;const s=await Wt({fs:t,cache:e,gitdir:r,oid:i}),c=s.tree;return n===s.oid?o=s.path:(o=await Wi({fs:t,cache:e,gitdir:r,tree:c,fileId:n,oid:a}),Array.isArray(o)&&(0===o.length?o=void 0:1===o.length&&(o=o[0]))),o}async function Wi({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:a,filepaths:o=[],parentPath:s=""}){const c=i.entries().map(function(i){let c;return i.oid===n?(c=q(s,i.path),o.push(c)):"tree"===i.type&&(c=Tt({fs:t,cache:e,gitdir:r,oid:i.oid}).then(function({object:c}){return Wi({fs:t,cache:e,gitdir:r,tree:pt.from(c),fileId:n,oid:a,filepaths:o,parentPath:q(s,i.path)})})),c});return await Promise.all(c),o}async function Gi({fs:t,cache:e,gitdir:r,commit:i,shallow:n}){const a=n||!i.commit.parent[0]?"4b825dc642cb6eb9a060e54bf8d69288fbee4904":i.commit.parent[0];return Jt({fs:t,cache:e,gitdir:r,trees:[qt({ref:i.oid}),qt({ref:a})],map:async(t,[e,r])=>{const[i,n]=await Promise.all([e&&e.type(),r&&r.type()]);if("tree"===i)return n&&"tree"!==n?[null,await r.oid(),t]:void 0;if("tree"===n)return i?[await e.oid(),null,t]:void 0;const[a,o]=await Promise.all([e?e.oid():null,r?r.oid():null]);return a!==o?[a,o,t]:void 0}})}async function qi({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i,ref:n="HEAD",depth:a,since:o,author:s,force:c,follow:f,includeChanges:d=!1,cache:l={}}){try{de("fs",t),de("gitdir",r),de("ref",n);const e=new ce(t),h=await le({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:a,since:o,author:s,force:c,follow:f,includeChanges:d}){const l=void 0===o?void 0:Math.floor(o.valueOf()/1e3),h=null==s?void 0:new RegExp(s,"i"),u=[],p=t=>{(({commit:t})=>void 0===h||!!t.author&&h.test(`${t.author.name} <${t.author.email}>`))(t)&&u.push(t)},g=await Wr.read({fs:t,gitdir:r}),w=await ft.resolve({fs:t,gitdir:r,ref:n}),m=[await Oe({fs:t,cache:e,gitdir:r,oid:w})];let y,b,_,v;function x(t){v&&i&&p(t)}for(;m.length>0;){const n=m.pop();if(void 0!==l&&n.commit.committer.timestamp<=l)break;if(i){let a;try{a=await De({fs:t,cache:e,gitdir:r,oid:n.commit.tree,filepath:i}),!_||y===a.oid&&b===a.mode||p(_),y=a.oid,b=a.mode,_=n,v=!0}catch(a){if(!(a instanceof U))throw a;{let o=f&&y;if(o&&(o=await Hi({fs:t,cache:e,gitdir:r,oid:n.commit.tree,fileId:y}),o))if(Array.isArray(o)){if(_){const n=await Hi({fs:t,cache:e,gitdir:r,oid:_.commit.tree,fileId:y});if(Array.isArray(n)){if(o=o.filter(t=>-1===n.indexOf(t)),1!==o.length){o=!1,_&&p(_);break}o=o[0],i=o,_&&p(_)}}}else i=o,_&&p(_);if(!o){if(v&&y&&(p(_),!c))break;if(!c&&!f)throw a}_=n,v=!1}}}else p(n);if(void 0!==a&&u.length===a){x(n);break}if(!g.has(n.oid))for(const i of n.commit.parent){const n=await Oe({fs:t,cache:e,gitdir:r,oid:i});m.map(t=>t.oid).includes(n.oid)||m.push(n)}0===m.length&&x(n),m.sort((t,e)=>zi(t.commit,e.commit))}if(d)for(const i of u)i.commit.changes=await Gi({fs:t,cache:e,gitdir:r,commit:i,shallow:g.has(i.oid)});return u}({fs:e,cache:l,gitdir:h,filepath:i,ref:n,depth:a,since:o,author:s,force:c,follow:f,includeChanges:d})}catch(t){throw t.caller="git.log",t}}async function Zi({fs:t,onSign:e,dir:r,gitdir:i=q(r,".git"),ours:n,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:f=!1,abortOnConflict:d=!0,message:l,author:h,committer:u,signingKey:p,cache:g={},mergeDriver:w,allowUnrelatedHistories:m=!1}){try{de("fs",t),p&&de("onSign",e);const y=new ce(t),b=await le({fsp:y,dotgit:i}),_=await Re({fs:y,gitdir:b,author:h});if(!(_||s&&o))throw new Ee("author");const v=await Pe({fs:y,gitdir:b,author:_,committer:u});if(!(v||s&&o))throw new Ee("committer");return await hi({fs:y,cache:g,dir:r,gitdir:b,ours:n,theirs:a,fastForward:o,fastForwardOnly:s,dryRun:c,noUpdateBranch:f,abortOnConflict:d,message:l,author:_,committer:v,signingKey:p,onSign:e,mergeDriver:w,allowUnrelatedHistories:m})}catch(t){throw t.caller="git.merge",t}}const Ki={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function Vi({fs:t,cache:e,dir:r,gitdir:i=q(r,".git"),oids:n}){const a=new w,o=[];function s(t,e){const r=Buffer.from(t,e);o.push(r),a.update(r)}async function c({stype:t,object:e}){const r=Ki[t];let i=e.length,n=i>15?128:0;const a=15&i;i>>>=4;let o=(n|r|a).toString(16);for(s(o,"hex");n;)n=i>127?128:0,o=n|127&i,s(jr(2,o),"hex"),i>>>=7;s(Buffer.from(await ye(e)))}s("PACK"),s("00000002","hex"),s(jr(8,n.length),"hex");for(const r of n){const{type:n,object:a}=await Tt({fs:t,cache:e,gitdir:i,oid:r});await c({write:s,object:a,stype:n})}const f=a.digest();return o.push(f),o}async function Yi({fs:t,dir:e,gitdir:r=q(e,".git"),oids:i,write:n=!1,cache:a={}}){try{de("fs",t),de("gitdir",r),de("oids",i);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,oids:i,write:n}){const a=await Vi({fs:t,cache:e,gitdir:r,oids:i}),o=Buffer.from(await Sr(a)),s=`pack-${o.slice(-20).toString("hex")}.pack`;return n?(await t.write(q(r,`objects/pack/${s}`),o),{filename:s}):{filename:s,packfile:new Uint8Array(o)}}({fs:e,cache:a,gitdir:o,oids:i,write:n})}catch(t){throw t.caller="git.packObjects",t}}async function Xi({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=q(s,".git"),ref:f,url:d,remote:l,remoteRef:h,prune:u=!1,pruneTags:p=!1,fastForward:g=!0,fastForwardOnly:w=!1,corsProxy:m,singleBranch:y,headers:b={},author:_,committer:v,signingKey:x,cache:k={}}){try{de("fs",t),de("gitdir",c);const E=new ce(t),A=await le({fsp:E,dotgit:c}),S=await Re({fs:E,gitdir:A,author:_});if(!S)throw new Ee("author");const B=await Pe({fs:E,gitdir:A,author:S,committer:v});if(!B)throw new Ee("committer");return await ui({fs:E,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:A,ref:f,url:d,remote:l,remoteRef:h,fastForward:g,fastForwardOnly:w,corsProxy:m,singleBranch:y,headers:b,author:S,committer:B,signingKey:x,prune:u,pruneTags:p})}catch(t){throw t.caller="git.pull",t}}async function Ji({fs:t,cache:e,dir:r,gitdir:i=q(r,".git"),oids:n}){const a=new Set;async function o(r){if(a.has(r))return;a.add(r);const{type:n,object:s}=await Tt({fs:t,cache:e,gitdir:i,oid:r});if("tag"===n){const t=zt.from(s).headers().object;await o(t)}else if("commit"===n){const t=Ht.from(s).headers().tree;await o(t)}else if("tree"===n){const t=pt.from(s);for(const e of t)"blob"===e.type&&a.add(e.oid),"tree"===e.type&&await o(e.oid)}}for(const t of n)await o(t);return a}class Qi extends e{constructor(t,e){super(`One or more branches were not updated: ${t}`),this.code=this.name=Qi.code,this.data={prettyDetails:t,result:e}}}Qi.code="GitPushError";class tn extends e{constructor(t){let e="";"not-fast-forward"===t?e=" because it was not a simple fast-forward":"tag-exists"===t&&(e=" because tag already exists"),super(`Push rejected${e}. Use "force: true" to override.`),this.code=this.name=tn.code,this.data={reason:t}}}async function en({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,dir:c,gitdir:f=q(c,".git"),ref:d,remoteRef:l,remote:h="origin",url:u,force:p=!1,delete:g=!1,corsProxy:w,headers:m={},cache:y={},signal:b}){try{de("fs",t),de("http",e),de("gitdir",f);const c=new ce(t),_=await le({fsp:c,dotgit:f});return await async function({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPrePush:c,gitdir:f,ref:d,remoteRef:l,remote:h,url:u,force:p=!1,delete:g=!1,corsProxy:w,headers:m={},signal:y}){const b=d||await mr({fs:t,gitdir:f});if(void 0===b)throw new fe("ref");const _=await at.get({fs:t,gitdir:f});h=h||await _.get(`branch.${b}.pushRemote`)||await _.get("remote.pushDefault")||await _.get(`branch.${b}.remote`)||"origin";const v=u||await _.get(`remote.${h}.pushurl`)||await _.get(`remote.${h}.url`);if(void 0===v)throw new fe("remote OR url");const x=l||await _.get(`branch.${b}.merge`);if(void 0===v)throw new fe("remoteRef");void 0===w&&(w=await _.get("http.corsProxy"));const k=await ft.expand({fs:t,gitdir:f,ref:b}),E=g?"0000000000000000000000000000000000000000":await ft.resolve({fs:t,gitdir:f,ref:k}),A=Lr.getRemoteHelperFor({url:v}),S=await A.discover({http:r,onAuth:Gr({config:_,onAuth:a}),onAuthSuccess:o,onAuthFailure:Gr({config:_,onAuth:s}),corsProxy:w,service:"git-receive-pack",url:v,headers:m,protocolVersion:1,signal:y}),B=S.auth;let $;if(x)try{$=await ft.expandAgainstMap({ref:x,map:S.refs})}catch(t){if(!(t instanceof U))throw t;$=x.startsWith("refs/")?x:`refs/heads/${x}`}else $=k;const R=S.refs.get($)||"0000000000000000000000000000000000000000";if(c&&!await c({remote:h,url:v,localRef:{ref:g?"(delete)":k,oid:E},remoteRef:{ref:$,oid:R}}))throw new kr;const P=!S.capabilities.has("no-thin");let I=new Set;if(!g){const r=[...S.refs.values()];let i=new Set;if("0000000000000000000000000000000000000000"!==R){let n=[];try{n=await di({fs:t,cache:e,gitdir:f,oids:[E,R]})}catch(t){n=[]}for(const t of n)r.push(t);P&&(i=await Ji({fs:t,cache:e,gitdir:f,oids:n}))}if(!r.includes(E)){const i=await async function({fs:t,cache:e,dir:r,gitdir:i=q(r,".git"),start:n,finish:a}){const o=await Wr.read({fs:t,gitdir:i}),s=new Set,c=new Set;for(const e of n)s.add(await ft.resolve({fs:t,gitdir:i,ref:e}));for(const e of a)try{const r=await ft.resolve({fs:t,gitdir:i,ref:e});c.add(r)}catch(t){}const f=new Set;async function d(r){f.add(r);const{type:n,object:a}=await Tt({fs:t,cache:e,gitdir:i,oid:r});if("tag"===n)return d(zt.from(a).headers().object);if("commit"!==n)throw new C(r,n,"commit");if(!o.has(r)){const t=Ht.from(a).headers().parent;for(r of t)c.has(r)||f.has(r)||await d(r)}}for(const t of s)await d(t);return f}({fs:t,cache:e,gitdir:f,start:[E],finish:r});I=await Ji({fs:t,cache:e,gitdir:f,oids:i})}if(P){try{const r=await ft.resolve({fs:t,gitdir:f,ref:`refs/remotes/${h}/HEAD`,depth:2}),{oid:n}=await ft.resolveAgainstMap({ref:r.replace(`refs/remotes/${h}/`,""),fullref:r,map:S.refs}),a=[n];for(const r of await Ji({fs:t,cache:e,gitdir:f,oids:a}))i.add(r)}catch(t){}for(const t of i)I.delete(t)}if(E===R&&(p=!0),!p){if(k.startsWith("refs/tags")&&"0000000000000000000000000000000000000000"!==R)throw new tn("tag-exists");if("0000000000000000000000000000000000000000"!==E&&"0000000000000000000000000000000000000000"!==R&&!await Ri({fs:t,cache:e,gitdir:f,oid:E,ancestor:R,depth:-1}))throw new tn("not-fast-forward")}}const O=qr([...S.capabilities],["report-status","side-band-64k",`agent=${Zr.agent}`]),j=await async function({capabilities:t=[],triplets:e=[]}){const r=[];let i=`\0 ${t.join(" ")}`;for(const t of e)r.push(Ur.encode(`${t.oldoid} ${t.oid} ${t.fullRef}${i}\n`)),i="";return r.push(Ur.flush()),r}({capabilities:O,triplets:[{oldoid:R,oid:E,fullRef:$}]}),T=g?[]:await Vi({fs:t,cache:e,gitdir:f,oids:[...I]}),M=await A.connect({http:r,onProgress:i,corsProxy:w,service:"git-receive-pack",url:v,auth:B,headers:m,body:[...j,...T],signal:y}),{packfile:D,progress:N}=await Xr.demux(M.body);n&&Ar(Yr(N),async t=>{await n(t)});const F=await async function(t){const e={};let r="";const i=Ur.streamReader(t);let n=await i();for(;!0!==n;)null!==n&&(r+=n.toString("utf8")+"\n"),n=await i();const a=r.toString("utf8").split("\n");if(n=a.shift(),!n.startsWith("unpack "))throw new Or('unpack ok" or "unpack [error message]',n);e.ok="unpack ok"===n,e.ok||(e.error=n.slice(7)),e.refs={};for(const t of a){if(""===t.trim())continue;const r=t.slice(0,2),i=t.slice(3);let n=i.indexOf(" ");-1===n&&(n=i.length);const a=i.slice(0,n),o=i.slice(n+1);e.refs[a]={ok:"ok"===r,error:o}}return e}(D);if(M.headers&&(F.headers=M.headers),h&&F.ok&&F.refs[$].ok&&!k.startsWith("refs/tags")){const e=`refs/remotes/${h}/${$.replace("refs/heads/","")}`;g?await ft.deleteRef({fs:t,gitdir:f,ref:e}):await ft.writeRef({fs:t,gitdir:f,ref:e,value:E})}if(F.ok&&Object.values(F.refs).every(t=>t.ok))return F;{const t=Object.entries(F.refs).filter(([t,e])=>!e.ok).map(([t,e])=>`\n - ${t}: ${e.error}`).join("");throw new Qi(t,F)}}({fs:c,cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,gitdir:_,ref:d,remoteRef:l,remote:h,url:u,force:p,delete:g,corsProxy:w,headers:m,signal:b})}catch(t){throw t.caller="git.push",t}}async function rn({fs:t,cache:e,gitdir:r,oid:i}){const{type:n,object:a}=await Tt({fs:t,cache:e,gitdir:r,oid:i});if("tag"===n)return rn({fs:t,cache:e,gitdir:r,oid:i=zt.from(a).parse().object});if("blob"!==n)throw new C(i,n,"blob");return{oid:i,blob:new Uint8Array(a)}}async function nn({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){return void 0!==n&&(i=await Me({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await rn({fs:t,cache:e,gitdir:r,oid:i})}async function an({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,filepath:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await nn({fs:e,cache:a,gitdir:o,oid:i,filepath:n})}catch(t){throw t.caller="git.readBlob",t}}async function on({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await Oe({fs:e,cache:n,gitdir:a,oid:i})}catch(t){throw t.caller="git.readCommit",t}}async function sn({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i="refs/notes/commits",oid:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("ref",i),de("oid",n);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){const a=await ft.resolve({gitdir:r,fs:t,ref:i}),{blob:o}=await nn({fs:t,cache:e,gitdir:r,oid:a,filepath:n});return o}({fs:e,cache:a,gitdir:o,ref:i,oid:n})}catch(t){throw t.caller="git.readNote",t}}async function cn({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,format:n="parsed",filepath:a,encoding:o,cache:s={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new ce(t),c=await le({fsp:e,dotgit:r});void 0!==a&&(i=await Me({fs:e,cache:s,gitdir:c,oid:i,filepath:a}));const f="parsed"===n?"content":n,d=await Tt({fs:e,cache:s,gitdir:c,oid:i,format:f});if(d.oid=i,"parsed"===n)switch(d.format="parsed",d.type){case"commit":d.object=Ht.from(d.object).parse();break;case"tree":d.object=pt.from(d.object).entries();break;case"blob":o?d.object=d.object.toString(o):(d.object=new Uint8Array(d.object),d.format="content");break;case"tag":d.object=zt.from(d.object).parse();break;default:throw new C(d.oid,d.type,"blob|commit|tag|tree")}else"deflated"!==d.format&&"wrapped"!==d.format||(d.type=d.format);return d}catch(t){throw t.caller="git.readObject",t}}async function fn({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,oid:i}){const{type:n,object:a}=await Tt({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if("tag"!==n)throw new C(i,n,"tag");const o=zt.from(a);return{oid:i,tag:o.parse(),payload:o.payload()}}({fs:e,cache:n,gitdir:a,oid:i})}catch(t){throw t.caller="git.readTag",t}}async function dn({fs:t,dir:e,gitdir:r=q(e,".git"),oid:i,filepath:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await Fe({fs:e,cache:a,gitdir:o,oid:i,filepath:n})}catch(t){throw t.caller="git.readTree",t}}async function ln({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("filepath",i);const e=new ce(t),a=await le({fsp:e,dotgit:r});await B.acquire({fs:e,gitdir:a,cache:n},async function(t){const e=Array.isArray(i)?i:[i];for(const r of e)t.delete({filepath:r})})}catch(t){throw t.caller="git.remove",t}}async function hn({fs:t,onSign:e,dir:r,gitdir:i=q(r,".git"),ref:n="refs/notes/commits",oid:a,author:o,committer:s,signingKey:c,cache:f={}}){try{de("fs",t),de("gitdir",i),de("oid",a);const r=new ce(t),d=await le({fsp:r,dotgit:i}),l=await Re({fs:r,gitdir:d,author:o});if(!l)throw new Ee("author");const h=await Pe({fs:r,gitdir:d,author:l,committer:s});if(!h)throw new Ee("committer");return await async function({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:a,author:o,committer:s,signingKey:c}){let f;try{f=await ft.resolve({gitdir:i,fs:t,ref:n})}catch(t){if(!(t instanceof U))throw t}let d=(await Fe({fs:t,cache:e,gitdir:i,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;d=d.filter(t=>t.path!==a);const l=await ze({fs:t,gitdir:i,tree:d});return await Ue({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:l,parent:f&&[f],message:"Note removed by 'isomorphic-git removeNote'\n",author:o,committer:s,signingKey:c})}({fs:r,cache:f,onSign:e,gitdir:d,ref:n,oid:a,author:l,committer:h,signingKey:c})}catch(t){throw t.caller="git.removeNote",t}}async function un({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i,oldref:n,checkout:a=!1}){try{de("fs",t),de("gitdir",r),de("ref",i),de("oldref",n);const e=new ce(t),o=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!G(i,!0))throw new D(i,T.clean(i));if(!G(r,!0))throw new D(r,T.clean(r));const a=`refs/heads/${r}`,o=`refs/heads/${i}`;if(await ft.exists({fs:t,gitdir:e,ref:o}))throw new Le("branch",i,!1);const s=await ft.resolve({fs:t,gitdir:e,ref:a,depth:1});await ft.writeRef({fs:t,gitdir:e,ref:o,value:s}),await ft.deleteRef({fs:t,gitdir:e,ref:a});const c=await mr({fs:t,gitdir:e,fullname:!0});(n||c===a)&&await ft.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:o})}({fs:e,gitdir:o,ref:i,oldref:n,checkout:a})}catch(t){throw t.caller="git.renameBranch",t}}async function pn({gitdir:t,type:e,object:r}){return y(gt.wrap({type:e,object:r}))}async function gn({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i,ref:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("filepath",i);const o=new ce(t),s=await le({fsp:o,dotgit:r});let c,f;try{c=await ft.resolve({fs:o,gitdir:s,ref:n||"HEAD"})}catch(t){if(n||!(t instanceof U))throw t}if(c)try{c=await Me({fs:o,cache:a,gitdir:s,oid:c,filepath:i})}catch(t){if(!(t instanceof U||t instanceof Te||t instanceof C&&t.data.filepath))throw t;c=null}let d={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0};const l=e&&await o.read(q(e,i));l&&(f=await pn({gitdir:s,type:"blob",object:l}),c===f&&(d=await o.lstat(q(e,i)))),await B.acquire({fs:o,gitdir:s,cache:a},async function(t){t.delete({filepath:i}),c&&t.insert({filepath:i,stats:d,oid:c})})}catch(t){throw t.caller="git.reset",t}}async function wn({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i,depth:n}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new ce(t),a=await le({fsp:e,dotgit:r});return await ft.resolve({fs:e,gitdir:a,ref:i,depth:n})}catch(t){throw t.caller="git.resolveRef",t}}async function mn({fs:t,dir:e,gitdir:r=q(e,".git"),path:i,value:n,append:a=!1}){try{de("fs",t),de("gitdir",r),de("path",i);const e=new ce(t),o=await le({fsp:e,dotgit:r}),s=await at.get({fs:e,gitdir:o});a?await s.append(i,n):await s.set(i,n),await at.save({fs:e,gitdir:o,config:s})}catch(t){throw t.caller="git.setConfig",t}}async function yn({fs:t,gitdir:e,commit:r}){const i=Ht.from(r).toObject();return await be({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}tn.code="PushRejectedError";class bn{static get timezoneOffsetForRefLogEntry(){const t=(new Date).getTimezoneOffset(),e=Math.abs(Math.floor(t/60)),r=Math.abs(t%60).toString().padStart(2,"0");return`${t>0?"-":"+"}${e.toString().padStart(2,"0")}${r}`}static createStashReflogEntry(t,e,r){const i=t.name.replace(/\s/g,""),n=Math.floor(Date.now()/1e3),a=bn.timezoneOffsetForRefLogEntry;return`0000000000000000000000000000000000000000 ${e} ${i} ${t.email} ${n} ${a}\t${r}\n`}static getStashReflogEntry(t,e=!1){return t.split("\n").filter(t=>t).reverse().map((t,r)=>e?`stash@{${r}}: ${t.split("\t")[1]}`:t)}}class _n{constructor({fs:t,dir:e,gitdir:r=q(e,".git")}){Object.assign(this,{fs:t,dir:e,gitdir:r,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return q(this.gitdir,_n.refStash)}get refLogsStashPath(){return q(this.gitdir,_n.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Re({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Ee("author");return this._author}async getStashSHA(t,e){return await this.fs.exists(this.refStashPath)?(e||await this.readStashReflogs({parsed:!1}))[t].split(" ")[1]:null}async writeStashCommit({message:t,tree:e,parent:r}){return yn({fs:this.fs,gitdir:this.gitdir,commit:{message:t,tree:e,parent:r,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(t){const e=await this.readStashReflogs({parsed:!1});if(0!==t&&(t<0||t>e.length-1))throw new D(`stash@${t}`,"number that is in range of [0, num of stash pushed]");const r=await this.getStashSHA(t,e);return r?Oe({fs:this.fs,cache:{},gitdir:this.gitdir,oid:r}):{}}async writeStashRef(t){return ft.writeRef({fs:this.fs,gitdir:this.gitdir,ref:_n.refStash,value:t})}async writeStashReflogEntry({stashCommit:t,message:e}){const r=await this.getAuthor(),i=bn.createStashReflogEntry(r,t,e),n=this.refLogsStashPath;await A(n,async()=>{const t=await this.fs.exists(n)?await this.fs.read(n,"utf8"):"";await this.fs.write(n,t+i,"utf8")})}async readStashReflogs({parsed:t=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];const e=await this.fs.read(this.refLogsStashPath,"utf8");return bn.getStashReflogEntry(e,t)}}async function vn({fs:t,dir:e,gitdir:r,message:i=""}){const n=new _n({fs:t,dir:e,gitdir:r});await n.getAuthor();const a=await mr({fs:t,gitdir:r,fullname:!1}),o=await ft.resolve({fs:t,gitdir:r,ref:"HEAD"}),s=(await on({fs:t,dir:e,gitdir:r,oid:o})).commit.message,c=[o];let f=null,d=qt({ref:"HEAD"});const l=await lr({fs:t,dir:e,gitdir:r,treePair:[qt({ref:"HEAD"}),"stage"]});if(l){const t=await n.writeStashCommit({message:`stash-Index: WIP on ${a} - ${(new Date).toISOString()}`,tree:l,parent:c});c.push(t),f=l,d=j()}const h=await lr({fs:t,dir:e,gitdir:r,treePair:[d,"workdir"]});if(h){const t=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${(new Date).toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(t),f=h}if(!f||!l&&!h)throw new U("changes, nothing to stash");const u=(i.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${s}`;return{stashCommit:await n.writeStashCommit({message:u,tree:f,parent:c}),stashMsg:u,branch:a,stashMgr:n}}async function xn({fs:t,dir:e,gitdir:r,message:i=""}){const{stashCommit:n,stashMsg:a,branch:o,stashMgr:s}=await vn({fs:t,dir:e,gitdir:r,message:i});return await s.writeStashRef(n),await s.writeStashReflogEntry({stashCommit:n,message:a}),await tr({fs:t,dir:e,gitdir:r,ref:o,track:!1,force:!0}),n}async function kn({fs:t,dir:e,gitdir:r,message:i=""}){const{stashCommit:n}=await vn({fs:t,dir:e,gitdir:r,message:i});return n}async function En({fs:t,dir:e,gitdir:r,refIdx:i=0}){const n=new _n({fs:t,dir:e,gitdir:r}),a=await n.readStashCommit(i),{parent:o=null}=a.commit?a.commit:{};if(o&&Array.isArray(o))for(let i=0;i<o.length-1;i++){const n=(await Oe({fs:t,cache:{},gitdir:r,oid:o[i+1]})).commit.message.startsWith("stash-Index");await hr({fs:t,dir:e,gitdir:r,stashCommit:o[i+1],parentCommit:o[i],wasStaged:n})}}async function An({fs:t,dir:e,gitdir:r,refIdx:i=0}){const n=new _n({fs:t,dir:e,gitdir:r});if(!(await n.readStashCommit(i)).commit)return;const a=n.refStashPath;await A(a,async()=>{await t.exists(a)&&await t.rm(a)});const o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);const s=n.refLogsStashPath;await A(s,async()=>{if(o.length){await t.write(s,o.reverse().join("\n")+"\n","utf8");const e=o[o.length-1].split(" ")[1];await n.writeStashRef(e)}else await t.rm(s)})}async function Sn({fs:t,dir:e,gitdir:r}){return new _n({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function Bn({fs:t,dir:e,gitdir:r}){const i=new _n({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await A(n,async()=>{await Promise.all(n.map(async e=>{if(await t.exists(e))return t.rm(e)}))})}async function $n({fs:t,dir:e,gitdir:r,refIdx:i=0}){await En({fs:t,dir:e,gitdir:r,refIdx:i}),await An({fs:t,dir:e,gitdir:r,refIdx:i})}async function Rn({fs:t,dir:e,gitdir:r=q(e,".git"),op:i="push",message:n="",refIdx:a=0}){de("fs",t),de("dir",e),de("gitdir",r),de("op",i);const o={push:xn,apply:En,drop:An,list:Sn,clear:Bn,pop:$n,create:kn},s=["apply","drop","pop"];try{const c=new ce(t),f=await le({fsp:c,dotgit:r});["refs","logs","logs/refs"].map(t=>q(f,t)).forEach(async t=>{await c.exists(t)||await c.mkdir(t)});const d=o[i];if(d){if(s.includes(i)&&a<0)throw new D(`stash@${a}`,"number that is in range of [0, num of stash pushed]");return await d({fs:c,dir:e,gitdir:f,message:n,refIdx:a})}throw new Error(`To be implemented: ${i}`)}catch(t){throw t.caller="git.stash",t}}async function Pn({fs:t,dir:e,gitdir:r=q(e,".git"),filepath:i,cache:n={},refresh:a=!0}){try{de("fs",t),de("gitdir",r),de("filepath",i);const o=new ce(t),s=await le({fsp:o,dotgit:r}),c=await async function({fs:t,cache:e,gitdir:r}){let i;try{i=await ft.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(t){if(t instanceof U)return[];throw t}const{tree:n}=await Fe({fs:t,cache:e,gitdir:r,oid:i});return n}({fs:o,cache:n,gitdir:s}),f=await In({fs:o,cache:n,gitdir:s,tree:c,path:i}),d=await B.acquire({fs:o,gitdir:s,cache:n},async function(t){for(const e of t)if(e.path===i)return e;return null});if(null===f&&null===d&&await we.isIgnored({fs:o,gitdir:s,dir:e,filepath:i}))return"ignored";const l=await o.lstat(q(e,i)),h=null!==f,u=null!==d,p=null!==l&&(h||u||await async function({fs:t,dir:e,filepath:r}){const i=r.replace(/\\/g,"/").split("/").filter(t=>""!==t&&"."!==t);let n=e;for(const e of i){let r;try{r=await t._readdir(n)}catch(t){if("ENOENT"===t.code||"ENOTDIR"===t.code)return!1;throw t}if(!r.some(t=>t.normalize()===e.normalize()))return!1;n=q(n,e)}return!0}({fs:o,dir:e,filepath:i})),g=async()=>{if(u&&!x(d,l))return d.oid;{const t=await at.get({fs:o,gitdir:s}),r=await t.get("core.autocrlf"),c=await o.read(q(e,i),{autocrlf:r}),f=await pn({gitdir:s,type:"blob",object:c});return a&&u&&d.oid===f&&-1!==l.size&&await B.acquire({fs:o,gitdir:s,cache:n},async function(t){t.insert({filepath:i,stats:l,oid:f})}),f}};if(!h&&!p&&!u)return"absent";if(!h&&!p&&u)return"*absent";if(!h&&p&&!u)return"*added";if(!h&&p&&u)return await g()===d.oid?"added":"*added";if(h&&!p&&!u)return"deleted";if(h&&!p&&u)return d.oid,"*deleted";if(h&&p&&!u)return await g()===f?"*undeleted":"*undeletemodified";if(h&&p&&u){const t=await g();return t===f?t===d.oid?"unmodified":"*unmodified":t===d.oid?"modified":"*modified"}}catch(t){throw t.caller="git.status",t}}async function In({fs:t,cache:e,gitdir:r,tree:i,path:n}){"string"==typeof n&&(n=n.split("/"));const a=n.shift();for(const o of i)if(o.path===a){if(0===n.length)return o.oid;const{type:i,object:a}=await Tt({fs:t,cache:e,gitdir:r,oid:o.oid});if("tree"===i)return In({fs:t,cache:e,gitdir:r,tree:pt.from(a),path:n});if("blob"===i)throw new C(o.oid,i,"blob",n.join("/"))}return null}async function On({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{de("fs",t),de("gitdir",r),de("ref",i);const f=new ce(t),d=await le({fsp:f,dotgit:r});return await Jt({fs:f,cache:o,dir:e,gitdir:d,trees:[qt({ref:i}),Kt({refresh:c}),j()],map:async function(t,[r,i,o]){if(!r&&!o&&i&&!s&&await we.isIgnored({fs:f,dir:e,filepath:t}))return null;if(!n.some(e=>Xe(t,e)))return null;if(a&&!a(t))return;const[c,d,l]=await Promise.all([r&&r.type(),i&&i.type(),o&&o.type()]),h=[c,d,l].includes("blob");if(("tree"===c||"special"===c)&&!h)return;if("commit"===c)return null;if(("tree"===d||"special"===d)&&!h)return;if("commit"===l)return null;if(("tree"===l||"special"===l)&&!h)return;const u="blob"===c?await r.oid():void 0,p="blob"===l?await o.oid():void 0;let g;"blob"!==c&&"blob"===d&&"blob"!==l?g="42":"blob"===d&&(g=await i.oid());const w=[void 0,u,g,p],m=w.map(t=>w.indexOf(t));return m.shift(),[t,...m]}})}catch(t){throw t.caller="git.statusMatrix",t}}async function jn({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i,object:n,force:a=!1}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new ce(t);if(void 0===i)throw new fe("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;const o=await le({fsp:e,dotgit:r}),s=await ft.resolve({fs:e,gitdir:o,ref:n||"HEAD"});if(!a&&await ft.exists({fs:e,gitdir:o,ref:i}))throw new Le("tag",i);await ft.writeRef({fs:e,gitdir:o,ref:i,value:s})}catch(t){throw t.caller="git.tag",t}}async function Un({fs:t,dir:e,gitdir:r=q(e,".git"),cache:i={},filepath:n,oid:a,mode:o,add:s,remove:c,force:f}){try{de("fs",t),de("gitdir",r),de("filepath",n);const d=new ce(t),l=await le({fsp:d,dotgit:r});if(c)return await B.acquire({fs:d,gitdir:l,cache:i},async function(t){if(!f){const t=await d.lstat(q(e,n));if(t){if(t.isDirectory())throw new Te("directory");return}}t.has({filepath:n})&&t.delete({filepath:n})});let h;if(!a){if(h=await d.lstat(q(e,n)),!h)throw new U(`file at "${n}" on disk and "remove" not set`);if(h.isDirectory())throw new Te("directory")}return await B.acquire({fs:d,gitdir:l,cache:i},async function(t){if(!s&&!t.has({filepath:n}))throw new U(`file at "${n}" in index and "add" not set`);let r;if(a)r={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{r=h;const t=r.isSymbolicLink()?await d.readlink(q(e,n)):await d.read(q(e,n));a=await be({fs:d,gitdir:l,type:"blob",format:"content",object:t})}return t.insert({filepath:n,oid:a,stats:r}),a})}catch(t){throw t.caller="git.updateIndex",t}}function Cn(){try{return Zr.version}catch(t){throw t.caller="git.version",t}}async function Tn({fs:t,dir:e,gitdir:r=q(e,".git"),trees:i,map:n,reduce:a,iterate:o,cache:s={}}){try{de("fs",t),de("gitdir",r),de("trees",i);const c=new ce(t),f=await le({fsp:c,dotgit:r});return await Jt({fs:c,cache:s,dir:e,gitdir:f,trees:i,map:n,reduce:a,iterate:o})}catch(t){throw t.caller="git.walk",t}}async function Mn({fs:t,dir:e,gitdir:r=q(e,".git"),blob:i}){try{de("fs",t),de("gitdir",r),de("blob",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await be({fs:e,gitdir:n,type:"blob",object:i,format:"content"})}catch(t){throw t.caller="git.writeBlob",t}}async function Dn({fs:t,dir:e,gitdir:r=q(e,".git"),commit:i}){try{de("fs",t),de("gitdir",r),de("commit",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await yn({fs:e,gitdir:n,commit:i})}catch(t){throw t.caller="git.writeCommit",t}}async function Nn({fs:t,dir:e,gitdir:r=q(e,".git"),type:i,object:n,format:a="parsed",oid:o,encoding:s}){try{const e=new ce(t),c=await le({fsp:e,dotgit:r});if("parsed"===a){switch(i){case"commit":n=Ht.from(n).toObject();break;case"tree":n=pt.from(n).toObject();break;case"blob":n=Buffer.from(n,s);break;case"tag":n=zt.from(n).toObject();break;default:throw new C(o||"",i,"blob|commit|tag|tree")}a="content"}return await be({fs:e,gitdir:c,type:i,object:n,oid:o,format:a})}catch(t){throw t.caller="git.writeObject",t}}async function Fn({fs:t,dir:e,gitdir:r=q(e,".git"),ref:i,value:n,force:a=!1,symbolic:o=!1}){try{de("fs",t),de("gitdir",r),de("ref",i),de("value",n);const e=new ce(t);if(!G(i,!0))throw new D(i,T.clean(i));const s=await le({fsp:e,dotgit:r});if(!a&&await ft.exists({fs:e,gitdir:s,ref:i}))throw new Le("ref",i);o?await ft.writeSymbolicRef({fs:e,gitdir:s,ref:i,value:n}):(n=await ft.resolve({fs:e,gitdir:s,ref:n}),await ft.writeRef({fs:e,gitdir:s,ref:i,value:n}))}catch(t){throw t.caller="git.writeRef",t}}async function zn({fs:t,dir:e,gitdir:r=q(e,".git"),tag:i}){try{de("fs",t),de("gitdir",r),de("tag",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,tag:r}){const i=zt.from(r).toObject();return await be({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}({fs:e,gitdir:n,tag:i})}catch(t){throw t.caller="git.writeTag",t}}async function Ln({fs:t,dir:e,gitdir:r=q(e,".git"),tree:i}){try{de("fs",t),de("gitdir",r),de("tree",i);const e=new ce(t),n=await le({fsp:e,dotgit:r});return await ze({fs:e,gitdir:n,tree:i})}catch(t){throw t.caller="git.writeTree",t}}const Hn={Errors:t,STAGE:j,TREE:qt,WORKDIR:Kt,add:ve,abortMerge:ue,addNote:He,addRemote:Ge,annotatedTag:qe,branch:Ze,cherryPick:pr,checkout:tr,clone:ti,commit:ei,getConfig:bi,getConfigAll:_i,setConfig:mn,currentBranch:ri,deleteBranch:ii,deleteRef:ni,deleteRemote:ai,deleteTag:oi,expandOid:ci,expandRef:fi,fastForward:pi,fetch:gi,findMergeBase:wi,findRoot:yi,getRemoteInfo:xi,getRemoteInfo2:Ei,hashBlob:Ai,indexPack:Si,init:Bi,isDescendent:Pi,isIgnored:Ii,listBranches:Oi,listFiles:Ci,listNotes:Ti,listRefs:Mi,listRemotes:Di,listServerRefs:Ni,listTags:Fi,log:qi,merge:Zi,packObjects:Yi,pull:Xi,push:en,readBlob:an,readCommit:on,readNote:sn,readObject:cn,readTag:fn,readTree:dn,remove:ln,removeNote:hn,renameBranch:un,resetIndex:gn,updateIndex:Un,resolveRef:wn,status:Pn,statusMatrix:On,tag:jn,version:Cn,walk:Tn,writeBlob:Mn,writeCommit:Dn,writeObject:Nn,writeRef:Fn,writeTag:zn,writeTree:Ln,stash:Rn}})(),i})());
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.git=e():t.git=e()}(self,()=>(()=>{var t={41:(t,e,r)=>{"use strict";var i=r(655),n=r(8068),a=r(9675),o=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],d=!!o&&o(t,e);if(i)i(t,e,{configurable:null===f&&d?d.configurable:!f,enumerable:null===s&&d?d.enumerable:!s,value:r,writable:null===c&&d?d.writable:!c});else{if(!l&&(s||c||f))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},76:t=>{"use strict";t.exports=Function.prototype.call},251:(t,e)=>{e.read=function(t,e,r,i,n){var a,o,s=8*n-i-1,c=(1<<s)-1,f=c>>1,l=-7,d=r?n-1:0,h=r?-1:1,u=t[e+d];for(d+=h,a=u&(1<<-l)-1,u>>=-l,l+=s;l>0;a=256*a+t[e+d],d+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=i;l>0;o=256*o+t[e+d],d+=h,l-=8);if(0===a)a=1-f;else{if(a===c)return o?NaN:1/0*(u?-1:1);o+=Math.pow(2,i),a-=f}return(u?-1:1)*o*Math.pow(2,a-i)},e.write=function(t,e,r,i,n,a){var o,s,c,f=8*a-n-1,l=(1<<f)-1,d=l>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,u=i?0:a-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(s=0,o=l):o+d>=1?(s=(e*c-1)*Math.pow(2,n),o+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;t[r+u]=255&s,u+=p,s/=256,n-=8);for(o=o<<n|s,f+=n;f>0;t[r+u]=255&o,u+=p,o/=256,f-=8);t[r+u-p]|=128*g}},392:(t,e,r)=>{"use strict";var i=r(8188).Buffer,n=r(5377);function a(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a.prototype.update=function(t,e){t=n(t,e||"utf8");for(var r=this._block,i=this._blockSize,a=t.length,o=this._len,s=0;s<a;){for(var c=o%i,f=Math.min(a-s,i-c),l=0;l<f;l++)r[c+l]=t[s+l];s+=f,(o+=f)%i===0&&this._update(r)}return this._len+=a,this},a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},414:t=>{"use strict";t.exports=Math.round},453:(t,e,r)=>{"use strict";var i,n=r(9612),a=r(9383),o=r(1237),s=r(9290),c=r(9538),f=r(8068),l=r(9675),d=r(5345),h=r(1514),u=r(8968),p=r(6188),g=r(8002),w=r(5880),m=r(414),y=r(3093),b=Function,_=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},v=r(5795),x=r(655),k=function(){throw new l},E=v?function(){try{return k}catch(t){try{return v(arguments,"callee").get}catch(t){return k}}}():k,A=r(4039)(),S=r(3628),B=r(1064),$=r(8648),R=r(1002),P=r(76),I={},O="undefined"!=typeof Uint8Array&&S?S(Uint8Array):i,j={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":A&&S?S([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":I,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&S?S(S([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&S?S((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&S?S((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&S?S(""[Symbol.iterator]()):i,"%Symbol%":A?Symbol:i,"%SyntaxError%":f,"%ThrowTypeError%":E,"%TypedArray%":O,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":R,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":B,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":p,"%Math.min%":g,"%Math.pow%":w,"%Math.round%":m,"%Math.sign%":y,"%Reflect.getPrototypeOf%":$};if(S)try{null.error}catch(t){var U=S(S(t));j["%Error.prototype%"]=U}var T=function t(e){var r;if("%AsyncFunction%"===e)r=_("async function () {}");else if("%GeneratorFunction%"===e)r=_("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=_("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&S&&(r=S(n.prototype))}return j[e]=r,r},C={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=r(6743),D=r(9957),F=M.call(P,Array.prototype.concat),N=M.call(R,Array.prototype.splice),z=M.call(P,String.prototype.replace),L=M.call(P,String.prototype.slice),H=M.call(P,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(t,e){var r,i=t;if(D(C,i)&&(i="%"+(r=C[i])[0]+"%"),D(j,i)){var n=j[i];if(n===I&&(n=T(i)),void 0===n&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new f("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,t))throw new f("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=L(t,0,1),r=L(t,-1);if("%"===e&&"%"!==r)throw new f("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new f("invalid intrinsic syntax, expected opening `%`");var i=[];return z(t,W,function(t,e,r,n){i[i.length]=r?z(n,G,"$1"):e||t}),i}(t),i=r.length>0?r[0]:"",n=q("%"+i+"%",e),a=n.name,o=n.value,s=!1,c=n.alias;c&&(i=c[0],N(r,F([0,1],c)));for(var d=1,h=!0;d<r.length;d+=1){var u=r[d],p=L(u,0,1),g=L(u,-1);if(('"'===p||"'"===p||"`"===p||'"'===g||"'"===g||"`"===g)&&p!==g)throw new f("property names with quotes must have matching quotes");if("constructor"!==u&&h||(s=!0),D(j,a="%"+(i+="."+u)+"%"))o=j[a];else if(null!=o){if(!(u in o)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(v&&d+1>=r.length){var w=v(o,u);o=(h=!!w)&&"get"in w&&!("originalValue"in w.get)?w.get:o[u]}else h=D(o,u),o=o[u];h&&!s&&(j[a]=o)}}return o}},487:(t,e,r)=>{"use strict";var i=r(6897),n=r(655),a=r(3126),o=r(2205);t.exports=function(t){var e=a(arguments),r=t.length-(arguments.length-1);return i(e,1+(r>0?r:0),!0)},n?n(t.exports,"apply",{value:o}):t.exports.apply=o},592:(t,e,r)=>{"use strict";var i=r(655),n=function(){return!!i};n.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch(t){return!0}},t.exports=n},655:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},809:t=>{"use strict";var e=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if("undefined"==typeof process||void 0===process.domain)throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||e.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||e.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||e.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=e.DEFAULT_MAX_PENDING};e.DEFAULT_TIMEOUT=0,e.DEFAULT_MAX_OCCUPATION_TIME=0,e.DEFAULT_MAX_EXECUTION_TIME=0,e.DEFAULT_MAX_PENDING=1e3,e.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if("function"!=typeof e)throw new Error("You must pass a function to execute");var n=null,a=null,o=null;"function"!=typeof r&&(i=r,r=null,o=new this.Promise(function(t,e){n=t,a=e})),i=i||{};var s=!1,c=null,f=null,l=null,d=this,h=function(e,i,c){f&&(clearTimeout(f),f=null),l&&(clearTimeout(l),l=null),e&&(d.queues[t]&&0===d.queues[t].length&&delete d.queues[t],d.domainReentrant&&delete d.domains[t]),s||(o?i?a(i):n(c):"function"==typeof r&&r(i,c),s=!0),e&&d.queues[t]&&d.queues[t].length>0&&d.queues[t].shift()()},u=function(r){if(s)return h(r);c&&(clearTimeout(c),c=null),d.domainReentrant&&r&&(d.domains[t]=process.domain);var n=i.maxExecutionTime||d.maxExecutionTime;if(n&&(l=setTimeout(function(){d.queues[t]&&h(r,new Error("Maximum execution time is exceeded "+t))},n)),1===e.length){var a=!1;try{e(function(t,e){a||(a=!0,h(r,t,e))})}catch(t){a||(a=!0,h(r,t))}}else d._promiseTry(function(){return e()}).then(function(t){h(r,void 0,t)},function(t){h(r,t)})};d.domainReentrant&&process.domain&&(u=process.domain.bind(u));var p=i.maxPending||d.maxPending;if(d.queues[t])if(d.domainReentrant&&process.domain&&process.domain===d.domains[t])u(!1);else if(d.queues[t].length>=p)h(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){u(!0)};i.skipQueue?d.queues[t].unshift(g):d.queues[t].push(g);var w=i.timeout||d.timeout;w&&(c=setTimeout(function(){c=null,h(!1,new Error("async-lock timed out in queue "+t))},w))}else d.queues[t]=[],u(!0);var m=i.maxOccupationTime||d.maxOccupationTime;return m&&(f=setTimeout(function(){d.queues[t]&&h(!1,new Error("Maximum occupation time is exceeded in queue "+t))},m)),o||void 0},e.prototype._acquireBatch=function(t,e,r,i){"function"!=typeof r&&(i=r,r=null);var n=this,a=t.reduceRight(function(t,e){return function(t,e){return function(r){n.acquire(t,e,r,i)}}(e,t)},e);if("function"!=typeof r)return new this.Promise(function(t,e){1===a.length?a(function(r,i){r?e(r):t(i)}):t(a())});a(r)},e.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0},e.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(t){return this.Promise.reject(t)}},t.exports=e},945:(t,e,r)=>{var i=r(8287),n=i.Buffer;function a(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(a(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),a(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},1002:t=>{"use strict";t.exports=Function.prototype.apply},1064:(t,e,r)=>{"use strict";var i=r(9612);t.exports=i.getPrototypeOf||null},1237:t=>{"use strict";t.exports=EvalError},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(t,e);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},1447:(t,e,r)=>{"use strict";var i=r(9805),n=r(3269),a=r(4823),o=r(7293),s=r(1998),c=-2,f=12,l=30;function d(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):c}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):c}function g(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?c:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,p(t))):c}function w(t,e){var r,i;return t?(i=new h,t.state=i,i.window=null,0!==(r=g(t,e))&&(t.state=null),r):c}var m,y,b=!0;function _(t){if(b){var e;for(m=new i.Buf32(512),y=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,y,0,t.work,{bits:5}),b=!1}t.lencode=m,t.lenbits=9,t.distcode=y,t.distbits=5}function v(t,e,r,n){var a,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new i.Buf8(o.wsize)),n>=o.wsize?(i.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>n&&(a=n),i.arraySet(o.window,e,r-n,a,o.wnext),(n-=a)?(i.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}e.inflateReset=p,e.inflateReset2=g,e.inflateResetKeep=u,e.inflateInit=function(t){return w(t,15)},e.inflateInit2=w,e.inflate=function(t,e){var r,h,u,p,g,w,m,y,b,x,k,E,A,S,B,$,R,P,I,O,j,U,T,C,M=0,D=new i.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return c;(r=t.state).mode===f&&(r.mode=13),g=t.next_out,u=t.output,m=t.avail_out,p=t.next_in,h=t.input,w=t.avail_in,y=r.hold,b=r.bits,x=w,k=m,U=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(2&r.wrap&&35615===y){r.check=0,D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0),y=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=l;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=l;break}if(b-=4,j=8+(15&(y>>>=4)),0===r.wbits)r.wbits=j;else if(j>r.wbits){t.msg="invalid window size",r.mode=l;break}r.dmax=1<<j,t.adler=r.check=1,r.mode=512&y?10:f,y=0,b=0;break;case 2:for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(r.flags=y,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=l;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=l;break}r.head&&(r.head.text=y>>8&1),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.head&&(r.head.time=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,D[2]=y>>>16&255,D[3]=y>>>24&255,r.check=a(r.check,D,4,0)),y=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(D[0]=255&y,D[1]=y>>>8&255,r.check=a(r.check,D,2,0)),y=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((E=r.length)>w&&(E=w),E&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,h,p,E,j)),512&r.flags&&(r.check=a(r.check,h,E,p)),w-=E,p+=E,r.length-=E),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===w)break t;E=0;do{j=h[p+E++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&E<w);if(512&r.flags&&(r.check=a(r.check,h,E,p)),w-=E,p+=E,j)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===w)break t;E=0;do{j=h[p+E++],r.head&&j&&r.length<65536&&(r.head.comment+=String.fromCharCode(j))}while(j&&E<w);if(512&r.flags&&(r.check=a(r.check,h,E,p)),w-=E,p+=E,j)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(y!==(65535&r.check)){t.msg="header crc mismatch",r.mode=l;break}y=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=f;break;case 10:for(;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}t.adler=r.check=d(y),y=0,b=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=w,r.hold=y,r.bits=b,2;t.adler=r.check=1,r.mode=f;case f:if(5===e||6===e)break t;case 13:if(r.last){y>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}switch(r.last=1&y,b-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6===e){y>>>=2,b-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=l}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if((65535&y)!=(y>>>16^65535)){t.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&y,y=0,b=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(E=r.length){if(E>w&&(E=w),E>m&&(E=m),0===E)break t;i.arraySet(u,h,p,E,g),w-=E,p+=E,m-=E,g+=E,r.length-=E;break}r.mode=f;break;case 17:for(;b<14;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(r.nlen=257+(31&y),y>>>=5,b-=5,r.ndist=1+(31&y),y>>>=5,b-=5,r.ncode=4+(15&y),y>>>=4,b-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.lens[F[r.have++]]=7&y,y>>>=3,b-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},U=s(0,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,U){t.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;$=(M=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,R=65535&M,!((B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(R<16)y>>>=B,b-=B,r.lens[r.have++]=R;else{if(16===R){for(C=B+2;b<C;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(y>>>=B,b-=B,0===r.have){t.msg="invalid bit length repeat",r.mode=l;break}j=r.lens[r.have-1],E=3+(3&y),y>>>=2,b-=2}else if(17===R){for(C=B+3;b<C;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}b-=B,j=0,E=3+(7&(y>>>=B)),y>>>=3,b-=3}else{for(C=B+7;b<C;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}b-=B,j=0,E=11+(127&(y>>>=B)),y>>>=7,b-=7}if(r.have+E>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=l;break}for(;E--;)r.lens[r.have++]=j}}if(r.mode===l)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,T={bits:r.lenbits},U=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,U){t.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},U=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,U){t.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(w>=6&&m>=258){t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=w,r.hold=y,r.bits=b,o(t,k),g=t.next_out,u=t.output,m=t.avail_out,p=t.next_in,h=t.input,w=t.avail_in,y=r.hold,b=r.bits,r.mode===f&&(r.back=-1);break}for(r.back=0;$=(M=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,R=65535&M,!((B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if($&&!(240&$)){for(P=B,I=$,O=R;$=(M=r.lencode[O+((y&(1<<P+I)-1)>>P)])>>>16&255,R=65535&M,!(P+(B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}y>>>=P,b-=P,r.back+=P}if(y>>>=B,b-=B,r.back+=B,r.length=R,0===$){r.mode=26;break}if(32&$){r.back=-1,r.mode=f;break}if(64&$){t.msg="invalid literal/length code",r.mode=l;break}r.extra=15&$,r.mode=22;case 22:if(r.extra){for(C=r.extra;b<C;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.length+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;$=(M=r.distcode[y&(1<<r.distbits)-1])>>>16&255,R=65535&M,!((B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(!(240&$)){for(P=B,I=$,O=R;$=(M=r.distcode[O+((y&(1<<P+I)-1)>>P)])>>>16&255,R=65535&M,!(P+(B=M>>>24)<=b);){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}y>>>=P,b-=P,r.back+=P}if(y>>>=B,b-=B,r.back+=B,64&$){t.msg="invalid distance code",r.mode=l;break}r.offset=R,r.extra=15&$,r.mode=24;case 24:if(r.extra){for(C=r.extra;b<C;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}r.offset+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===m)break t;if(E=k-m,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=l;break}E>r.wnext?(E-=r.wnext,A=r.wsize-E):A=r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=u,A=g-r.offset,E=r.length;E>m&&(E=m),m-=E,r.length-=E;do{u[g++]=S[A++]}while(--E);0===r.length&&(r.mode=21);break;case 26:if(0===m)break t;u[g++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===w)break t;w--,y|=h[p++]<<b,b+=8}if(k-=m,t.total_out+=k,r.total+=k,k&&(t.adler=r.check=r.flags?a(r.check,u,k,g-k):n(r.check,u,k,g-k)),k=m,(r.flags?y:d(y))!==r.check){t.msg="incorrect data check",r.mode=l;break}y=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===w)break t;w--,y+=h[p++]<<b,b+=8}if(y!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=l;break}y=0,b=0}r.mode=29;case 29:U=1;break t;case l:U=-3;break t;case 31:return-4;default:return c}return t.next_out=g,t.avail_out=m,t.next_in=p,t.avail_in=w,r.hold=y,r.bits=b,(r.wsize||k!==t.avail_out&&r.mode<l&&(r.mode<27||4!==e))&&v(t,t.output,t.next_out,k-t.avail_out)?(r.mode=31,-4):(x-=t.avail_in,k-=t.avail_out,t.total_in+=x,t.total_out+=k,r.total+=k,r.wrap&&k&&(t.adler=r.check=r.flags?a(r.check,u,k,t.next_out-k):n(r.check,u,k,t.next_out-k)),t.data_type=r.bits+(r.last?64:0)+(r.mode===f?128:0)+(20===r.mode||15===r.mode?256:0),(0===x&&0===k||4===e)&&0===U&&(U=-5),U)},e.inflateEnd=function(t){if(!t||!t.state)return c;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var r;return t&&t.state&&2&(r=t.state).wrap?(r.head=e,e.done=!1,0):c},e.inflateSetDictionary=function(t,e){var r,i=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?c:11===r.mode&&n(1,e,i,0)!==r.check?-3:v(t,e,i,i)?(r.mode=31,-4):(r.havedict=1,0):c},e.inflateInfo="pako inflate (from Nodeca project)"},1514:t=>{"use strict";t.exports=Math.abs},1668:(t,e,r)=>{"use strict";var i={};(0,r(9805).assign)(i,r(3303),r(7083),r(9681)),t.exports=i},1996:(t,e,r)=>{"use strict";var i=r(9805),n=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var o=new i.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function c(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",o=0;o<e;o++)r+=String.fromCharCode(t[o]);return r}o[254]=o[254]=1,e.string2buf=function(t){var e,r,n,a,o,s=t.length,c=0;for(a=0;a<s;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),c+=r<128?1:r<2048?2:r<65536?3:4;for(e=new i.Buf8(c),o=0,a=0;o<c;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},e.buf2binstring=function(t){return c(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,i,n,a,s=e||t.length,f=new Array(2*s);for(i=0,r=0;r<s;)if((n=t[r++])<128)f[i++]=n;else if((a=o[n])>4)f[i++]=65533,r+=a-1;else{for(n&=2===a?31:3===a?15:7;a>1&&r<s;)n=n<<6|63&t[r++],a--;a>1?f[i++]=65533:n<65536?f[i++]=n:(n-=65536,f[i++]=55296|n>>10&1023,f[i++]=56320|1023&n)}return c(f,i)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},1998:(t,e,r)=>{"use strict";var i=r(9805),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,r,c,f,l,d,h){var u,p,g,w,m,y,b,_,v,x=h.bits,k=0,E=0,A=0,S=0,B=0,$=0,R=0,P=0,I=0,O=0,j=null,U=0,T=new i.Buf16(16),C=new i.Buf16(16),M=null,D=0;for(k=0;k<=15;k++)T[k]=0;for(E=0;E<c;E++)T[e[r+E]]++;for(B=x,S=15;S>=1&&0===T[S];S--);if(B>S&&(B=S),0===S)return f[l++]=20971520,f[l++]=20971520,h.bits=1,0;for(A=1;A<S&&0===T[A];A++);for(B<A&&(B=A),P=1,k=1;k<=15;k++)if(P<<=1,(P-=T[k])<0)return-1;if(P>0&&(0===t||1!==S))return-1;for(C[1]=0,k=1;k<15;k++)C[k+1]=C[k]+T[k];for(E=0;E<c;E++)0!==e[r+E]&&(d[C[e[r+E]]++]=E);if(0===t?(j=M=d,y=19):1===t?(j=n,U-=257,M=a,D-=257,y=256):(j=o,M=s,y=-1),O=0,E=0,k=A,m=l,$=B,R=0,g=-1,w=(I=1<<B)-1,1===t&&I>852||2===t&&I>592)return 1;for(;;){b=k-R,d[E]<y?(_=0,v=d[E]):d[E]>y?(_=M[D+d[E]],v=j[U+d[E]]):(_=96,v=0),u=1<<k-R,A=p=1<<$;do{f[m+(O>>R)+(p-=u)]=b<<24|_<<16|v}while(0!==p);for(u=1<<k-1;O&u;)u>>=1;if(0!==u?(O&=u-1,O+=u):O=0,E++,0===--T[k]){if(k===S)break;k=e[r+d[E]]}if(k>B&&(O&w)!==g){for(0===R&&(R=B),m+=A,P=1<<($=k-R);$+R<S&&!((P-=T[$+R])<=0);)$++,P<<=1;if(I+=1<<$,1===t&&I>852||2===t&&I>592)return 1;f[g=O&w]=B<<24|$<<16|m-l}}return 0!==O&&(f[m+O]=k-R<<24|64<<16),h.bits=B,0}},2205:(t,e,r)=>{"use strict";var i=r(6743),n=r(1002),a=r(3144);t.exports=function(){return a(i,n,arguments)}},2535:t=>{function e(t){return Array.isArray(t)?t:[t]}const r=/^\s+$/,i=/(?:[^\\]|^)\\$/,n=/^\\!/,a=/^\\#/,o=/\r?\n/g,s=/^\.*\/|^\.+$/;let c="node-ignore";"undefined"!=typeof Symbol&&(c=Symbol.for("node-ignore"));const f=c,l=/([0-z])-([0-z])/g,d=()=>!1,h=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(0===r.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(t,e)=>{const{length:r}=e;return e.slice(0,r-r%2)+" "}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>e+r.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>"\\"===e?`\\[${r}${(t=>{const{length:e}=t;return t.slice(0,e-e%2)})(i)}${n}`:"]"===n&&i.length%2==0?`[${(t=>t.replace(l,(t,e,r)=>e.charCodeAt(0)<=r.charCodeAt(0)?t:""))(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>(e?`${e}[^/]+`:"[^/]*")+"(?=$|\\/$)"]],u=Object.create(null),p=t=>"string"==typeof t;class g{constructor(t,e,r,i){this.origin=t,this.pattern=e,this.negative=r,this.regex=i}}const w=(t,e)=>{throw new e(t)},m=(t,e,r)=>p(t)?t?!m.isNotRelative(t)||r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),y=t=>s.test(t);m.isNotRelative=y,m.convert=t=>t;class b{constructor({ignorecase:t=!0,ignoreCase:e=t,allowRelativePaths:r=!1}={}){var i;i=f,Object.defineProperty(this,i,{value:true}),this._rules=[],this._ignoreCase=e,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[f])return this._rules=this._rules.concat(t._rules),void(this._added=!0);if((t=>t&&p(t)&&!r.test(t)&&!i.test(t)&&0!==t.indexOf("#"))(t)){const e=((t,e)=>{const r=t;let i=!1;0===t.indexOf("!")&&(i=!0,t=t.substr(1));const o=((t,e)=>{let r=u[t];return r||(r=h.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),u[t]=r),e?new RegExp(r,"i"):new RegExp(r)})(t=t.replace(n,"!").replace(a,"#"),e);return new g(r,t,i,o)})(t,this._ignoreCase);this._added=!0,this._rules.push(e)}}add(t){return this._added=!1,e(p(t)?(t=>t.split(o))(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,e){let r=!1,i=!1;return this._rules.forEach(n=>{const{negative:a}=n;i===a&&r!==i||a&&!r&&!i&&!e||n.regex.test(t)&&(r=!a,i=a)}),{ignored:r,unignored:i}}_test(t,e,r,i){const n=t&&m.convert(t);return m(n,t,this._allowRelativePaths?d:w),this._t(n,e,r,i)}_t(t,e,r,i){if(t in e)return e[t];if(i||(i=t.split("/")),i.pop(),!i.length)return e[t]=this._testOne(t,r);const n=this._t(i.join("/")+"/",e,r,i);return e[t]=n.ignored?n:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return e(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const _=t=>new b(t);if(_.isPathValid=t=>m(t&&m.convert(t),t,d),_.default=_,t.exports=_,"undefined"!=typeof process&&(process.env&&process.env.IGNORE_TEST_WIN32||"win32"===process.platform)){const t=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");m.convert=t;const e=/^[a-z]:\//i;m.isNotRelative=t=>e.test(t)||y(t)}},2566:(t,e)=>{var r;r=function(t){t.version="1.2.2";var e=function(){for(var t=0,e=new Array(256),r=0;256!=r;++r)t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=r)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1,e[r]=t;return"undefined"!=typeof Int32Array?new Int32Array(e):e}(),r=function(t){var e=0,r=0,i=0,n="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(i=0;256!=i;++i)n[i]=t[i];for(i=0;256!=i;++i)for(r=t[i],e=256+i;e<4096;e+=256)r=n[e]=r>>>8^t[255&r];var a=[];for(i=1;16!=i;++i)a[i-1]="undefined"!=typeof Int32Array?n.subarray(256*i,256*i+256):n.slice(256*i,256*i+256);return a}(e),i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],f=r[6],l=r[7],d=r[8],h=r[9],u=r[10],p=r[11],g=r[12],w=r[13],m=r[14];t.table=e,t.bstr=function(t,r){for(var i=-1^r,n=0,a=t.length;n<a;)i=i>>>8^e[255&(i^t.charCodeAt(n++))];return~i},t.buf=function(t,r){for(var y=-1^r,b=t.length-15,_=0;_<b;)y=m[t[_++]^255&y]^w[t[_++]^y>>8&255]^g[t[_++]^y>>16&255]^p[t[_++]^y>>>24]^u[t[_++]]^h[t[_++]]^d[t[_++]]^l[t[_++]]^f[t[_++]]^c[t[_++]]^s[t[_++]]^o[t[_++]]^a[t[_++]]^n[t[_++]]^i[t[_++]]^e[t[_++]];for(b+=15;_<b;)y=y>>>8^e[255&(y^t[_++])];return~y},t.str=function(t,r){for(var i=-1^r,n=0,a=t.length,o=0,s=0;n<a;)(o=t.charCodeAt(n++))<128?i=i>>>8^e[255&(i^o)]:o<2048?i=(i=i>>>8^e[255&(i^(192|o>>6&31))])>>>8^e[255&(i^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),s=1023&t.charCodeAt(n++),i=(i=(i=(i=i>>>8^e[255&(i^(240|o>>8&7))])>>>8^e[255&(i^(128|o>>2&63))])>>>8^e[255&(i^(128|s>>6&15|(3&o)<<4))])>>>8^e[255&(i^(128|63&s))]):i=(i=(i=i>>>8^e[255&(i^(224|o>>12&15))])>>>8^e[255&(i^(128|o>>6&63))])>>>8^e[255&(i^(128|63&o))];return~i}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(e):r({})},2682:(t,e,r)=>{"use strict";var i=r(9600),n=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!i(e))throw new TypeError("iterator must be a function");var o,s;arguments.length>=3&&(o=r),s=t,"[object Array]"===n.call(s)?function(t,e,r){for(var i=0,n=t.length;i<n;i++)a.call(t,i)&&(null==r?e(t[i],i,t):e.call(r,t[i],i,t))}(t,e,o):"string"==typeof t?function(t,e,r){for(var i=0,n=t.length;i<n;i++)null==r?e(t.charAt(i),i,t):e.call(r,t.charAt(i),i,t)}(t,e,o):function(t,e,r){for(var i in t)a.call(t,i)&&(null==r?e(t[i],i,t):e.call(r,t[i],i,t))}(t,e,o)}},3093:(t,e,r)=>{"use strict";var i=r(4459);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},3126:(t,e,r)=>{"use strict";var i=r(6743),n=r(9675),a=r(76),o=r(3144);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return o(i,a,t)}},3144:(t,e,r)=>{"use strict";var i=r(6743),n=r(1002),a=r(76),o=r(7119);t.exports=o||i.call(a,n)},3269:t=>{"use strict";t.exports=function(t,e,r,i){for(var n=65535&t,a=t>>>16&65535,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(n=n+e[i++]|0)|0}while(--o);n%=65521,a%=65521}return n|a<<16}},3303:(t,e,r)=>{"use strict";var i=r(8411),n=r(9805),a=r(1996),o=r(4674),s=r(4442),c=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(o[r]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var l;if(l="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=i.deflateSetDictionary(this.strm,l)))throw new Error(o[r]);this._dict_set=!0}}function l(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||o[r.err];return r.result}f.prototype.push=function(t,e){var r,o,s=this.strm,f=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=a.string2buf(t):"[object ArrayBuffer]"===c.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new n.Buf8(f),s.next_out=0,s.avail_out=f),1!==(r=i.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=i.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=f,e.deflate=l,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},3548:t=>{t.exports=function(t,e){var r,i,n=t,a=e,o=n.length,s=a.length,c=!1,f=null,l=o+1,d=[],h=[],u=[],p="",g=function(t,e,r){return{x:t,y:e,k:r}},w=function(t,e){return{elem:t,t:e}},m=function(t,e,r){var i,c,f;for(i=e>r?d[t-1+l]:d[t+1+l],c=(f=Math.max(e,r))-t;c<o&&f<s&&n[c]===a[f];)++c,++f;return d[t+l]=h.length,h[h.length]=new g(c,f,i),f};return o>=s&&(r=n,i=o,n=a,a=r,o=s,s=i,c=!0,l=o+1),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return f},getlcs:function(){return p},getses:function(){return u},compose:function(){var t,e,r,i,y,b,_,v;for(t=s-o,e=o+s+3,r={},_=0;_<e;++_)r[_]=-1,d[_]=-1;i=-1;do{for(v=-++i;v<=t-1;++v)r[v+l]=m(v,r[v-1+l]+1,r[v+1+l]);for(v=t+i;v>=t+1;--v)r[v+l]=m(v,r[v-1+l]+1,r[v+1+l]);r[t+l]=m(t,r[t-1+l]+1,r[t+1+l])}while(r[t+l]!==s);for(f=t+2*i,y=d[t+l],b=[];-1!==y;)b[b.length]=new g(h[y].x,h[y].y,null),y=h[y].k;!function(t){var e,r,i;for(e=r=0,i=t.length-1;i>=0;--i)for(;e<t[i].x||r<t[i].y;)t[i].y-t[i].x>r-e?(u[u.length]=new w(a[r],c?-1:1),++r):t[i].y-t[i].x<r-e?(u[u.length]=new w(n[e],c?1:-1),++e):(u[u.length]=new w(n[e],0),p+=n[e],++e,++r)}(b)}}}},3628:(t,e,r)=>{"use strict";var i=r(8648),n=r(1064),a=r(7176);t.exports=i?function(t){return i(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return n(t)}:a?function(t){return a(t)}:null},3665:(t,e,r)=>{"use strict";var i=r(9805);function n(t){for(var e=t.length;--e>=0;)t[e]=0}var a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);n(f);var l=new Array(60);n(l);var d=new Array(512);n(d);var h=new Array(256);n(h);var u=new Array(29);n(u);var p,g,w,m=new Array(30);function y(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?d[t]:d[256+(t>>>7)]}function v(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function x(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,v(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function k(t,e,r){x(t,r[2*e],r[2*e+1])}function E(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function A(t,e,r){var i,n,a=new Array(16),o=0;for(i=1;i<=15;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var s=t[2*n+1];0!==s&&(t[2*n]=E(a[s]++,s))}}function S(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function B(t){t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function $(t,e,r,i){var n=2*e,a=2*r;return t[n]<t[a]||t[n]===t[a]&&i[e]<=i[r]}function R(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&$(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!$(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}function P(t,e,r){var i,n,s,c,f=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*f]<<8|t.pending_buf[t.d_buf+2*f+1],n=t.pending_buf[t.l_buf+f],f++,0===i?k(t,n,e):(k(t,(s=h[n])+256+1,e),0!==(c=a[s])&&x(t,n-=u[s],c),k(t,s=_(--i),r),0!==(c=o[s])&&x(t,i-=m[s],c))}while(f<t.last_lit);k(t,256,e)}function I(t,e){var r,i,n,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,c=e.stat_desc.elems,f=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<c;r++)0!==a[2*r]?(t.heap[++t.heap_len]=f=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)a[2*(n=t.heap[++t.heap_len]=f<2?++f:0)]=1,t.depth[n]=0,t.opt_len--,s&&(t.static_len-=o[2*n+1]);for(e.max_code=f,r=t.heap_len>>1;r>=1;r--)R(t,a,r);n=c;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,a[2*n]=a[2*r]+a[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,a[2*r+1]=a[2*i+1]=n,t.heap[1]=n++,R(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,a,o,s,c=e.dyn_tree,f=e.max_code,l=e.stat_desc.static_tree,d=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(a=c[2*c[2*(i=t.heap[r])+1]+1]+1)>p&&(a=p,g++),c[2*i+1]=a,i>f||(t.bl_count[a]++,o=0,i>=u&&(o=h[i-u]),s=c[2*i],t.opt_len+=s*(a+o),d&&(t.static_len+=s*(l[2*i+1]+o)));if(0!==g){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(i=t.bl_count[a];0!==i;)(n=t.heap[--r])>f||(c[2*n+1]!==a&&(t.opt_len+=(a-c[2*n+1])*c[2*n],c[2*n+1]=a),i--)}}(t,e),A(a,f,t.bl_count)}function O(t,e,r){var i,n,a=-1,o=e[1],s=0,c=7,f=4;for(0===o&&(c=138,f=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++s<c&&n===o||(s<f?t.bl_tree[2*n]+=s:0!==n?(n!==a&&t.bl_tree[2*n]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,a=n,0===o?(c=138,f=3):n===o?(c=6,f=3):(c=7,f=4))}function j(t,e,r){var i,n,a=-1,o=e[1],s=0,c=7,f=4;for(0===o&&(c=138,f=3),i=0;i<=r;i++)if(n=o,o=e[2*(i+1)+1],!(++s<c&&n===o)){if(s<f)do{k(t,n,t.bl_tree)}while(0!==--s);else 0!==n?(n!==a&&(k(t,n,t.bl_tree),s--),k(t,16,t.bl_tree),x(t,s-3,2)):s<=10?(k(t,17,t.bl_tree),x(t,s-3,3)):(k(t,18,t.bl_tree),x(t,s-11,7));s=0,a=n,0===o?(c=138,f=3):n===o?(c=6,f=3):(c=7,f=4)}}n(m);var U=!1;function T(t,e,r,n){x(t,0+(n?1:0),3),function(t,e,r){B(t),v(t,r),v(t,~r),i.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r)}e._tr_init=function(t){U||(function(){var t,e,r,i,n,c=new Array(16);for(r=0,i=0;i<28;i++)for(u[i]=r,t=0;t<1<<a[i];t++)h[r++]=i;for(h[r-1]=i,n=0,i=0;i<16;i++)for(m[i]=n,t=0;t<1<<o[i];t++)d[n++]=i;for(n>>=7;i<30;i++)for(m[i]=n<<7,t=0;t<1<<o[i]-7;t++)d[256+n++]=i;for(e=0;e<=15;e++)c[e]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,c[8]++;for(;t<=255;)f[2*t+1]=9,t++,c[9]++;for(;t<=279;)f[2*t+1]=7,t++,c[7]++;for(;t<=287;)f[2*t+1]=8,t++,c[8]++;for(A(f,287,c),t=0;t<30;t++)l[2*t+1]=5,l[2*t]=E(t,5);p=new y(f,a,257,286,15),g=new y(l,o,0,30,15),w=new y(new Array(0),s,0,19,7)}(),U=!0),t.l_desc=new b(t.dyn_ltree,p),t.d_desc=new b(t.dyn_dtree,g),t.bl_desc=new b(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,S(t)},e._tr_stored_block=T,e._tr_flush_block=function(t,e,r,i){var n,a,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),o=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*c[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==e?T(t,e,r,i):4===t.strategy||a===n?(x(t,2+(i?1:0),3),P(t,f,l)):(x(t,4+(i?1:0),3),function(t,e,r,i){var n;for(x(t,e-257,5),x(t,r-1,5),x(t,i-4,4),n=0;n<i;n++)x(t,t.bl_tree[2*c[n]+1],3);j(t,t.dyn_ltree,e-1),j(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),P(t,t.dyn_ltree,t.dyn_dtree)),S(t),i&&B(t)},e._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(h[r]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){x(t,2,3),k(t,256,f),function(t){16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},3737:(t,e,r)=>{"use strict";var i=r(6698),n=r(392),a=r(8188).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,n.call(this,64,56)}function f(t){return t<<1|t>>>31}function l(t){return t<<5|t>>>27}function d(t){return t<<30|t>>>2}function h(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,n=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)e[c]=t.readInt32BE(4*c);for(;c<80;++c)e[c]=f(e[c-3]^e[c-8]^e[c-14]^e[c-16]);for(var u=0;u<80;++u){var p=~~(u/20),g=l(r)+h(p,i,n,a)+s+e[u]+o[p]|0;s=a,a=n,n=d(i),i=r,r=g}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var t=a.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},4039:(t,e,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,n=r(1333);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}},4372:(t,e,r)=>{"use strict";var i=r(9675),n=r(6556)("TypedArray.prototype.buffer",!0),a=r(5680);t.exports=n||function(t){if(!a(t))throw new i("Not a Typed Array");return t.buffer}},4442:t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},4459:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},4674:t=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},4823:t=>{"use strict";var e=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,r,i,n){var a=e,o=n+i;t^=-1;for(var s=n;s<o;s++)t=t>>>8^a[255&(t^r[s])];return-1^t}},5345:t=>{"use strict";t.exports=URIError},5377:(t,e,r)=>{"use strict";var i=r(945).Buffer,n=r(4634),a=r(4372),o=ArrayBuffer.isView||function(t){try{return a(t),!0}catch(t){return!1}},s="undefined"!=typeof Uint8Array,c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,f=c&&(i.prototype instanceof Uint8Array||i.TYPED_ARRAY_SUPPORT);t.exports=function(t,e){if(t instanceof i)return t;if("string"==typeof t)return i.from(t,e);if(c&&o(t)){if(0===t.byteLength)return i.alloc(0);if(f){var r=i.from(t.buffer,t.byteOffset,t.byteLength);if(r.byteLength===t.byteLength)return r}var a=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),l=i.from(a);if(l.length===t.byteLength)return l}if(s&&t instanceof Uint8Array)return i.from(t);var d=n(t);if(d)for(var h=0;h<t.length;h+=1){var u=t[h];if("number"!=typeof u||u<0||u>255||~~u!==u)throw new RangeError("Array items must be numbers in the range 0-255.")}if(d||i.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return i.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},5680:(t,e,r)=>{"use strict";var i=r(5767);t.exports=function(t){return!!i(t)}},5767:(t,e,r)=>{"use strict";var i=r(2682),n=r(9209),a=r(487),o=r(6556),s=r(5795),c=r(3628),f=o("Object.prototype.toString"),l=r(9092)(),d="undefined"==typeof globalThis?r.g:globalThis,h=n(),u=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},g={__proto__:null};i(h,l&&s&&c?function(t){var e=new d[t];if(Symbol.toStringTag in e&&c){var r=c(e),i=s(r,Symbol.toStringTag);if(!i&&r){var n=c(r);i=s(n,Symbol.toStringTag)}g["$"+t]=a(i.get)}}:function(t){var e=new d[t],r=e.slice||e.set;r&&(g["$"+t]=a(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l){var e=u(f(t),8,-1);return p(h,e)>-1?e:"Object"===e&&function(t){var e=!1;return i(g,function(r,i){if(!e)try{r(t),e=u(i,1)}catch(t){}}),e}(t)}return s?function(t){var e=!1;return i(g,function(r,i){if(!e)try{"$"+r(t)===i&&(e=u(i,1))}catch(t){}}),e}(t):null}},5795:(t,e,r)=>{"use strict";var i=r(6549);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},5880:t=>{"use strict";t.exports=Math.pow},6188:t=>{"use strict";t.exports=Math.max},6219:t=>{"use strict";function e(t,e,r){return e=e instanceof RegExp?e:new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),t.replace(e,r)}var r={clean:function(t){if("string"!=typeof t)throw new Error("Expected a string, received: "+t);return t=e(t,"./","/"),t=e(t,"..","."),t=e(t," ","-"),t=e(t,/^[~^:?*\\\-]/g,""),t=e(t,/[~^:?*\\]/g,"-"),t=e(t,/[~^:?*\\\-]$/g,""),t=e(t,"@{","-"),t=e(t,/\.$/g,""),t=e(t,/\/$/g,""),e(t,/\.lock$/g,"")}};t.exports=r},6549:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},6556:(t,e,r)=>{"use strict";var i=r(453),n=r(3126),a=n([i("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&a(t,".prototype.")>-1?n([r]):r}},6578:t=>{"use strict";t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6698:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},6743:(t,e,r)=>{"use strict";var i=r(9353);t.exports=Function.prototype.bind||i},6867:t=>{"use strict";const e=(t,e)=>function(...r){return new(0,e.promiseModule)((i,n)=>{e.multiArgs?r.push((...t)=>{e.errorFirst?t[0]?n(t):(t.shift(),i(t)):i(t)}):e.errorFirst?r.push((t,e)=>{t?n(t):i(e)}):r.push(i),t.apply(this,r)})};t.exports=(t,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const i=typeof t;if(null===t||"object"!==i&&"function"!==i)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":i}\``);const n=t=>{const e=e=>"string"==typeof e?t===e:e.test(t);return r.include?r.include.some(e):!r.exclude.some(e)};let a;a="function"===i?function(...i){return r.excludeMain?t(...i):e(t,r).apply(this,i)}:Object.create(Object.getPrototypeOf(t));for(const i in t){const o=t[i];a[i]="function"==typeof o&&n(i)?e(o,r):o}return a}},6895:(t,e,r)=>{var i=r(3548);function n(t,e){for(var r=[],n=t.length,a=e.length,o=function(t,e){var r=new i(t,e);r.compose();for(var n,a,o=r.getses(),s=t.length-1,c=e.length-1,f=o.length-1;f>=0;--f)o[f].t===r.SES_COMMON?(a?(a.chain={file1index:s,file2index:c,chain:null},a=a.chain):a=n={file1index:s,file2index:c,chain:null},s--,c--):o[f].t===r.SES_DELETE?s--:o[f].t===r.SES_ADD&&c--;var l={file1index:-1,file2index:-1,chain:null};return a?(a.chain=l,n):l}(t,e);null!==o;o=o.chain){var s=n-o.file1index-1,c=a-o.file2index-1;n=o.file1index,a=o.file2index,(s||c)&&r.push({file1:[n+1,s],file2:[a+1,c]})}return r.reverse(),r}t.exports=function(t,e,r){var i=[],a=[t,e,r],o=function(t,e,r){var i,a=n(e,t),o=n(e,r),s=[];function c(t,e){s.push([t.file1[0],e,t.file1[1],t.file2[0],t.file2[1]])}for(i=0;i<a.length;i++)c(a[i],0);for(i=0;i<o.length;i++)c(o[i],2);s.sort(function(t,e){return t[0]-e[0]});var f=[],l=0;function d(t){t>l&&(f.push([1,l,t-l]),l=t)}for(var h=0;h<s.length;h++){for(var u=h,p=s[h],g=p[0],w=g+p[2];h<s.length-1;){var m=s[h+1],y=m[0];if(y>w)break;w=Math.max(w,y+m[2]),h++}if(d(g),u==h)p[4]>0&&f.push([p[1],p[3],p[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=u;i<=h;i++){var _=b[(p=s[i])[1]],v=p[0],x=v+p[2],k=p[3],E=k+p[4];_[0]=Math.min(k,_[0]),_[1]=Math.max(E,_[1]),_[2]=Math.min(v,_[2]),_[3]=Math.max(x,_[3])}var A=b[0][0]+(g-b[0][2]),S=b[0][1]+(w-b[0][3]),B=b[2][0]+(g-b[2][2]),$=b[2][1]+(w-b[2][3]);f.push([-1,A,S-A,g,w-g,B,$-B])}l=w}return d(e.length),f}(t,e,r),s=[];function c(){s.length&&i.push({ok:s}),s=[]}function f(t){for(var e=0;e<t.length;e++)s.push(t[e])}function l(e){if(e[2]!=e[6])return!0;for(var i=e[1],n=e[5],a=0;a<e[2];a++)if(t[a+i]!=r[a+n])return!0;return!1}for(var d=0;d<o.length;d++){var h=o[d],u=h[0];-1==u?l(h)?(c(),i.push({conflict:{a:t.slice(h[1],h[1]+h[2]),aIndex:h[1],o:e.slice(h[3],h[3]+h[4]),oIndex:h[3],b:r.slice(h[5],h[5]+h[6]),bIndex:h[5]}})):f(a[0].slice(h[1],h[1]+h[2])):f(a[u].slice(h[1],h[1]+h[2]))}return c(),i}},6897:(t,e,r)=>{"use strict";var i=r(453),n=r(41),a=r(592)(),o=r(5795),s=r(9675),c=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,f=!0;if("length"in t&&o){var l=o(t,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(f=!1)}return(i||f||!r)&&(a?n(t,"length",e,!0,!0):n(t,"length",e)),t}},7083:(t,e,r)=>{"use strict";var i=r(1447),n=r(9805),a=r(1996),o=r(9681),s=r(4674),c=r(4442),f=r(7414),l=Object.prototype.toString;function d(t){if(!(this instanceof d))return new d(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,e.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new f,i.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=i.inflateSetDictionary(this.strm,e.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(t,e){var r=new d(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}d.prototype.push=function(t,e){var r,s,c,f,d,h=this.strm,u=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?h.input=a.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new n.Buf8(u),h.next_out=0,h.avail_out=u),(r=i.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=i.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===g&&(r=o.Z_OK,g=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(c=a.utf8border(h.output,h.next_out),f=h.next_out-c,d=a.buf2string(h.output,c),h.next_out=f,h.avail_out=u-f,f&&n.arraySet(h.output,h.output,c,f,0),this.onData(d)):this.onData(n.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=d,e.inflate=h,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},e.ungzip=h},7119:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(t,e,r)=>{"use strict";var i,n=r(3126),a=r(5795);try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!i&&a&&a(Object.prototype,"__proto__"),s=Object,c=s.getPrototypeOf;t.exports=o&&"function"==typeof o.get?n([o.get]):"function"==typeof c&&function(t){return c(null==t?t:s(t))}},7293:t=>{"use strict";t.exports=function(t,e){var r,i,n,a,o,s,c,f,l,d,h,u,p,g,w,m,y,b,_,v,x,k,E,A,S;r=t.state,i=t.next_in,A=t.input,n=i+(t.avail_in-5),a=t.next_out,S=t.output,o=a-(e-t.avail_out),s=a+(t.avail_out-257),c=r.dmax,f=r.wsize,l=r.whave,d=r.wnext,h=r.window,u=r.hold,p=r.bits,g=r.lencode,w=r.distcode,m=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;t:do{p<15&&(u+=A[i++]<<p,p+=8,u+=A[i++]<<p,p+=8),b=g[u&m];e:for(;;){if(u>>>=_=b>>>24,p-=_,0==(_=b>>>16&255))S[a++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}b=g[(65535&b)+(u&(1<<_)-1)];continue e}for(v=65535&b,(_&=15)&&(p<_&&(u+=A[i++]<<p,p+=8),v+=u&(1<<_)-1,u>>>=_,p-=_),p<15&&(u+=A[i++]<<p,p+=8,u+=A[i++]<<p,p+=8),b=w[u&y];;){if(u>>>=_=b>>>24,p-=_,16&(_=b>>>16&255)){if(x=65535&b,p<(_&=15)&&(u+=A[i++]<<p,(p+=8)<_&&(u+=A[i++]<<p,p+=8)),(x+=u&(1<<_)-1)>c){t.msg="invalid distance too far back",r.mode=30;break t}if(u>>>=_,p-=_,x>(_=a-o)){if((_=x-_)>l&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,E=h,0===d){if(k+=f-_,_<v){v-=_;do{S[a++]=h[k++]}while(--_);k=a-x,E=S}}else if(d<_){if(k+=f+d-_,(_-=d)<v){v-=_;do{S[a++]=h[k++]}while(--_);if(k=0,d<v){v-=_=d;do{S[a++]=h[k++]}while(--_);k=a-x,E=S}}}else if(k+=d-_,_<v){v-=_;do{S[a++]=h[k++]}while(--_);k=a-x,E=S}for(;v>2;)S[a++]=E[k++],S[a++]=E[k++],S[a++]=E[k++],v-=3;v&&(S[a++]=E[k++],v>1&&(S[a++]=E[k++]))}else{k=a-x;do{S[a++]=S[k++],S[a++]=S[k++],S[a++]=S[k++],v-=3}while(v>2);v&&(S[a++]=S[k++],v>1&&(S[a++]=S[k++]))}break}if(64&_){t.msg="invalid distance code",r.mode=30;break t}b=w[(65535&b)+(u&(1<<_)-1)]}}break}}while(i<n&&a<s);i-=v=p>>3,u&=(1<<(p-=v<<3))-1,t.next_in=i,t.next_out=a,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=a<s?s-a+257:257-(a-s),r.hold=u,r.bits=p}},7414:t=>{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,a=s(t),o=a[0],c=a[1],f=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,c)),l=0,d=c>0?o-4:o;for(r=0;r<d;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;return 2===c&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[l++]=255&e),1===c&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e),f},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,a=[],o=16383,s=0,c=i-n;s<c;s+=o)a.push(f(t,s,s+o>c?c:s+o));return 1===n?(e=t[i-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],i[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function f(t,e,r){for(var i,n=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),n.push(c(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8002:t=>{"use strict";t.exports=Math.min},8068:t=>{"use strict";t.exports=SyntaxError},8188:(t,e,r)=>{var i=r(8287),n=i.Buffer;function a(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(a(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),a(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},8287:(t,e,r)=>{"use strict";const i=r(7526),n=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let i=s(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return u(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return u(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return u(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return c.from(i,e,r);const n=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return l(t),s(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function u(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,c.prototype),i}function p(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return i?-1:q(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return $(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,i,n){let a,o=1,s=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,s/=2,c/=2,r/=2}function f(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(a=r;a<s;a++)if(f(t,a)===f(e,-1===i?0:a-i)){if(-1===i&&(i=a),a-i+1===c)return i*o}else-1!==i&&(a-=a-i),i=-1}else for(r+c>s&&(r=s-c),a=r;a>=0;a--){let r=!0;for(let i=0;i<c;i++)if(f(t,a+i)!==f(e,i)){r=!1;break}if(r)return a}return-1}function _(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const a=e.length;let o;for(i>a/2&&(i=a/2),o=0;o<i;++o){const i=parseInt(e.substr(2*o,2),16);if(Y(i))return o;t[r+o]=i}return o}function v(t,e,r,i){return K(q(e,t.length-r),t,r,i)}function x(t,e,r,i){return K(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function k(t,e,r,i){return K(Z(e),t,r,i)}function E(t,e,r,i){return K(function(t,e){let r,i,n;const a=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,a.push(n),a.push(i);return a}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let a=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,s,c;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[n+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(a=c));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(c=(15&e)<<12|(63&r)<<6|63&i,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=t[n+1],i=t[n+2],s=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&s)&&(c=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&s,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),n+=o}return function(t){const e=t.length;if(e<=B)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=B));return r}(i)}e.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},c.allocUnsafe=function(t){return d(t)},c.allocUnsafeSlow=function(t){return d(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,a=Math.min(r,i);n<a;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=c.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(V(e,Uint8Array))n+e.length>i.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):w.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(t,e,r,i,n){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const s=Math.min(a,o),f=this.slice(i,n),l=t.slice(e,r);for(let t=0;t<s;++t)if(f[t]!==l[t]){a=f[t],o=l[t];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},c.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return x(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const B=4096;function $(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function R(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function P(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=X[t[i]];return n}function I(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function O(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,i,n,a){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<a)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function U(t,e,r,i,n){L(e,i,n,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function T(t,e,r,i,n){L(e,i,n,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function C(t,e,r,i,n,a){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function D(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,c.prototype),i},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=this[t],n=1,a=0;for(;++a<e&&(n*=256);)i+=this[t+a]*n;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=this[t],n=1,a=0;for(;++a<e&&(n*=256);)i+=this[t+a]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let i=e,n=1,a=this[t+--i];for(;i>0&&(n*=256);)a+=this[t+--i]*n;return n*=128,a>=n&&(a-=Math.pow(2,8*e)),a},c.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),c.prototype.readBigInt64BE=J(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||W(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),n.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),n.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),n.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),n.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,a=0;for(this[e]=255&t;++a<r&&(n*=256);)this[e+a]=t/n&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,a=1;for(this[e+n]=255&t;--n>=0&&(a*=256);)this[e+n]=t/a&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=J(function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(t,e=0){return T(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=0,a=1,o=0;for(this[e]=255&t;++n<r&&(a*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/a|0)-o&255;return e+r},c.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=r-1,a=1,o=0;for(this[e+n]=255&t;--n>=0&&(a*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/a|0)-o&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=J(function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(t,e=0){return T(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},c.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const a=c.isBuffer(t)?t:c.from(t,i),o=a.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=a[n%o]}return this};const F={};function N(t,e,r){F[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function z(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function L(t,e,r,i,n,a){if(t>r||t<e){const i="bigint"==typeof e?"n":"";let n;throw n=a>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(a+1)}${i}`:`>= -(2${i} ** ${8*(a+1)-1}${i}) and < 2 ** ${8*(a+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new F.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||W(e,t.length-(r+1))}(i,n,a)}function H(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function W(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}N("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),N("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=z(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=z(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const i=t.length;let n=null;const a=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Z(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function J(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},8411:(t,e,r)=>{"use strict";var i,n=r(9805),a=r(3665),o=r(3269),s=r(4823),c=r(4674),f=-2,l=258,d=262,h=103,u=113,p=666;function g(t,e){return t.msg=c[e],e}function w(t){return(t<<1)-(t>4?9:0)}function m(t){for(var e=t.length;--e>=0;)t[e]=0}function y(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function b(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,y(t.strm)}function _(t,e){t.pending_buf[t.pending++]=e}function v(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function x(t,e,r,i){var a=t.avail_in;return a>i&&(a=i),0===a?0:(t.avail_in-=a,n.arraySet(e,t.input,t.next_in,a,r),1===t.state.wrap?t.adler=o(t.adler,e,a,r):2===t.state.wrap&&(t.adler=s(t.adler,e,a,r)),t.next_in+=a,t.total_in+=a,a)}function k(t,e){var r,i,n=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,c=t.strstart>t.w_size-d?t.strstart-(t.w_size-d):0,f=t.window,h=t.w_mask,u=t.prev,p=t.strstart+l,g=f[a+o-1],w=f[a+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+o]===w&&f[r+o-1]===g&&f[r]===f[a]&&f[++r]===f[a+1]){a+=2,r++;do{}while(f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&a<p);if(i=l-(p-a),a=p-l,i>o){if(t.match_start=e,o=i,i>=s)break;g=f[a+o-1],w=f[a+o]}}}while((e=u[e&h])>c&&0!==--n);return o<=t.lookahead?o:t.lookahead}function E(t){var e,r,i,a,o,s=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-d)){n.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=r=t.hash_size;do{i=t.head[--e],t.head[e]=i>=s?i-s:0}while(--r);e=r=s;do{i=t.prev[--e],t.prev[e]=i>=s?i-s:0}while(--r);a+=s}if(0===t.strm.avail_in)break;if(r=x(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=r,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<d&&0!==t.strm.avail_in)}function A(t,e){for(var r,i;;){if(t.lookahead<d){if(E(t),t.lookahead<d&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-d&&(t.match_length=k(t,r)),t.match_length>=3)if(i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function S(t,e){for(var r,i,n;;){if(t.lookahead<d){if(E(t),t.lookahead<d&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-d&&(t.match_length=k(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(b(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=a._tr_tally(t,0,t.window[t.strstart-1]))&&b(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}function B(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function $(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function R(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:u,t.adler=2===e.wrap?0:1,e.last_flush=0,a._tr_init(e),0):g(t,f)}function P(t){var e,r=R(t);return 0===r&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r}function I(t,e,r,i,a,o){if(!t)return f;var s=1;if(-1===e&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>9||8!==r||i<8||i>15||e<0||e>9||o<0||o>4)return g(t,f);8===i&&(i=9);var c=new $;return t.state=c,c.strm=t,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new n.Buf8(2*c.w_size),c.head=new n.Buf16(c.hash_size),c.prev=new n.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new n.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=e,c.strategy=o,c.method=r,P(t)}i=[new B(0,0,0,0,function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(E(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,b(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-d&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(b(t,!1),t.strm.avail_out),1)}),new B(4,4,8,4,A),new B(4,5,16,8,A),new B(4,6,32,32,A),new B(4,4,16,16,S),new B(8,16,32,32,S),new B(8,16,128,128,S),new B(8,32,128,256,S),new B(32,128,258,1024,S),new B(32,258,258,4096,S)],e.deflateInit=function(t,e){return I(t,e,8,15,8,0)},e.deflateInit2=I,e.deflateReset=P,e.deflateResetKeep=R,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?f:(t.state.gzhead=e,0):f},e.deflate=function(t,e){var r,n,o,c;if(!t||!t.state||e>5||e<0)return t?g(t,f):f;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||n.status===p&&4!==e)return g(t,0===t.avail_out?-5:f);if(n.strm=t,r=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,_(n,31),_(n,139),_(n,8),n.gzhead?(_(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),_(n,255&n.gzhead.time),_(n,n.gzhead.time>>8&255),_(n,n.gzhead.time>>16&255),_(n,n.gzhead.time>>24&255),_(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),_(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(_(n,255&n.gzhead.extra.length),_(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=s(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(_(n,0),_(n,0),_(n,0),_(n,0),_(n,0),_(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),_(n,3),n.status=u);else{var d=8+(n.w_bits-8<<4)<<8;d|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(d|=32),d+=31-d%31,n.status=u,v(n,d),0!==n.strstart&&(v(n,t.adler>>>16),v(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),y(t),o=n.pending,n.pending!==n.pending_buf_size));)_(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),y(t),o=n.pending,n.pending===n.pending_buf_size)){c=1;break}c=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,_(n,c)}while(0!==c);n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),0===c&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),y(t),o=n.pending,n.pending===n.pending_buf_size)){c=1;break}c=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,_(n,c)}while(0!==c);n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),0===c&&(n.status=h)}else n.status=h;if(n.status===h&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&y(t),n.pending+2<=n.pending_buf_size&&(_(n,255&t.adler),_(n,t.adler>>8&255),t.adler=0,n.status=u)):n.status=u),0!==n.pending){if(y(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&w(e)<=w(r)&&4!==e)return g(t,-5);if(n.status===p&&0!==t.avail_in)return g(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&n.status!==p){var x=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(E(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,o,s=t.window;;){if(t.lookahead<=l){if(E(t),t.lookahead<=l&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[n=t.strstart-1])===s[++n]&&i===s[++n]&&i===s[++n]){o=t.strstart+l;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=l-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(b(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(b(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(b(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==x&&4!==x||(n.status=p),1===x||3===x)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===x&&(1===e?a._tr_align(n):5!==e&&(a._tr_stored_block(n,0,0,!1),3===e&&(m(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),y(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(_(n,255&t.adler),_(n,t.adler>>8&255),_(n,t.adler>>16&255),_(n,t.adler>>24&255),_(n,255&t.total_in),_(n,t.total_in>>8&255),_(n,t.total_in>>16&255),_(n,t.total_in>>24&255)):(v(n,t.adler>>>16),v(n,65535&t.adler)),y(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==h&&e!==u&&e!==p?g(t,f):(t.state=null,e===u?g(t,-3):0):f},e.deflateSetDictionary=function(t,e){var r,i,a,s,c,l,d,h,u=e.length;if(!t||!t.state)return f;if(2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return f;for(1===s&&(t.adler=o(t.adler,e,u,0)),r.wrap=0,u>=r.w_size&&(0===s&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new n.Buf8(r.w_size),n.arraySet(h,e,u-r.w_size,r.w_size,0),e=h,u=r.w_size),c=t.avail_in,l=t.next_in,d=t.input,t.avail_in=u,t.next_in=0,t.input=e,E(r);r.lookahead>=3;){i=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+3-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--a);r.strstart=i,r.lookahead=2,E(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=l,t.input=d,t.avail_in=c,r.wrap=s,0},e.deflateInfo="pako deflate (from Nodeca project)"},8465:(t,e,r)=>{"use strict";t.exports=r(809)},8648:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8968:t=>{"use strict";t.exports=Math.floor},9092:(t,e,r)=>{"use strict";var i=r(1333);t.exports=function(){return i()&&!!Symbol.toStringTag}},9209:(t,e,r)=>{"use strict";var i=r(6578),n="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<i.length;e++)"function"==typeof n[i[e]]&&(t[t.length]=i[e]);return t}},9290:t=>{"use strict";t.exports=RangeError},9353:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var n=0;n<e.length;n+=1)r[n+t.length]=e[n];return r};t.exports=function(t){var n=this;if("function"!=typeof n||"[object Function]"!==e.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var a,o=function(t){for(var e=[],r=1,i=0;r<t.length;r+=1,i+=1)e[i]=t[r];return e}(arguments),s=r(0,n.length-o.length),c=[],f=0;f<s;f++)c[f]="$"+f;if(a=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(c)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var e=n.apply(this,i(o,arguments));return Object(e)===e?e:this}return n.apply(t,i(o,arguments))}),n.prototype){var l=function(){};l.prototype=n.prototype,a.prototype=new l,l.prototype=null}return a}},9383:t=>{"use strict";t.exports=Error},9538:t=>{"use strict";t.exports=ReferenceError},9600:t=>{"use strict";var e,r,i=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},n(function(){throw 42},null,e)}catch(t){t!==r&&(n=null)}else n=null;var a=/^\s*class\b/,o=function(t){try{var e=i.call(t);return a.test(e)}catch(t){return!1}},s=function(t){try{return!o(t)&&(i.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(d=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=n?function(t){if(d(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{n(t,null,e)}catch(t){if(t!==r)return!1}return!o(t)&&s(t)}:function(t){if(d(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(f)return s(t);if(o(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},9612:t=>{"use strict";t.exports=Object},9675:t=>{"use strict";t.exports=TypeError},9681:t=>{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},9805:(t,e)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(var a=0;a<i;a++)t[n+a]=e[r+a]},flattenChunks:function(t){var e,r,i,n,a,o;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(o=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)a=t[e],o.set(a,n),n+=a.length;return o}},a={arraySet:function(t,e,r,i,n){for(var a=0;a<i;a++)t[n+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(r)},9957:(t,e,r)=>{"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,a=r(6743);t.exports=a.call(i,n)}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,r),a.exports}r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{Errors:()=>t,STAGE:()=>U,TREE:()=>Zt,WORKDIR:()=>Vt,abortMerge:()=>pe,add:()=>xe,addNote:()=>We,addRemote:()=>qe,annotatedTag:()=>Ze,branch:()=>Ke,checkout:()=>er,cherryPick:()=>gr,clone:()=>ei,commit:()=>ri,currentBranch:()=>ii,default:()=>Wn,deleteBranch:()=>ni,deleteRef:()=>ai,deleteRemote:()=>oi,deleteTag:()=>si,expandOid:()=>fi,expandRef:()=>li,fastForward:()=>gi,fetch:()=>wi,findMergeBase:()=>mi,findRoot:()=>bi,getConfig:()=>_i,getConfigAll:()=>vi,getRemoteInfo:()=>ki,getRemoteInfo2:()=>Ai,hashBlob:()=>Si,indexPack:()=>Bi,init:()=>$i,isDescendent:()=>Ii,isIgnored:()=>Oi,listBranches:()=>ji,listFiles:()=>Ci,listNotes:()=>Mi,listRefs:()=>Di,listRemotes:()=>Fi,listServerRefs:()=>Ni,listTags:()=>zi,log:()=>Zi,merge:()=>Ki,packObjects:()=>Xi,pull:()=>Ji,push:()=>rn,readBlob:()=>on,readCommit:()=>sn,readNote:()=>cn,readObject:()=>fn,readTag:()=>ln,readTree:()=>dn,remove:()=>hn,removeNote:()=>un,renameBranch:()=>pn,resetIndex:()=>wn,resolveRef:()=>mn,setConfig:()=>yn,stash:()=>Pn,status:()=>In,statusMatrix:()=>jn,tag:()=>Un,updateIndex:()=>Tn,version:()=>Cn,walk:()=>Mn,writeBlob:()=>Dn,writeCommit:()=>Fn,writeObject:()=>Nn,writeRef:()=>zn,writeTag:()=>Ln,writeTree:()=>Hn});var t={};r.r(t),r.d(t,{AlreadyExistsError:()=>He,AmbiguousError:()=>ci,CheckoutConflictError:()=>Ve,CherryPickLocalChangesError:()=>rr,CherryPickMergeCommitError:()=>ir,CherryPickRootCommitError:()=>nr,CommitNotFetchedError:()=>Ye,DecompressionError:()=>$t,EmptyCommitError:()=>Ee,EmptyServerResponseError:()=>Or,FastForwardError:()=>hi,GitPushError:()=>tn,HttpError:()=>xr,IndexResetError:()=>te,InternalError:()=>a,InvalidFilepathError:()=>Me,InvalidOidError:()=>D,InvalidRefNameError:()=>F,MaxDepthError:()=>Ri,MergeConflictError:()=>ar,MergeNotSupportedError:()=>or,MissingNameError:()=>Ae,MissingParameterError:()=>le,MultipleGitError:()=>ge,NoCommitError:()=>Se,NoRefspecError:()=>N,NotFoundError:()=>T,ObjectTypeError:()=>C,ParseError:()=>jr,PushRejectedError:()=>en,RemoteCapabilityError:()=>br,SmartHttpError:()=>kr,UnknownTransportError:()=>_r,UnmergedPathsError:()=>n,UnsafeFilepathError:()=>o,UrlParseError:()=>vr,UserCanceledError:()=>Er});class e extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const r=new e(t.message),i=r;return i.code=t.code,i.data=t.data,r.caller=t.caller,r.stack=t.stack,r}get isIsomorphicGitError(){return!0}}class n extends e{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=n.code,this.data={filepaths:t}}}n.code="UnmergedPathsError";class a extends e{constructor(t){super(`An internal error caused this command to fail.\n\nIf you're using an application that depends on isomorphic-git, please report this error to that application's developers.\n\nIf you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${t}`),this.code=this.name=a.code,this.data={message:t}}}a.code="InternalError";class o extends e{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=o.code,this.data={filepath:t}}}o.code="UnsafeFilepathError";class s{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const e=this.buffer.slice(this._start,this._start+t);return this._start+=t,e}toString(t,e){const r=this.buffer.toString(t,this._start,this._start+e);return this._start+=e,r}write(t,e,r){const i=this.buffer.write(t,this._start,e,r);return this._start+=e,i}copy(t,e,r){const i=t.copy(this.buffer,this._start,e,r);return this._start+=i,i}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const e=this.buffer.writeUInt8(t,this._start);return this._start+=1,e}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const e=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,e}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const e=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,e}}const c=/[\ud800-]/;function f(t,e,r){if(r<55296||r>57343)return!1;if(r<56320){const r=e+1<t.length?t.charCodeAt(e+1):0;return r<56320||r>57343}const i=e>0?t.charCodeAt(e-1):0;return i<55296||i>56319}function l(t,e){if(!c.test(t)&&!c.test(e))return-(t<e)||+(t>e);const r=Math.min(t.length,e.length);for(let i=0;i<r;i++){let r=t.charCodeAt(i),n=e.charCodeAt(i);if(r!==n){if(f(t,i,r)&&(r=65533),f(e,i,n)&&(n=65533),r===n)continue;return r>=55296&&n>=55296&&(r+=r>=57344?-2048:8192,n+=n>=57344?-2048:8192),r<n?-1:1}}return t.length<e.length?-1:t.length>e.length?1:0}function d(t,e){return l(t.path,e.path)}function h(t){let e=t>0?t>>12:0;4!==e&&8!==e&&10!==e&&14!==e&&(e=8);let r=511&t;return r=73&r?493:420,8!==e&&(r=0),(e<<12)+r}const u=2**32;function p(t,e,r,i){if(void 0!==t&&void 0!==e)return[t,e];void 0===r&&(r=i.valueOf());const n=Math.floor(r/1e3);return[n,1e6*(r-1e3*n)]}function g(t){const[e,r]=p(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=p(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%u,ctimeNanoseconds:r%u,mtimeSeconds:i%u,mtimeNanoseconds:n%u,dev:t.dev%u,ino:t.ino%u,mode:h(t.mode%u),uid:t.uid%u,gid:t.gid%u,size:t.size>-1?t.size%u:0}}var w=r(3737);let m=null;async function y(t){return null===m&&(m=await async function(){try{return"da39a3ee5e6b4b0d3255bfef95601890afd80709"===await b(new Uint8Array([]))}catch(t){}return!1}()),m?b(t):function(t){return(new w).update(t).digest("hex")}(t)}async function b(t){return function(t){let e="";for(const r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}(await crypto.subtle.digest("SHA-1",t))}function _(t){return{assumeValid:Boolean(32768&t),extended:Boolean(16384&t),stage:(12288&t)>>12,nameLength:4095&t,skipWorktree:!1,intentToAdd:!1}}function v(t){return Boolean(t.flags.skipWorktree||t.flags.intentToAdd)}class x{constructor(t,e){this._dirty=!1,this._unmergedPaths=e||new Set,this._entries=t||new Map}_addEntry(t){if(0===t.flags.stage)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let e=this._entries.get(t.path);e||(this._entries.set(t.path,t),e=t),e.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return x.fromBuffer(t);if(null===t)return new x(null);throw new a("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(0===t.length)throw new a("Index file is empty (.git/index)");const e=new x,r=new s(t),i=r.toString("utf8",4);if("DIRC"!==i)throw new a(`Invalid dircache magic file number: ${i}`);const n=await y(t.slice(0,-20)),c=t.slice(-20).toString("hex");if(c!==n)throw new a(`Invalid checksum in GitIndex buffer: expected ${c} but saw ${n}`);const f=r.readUInt32BE();if(2!==f&&3!==f)throw new a(`Unsupported dircache version: ${f}`);const l=r.readUInt32BE();let d=0;for(;!r.eof()&&d<l;){const i={};i.ctimeSeconds=r.readUInt32BE(),i.ctimeNanoseconds=r.readUInt32BE(),i.mtimeSeconds=r.readUInt32BE(),i.mtimeNanoseconds=r.readUInt32BE(),i.dev=r.readUInt32BE(),i.ino=r.readUInt32BE(),i.mode=r.readUInt32BE(),i.uid=r.readUInt32BE(),i.gid=r.readUInt32BE(),i.size=r.readUInt32BE(),i.oid=r.slice(20).toString("hex");const n=r.readUInt16BE();if(i.flags=_(n),i.flags.extended){const t=r.readUInt16BE();if(-24577&t)throw new a(`Unknown index entry format: 0x${t.toString(16)}`);i.flags.skipWorktree=Boolean(16384&t),i.flags.intentToAdd=Boolean(8192&t)}const s=t.indexOf(0,r.tell()+1)-r.tell();if(s<1)throw new a(`Got a path length of: ${s}`);if(i.path=r.toString("utf8",s),i.path.includes("..\\")||i.path.includes("../"))throw new o(i.path);let c=8-(r.tell()-12)%8;for(0===c&&(c=8);c--;){const t=r.readUInt8();if(0!==t)throw new a(`Expected 1-8 null characters but got '${t}' after ${i.path}`);if(r.eof())throw new a("Unexpected end of file")}i.stages=[],e._addEntry(i),d++}return e}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(d)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(t=>t):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:e,oid:r,stage:i=0}){e||(e={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),e=g(e);const n=Buffer.from(t),a=0===i?this._entries.get(t):void 0,o={ctimeSeconds:e.ctimeSeconds,ctimeNanoseconds:e.ctimeNanoseconds,mtimeSeconds:e.mtimeSeconds,mtimeNanoseconds:e.mtimeNanoseconds,dev:e.dev,ino:e.ino,mode:e.mode||33188,uid:e.uid,gid:e.gid,size:e.size,path:t,oid:r,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:n.length<4095?n.length:4095,skipWorktree:Boolean(a?.flags.skipWorktree),intentToAdd:!1},stages:[]};this._addEntry(o),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const e of this._entries.keys())e.startsWith(t+"/")&&this._entries.delete(e);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join("\n")}static async _entryToBuffer(t){const e=Buffer.from(t.path),r=v(t),i=8*Math.ceil((62+(r?2:0)+e.length+1)/8),n=Buffer.alloc(i),a=new s(n),o=g(t);return a.writeUInt32BE(o.ctimeSeconds),a.writeUInt32BE(o.ctimeNanoseconds),a.writeUInt32BE(o.mtimeSeconds),a.writeUInt32BE(o.mtimeNanoseconds),a.writeUInt32BE(o.dev),a.writeUInt32BE(o.ino),a.writeUInt32BE(o.mode),a.writeUInt32BE(o.uid),a.writeUInt32BE(o.gid),a.writeUInt32BE(o.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(function(t){const e=t.flags;return e.extended=v(t),e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((3&e.stage)<<12)+(4095&e.nameLength)}(t)),r&&a.writeUInt16BE(function(t){return(t.flags.skipWorktree?16384:0)+(t.flags.intentToAdd?8192:0)}(t)),a.write(t.path,e.length,"utf8"),n}async toObject(){const t=Buffer.alloc(12),e=new s(t);e.write("DIRC",4,"utf8"),e.writeUInt32BE(this.entriesFlat.some(v)?3:2),e.writeUInt32BE(this.entriesFlat.length);let r=[];for(const t of this.entries)if(r.push(x._entryToBuffer(t)),t.stages.length>1)for(const e of t.stages)e&&e!==t&&r.push(x._entryToBuffer(e));r=await Promise.all(r);const i=Buffer.concat(r),n=Buffer.concat([t,i]),a=await y(n);return Buffer.concat([n,Buffer.from(a,"hex")])}}function k(t,e,r=!0,i=!0){const n=g(t),a=g(e);return r&&n.mode!==a.mode||n.mtimeSeconds!==a.mtimeSeconds||n.ctimeSeconds!==a.ctimeSeconds||n.uid!==a.uid||n.gid!==a.gid||i&&n.ino!==a.ino||n.size!==a.size}var E=r(8465);let A;function S(t,e){return(void 0===A&&(A=new E({maxPending:1/0})),A).acquire(t,e)}const B=Symbol("IndexCache");class ${static async acquire({fs:t,gitdir:e,cache:r,allowUnmerged:i=!0},a){r[B]||(r[B]={map:new Map,stats:new Map});const o=`${e}/index`;let s,c=[];return await S(o,async()=>{const e=r[B];await async function(t,e,r){const i=r.stats.get(e);if(void 0===i)return!0;if(null===i)return!1;const n=await t.lstat(e);if(null===n)return!1;if(k(i,n))return!0;const a=g(i),o=g(n);return a.mtimeNanoseconds!==o.mtimeNanoseconds||a.ctimeNanoseconds!==o.ctimeNanoseconds}(t,o,e)&&await async function(t,e,r){const[i,n]=await Promise.all([t.lstat(e),t.read(e)]),a=await x.from(n);r.map.set(e,a),r.stats.set(e,i)}(t,o,e);const f=e.map.get(o);if(c=f.unmergedPaths,c.length&&!i)throw new n(c);if(s=await a(f),f._dirty){const r=await f.toObject();await t.write(o,r),e.stats.set(o,await t.lstat(o)),f._dirty=!1}}),s}}function R(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function P(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return-1===e?".":0===e?"/":t.slice(0,e)}function I(t){const e=new Map,r=function(t){if(!e.has(t)){const i={type:"tree",fullpath:t,basename:R(t),metadata:{},children:[]};e.set(t,i),i.parent=r(P(t)),i.parent&&i.parent!==i&&i.parent.children.push(i)}return e.get(t)},i=function(t,i){if(!e.has(t)){const n={type:"blob",fullpath:t,basename:R(t),metadata:i,parent:r(P(t)),children:[]};n.parent&&n.parent.children.push(n),e.set(t,n)}return e.get(t)};r(".");for(const e of t)i(e.path,e);return e}class O{constructor({fs:t,gitdir:e,cache:r}){this.treePromise=$.acquire({fs:t,gitdir:e,cache:r},async function(t){return I(t.entries)});const i=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){const e=t._fullpath,r=(await this.treePromise).get(e);if(!r)return null;if("blob"===r.type)return null;if("tree"!==r.type)throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);const i=r.children.map(t=>t.fullpath);return i.sort(l),i}async type(t){return!1===t._type&&await t.stat(),t._type}async mode(t){return!1===t._mode&&await t.stat(),t._mode}async stat(t){if(!1===t._stat){const e=(await this.treePromise).get(t._fullpath);if(!e)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const r="tree"===e.type?{}:g(e.metadata);t._type="tree"===e.type?"tree":function(t){switch(t){case 16384:return"tree";case 33188:case 33261:case 40960:return"blob";case 57344:return"commit"}throw new a(`Unexpected GitTree entry mode: ${t.toString(8)}`)}(r.mode),t._mode=r.mode,"tree"===e.type?t._stat=void 0:t._stat=r}return t._stat}async content(t){}async oid(t){if(!1===t._oid){const e=(await this.treePromise).get(t._fullpath);t._oid=e.metadata.oid}return t._oid}}const j=Symbol("GitWalkSymbol");function U(){const t=Object.create(null);return Object.defineProperty(t,j,{value:function({fs:t,gitdir:e,cache:r}){return new O({fs:t,gitdir:e,cache:r})}}),Object.freeze(t),t}class T extends e{constructor(t){super(`Could not find ${t}.`),this.code=this.name=T.code,this.data={what:t}}}T.code="NotFoundError";class C extends e{constructor(t,e,r,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${r} but it is a ${e}.`),this.code=this.name=C.code,this.data={oid:t,actual:e,expected:r,filepath:i}}}C.code="ObjectTypeError";var M=r(6219);class D extends e{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=D.code,this.data={value:t}}}D.code="InvalidOidError";class F extends e{constructor(t,e){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${e}".)`),this.code=this.name=F.code,this.data={ref:t,suggestion:e}}}F.code="InvalidRefNameError";class N extends e{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:\n[remote "${t}"]\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n`),this.code=this.name=N.code,this.data={remote:t}}}N.code="NoRefspecError";class z{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let e=null;this.parsedConfig=t.trim().split("\n").map(t=>{if(/^\s*#/.test(t))return{line:t,comment:!0};const r=t.indexOf(" ");if(t.startsWith("^")){const r=t.slice(1);return this.refs.set(e+"^{}",r),{line:t,ref:e,peeled:r}}{const i=t.slice(0,r);return e=t.slice(r+1),this.refs.set(e,i),{line:t,ref:e,oid:i}}})}return this}static from(t){return new z(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(e=>e.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join("\n")+"\n"}}class L{constructor({remotePath:t,localPath:e,force:r,matchPrefix:i}){Object.assign(this,{remotePath:t,localPath:e,force:r,matchPrefix:i})}static from(t){const[e,r,i,n,o]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s="+"===e,c="*"===i;if(c!==("*"===o))throw new a("Invalid refspec");return new L({remotePath:r,localPath:n,force:s,matchPrefix:c})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class H{constructor(t=[]){this.rules=t}static from(t){const e=[];for(const r of t)e.push(L.from(r));return new H(e)}add(t){const e=L.from(t);this.rules.push(e)}translate(t){const e=[];for(const r of this.rules)for(const i of t){const t=r.translate(i);t&&e.push([i,t])}return e}translateOne(t){let e=null;for(const r of this.rules){const i=r.translate(t);i&&(e=i)}return e}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function W(t,e){const r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(r<i)||+(r>i);return 0===n?t.endsWith("^{}")?1:-1:n}const G=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function q(t,e){if("string"!=typeof t)throw new TypeError("Reference name must be a string");return!G.test(t)&&(!!e||t.includes("/"))}function Z(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const i=t[r].replace(/\\/g,"/");0!==i.length&&(/^[a-zA-Z]:\//.test(i)||void 0===e?e=i:e+="/"+i)}return void 0===e?".":function(t){if(!t.length)return".";const e=function(t){return t.length>=2&&/^[a-zA-Z]:/.test(t)?t.slice(0,2):null}(t=t.replace(/\\/g,"/")),r="/"===t[0]||null!==e&&"/"===t[2],i="/"===t.at(-1);let n=function(t,e){let r="",i=0,n=-1,a=0,o="\0";for(let s=0;s<=t.length;++s){if(s<t.length)o=t[s];else{if("/"===o)break;o="/"}if("/"===o){if(n===s-1||1===a);else if(2===a){if(r.length<2||2!==i||"."!==r.at(-1)||"."!==r.at(-2)){if(r.length>2){const t=r.lastIndexOf("/");-1===t?(r="",i=0):(r=r.slice(0,t),i=r.length-1-r.lastIndexOf("/")),n=s,a=0;continue}if(0!==r.length){r="",i=0,n=s,a=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,s):r=t.slice(n+1,s),i=s-n-1;n=s,a=0}else"."===o&&-1!==a?++a:a=-1}return r}(e?t.slice(2):t,!r);if(!n.length){const t=e?r?e+"/":e:r?"/":".";return i&&!r?t+"/":t}return i&&(n+="/"),e?r?`${e}/${n}`:`${e}${n}`:r?`/${n}`:n}(e)}const K=t=>{if("boolean"==typeof t)return t;if("true"===(t=t.trim().toLowerCase())||"yes"===t||"on"===t)return!0;if("false"===t||"no"===t||"off"===t)return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},V={core:{filemode:K,bare:K,logallrefupdates:K,symlinks:K,ignorecase:K,bigFileThreshold:t=>{if("number"==typeof t)return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1048576),t.endsWith("g")&&(e*=1073741824),e}}},Y=/^\[([A-Za-z0-9-.]+)(?:[ \t]+"((?:[^"\\]|\\.)*)")?\][ \t]*(?:[#;].*)?$/,X=/^[A-Za-z0-9-.]+$/,J=/^([A-Za-z][A-Za-z0-9-]*)(?:\s*=\s*(.*))?$/,Q=/^[A-Za-z][A-Za-z0-9-]*$/,tt=new Map([["t","\t"],["b","\b"],["n","\n"],["\\","\\"],['"','"']]),et=t=>{let e="",r="",i=!1;for(let n=0;n<t.length;n++){const a=t[n];if(i||!/[ \t\r\v\f]/.test(a)){if(!i&&("#"===a||";"===a))break;e+=r,r="","\\"===a&&tt.has(t[n+1])?e+=tt.get(t[++n]):'"'===a?i=!i:e+=a}else""!==e&&(r+=a)}return e},rt=t=>null!=t?t.toLowerCase():null,it=(t,e,r)=>[rt(t),e,rt(r)].filter(t=>null!=t).join("."),nt=t=>{const e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:it(r,n,i),sectionPath:it(r,n,null),isSection:!!r}};class at{constructor(t){let e=null,r=null;this.parsedConfig=t?t.split("\n").map(t=>{let i=null,n=null;const a=t.trim(),o=(t=>{const e=Y.exec(t);if(null!=e){const[t,r]=e.slice(1);return[t,r&&r.replace(/\\(.)/g,"$1")]}return null})(a),s=null!=o;if(s)[e,r]=o;else{const t=(t=>{const e=J.exec(t);if(null!=e){const[t,r="true"]=e.slice(1);return[t,et(r)]}return null})(a);null!=t&&([i,n]=t)}const c=it(e,r,i);return{line:t,isSection:s,section:e,subsection:r,name:i,value:n,path:c}}):[]}static from(t){return new at(t)}async get(t,e=!1){const r=nt(t).path,i=this.parsedConfig.filter(t=>t.path===r).map(({section:t,name:e,value:r})=>{const i=V[t]&&V[t][e];return i?i(r):r});return e?i:i.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(e=>e.isSection&&e.section===t).map(t=>t.subsection)}async deleteSection(t,e){this.parsedConfig=this.parsedConfig.filter(r=>!(r.section===t&&r.subsection===e))}async append(t,e){return this.set(t,e,!0)}async set(t,e,r=!1){const{section:i,subsection:n,name:a,path:o,sectionPath:s,isSection:c}=nt(t),f=(l=this.parsedConfig,d=t=>t.path===o,l.reduce((t,e,r)=>d(e)?r:t,-1));var l,d;if(null==e)-1!==f&&this.parsedConfig.splice(f,1);else if(-1!==f){const t=this.parsedConfig[f],i=Object.assign({},t,{name:a,value:e,modified:!0});r?this.parsedConfig.splice(f+1,0,i):this.parsedConfig[f]=i}else{const t=this.parsedConfig.findIndex(t=>t.path===s),r={section:i,subsection:n,name:a,value:e,modified:!0,path:o};if(X.test(i)&&Q.test(a))if(t>=0)this.parsedConfig.splice(t+1,0,r);else{const t={isSection:c,section:i,subsection:n,modified:!0,path:s};this.parsedConfig.push(t,r)}}}toString(){return this.parsedConfig.map(({line:t,section:e,subsection:r,name:i,value:n,modified:a=!1})=>a?null!=i&&null!=n?`\t${i} = ${(t=>{if("string"!=typeof t)return t;const e=t.startsWith(" ")||t.endsWith(" ")||/[#;]/.test(t)?'"':"";return`${e}${t.replace(/[\\"\n\t]/g,t=>"\n"===t?"\\n":"\t"===t?"\\t":`\\${t}`)}${e}`})(n)}`:null!=r?`[${e} "${r}"]`:`[${e}]`:t).join("\n")}}class ot{static async get({fs:t,gitdir:e}){const r=await t.read(`${e}/config`,{encoding:"utf8"});return at.from(r)}static async save({fs:t,gitdir:e,config:r}){await t.write(`${e}/config`,r.toString(),{encoding:"utf8"})}}const st=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],ct=["config","description","index","shallow","commondir"];function ft(t){if(ct.includes(t))throw new F(t,`refs/heads/${t}`);if(!q(t,!0))throw new F(t,M.clean(t))}class lt{static async updateRemoteRefs({fs:t,gitdir:e,remote:r,refs:i,symrefs:n,tags:a,refspecs:o,prune:s=!1,pruneTags:c=!1}){for(const t of i.values())if(!t.match(/[0-9a-f]{40}/))throw new D(t);const f=await ot.get({fs:t,gitdir:e});if(!o){if(0===(o=await f.getall(`remote.${r}.fetch`)).length)throw new N(r);o.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}const l=H.from(o),d=new Map,h=l.translate([...i.keys()]),u=[];for(const[t,e]of l.translate([...n.keys()])){const r=l.translateOne(n.get(t));r&&(ft(r),u.push([e,`ref: ${r}`]))}const p=a?[...i.keys()].filter(t=>t.startsWith("refs/tags")&&!t.endsWith("^{}")):[];for(const[,t]of h)ft(t);for(const[t]of u)ft(t);if(p.forEach(ft),c){const r=await lt.listRefs({fs:t,gitdir:e,filepath:"refs/tags"});await lt.deleteRefs({fs:t,gitdir:e,refs:r.map(t=>`refs/tags/${t}`)})}for(const r of p)if(!await lt.exists({fs:t,gitdir:e,ref:r})){const t=i.get(r);d.set(r,t)}for(const[t,e]of h){const r=i.get(t);d.set(e,r)}for(const[t,e]of u)d.set(t,e);const g=[];if(s){for(const r of l.localNamespaces()){const i=(await lt.listRefs({fs:t,gitdir:e,filepath:r})).map(t=>`${r}/${t}`);for(const t of i)d.has(t)||g.push(t)}g.length>0&&await lt.deleteRefs({fs:t,gitdir:e,refs:g})}for(const[r,i]of d)await S(r,async()=>t.write(Z(e,r),`${i.trim()}\n`,"utf8"));return{pruned:g}}static async writeRef({fs:t,gitdir:e,ref:r,value:i}){if(ft(r),!i.match(/[0-9a-f]{40}/))throw new D(i);await S(r,async()=>t.write(Z(e,r),`${i.trim()}\n`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:e,ref:r,value:i}){ft(r),await S(r,async()=>t.write(Z(e,r),`ref: ${i.trim()}\n`,"utf8"))}static async deleteRef({fs:t,gitdir:e,ref:r}){return lt.deleteRefs({fs:t,gitdir:e,refs:[r]})}static async deleteRefs({fs:t,gitdir:e,refs:r}){r.forEach(ft),await Promise.all(r.map(r=>t.rm(Z(e,r))));let i=await S("packed-refs",async()=>t.read(`${e}/packed-refs`,{encoding:"utf8"}));const n=z.from(i),a=n.refs.size;for(const t of r)n.refs.has(t)&&n.delete(t);n.refs.size<a&&(i=n.toString(),await S("packed-refs",async()=>t.write(`${e}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:e,ref:r,depth:i,visited:n=new Set}){if(void 0!==i&&-1===--i)return r;if(r.startsWith("ref: "))return r=r.slice(5),lt.resolve({fs:t,gitdir:e,ref:r,depth:i,visited:n});if(40===r.length&&/[0-9a-f]{40}/.test(r))return r;const o=await lt.packedRefs({fs:t,gitdir:e}),s=st(r).filter(t=>!ct.includes(t));for(const r of s){const s=await S(r,async()=>await t.read(`${e}/${r}`,{encoding:"utf8"})||o.get(r));if(s){if(n.has(r))throw new a(`Circular reference detected while resolving ref "${r}"`);return n.add(r),lt.resolve({fs:t,gitdir:e,ref:s.trim(),depth:i,visited:n})}}throw new T(r)}static async isUnbornBranch({fs:t,gitdir:e,ref:r}){let i;try{i=await lt.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2})}catch(t){if(t instanceof T)return!1;throw t}return!!i.startsWith("refs/heads/")&&("HEAD"===r||st(r).includes(i))}static async exists({fs:t,gitdir:e,ref:r}){try{return await lt.expand({fs:t,gitdir:e,ref:r}),!0}catch(t){if(t instanceof T)return!1;throw t}}static async expand({fs:t,gitdir:e,ref:r}){if(40===r.length&&/[0-9a-f]{40}/.test(r))return r;const i=await lt.packedRefs({fs:t,gitdir:e}),n=st(r).filter(t=>!ct.includes(t));for(const r of n){if(await S(r,async()=>t.exists(`${e}/${r}`)))return r;if(i.has(r))return r}throw new T(r)}static async expandAgainstMap({ref:t,map:e}){const r=st(t);for(const t of r)if(await e.has(t))return t;throw new T(t)}static resolveAgainstMap({ref:t,fullref:e=t,depth:r,map:i}){if(void 0!==r&&-1===--r)return{fullref:e,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),lt.resolveAgainstMap({ref:t,fullref:e,depth:r,map:i});if(40===t.length&&/[0-9a-f]{40}/.test(t))return{fullref:e,oid:t};const n=st(t);for(const t of n){const e=i.get(t);if(e)return lt.resolveAgainstMap({ref:e.trim(),fullref:t,depth:r,map:i})}throw new T(t)}static async packedRefs({fs:t,gitdir:e}){const r=await S("packed-refs",async()=>t.read(`${e}/packed-refs`,{encoding:"utf8"}));return z.from(r).refs}static async listRefs({fs:t,gitdir:e,filepath:r}){const i=await lt.packedRefs({fs:t,gitdir:e});let n=null;try{n=await t.readdirDeep(`${e}/${r}`),n=n.map(t=>t.replace(`${e}/${r}/`,""))}catch(t){n=[]}for(let t of i.keys())t.startsWith(r)&&(t=t.replace(r+"/",""),n.includes(t)||n.push(t));return n.sort(W),n}static async listBranches({fs:t,gitdir:e,remote:r}){return r?lt.listRefs({fs:t,gitdir:e,filepath:`refs/remotes/${r}`}):lt.listRefs({fs:t,gitdir:e,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:e}){return(await lt.listRefs({fs:t,gitdir:e,filepath:"refs/tags"})).filter(t=>!t.endsWith("^{}"))}}function dt(t,e){return l(ht(t),ht(e))}function ht(t){return"040000"===t.mode?t.path+"/":t.path}function ut(t){switch(t){case"040000":return"tree";case"100644":case"100755":case"120000":return"blob";case"160000":return"commit"}throw new a(`Unexpected GitTree entry mode: ${t}`)}function pt(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=function(t){if("number"==typeof t&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new a(`Could not understand file mode: ${t}`)}(t.mode),t.type||(t.type=ut(t.mode)),t}class gt{constructor(t){if(Buffer.isBuffer(t))this._entries=function(t){const e=[];let r=0;for(;r<t.length;){const i=t.indexOf(32,r);if(-1===i)throw new a(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);const n=t.indexOf(0,r);if(-1===n)throw new a(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let s=t.slice(r,i).toString("utf8");"40000"===s&&(s="040000");const c=ut(s),f=t.slice(i+1,n).toString("utf8"),l=f.replace(/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/g,""),d=l.split(":")[0].toLowerCase().replace(/[. ]+$/,"");if(f.includes("\\")||f.includes("/")||"."===l||".."===l||".git"===d||/^\.?git~[1-9]$/.test(d))throw new o(f);const h=t.slice(n+1,n+21).toString("hex");r=n+21,e.push({mode:s,path:f,oid:h,type:c})}return e}(t);else{if(!Array.isArray(t))throw new a("invalid type passed to GitTree constructor");this._entries=t.map(pt)}this._entries.sort(d)}static from(t){return new gt(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join("\n")}toObject(){const t=[...this._entries];return t.sort(dt),Buffer.concat(t.map(t=>{const e=Buffer.from(t.mode.replace(/^0/,"")),r=Buffer.from(" "),i=Buffer.from(t.path,"utf8"),n=Buffer.from([0]),a=Buffer.from(t.oid,"hex");return Buffer.concat([e,r,i,n,a])}))}entries(){return this._entries}*[Symbol.iterator](){for(const t of this._entries)yield t}}class wt{static wrap({type:t,object:e}){const r=`${t} ${e.length}\0`,i=r.length,n=i+e.length,a=new Uint8Array(n);for(let t=0;t<i;t++)a[t]=r.charCodeAt(t);return a.set(e,i),a}static unwrap(t){const e=t.indexOf(32),r=t.indexOf(0),i=t.slice(0,e).toString("utf8"),n=t.slice(e+1,r).toString("utf8"),o=t.length-(r+1);if(parseInt(n)!==o)throw new a(`Length mismatch: expected ${n} bytes but got ${o} instead.`);return{type:i,object:Buffer.from(t.slice(r+1))}}}async function mt({fs:t,gitdir:e,oid:r}){const i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}var yt=r(2566);function bt(t,e){const r=new s(t),i=_t(r);if(i!==e.byteLength)throw new a(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);const n=_t(r);let o;const c=xt(r,e);if(c.byteLength===n)o=c;else{const t=[c];let i=c.byteLength;for(;!r.eof();){const n=xt(r,e);t.push(n),i+=n.byteLength}if(n!==i)throw new a(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${i} bytes`);o=Buffer.concat(t,n)}return o}function _t(t){let e=0,r=0,i=null;do{i=t.readUInt8(),e|=(127&i)<<r,r+=7}while(128&i);return e}function vt(t,e,r){let i=0,n=0;for(;r--;)1&e&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}function xt(t,e){const r=t.readUInt8();if(128&r){const i=vt(t,15&r,4);let n=vt(t,(112&r)>>4,3);return 0===n&&(n=65536),e.slice(i,i+n)}return t.slice(r)}var kt=r(1668);function Et(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:function(t){let e=[t];return{next:()=>Promise.resolve({done:0===e.length,value:e.pop()}),return:()=>(e=[],{}),[Symbol.asyncIterator](){return this}}}(t)}class At{constructor(t){if("undefined"==typeof Buffer)throw new Error("Missing Buffer dependency");this.stream=Et(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),this.cursor!==this.buffer.length||(await this._loadnext(),!this._ended)))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),this.cursor!==this.buffer.length||(await this._loadnext(),!this._ended)))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:e}=await this.stream.next();return t&&(this._ended=!0,!e)?Buffer.alloc(0):(e&&(e=Buffer.from(e)),e)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;const e=[this.buffer];for(;this.cursor+t>St(e);){const t=await this._next();if(this._ended)break;e.push(t)}this.buffer=Buffer.concat(e)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}}function St(t){return t.reduce((t,e)=>t+e.length,0)}async function Bt(t){let e=await t.byte();const r=e>>4&7;let i,n,a=15&e;if(128&e){let r=4;do{e=await t.byte(),a|=(127&e)<<r,r+=7}while(128&e)}if(6===r){let r=0;i=0;const a=[];do{e=await t.byte(),i|=(127&e)<<r,r+=7,a.push(e)}while(128&e);n=Buffer.from(a)}return 7===r&&(n=await t.read(20)),{type:r,length:a,ofs:i,reference:n}}class $t extends e{constructor(t){super(`Invalid compressed buffer: ${t}`),this.code=this.name=$t.code,this.data={message:t}}}$t.code="DecompressionError";let Rt=!1;async function Pt(t){null===Rt&&(Rt=function(){try{if(new DecompressionStream("deflate"))return!0}catch(t){}return!1}());try{return Rt?await async function(t){const e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);try{return new Uint8Array(await new Response(r).arrayBuffer())}catch(t){if(t&&"TypeError"===t.name&&""===t.message)throw new $t("decompression failed");throw t}}(t):kt.inflate(t)}catch(t){if("string"==typeof t)throw new $t(t);throw t}}function It(t){const e=[];let r=0,i=0;do{r=t.readUInt8();const n=127&r;e.push(n),i=128&r}while(i);return e.reduce((t,e)=>t+1<<7|e,-1)}class Ot{constructor(t){this.maxBytes=t,this.bytes=0,this.map=new Map}get(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){const r=e.object.byteLength;if(!(r>this.maxBytes/4)){this.map.set(t,e),this.bytes+=r;for(const[t,e]of this.map){if(this.bytes<=this.maxBytes)break;this.map.delete(t),this.bytes-=e.object.byteLength}}}}class jt{constructor(t){Object.assign(this,t),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:e}){const r=new s(t);if("ff744f63"!==r.slice(4).toString("hex"))return;const i=r.readUInt32BE();if(2!==i)throw new a(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2147483648)throw new a("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");r.seek(r.tell()+1020);const n=r.readUInt32BE(),o=[];for(let t=0;t<n;t++){const e=r.slice(20).toString("hex");o[t]=e}r.seek(r.tell()+4*n);const c=new Map;for(let t=0;t<n;t++)c.set(o[t],r.readUInt32BE());const f=r.slice(20).toString("hex");return new jt({hashes:o,crcs:{},offsets:c,packfileSha:f,getExternalRefDelta:e})}static async fromPack({pack:t,getExternalRefDelta:e,onProgress:r}){const i={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},n={},o=t.slice(-20).toString("hex"),c=[],f={},l=new Map;let d=null,h=null;const u=new Ot(33554432),p=new Map;await async function(t,e){const r=new At(t);let i=await r.read(4);if(i=i.toString("utf8"),"PACK"!==i)throw new a(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),2!==n)throw new a(`Invalid packfile version: ${n}`);let o=await r.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!r.eof()&&o--;){const t=r.tell(),{type:i,length:n,ofs:s,reference:c}=await Bt(r),f=new kt.Inflate;for(;!f.result;){const l=await r.chunk();if(!l)break;if(f.push(l,!1),f.err)throw new a(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==n)throw new a("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(l.length-f.strm.avail_in);const d=r.tell();await e({data:f.result,type:i,num:o,offset:t,end:d,reference:c,ofs:s})}}}}([t],async({data:t,type:e,reference:o,offset:c,num:f})=>{null===d&&(d=f);const l=Math.floor(100*(d-f)/d);l!==h&&r&&await r({phase:"Receiving objects",loaded:d-f,total:d}),h=l,(["commit","tree","blob","tag"].includes(e=i[e])||"ofs-delta"===e||"ref-delta"===e)&&(n[c]={type:e,offset:c});const g=n[c];if(!g)return;const w=function({type:t,data:e,reference:r,offset:i},n,o){const c=Buffer.from(e.buffer,e.byteOffset,e.byteLength);if("ofs-delta"!==t&&"ref-delta"!==t)return{type:t,object:c};const f="ofs-delta"===t?i-It(new s(r)):o.get(r.toString("hex")),l=n.get(f);if(!l)return null;try{return{type:l.type,object:Buffer.from(bt(c,l.object))}}catch(t){if(t instanceof a||t instanceof RangeError)return null;throw t}}({type:e,data:t,reference:o,offset:c},u,p);w&&(g.oid=await y(wt.wrap(w)),p.set(g.oid,c),u.set(c,w))});const g=Object.keys(n).map(Number);for(const[e,r]of g.entries()){const i=e+1===g.length?t.byteLength-20:g[e+1],a=n[r],o=yt.buf(t.slice(r,i))>>>0;a.end=i,a.crc=o}const w=new jt({pack:Promise.resolve(t),packfileSha:o,crcs:f,hashes:c,offsets:l,getExternalRefDelta:e});h=null;let m=0;const b=[0,0,0,0,0,0,0,0,0,0,0,0];for(let t in n){t=Number(t);const e=Math.floor(100*m/d);e!==h&&r&&await r({phase:"Resolving deltas",loaded:m,total:d}),m++,h=e;const i=n[t];if(!i.oid)try{w.readDepth=0,w.externalReadDepth=0;const{type:e,object:r}=await w.readSlice({start:t});b[w.readDepth]+=1,i.oid=await y(wt.wrap({type:e,object:r}))}catch(t){continue}c.push(i.oid),l.set(i.oid,t),f[i.oid]=i.crc}return c.sort(),w}async toBuffer(){const t=[],e=(e,r)=>{t.push(Buffer.from(e,r))};e("ff744f63","hex"),e("00000002","hex");const r=new s(Buffer.alloc(1024));for(let t=0;t<256;t++){let e=0;for(const r of this.hashes)parseInt(r.slice(0,2),16)<=t&&e++;r.writeUInt32BE(e)}t.push(r.buffer);for(const t of this.hashes)e(t,"hex");const i=new s(Buffer.alloc(4*this.hashes.length));for(const t of this.hashes)i.writeUInt32BE(this.crcs[t]);t.push(i.buffer);const n=new s(Buffer.alloc(4*this.hashes.length));for(const t of this.hashes)n.writeUInt32BE(this.offsets.get(t));t.push(n.buffer),e(this.packfileSha,"hex");const a=Buffer.concat(t),o=await y(a),c=Buffer.alloc(20);return c.write(o,"hex"),Buffer.concat([a,c])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new a(`Could not read object ${t} from packfile`)}const e=this.offsets.get(t);return this.readSlice({start:e})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;const e=await this.pack;if(!e)throw new a("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");const r=e.slice(t),i=new s(r),n=i.readUInt8(),o=112&n;let c={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"}[o];if(void 0===c)throw new a("Unrecognized type: 0b"+o.toString(2));const f=15&n;let l=f;128&n&&(l=function(t,e){let r=e,i=4,n=null;do{n=t.readUInt8(),r|=(127&n)<<i,i+=7}while(128&n);return r}(i,f));let d=null,h=null;if("ofs_delta"===c){const e=t-It(i);({object:d,type:c}=await this.readSlice({start:e}))}if("ref_delta"===c){const t=i.slice(20).toString("hex");({object:d,type:c}=await this.read({oid:t}))}const u=r.slice(i.tell());if(h=Buffer.from(await Pt(u)),h.byteLength!==l)throw new a(`Packfile told us object would have length ${l} but it had length ${h.byteLength}`);return d&&(h=Buffer.from(bt(h,d))),this.readDepth>3&&(this.offsetCache[t]={type:c,object:h}),{type:c,format:"content",object:h}}}const Ut=Symbol("PackfileCache");function Tt({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:a}){e[Ut]||(e[Ut]=new Map);let o=e[Ut].get(r);return o||(o=async function({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){const a=await t.read(e);return jt.fromIdx({idx:a,getExternalRefDelta:r})}({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:a}),e[Ut].set(r,o),o.catch(()=>{e[Ut].get(r)===o&&e[Ut].delete(r)})),o}async function Ct(t,e){const r=t.subarray(-20),i=Array.from(r).map(t=>t.toString(16).padStart(2,"0")).join("");if(i!==e)throw new a(`Packfile trailer mismatch: expected ${e}, got ${i}. The packfile may be corrupted.`);const n=await async function(t,{start:e=0,end:r=t.length}={}){return y(t.subarray(e,r))}(t,{start:0,end:t.length-20});if(n!==e)throw new a(`Packfile payload corrupted: calculated ${n} but expected ${e}. The packfile may have been tampered with.`)}async function Mt({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){if(!["deflated","wrapped","content"].includes(n))throw new a(`invalid requested format "${n}"`);const o=i=>Mt({fs:t,cache:e,gitdir:r,oid:i});let s;if("4b825dc642cb6eb9a060e54bf8d69288fbee4904"===i&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await mt({fs:t,gitdir:r,oid:i})),!s){if(s=await async function({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:o}){let s=await t.readdir(Z(r,"objects/pack"));s=s.filter(t=>t.endsWith(".idx"));for(const n of s){const s=`${r}/objects/pack/${n}`,c=await Tt({fs:t,cache:e,filename:s,getExternalRefDelta:o});if(c.error)throw new a(c.error);if(c.offsets.has(i)){const e=s.replace(/idx$/,"pack");if(!c.pack){const r=t.read(e);c.pack=r,r.catch(()=>{c.pack===r&&(c.pack=null)})}const r=await c.pack;if(!r)throw c.pack=null,new a(`Could not read packfile at ${e}. The file may be missing, corrupted, or too large to read into memory.`);c._checksumVerification||(c._checksumVerification=Ct(r,c.packfileSha)),await c._checksumVerification;const f=await c.read({oid:i,getExternalRefDelta:o});return f.format="content",f.source=`objects/pack/${n.replace(/idx$/,"pack")}`,f}}return null}({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o}),!s)throw new T(i);return s}if("deflated"===n)return s;if("deflated"===s.format&&(s.object=Buffer.from(await Pt(s.object)),s.format="wrapped"),"wrapped"===n)return s;const c=await y(s.object);if(c!==i)throw new a(`SHA check failed! Expected ${i}, computed ${c}`);const{object:f,type:l}=wt.unwrap(s.object);return s.type=l,s.object=f,s.format="content",s}function Dt({name:t,email:e,timestamp:r,timezoneOffset:i}){return`${t} <${e}> ${r} ${i=function(t){const e=function(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}(0===(r=t)?r:-r);var r;t=Math.abs(t);const i=Math.floor(t/60);t-=60*i;let n=String(i),a=String(t);return n.length<2&&(n="0"+n),a.length<2&&(a="0"+a),(-1===e?"-":"+")+n+a}(i)}`}function Ft(t){return(t=(t=t.replace(/\r/g,"")).replace(/^\n+/,"")).replace(/\n+$/,"")+"\n"}function Nt(t){const[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:zt(n)}}function zt(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=("+"===e?1:-1)*(60*Number(r)+Number(i)),0===(n=i)?n:-n;var n}class Lt{constructor(t){if("string"==typeof t)this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else{if("object"!=typeof t)throw new a("invalid type passed to GitAnnotatedTag constructor");this._tag=Lt.render(t)}}static from(t){return new Lt(t)}static render(t){return`object ${t.object}\ntype ${t.type}\ntag ${t.tag}\ntagger ${Dt(t.tagger)}\n\n${t.message}\n${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf("\n\n"))}message(){const t=this.withoutSignature();return t.slice(t.indexOf("\n\n")+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){const t=this.justHeaders().split("\n"),e=[];for(const r of t)" "===r[0]?e[e.length-1]+="\n"+r.slice(1):e.push(r);const r={};for(const t of e){const e=t.slice(0,t.indexOf(" ")),i=t.slice(t.indexOf(" ")+1);Array.isArray(r[e])?r[e].push(i):r[e]=i}return r.tagger&&(r.tagger=Nt(r.tagger)),r.committer&&(r.committer=Nt(r.committer)),r}withoutSignature(){const t=Ft(this._tag);return-1===t.indexOf("\n-----BEGIN PGP SIGNATURE-----")?t:t.slice(0,t.lastIndexOf("\n-----BEGIN PGP SIGNATURE-----"))}gpgsig(){if(-1!==this._tag.indexOf("\n-----BEGIN PGP SIGNATURE-----"))return Ft(this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27))}payload(){return this.withoutSignature()+"\n"}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,e,r){const i=t.payload();let{signature:n}=await e({payload:i,secretKey:r});n=Ft(n);const a=i+n;return Lt.from(a)}}function Ht(t){return t.trim().split("\n").map(t=>" "+t).join("\n")+"\n"}class Wt{constructor(t){if("string"==typeof t)this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else{if("object"!=typeof t)throw new a("invalid type passed to GitCommit constructor");this._commit=Wt.render(t)}}static fromPayloadSignature({payload:t,signature:e}){const r=Wt.justHeaders(t),i=Wt.justMessage(t),n=Ft(r+"\ngpgsig"+Ht(e)+"\n"+i);return new Wt(n)}static from(t){return new Wt(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return Wt.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Ft(t.slice(t.indexOf("\n\n")+2))}static justHeaders(t){return t.slice(0,t.indexOf("\n\n"))}parseHeaders(){const t=Wt.justHeaders(this._commit).split("\n"),e=[];for(const r of t)" "===r[0]?e[e.length-1]+="\n"+r.slice(1):e.push(r);const r={parent:[]};for(const t of e){const e=t.slice(0,t.indexOf(" ")),i=t.slice(t.indexOf(" ")+1);Array.isArray(r[e])?r[e].push(i):r[e]=i}return r.author&&(r.author=Nt(r.author)),r.committer&&(r.committer=Nt(r.committer)),r}static renderHeaders(t){let e="";if(t.tree?e+=`tree ${t.tree}\n`:e+="tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\n",t.parent){if(void 0===t.parent.length)throw new a("commit 'parent' property should be an array");for(const r of t.parent)e+=`parent ${r}\n`}return e+=`author ${Dt(t.author)}\n`,e+=`committer ${Dt(t.committer||t.author)}\n`,t.gpgsig&&(e+="gpgsig"+Ht(t.gpgsig)),e}static render(t){return Wt.renderHeaders(t)+"\n"+Ft(t.message)}render(){return this._commit}withoutSignature(){const t=Ft(this._commit);return-1===t.indexOf("\ngpgsig")?t:Ft(t.slice(0,t.indexOf("\ngpgsig"))+"\n"+t.slice(t.indexOf("-----END PGP SIGNATURE-----\n")+28))}isolateSignature(){return this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27).split("\n").map(t=>t.replace(/^ /,"")).join("\n")}static async sign(t,e,r){const i=t.withoutSignature(),n=Wt.justMessage(t._commit);let{signature:a}=await e({payload:i,secretKey:r});a=Ft(a);const o=Wt.justHeaders(t._commit)+"\ngpgsig"+Ht(a)+"\n"+n;return Wt.from(o)}}async function Gt({fs:t,cache:e,gitdir:r,oid:i}){if("4b825dc642cb6eb9a060e54bf8d69288fbee4904"===i)return{tree:gt.from([]),oid:i};const{type:n,object:a}=await Mt({fs:t,cache:e,gitdir:r,oid:i});if("tag"===n)return Gt({fs:t,cache:e,gitdir:r,oid:i=Lt.from(a).parse().object});if("commit"===n)return Gt({fs:t,cache:e,gitdir:r,oid:i=Wt.from(a).parse().tree});if("tree"!==n)throw new C(i,n,"tree");return{tree:gt.from(a),oid:i}}class qt{constructor({fs:t,gitdir:e,ref:r,cache:i}){this.fs=t,this.cache=i,this.gitdir=e,this.mapPromise=(async()=>{const i=new Map;let n;try{n=await lt.resolve({fs:t,gitdir:e,ref:r})}catch(i){if(!(i instanceof T&&await lt.isUnbornBranch({fs:t,gitdir:e,ref:r})))throw i;n="4b825dc642cb6eb9a060e54bf8d69288fbee4904"}const a=await Gt({fs:t,cache:this.cache,gitdir:e,oid:n});return a.type="tree",a.mode="40000",i.set(".",a),i})();const n=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(t){const e=t._fullpath,{fs:r,cache:i,gitdir:n}=this,a=await this.mapPromise,o=a.get(e);if(!o)throw new Error(`No obj for ${e}`);const s=o.oid;if(!s)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if("tree"!==o.type)return null;const{type:c,object:f}=await Mt({fs:r,cache:i,gitdir:n,oid:s});if(c!==o.type)throw new C(s,c,o.type);const l=gt.from(f);for(const t of l)a.set(Z(e,t.path),t);return l.entries().map(t=>Z(e,t.path))}async type(t){if(!1===t._type){const e=await this.mapPromise,{type:r}=e.get(t._fullpath);t._type=r}return t._type}async mode(t){if(!1===t._mode){const e=await this.mapPromise,{mode:r}=e.get(t._fullpath);t._mode=h(parseInt(r,8))}return t._mode}async stat(t){}async content(t){if(!1===t._content){const e=await this.mapPromise,{fs:r,cache:i,gitdir:n}=this,a=e.get(t._fullpath).oid,{type:o,object:s}=await Mt({fs:r,cache:i,gitdir:n,oid:a});t._content="blob"!==o?void 0:new Uint8Array(s)}return t._content}async oid(t){if(!1===t._oid){const e=(await this.mapPromise).get(t._fullpath);t._oid=e.oid}return t._oid}}function Zt({ref:t="HEAD"}={}){const e=Object.create(null);return Object.defineProperty(e,j,{value:function({fs:e,gitdir:r,cache:i}){return new qt({fs:e,gitdir:r,ref:t,cache:i})}}),Object.freeze(e),e}class Kt{constructor({fs:t,dir:e,gitdir:r,cache:i,refresh:n=!0}){this.fs=t,this.cache=i,this.dir=e,this.gitdir=r,this.refresh=n,this.refreshQueue=[],this.flushed=!1,this.config=null;const a=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){if("tree"!==await t.type())return null;const e=t._fullpath,{fs:r,dir:i}=this,n=await r.readdir(Z(i,e));return null===n?null:n.map(t=>Z(e,t))}async type(t){return!1===t._type&&await t.stat(),t._type}async mode(t){return!1===t._mode&&await t.stat(),t._mode}async stat(t){if(!1===t._stat){const{fs:e,dir:r}=this;let i=await e.lstat(`${r}/${t._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let n=i.isDirectory()?"tree":"blob";"blob"!==n||i.isFile()||i.isSymbolicLink()||(n="special"),t._type=n,i=g(i),t._mode=i.mode,-1===i.size&&t._actualSize&&(i.size=t._actualSize),t._stat=i}return t._stat}async content(t){if(!1===t._content){const{fs:e,dir:r,gitdir:i}=this;if("tree"===await t.type())t._content=void 0;else{let n;if(await t.mode()>>12==10)n=await e.readlink(`${r}/${t._fullpath}`);else{const a=await this._getGitConfig(e,i),o=await a.get("core.autocrlf");n=await e.read(`${r}/${t._fullpath}`,{autocrlf:o})}t._actualSize=n.length,t._stat&&-1===t._stat.size&&(t._stat.size=t._actualSize),t._content=new Uint8Array(n)}}return t._content}async oid(t){if(!1===t._oid){const e=this,{fs:r,gitdir:i,cache:n}=this;let a;await $.acquire({fs:r,gitdir:i,cache:n},async function(n){const o=n.entriesMap.get(t._fullpath),s=await t.stat(),c=await e._getGitConfig(r,i),f=await c.get("core.filemode"),l="undefined"==typeof process||!("win32"===process.platform);if(!o||k(s,o,f,l)){const r=await t.content();void 0===r?a=void 0:(a=await y(wt.wrap({type:"blob",object:r})),!e.refresh||!o||o.flags.intentToAdd||a!==o.oid||f&&s.mode!==o.mode||!k(s,o,f,l)||(e.flushed?n.insert({filepath:t._fullpath,stats:s,oid:a}):e.refreshQueue.push({filepath:t._fullpath,stage:o,stats:s,oid:a})))}else a=o.oid}),t._oid=a}return t._oid}async flush(){const{fs:t,gitdir:e,cache:r,refreshQueue:i}=this;this.refreshQueue=[],this.flushed=!0,0!==i.length&&await $.acquire({fs:t,gitdir:e,cache:r},async t=>{for(const{filepath:e,stage:r,stats:n,oid:a}of i)t.entriesMap.get(e)===r&&t.insert({filepath:e,stats:n,oid:a})})}async _getGitConfig(t,e){return this.config||(this.config=await ot.get({fs:t,gitdir:e})),this.config}}function Vt({refresh:t=!0}={}){const e=Object.create(null);return Object.defineProperty(e,j,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new Kt({fs:e,dir:r,gitdir:i,cache:n,refresh:t})}}),Object.freeze(e),e}const Yt=void 0===Array.prototype.flat?t=>t.reduce((t,e)=>t.concat(e),[]):t=>t.flat();class Xt{constructor(){this.value=null}consider(t){null!=t&&(null===this.value||t<this.value)&&(this.value=t)}reset(){this.value=null}}function*Jt(t){const e=new Xt;let r;const i=[],n=t.length;for(let r=0;r<n;r++)i[r]=t[r].next().value,void 0!==i[r]&&e.consider(i[r]);if(null!==e.value)for(;;){const a=[];r=e.value,e.reset();for(let o=0;o<n;o++)void 0!==i[o]&&i[o]===r?(a[o]=i[o],i[o]=t[o].next().value):a[o]=null,void 0!==i[o]&&e.consider(i[o]);if(yield a,null===e.value)return}}async function Qt({fs:t,cache:e,dir:r,gitdir:i,trees:n,map:a=async(t,e)=>e,reduce:o=async(t,e)=>{const r=Yt(e);return void 0!==t&&r.unshift(t),r},iterate:s=(t,e)=>Promise.all([...e].map(t))}){const c=n.map(n=>n[j]({fs:t,dir:r,gitdir:i,cache:e})),f=new Array(c.length).fill("."),l=function(t,e){const r=e-0;return Array.from({length:r},(t,e)=>0+e)}(0,c.length),d=async t=>{const{entries:e,children:r}=await(async t=>{l.forEach(e=>{const r=t[e];t[e]=r&&new c[e].ConstructEntry(r)});const e=(await Promise.all(l.map(e=>{const r=t[e];return r?c[e].readdir(r):[]}))).map(t=>(null===t?[]:t)[Symbol.iterator]());return{entries:t,children:Jt(e)}})(t),i=e.find(t=>t&&t._fullpath)._fullpath,n=await a(i,e);if(null!==n){let t=await s(d,r);return t=t.filter(t=>void 0!==t),o(n,t)}},h=await d(f);for(const t of c)t.flush&&await t.flush();return h}class te extends e{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=te.code,this.data={filepath:t}}}te.code="IndexResetError";var ee=r(6867);async function re(t,e,r=10){try{await t(e)}catch(i){if(null===i)return;if("EEXIST"===i.code)return;if("ENOENT"!==i.code)throw i;const n=P(e);if("."===n||"/"===n||n===e)throw i;await re(t,n,r);for(let i=0;;i++)try{return void await t(e)}catch(t){if(null===t||"EEXIST"===t.code)return;if("ENOENT"===t.code&&i<r){await new Promise(t=>setTimeout(t,0));continue}throw t}}}async function ie(t,e){const r=await t.readdir(e);null==r?await t.rm(e):r.length?await Promise.all(r.map(r=>{const i=Z(e,r);return t.lstat(i).then(e=>{if(e)return e.isDirectory()?ie(t,i):t.rm(i)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function ne(t){return"function"==typeof t}function ae(t){const e=t.code;return"string"==typeof e&&("ENOENT"===e||"ENOTDIR"===e||e.includes("ENS"))}function oe(t){return function(t){return t&&"object"==typeof t}(e=(t=>{try{return t.readFile().catch(t=>t)}catch(t){return t}})(t))&&ne(e.then)&&ne(e.catch);var e}const se=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function ce(t,e){if(oe(e))for(const r of se)t[`_${r}`]=e[r].bind(e);else for(const r of se)t[`_${r}`]=ee(e[r].bind(e));oe(e)?(e.cp&&(t._cp=e.cp.bind(e)),e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=ie.bind(null,t)):(e.cp&&(t._cp=ee(e.cp.bind(e))),e.rm?t._rm=ee(e.rm.bind(e)):e.rmdir.length>2?t._rm=ee(e.rmdir.bind(e)):t._rm=ie.bind(null,t))}class fe{constructor(t){if(void 0!==t._original_unwrapped_fs)return t;const e=Object.getOwnPropertyDescriptor(t,"promises");e&&e.enumerable?ce(this,t.promises):ce(this,t),this._original_unwrapped_fs=t}async exists(t,e={}){try{return await this._stat(t),!0}catch(t){if(ae(t))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',t),t}}async read(t,e={}){let r;try{r=await this._readFile(t,e)}catch(t){if(ae(t)||"EISDIR"===t.code)return null;throw t}if(null==r)return null;if("true"===e.autocrlf)try{r=new TextDecoder("utf8",{fatal:!0}).decode(r),r=r.replace(/\r\n/g,"\n"),r=(new TextEncoder).encode(r)}catch(t){}return"string"!=typeof r&&(r=Buffer.from(r)),r}async write(t,e,r={}){try{await this._writeFile(t,e,r)}catch(i){await this.mkdir(P(t)),await this._writeFile(t,e,r)}}async mkdir(t){await re(this._mkdir,t)}async rm(t){try{await this._unlink(t)}catch(t){if("ENOENT"!==t.code)throw t}}async rmdir(t,e){try{e&&e.recursive?await this._rm(t,e):await this._rmdir(t)}catch(t){if("ENOENT"!==t.code)throw t}}async readdir(t){let e;try{e=await this._readdir(t)}catch(t){if("ENOTDIR"===t.code)return null;if(ae(t))return[];throw t}return e.sort(l),e}async readdirDeep(t){const e=await this._readdir(t);return(await Promise.all(e.map(async e=>{const r=t+"/"+e;return(await this._stat(r)).isDirectory()?this.readdirDeep(r):r}))).reduce((t,e)=>t.concat(e),[])}async lstat(t){try{return await this._lstat(t)}catch(t){if(ae(t))return null;throw t}}async readlink(t,e={encoding:"buffer"}){try{const r=await this._readlink(t,e);return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(t){if(ae(t))return null;throw t}}async writelink(t,e){return this._symlink(e.toString("utf8"),t)}}class le extends e{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=le.code,this.data={parameter:t}}}function de(t,e){if(void 0===e)throw new le(t)}async function he({fsp:t,dotgit:e}){de("fsp",t),de("dotgit",e);const r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(t=>t.trimRight().substr(8)).then(t=>{return(r=t).startsWith("/")||/^[a-zA-Z]:[\\/]/.test(r)?t:Z(P(e),t);var r}):e}async function ue(t,e){return!(!t&&!e||(!t||e)&&(t||!e)&&("tree"===await t.type()&&"tree"===await e.type()||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid()))}async function pe({fs:t,dir:e,gitdir:r=Z(e,".git"),commit:i="HEAD",cache:n={}}){try{de("fs",t),de("dir",e),de("gitdir",r);const a=new fe(t),o=[Zt({ref:i}),Vt(),U()];let s=[];const c=await he({fsp:a,dotgit:r});await $.acquire({fs:a,gitdir:c,cache:n},async function(t){s=t.unmergedPaths});const f=await Qt({fs:a,cache:n,dir:e,gitdir:c,trees:o,map:async function(t,[e,r,i]){const n=!await ue(r,i),a=s.includes(t),o=!await ue(i,e);if(n||a)return e?{path:t,mode:await e.mode(),oid:await e.oid(),type:await e.type(),content:await e.content()}:void 0;if(o)return!1;throw new te(t)}});await $.acquire({fs:a,gitdir:c,cache:n},async function(t){for(const r of f)if(!1!==r)if(r){if("blob"===r.type){const i=(new TextDecoder).decode(r.content);await a.write(`${e}/${r.path}`,i,{mode:r.mode}),t.insert({filepath:r.path,oid:r.oid,stage:0})}}else await a.rmdir(`${e}/${r.path}`,{recursive:!0}),t.delete({filepath:r.path})})}catch(t){throw t.caller="git.abortMerge",t}}le.code="MissingParameterError";class ge extends e{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=ge.code,this.data={errors:t},this.errors=t}}ge.code="MultipleGitError";var we=r(2535);class me{static async isIgnored({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i}){if(".git"===R(i))return!0;if("."===i)return!1;let n="";const a=Z(r,"info","exclude");await t.exists(a)&&(n=await t.read(a,"utf8"));const o=[{gitignore:Z(e,".gitignore"),filepath:i}],s=i.split("/").filter(Boolean);for(let t=1;t<s.length;t++){const r=s.slice(0,t).join("/"),i=s.slice(t).join("/");o.push({gitignore:Z(e,r,".gitignore"),filepath:i})}let c=!1;for(const[e,r]of o.entries()){const i=await t.read(r.gitignore,"utf8"),a=we();0===e&&a.add(n),a.add(i);const o=P(r.filepath);if("."!==o&&a.ignores(o))return!0;c=c?!a.test(r.filepath).unignored:a.test(r.filepath).ignored}return c}}let ye=null;async function be(t){return null===ye&&(ye=function(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(t){return!1}}()),ye?async function(t){const e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}(t):kt.deflate(t)}async function _e({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:o,dryRun:s=!1}){return"deflated"!==n&&("wrapped"!==n&&(i=wt.wrap({type:r,object:i})),o=await y(i),i=Buffer.from(await be(i))),s||await async function({fs:t,gitdir:e,object:r,format:i,oid:n}){if("deflated"!==i)throw new a("GitObjectStoreLoose expects objects to write to be in deflated format");const o=`${e}/objects/${n.slice(0,2)}/${n.slice(2)}`;await t.exists(o)||await t.write(o,r)}({fs:t,gitdir:e,object:i,format:"deflated",oid:o}),o}function ve(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}async function xe({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i,cache:n={},force:a=!1,parallel:o=!0}){try{de("fs",t),de("dir",e),de("gitdir",r),de("filepath",i);const s=new fe(t),c=await he({fsp:s,dotgit:r});await $.acquire({fs:s,gitdir:c,cache:n},async t=>{const r=await ot.get({fs:s,gitdir:c}),n=await r.get("core.autocrlf");return ke({dir:e,gitdir:c,fs:s,filepath:i,index:t,force:a,parallel:o,autocrlf:n})})}catch(t){throw t.caller="git.add",t}}async function ke({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:a,parallel:o,autocrlf:s}){const c=(i=Array.isArray(i)?i:[i]).map(async i=>{if(!a&&!function(t,e){if(t.has({filepath:e}))return!0;const r=`${e}/`;for(const e of t.entriesMap.keys())if(e.startsWith(r))return!0;return!1}(n,i)&&await me.isIgnored({fs:r,dir:t,gitdir:e,filepath:i}))return;const c=await r.lstat(Z(t,i));if(!c)throw new T(i);if(c.isDirectory()){const c=await r.readdir(Z(t,i));if(o){const f=c.map(c=>ke({dir:t,gitdir:e,fs:r,filepath:[Z(i,c)],index:n,force:a,parallel:o,autocrlf:s}));await Promise.all(f)}else for(const f of c)await ke({dir:t,gitdir:e,fs:r,filepath:[Z(i,f)],index:n,force:a,parallel:o,autocrlf:s})}else{const a=c.isSymbolicLink()?await r.readlink(Z(t,i)).then(ve):await r.read(Z(t,i),{autocrlf:s});if(null===a)throw new T(i);const o=await _e({fs:r,gitdir:e,type:"blob",object:a});n.insert({filepath:i,stats:c,oid:o})}}),f=await Promise.allSettled(c),l=f.filter(t=>"rejected"===t.status).map(t=>t.reason);if(l.length>1)throw new ge(l);if(1===l.length)throw l[0];return f.filter(t=>"fulfilled"===t.status&&t.value).map(t=>t.value)}class Ee extends e{constructor(){super("Cannot create an empty commit when disallowEmpty is true."),this.code=this.name=Ee.code,this.data={}}}Ee.code="EmptyCommitError";class Ae extends e{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=Ae.code,this.data={role:t}}}Ae.code="MissingNameError";class Se extends e{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Se.code,this.data={ref:t}}}async function Be({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=await async function({fs:t,gitdir:e,oid:r}){const i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}({fs:t,gitdir:r,oid:i});return o||(o=await async function({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let o=await t.readdir(Z(r,"objects/pack"));o=o.filter(t=>t.endsWith(".idx"));for(const s of o){const o=`${r}/objects/pack/${s}`,c=await Tt({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(c.error)throw new a(c.error);if(c.offsets.has(i))return!0}return!1}({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:i=>Mt({fs:t,cache:e,gitdir:r,oid:i})})),o}async function $e({fs:t,gitdir:e,path:r}){return(await ot.get({fs:t,gitdir:e})).get(r)}function Re(t,...e){for(const r of e)if(r)for(const e of Object.keys(r)){const i=r[e];void 0!==i&&(t[e]=i)}return t}async function Pe({fs:t,gitdir:e,author:r,commit:i}){const n=Math.floor(Date.now()/1e3),a=Re({},{name:await $e({fs:t,gitdir:e,path:"user.name"}),email:await $e({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(1e3*n).getTimezoneOffset()},i?i.author:void 0,r);if(void 0!==a.name)return a}async function Ie({fs:t,gitdir:e,author:r,committer:i,commit:n}){const a=Math.floor(Date.now()/1e3),o=Re({},{name:await $e({fs:t,gitdir:e,path:"user.name"}),email:await $e({fs:t,gitdir:e,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(1e3*a).getTimezoneOffset()},n?n.committer:void 0,r,i);if(void 0!==o.name)return o}async function Oe({fs:t,cache:e,gitdir:r,oid:i}){const{type:n,object:a}=await Mt({fs:t,cache:e,gitdir:r,oid:i});if("tag"===n)return Oe({fs:t,cache:e,gitdir:r,oid:i=Lt.from(a).parse().object});if("commit"!==n)throw new C(i,n,"commit");return{commit:Wt.from(a),oid:i}}async function je({fs:t,cache:e,gitdir:r,oid:i}){const{commit:n,oid:a}=await Oe({fs:t,cache:e,gitdir:r,oid:i});return{oid:a,commit:n.parse(),payload:n.withoutSignature()}}Se.code="NoCommitError";const Ue="4b825dc642cb6eb9a060e54bf8d69288fbee4904";async function Te({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:f=!1,noUpdateBranch:l=!1,disallowEmpty:d=!1,ref:h,parent:u,tree:p}){let g,w,m=!1,y=!1;if(!h){const e=await t.read(`${i}/HEAD`,{encoding:"utf8"});y=!e.startsWith("ref:"),h=await lt.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2})}try{g=await lt.resolve({fs:t,gitdir:i,ref:h})}catch(t){if(!(t instanceof T))throw t;m=!0}if(m||!c&&!d||(w=await je({fs:t,gitdir:i,oid:g,cache:e})),c&&m)throw new Se(h);const b=c?await Pe({fs:t,gitdir:i,author:a,commit:w.commit}):await Pe({fs:t,gitdir:i,author:a});if(!b)throw new Ae("author");const _=c?await Ie({fs:t,gitdir:i,author:b,committer:o,commit:w.commit}):await Ie({fs:t,gitdir:i,author:b,committer:o});if(!_)throw new Ae("committer");return $.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(a){const o=I(a.entries.filter(t=>!t.flags.intentToAdd)).get(".");if(p||(p=await Ce({fs:t,gitdir:i,inode:o,dryRun:f})),u=u?await Promise.all(u.map(async r=>{let n=await lt.resolve({fs:t,gitdir:i,ref:r});for(;await Be({fs:t,cache:e,gitdir:i,oid:n});){const{type:r,object:a}=await Mt({fs:t,cache:e,gitdir:i,oid:n});if("commit"===r)break;if("tag"!==r)throw new C(n,r,"commit");n=Lt.from(a).parse().object}return n})):c?w.commit.parent:g?[g]:[],d&&!c&&(m&&p===Ue||!m&&p===w.commit.tree))throw new Ee;if(!n){if(!c)throw new le("message");n=w.commit.message}let v=Wt.from({tree:p,parent:u,author:b,committer:_,message:n});s&&(v=await Wt.sign(v,r,s));const x=await _e({fs:t,gitdir:i,type:"commit",object:v.toObject(),dryRun:f});return l||f||await lt.writeRef({fs:t,gitdir:i,ref:y?"HEAD":h,value:x}),x})}async function Ce({fs:t,gitdir:e,inode:r,dryRun:i}){const n=r.children;for(const r of n)"tree"===r.type&&(r.metadata.mode="040000",r.metadata.oid=await Ce({fs:t,gitdir:e,inode:r,dryRun:i}));const a=n.map(t=>({mode:t.metadata.mode,path:t.basename,oid:t.metadata.oid,type:t.type})),o=gt.from(a);return await _e({fs:t,gitdir:e,type:"tree",object:o.toObject(),dryRun:i})}class Me extends e{constructor(t){let e="invalid filepath";"leading-slash"===t||"trailing-slash"===t?e='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':"directory"===t&&(e='"filepath" should not be a directory.'),super(e),this.code=this.name=Me.code,this.data={reason:t}}}async function De({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){return(await Fe({fs:t,cache:e,gitdir:r,oid:i,filepath:n})).oid}async function Fe({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Me("leading-slash");if(n.endsWith("/"))throw new Me("trailing-slash");const a=i,o=await Gt({fs:t,cache:e,gitdir:r,oid:i}),s=o.tree;return""===n?{mode:"040000",oid:o.oid,path:"",type:"tree"}:Ne({fs:t,cache:e,gitdir:r,tree:s,pathArray:n.split("/"),oid:a,filepath:n})}async function Ne({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:a,filepath:o}){const s=n.shift();for(const c of i)if(c.path===s){if(0===n.length)return c;{const{type:s,object:f}=await Mt({fs:t,cache:e,gitdir:r,oid:c.oid});if("tree"!==s)throw new C(a,s,"tree",o);return Ne({fs:t,cache:e,gitdir:r,tree:i=gt.from(f),pathArray:n,oid:a,filepath:o})}}throw new T(`file or directory found at "${a}:${o}"`)}async function ze({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){void 0!==n&&(i=await De({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));const{tree:a,oid:o}=await Gt({fs:t,cache:e,gitdir:r,oid:i});return{oid:o,tree:a.entries()}}async function Le({fs:t,gitdir:e,tree:r}){const i=gt.from(r).toObject();return await _e({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}Me.code="InvalidFilepathError";class He extends e{constructor(t,e,r=!0){super(`Failed to create ${t} at ${e} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=He.code,this.data={noun:t,where:e,canForce:r}}}async function We({fs:t,onSign:e,dir:r,gitdir:i=Z(r,".git"),ref:n="refs/notes/commits",oid:a,note:o,force:s,author:c,committer:f,signingKey:l,cache:d={}}){try{de("fs",t),de("gitdir",i),de("oid",a),de("note",o),l&&de("onSign",e);const r=new fe(t),h=await Pe({fs:r,gitdir:i,author:c});if(!h)throw new Ae("author");const u=await Ie({fs:r,gitdir:i,author:h,committer:f});if(!u)throw new Ae("committer");const p=await he({fsp:r,dotgit:i});return await async function({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:a,note:o,force:s,author:c,committer:f,signingKey:l}){let d;try{d=await lt.resolve({gitdir:i,fs:t,ref:n})}catch(t){if(!(t instanceof T))throw t}let h=(await ze({fs:t,cache:e,gitdir:i,oid:d||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(s)h=h.filter(t=>t.path!==a);else for(const t of h)if(t.path===a)throw new He("note",a);"string"==typeof o&&(o=Buffer.from(o,"utf8"));const u=await _e({fs:t,gitdir:i,type:"blob",object:o,format:"content"});h.push({mode:"100644",path:a,oid:u,type:"blob"});const p=await Le({fs:t,gitdir:i,tree:h});return await Te({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:p,parent:d&&[d],message:"Note added by 'isomorphic-git addNote'\n",author:c,committer:f,signingKey:l})}({fs:r,cache:d,onSign:e,gitdir:p,ref:n,oid:a,note:o,force:s,author:h,committer:u,signingKey:l})}catch(t){throw t.caller="git.addNote",t}}async function Ge({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!q(r,!0))throw new F(r,M.clean(r));const a=await ot.get({fs:t,gitdir:e});if(!n&&(await a.getSubsections("remote")).includes(r)&&i!==await a.get(`remote.${r}.url`))throw new He("remote",r);await a.set(`remote.${r}.url`,i),await a.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ot.save({fs:t,gitdir:e,config:a})}async function qe({fs:t,dir:e,gitdir:r=Z(e,".git"),remote:i,url:n,force:a=!1}){try{de("fs",t),de("gitdir",r),de("remote",i),de("url",n);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await Ge({fs:e,gitdir:o,remote:i,url:n,force:a})}catch(t){throw t.caller="git.addRemote",t}}async function Ze({fs:t,onSign:e,dir:r,gitdir:i=Z(r,".git"),ref:n,tagger:a,message:o=n,gpgsig:s,object:c,signingKey:f,force:l=!1,cache:d={}}){try{de("fs",t),de("gitdir",i),de("ref",n),f&&de("onSign",e);const r=new fe(t),h=await he({fsp:r,dotgit:i}),u=await Pe({fs:r,gitdir:h,author:a});if(!u)throw new Ae("tagger");return await async function({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:a,message:o=n,gpgsig:s,object:c,signingKey:f,force:l=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!l&&await lt.exists({fs:t,gitdir:i,ref:n}))throw new He("tag",n);const d=await lt.resolve({fs:t,gitdir:i,ref:c||"HEAD"}),{type:h}=await Mt({fs:t,cache:e,gitdir:i,oid:d});let u=Lt.from({object:d,type:h,tag:n.replace("refs/tags/",""),tagger:a,message:o,gpgsig:s});f&&(u=await Lt.sign(u,r,f));const p=await _e({fs:t,gitdir:i,type:"tag",object:u.toObject()});await lt.writeRef({fs:t,gitdir:i,ref:n,value:p})}({fs:r,cache:d,onSign:e,gitdir:h,ref:n,tagger:u,message:o,gpgsig:s,object:c,signingKey:f,force:l})}catch(t){throw t.caller="git.annotatedTag",t}}async function Ke({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i,object:n,checkout:a=!1,force:o=!1}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new fe(t),s=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:a=!1}){if(!q(r,!0))throw new F(r,M.clean(r));const o=`refs/heads/${r}`;if(!a&&await lt.exists({fs:t,gitdir:e,ref:o}))throw new He("branch",r,!1);let s;try{s=await lt.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(t){if(!(t instanceof T))throw t}s&&(s=(await Oe({fs:t,cache:{},gitdir:e,oid:s})).oid,await lt.writeRef({fs:t,gitdir:e,ref:o,value:s})),n&&await lt.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:o})}({fs:e,gitdir:s,ref:i,object:n,checkout:a,force:o})}catch(t){throw t.caller="git.branch",t}}He.code="AlreadyExistsError";class Ve extends e{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=Ve.code,this.data={filepaths:t}}}Ve.code="CheckoutConflictError";class Ye extends e{constructor(t,e){super(`Failed to checkout "${t}" because commit ${e} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Ye.code,this.data={ref:t,oid:e}}}async function Xe(t,e,r){const i=r.split("/");i.pop();let n=e;for(const e of i){if(""===e||"."===e)continue;n=`${n}/${e}`;const i=await t.lstat(n);if(i&&i.isSymbolicLink())throw new o(r)}}Ye.code="CommitNotFetchedError";const Je=(t,e)=>{if("."===t||null==e||0===e.length||"."===e)return!0;const r=e.endsWith("/")?e.slice(0,-1):e;return"."===r||(r.length>=t.length?r===t||r.startsWith(`${t}/`):t.startsWith(`${r}/`))};async function Qe({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:o,remote:s,ref:c,filepaths:f,noCheckout:l,noUpdateHead:d,dryRun:h,force:u,track:p=!0,restoreFromIndex:g=!1,nonBlocking:w=!1,batchSize:m=100}){let y,b;if(i)try{y=await lt.resolve({fs:t,gitdir:o,ref:"HEAD"})}catch(t){y="0000000000000000000000000000000000000000"}try{b=await lt.resolve({fs:t,gitdir:o,ref:c})}catch(e){if("HEAD"===c||!(e instanceof T))throw e;const r=`${s}/${c}`;if(b=await lt.resolve({fs:t,gitdir:o,ref:r}),p){const e=await ot.get({fs:t,gitdir:o});await e.set(`branch.${c}.remote`,s),await e.set(`branch.${c}.merge`,`refs/heads/${c}`),await ot.save({fs:t,gitdir:o,config:e})}await lt.writeRef({fs:t,gitdir:o,ref:`refs/heads/${c}`,value:b})}if(!d)try{b=(await Oe({fs:t,cache:e,gitdir:o,oid:b})).oid}catch(t){if(t instanceof T)throw new Ye(c,t.data.what);throw t}if(!l){let s;try{s=await async function({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:a,force:o,filepaths:s,restoreFromIndex:c}){let f=0;return Qt({fs:t,cache:e,dir:i,gitdir:n,trees:[c?U():Zt({ref:a}),Vt(),U()],map:async function(t,[e,i,n]){if("."!==t){if(s&&!s.some(e=>Je(t,e)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++f}),[!!n,!!e,!!i].map(Number).join("")){case"000":return;case"001":return!c&&o&&s&&s.includes(t)?["delete",t]:void 0;case"010":switch(await e.type()){case"tree":return["mkdir",t];case"blob":return["create",t,await e.oid(),await e.mode()];case"commit":return["mkdir-index",t,await e.oid(),await e.mode()];default:return["error",`new entry Unhandled type ${await e.type()}`]}case"011":switch(`${await e.type()}-${await i.type()}`){case"tree-tree":case"commit-tree":return;case"tree-blob":case"blob-tree":case"commit-blob":return["conflict",t];case"blob-blob":return await e.oid()!==await i.oid()?o?["update",t,await e.oid(),await e.mode(),await e.mode()!==await i.mode()]:["conflict",t]:await e.mode()!==await i.mode()?o?["update",t,await e.oid(),await e.mode(),!0]:["conflict",t]:["create-index",t,await e.oid(),await e.mode()];default:return["error",`new entry Unhandled type ${e.type}`]}case"100":return["delete-index",t];case"101":switch(await n.type()){case"tree":case"commit":return["rmdir-index",t];case"blob":return await n.oid()!==await i.oid()?o?["delete",t]:["conflict",t]:["delete",t];default:return["error",`delete entry Unhandled type ${await n.type()}`]}case"110":case"111":switch(`${await n.type()}-${await e.type()}`){case"tree-tree":return;case"blob-blob":if(await n.oid()===await e.oid()&&await n.mode()===await e.mode()&&!o)return;if(i){if(await i.oid()!==await n.oid()&&await i.oid()!==await e.oid())return o?["update",t,await e.oid(),await e.mode(),await e.mode()!==await i.mode()]:["conflict",t]}else if(o)return["update",t,await e.oid(),await e.mode(),await e.mode()!==await n.mode()];return await e.mode()!==await n.mode()?["update",t,await e.oid(),await e.mode(),!0]:await e.oid()!==await n.oid()?["update",t,await e.oid(),await e.mode(),!1]:void 0;case"tree-blob":return["update-dir-to-blob",t,await e.oid()];case"blob-tree":return["update-blob-to-tree",t];case"commit-commit":return["mkdir-index",t,await e.oid(),await e.mode()];default:return["error",`update entry Unhandled type ${await n.type()}-${await e.type()}`]}}}},reduce:async function(t,e){return e=Yt(e),t?t&&"rmdir"===t[0]?(e.push(t),e):(e.unshift(t),e):e}})}({fs:t,cache:e,onProgress:r,dir:n,gitdir:o,ref:c,force:u,filepaths:f,restoreFromIndex:g})}catch(t){throw t instanceof T&&t.data.what===b?new Ye(c,b):t}const l=s.filter(([t])=>"conflict"===t).map(([t,e])=>e);if(l.length>0)throw new Ve(l);const d=s.filter(([t])=>"error"===t).map(([t,e])=>e);if(d.length>0)throw new a(d.join(", "));if(h)return void(i&&await i({previousHead:y,newHead:b,type:null!=f&&f.length>0?"file":"branch"}));let p=0;const _=s.length;if(await $.acquire({fs:t,gitdir:o,cache:e},async function(e){await Promise.all(s.filter(([t])=>"delete"===t||"delete-index"===t).map(async function([i,a]){const o=`${n}/${a}`;"delete"===i&&await t.rm(o),e.delete({filepath:a}),r&&await r({phase:"Updating workdir",loaded:++p,total:_})}))}),await $.acquire({fs:t,gitdir:o,cache:e},async function(e){for(const[i,a]of s)if("rmdir"===i||"rmdir-index"===i){const o=`${n}/${a}`;try{"rmdir"===i&&await t.rmdir(o),e.delete({filepath:a}),r&&await r({phase:"Updating workdir",loaded:++p,total:_})}catch(t){if("ENOTEMPTY"!==t.code)throw t;console.log(`Did not delete ${a} because directory is not empty`)}}}),await Promise.all(s.filter(([t])=>"mkdir"===t||"mkdir-index"===t).map(async function([e,i]){const a=`${n}/${i}`;await Xe(t,n,i),await t.mkdir(a),r&&await r({phase:"Updating workdir",loaded:++p,total:_})})),w){const i=s.filter(([t])=>"create"===t||"create-index"===t||"update"===t||"mkdir-index"===t),c=await tr("Update Working Dir",i.map(([r,i,s,c,f])=>()=>async function({fs:t,cache:e,gitdir:r,dir:i},[n,o,s,c,f]){const l=`${i}/${o}`;if("create-index"!==n&&"mkdir-index"!==n){await Xe(t,i,o);const{object:n}=await Mt({fs:t,cache:e,gitdir:r,oid:s});if(f&&await t.rm(l),33188===c)await t.write(l,n);else if(33261===c)await t.write(l,n,{mode:511});else{if(40960!==c)throw new a(`Invalid mode 0o${c.toString(8)} detected in blob ${s}`);await t.writelink(l,n)}}const d=await t.lstat(l);return 33261===c&&(d.mode=493),"mkdir-index"===n&&(d.mode=57344),[o,s,d]}({fs:t,cache:e,gitdir:o,dir:n},[r,i,s,c,f])),r,m);await $.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(t){await tr("Update Index",c.map(([e,r,i])=>()=>async function({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(t){console.warn(`Error inserting ${e} into index:`,t)}}({index:t,fullpath:e,oid:r,stats:i})),r,m)})}else await $.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(i){const c=await Promise.allSettled(s.filter(([t])=>"create"===t||"create-index"===t||"update"===t||"mkdir-index"===t).map(async function([s,c,f,l,d]){const h=`${n}/${c}`;if("create-index"!==s&&"mkdir-index"!==s){await Xe(t,n,c);const{object:r}=await Mt({fs:t,cache:e,gitdir:o,oid:f});if(d&&await t.rm(h),33188===l)await t.write(h,r);else if(33261===l)await t.write(h,r,{mode:511});else{if(40960!==l)throw new a(`Invalid mode 0o${l.toString(8)} detected in blob ${f}`);await t.writelink(h,r)}}const u=await t.lstat(h);33261===l&&(u.mode=493),"mkdir-index"===s&&(u.mode=57344),i.insert({filepath:c,stats:u,oid:f}),r&&await r({phase:"Updating workdir",loaded:++p,total:_})})),f=[];for(const t of c)"rejected"===t.status&&(f.push(t.reason),console.error("[isomorphic-git checkout] task rejected:",t.reason?.stack??t.reason));if(f.length>0)throw new ge(f)});i&&await i({previousHead:y,newHead:b,type:null!=f&&f.length>0?"file":"branch"})}if(!d){const e=await lt.expand({fs:t,gitdir:o,ref:c});e.startsWith("refs/heads")?await lt.writeSymbolicRef({fs:t,gitdir:o,ref:"HEAD",value:e}):await lt.writeRef({fs:t,gitdir:o,ref:"HEAD",value:b})}}async function tr(t,e,r,i){const n=[],a=[];for(let o=0;o<e.length;o+=i){const s=e.slice(o,o+i).map(t=>t());(await Promise.allSettled(s)).forEach(e=>{"fulfilled"===e.status?n.push(e.value):(a.push(e.reason),console.error(`[isomorphic-git ${t}] task rejected:`,e.reason?.stack??e.reason))}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:e.length})}if(a.length>0)throw new ge(a);return n}async function er({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=Z(i,".git"),remote:a="origin",ref:o,filepaths:s,noCheckout:c=!1,noUpdateHead:f=void 0===o,dryRun:l=!1,force:d=!1,track:h=!0,cache:u={},nonBlocking:p=!1,batchSize:g=100}){try{de("fs",t),de("dir",i),de("gitdir",n);const w=o||"HEAD",m=void 0===o&&null!=s&&s.length>0,y=new fe(t),b=await he({fsp:y,dotgit:n});return await Qe({fs:y,cache:u,onProgress:e,onPostCheckout:r,dir:i,gitdir:b,remote:a,ref:w,filepaths:s,noCheckout:c,noUpdateHead:f,dryRun:l,force:d,track:h,restoreFromIndex:m,nonBlocking:p,batchSize:g})}catch(t){throw t.caller="git.checkout",t}}class rr extends e{constructor(t){super(`Your local changes to the following files would be overwritten by cherry-pick: ${t.join(", ")}`),this.code=this.name=rr.code,this.data={filepaths:t}}}rr.code="CherryPickLocalChangesError";class ir extends e{constructor(t,e){super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${e} parents and require specifying which parent to use as the base.`),this.code=this.name=ir.code,this.data={oid:t,parentCount:e}}}ir.code="CherryPickMergeCommitError";class nr extends e{constructor(t){super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`),this.code=this.name=nr.code,this.data={oid:t}}}nr.code="CherryPickRootCommitError";class ar extends e{constructor(t,e,r,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=ar.code,this.data={filepaths:t,bothModified:e,deleteByUs:r,deleteByTheirs:i}}}ar.code="MergeConflictError";class or extends e{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=or.code,this.data={}}}or.code="MergeNotSupportedError";var sr=r(6895);const cr=/^.*(\r?\n|$)/gm;function fr({branches:t,contents:e}){const r=t[1],i=t[2],n=e[0],a=e[1],o=e[2],s=a.match(cr),c=n.match(cr),f=o.match(cr),l=sr(s,c,f);let d="",h=!0;for(const t of l)t.ok&&(d+=t.ok.join("")),t.conflict&&(h=!1,d+=`${"<".repeat(7)} ${r}\n`,d+=t.conflict.a.join(""),d+=`${"=".repeat(7)}\n`,d+=t.conflict.b.join(""),d+=`${">".repeat(7)} ${i}\n`);return{cleanMerge:h,mergedText:d}}async function lr({fs:t,cache:e,dir:r,gitdir:i=Z(r,".git"),index:n,ourOid:a,baseOid:o,theirOid:s,ourName:c="ours",baseName:f="base",theirName:l="theirs",dryRun:d=!1,abortOnConflict:h=!0,mergeDriver:u}){const p=Zt({ref:a}),g=Zt({ref:o}),w=Zt({ref:s}),m=[],y=[],b=[],_=[],v=await Qt({fs:t,cache:e,dir:r,gitdir:i,trees:[p,g,w],map:async function(e,[r,a,o]){const s=R(e);switch(`${await ue(r,a)}-${await ue(o,a)}`){case"false-false":return{mode:await a.mode(),path:s,oid:await a.oid(),type:await a.type()};case"false-true":return o||"tree"!==await r.type()?o?{mode:await o.mode(),path:s,oid:await o.oid(),type:await o.type()}:void 0:{mode:await r.mode(),path:s,oid:await r.oid(),type:await r.type()};case"true-false":return r||"tree"!==await o.type()?r?{mode:await r.mode(),path:s,oid:await r.oid(),type:await r.type()}:void 0:{mode:await o.mode(),path:s,oid:await o.oid(),type:await o.type()};case"true-true":if(r&&o&&"tree"===await r.type()&&"tree"===await o.type())return{mode:await r.mode(),path:s,oid:await r.oid(),type:"tree"};if(r&&o&&"blob"===await r.type()&&"blob"===await o.type())return async function({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:a,ourName:o,theirName:s,baseName:c,dryRun:f,mergeDriver:l=fr}){const d="blob";let h="100755",u="",p="";n&&"blob"===await n.type()&&(h=await n.mode(),u=await n.oid(),p=Buffer.from(await n.content()).toString("utf8"));const g=h===await i.mode()?await a.mode():await i.mode();if(await i.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:d}};if(await i.oid()===u)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await a.oid(),type:d}};if(await a.oid()===u)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:d}};const w=Buffer.from(await i.content()).toString("utf8"),m=Buffer.from(await a.content()).toString("utf8"),{mergedText:y,cleanMerge:b}=await l({branches:[c,o,s],contents:[p,w,m],path:r});return{cleanMerge:b,mergeResult:{mode:g,path:r,oid:await _e({fs:t,gitdir:e,type:"blob",object:Buffer.from(y,"utf8"),dryRun:f}),type:d}}}({fs:t,gitdir:i,path:s,ours:r,base:a,theirs:o,ourName:c,baseName:f,theirName:l,mergeDriver:u}).then(async t=>{if(t.cleanMerge)h||n.insert({filepath:e,oid:t.mergeResult.oid,stage:0});else if(m.push(e),y.push(e),!h){let t="";a&&"blob"===await a.type()&&(t=await a.oid());const i=await r.oid(),s=await o.oid();n.delete({filepath:e}),t&&n.insert({filepath:e,oid:t,stage:1}),n.insert({filepath:e,oid:i,stage:2}),n.insert({filepath:e,oid:s,stage:3})}return t.mergeResult});if(a&&!r&&o&&"blob"===await a.type()&&"blob"===await o.type()){if(m.push(e),b.push(e),!h){const t=await a.oid(),r=await o.oid();n.delete({filepath:e}),n.insert({filepath:e,oid:t,stage:1}),n.insert({filepath:e,oid:r,stage:3})}return{mode:await o.mode(),oid:await o.oid(),type:"blob",path:s}}if(a&&r&&!o&&"blob"===await a.type()&&"blob"===await r.type()){if(m.push(e),_.push(e),!h){const t=await a.oid(),i=await r.oid();n.delete({filepath:e}),n.insert({filepath:e,oid:t,stage:1}),n.insert({filepath:e,oid:i,stage:2})}return{mode:await r.mode(),oid:await r.oid(),type:"blob",path:s}}if(a&&!r&&!o&&("blob"===await a.type()||"tree"===await a.type()))return;throw new or}},reduce:0===m.length||r&&!h?async(e,r)=>{const n=r.filter(Boolean);if(e&&(!e||"tree"!==e.type||0!==n.length||"."===e.path)){if(n.length>0||"."===e.path&&0===n.length){const r=new gt(n).toObject(),a=await _e({fs:t,gitdir:i,type:"tree",object:r,dryRun:d});e.oid=a}return e}}:void 0});return 0!==m.length?(r&&!h&&await Qt({fs:t,cache:e,dir:r,gitdir:i,trees:[Zt({ref:v.oid})],map:async function(e,[i]){const n=`${r}/${e}`;if("blob"===await i.type()){const e=await i.mode(),r=await i.content();await t.write(n,r,{mode:e})}return!0}}),new ar(m,y,b,_)):v.oid}const dr={stage:U,workdir:Vt};async function hr({fs:t,dir:e,gitdir:r,treePair:i}){const n="stage"===i[1],o=i.map(t=>"string"==typeof t?dr[t]():t),s=[],c=await Qt({fs:t,cache:{},dir:e,gitdir:r,trees:o,map:async(i,[n,a])=>{if("."!==i&&!await me.isIgnored({fs:t,dir:e,gitdir:r,filepath:i}))return a?((!n||await n.oid()!==await a.oid()&&void 0!==await a.oid())&&s.push([n,a]),{mode:await a.mode(),path:i,oid:await a.oid(),type:await a.type()}):void 0},reduce:async(t,e)=>(e=e.filter(Boolean),t?(t.children=e,t):e.length>0?e:void 0),iterate:async(r,i)=>{const a=[];for(const r of i){const[i,o]=r;n?o&&(await t.exists(`${e}/${o.toString()}`)?a.push(r):s.push([null,o])):i&&(o?a.push(r):s.push([i,null]))}return a.length?Promise.all(a.map(r)):[]}});if(0===s.length||0===c.length)return null;const f=(await async function({fs:t,dir:e,gitdir:r,entries:i}){return Promise.all(i.map(async function i(n){if("tree"===n.type){if(!n.oid){const e=await Promise.all(n.children.map(i));n.oid=await Le({fs:t,gitdir:r,tree:e}),n.mode=16384}}else"blob"===n.type&&(n.oid=await async function(t,e,r,i,n=null){const o=Z(r,i),s=await t.lstat(o);if(!s)throw new T(o);if(s.isDirectory())throw new a(`${o}: file expected, but found directory`);const c=n?await mt({fs:t,gitdir:e,oid:n}):void 0;let f=c?n:void 0;return c||await S(o,async()=>{const r=s.isSymbolicLink()?await t.readlink(o).then(ve):await t.read(o);if(null===r)throw new T(o);f=await _e({fs:t,gitdir:e,type:"blob",object:r})}),f}(t,r,e,n.path,n.oid),n.mode=33188);return n.path=n.path.split("/").pop(),n}))}({fs:t,dir:e,gitdir:r,entries:c})).filter(Boolean).map(t=>({mode:t.mode,path:t.path,oid:t.oid,type:t.type}));return Le({fs:t,gitdir:r,tree:f})}async function ur({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:a}){const o=[],s=[],c=await Qt({fs:t,cache:{},dir:e,gitdir:r,trees:[Zt({ref:n}),Zt({ref:i})],map:async(i,[n,c])=>{if("."===i||await me.isIgnored({fs:t,dir:e,gitdir:r,filepath:i}))return;const f=c?await c.type():await n.type();if("tree"!==f&&"blob"!==f)return;if(!c&&n){const t="tree"===f?"rmdir":"rm";return"tree"===f&&o.push(i),"blob"===f&&a&&s.push({filepath:i,oid:await n.oid()}),{method:t,filepath:i}}const l=await c.oid();return n&&await n.oid()===l?void 0:"tree"===f?{method:"mkdir",filepath:i}:(a&&s.push({filepath:i,oid:l,stats:await t.lstat(Z(e,i))}),{method:"write",filepath:i,oid:l})}});await S(r,async()=>{for(const i of c){const n=Z(e,i.filepath);switch(i.method){case"rmdir":await t.rmdir(n);break;case"mkdir":await Xe(t,e,i.filepath),await t.mkdir(n);break;case"rm":await t.rm(n);break;case"write":if(!o.some(t=>n.startsWith(t))){await Xe(t,e,i.filepath);const{object:a}=await Mt({fs:t,cache:{},gitdir:r,oid:i.oid});await t.exists(n)&&await t.rm(n),await t.write(n,a)}}}}),await $.acquire({fs:t,gitdir:r,cache:{}},async t=>{s.forEach(({filepath:e,stats:r,oid:i})=>{t.insert({filepath:e,stats:r,oid:i})})})}async function pr({fs:t,cache:e,dir:r,gitdir:i,oid:n,dryRun:a=!1,noUpdateBranch:o=!1,abortOnConflict:s=!0,committer:c,mergeDriver:f}){const{commit:l,oid:d}=await je({fs:t,cache:e,gitdir:i,oid:n});if(l.parent.length>1)throw new ir(d,l.parent.length);if(0===l.parent.length)throw new nr(d);const h=await lt.resolve({fs:t,gitdir:i,ref:"HEAD"}),{commit:u}=await je({fs:t,cache:e,gitdir:i,oid:h}),p=l.parent[0],{commit:g}=await je({fs:t,cache:e,gitdir:i,oid:p});if(r&&(!a&&!o||!s)){const n=await async function({fs:t,cache:e,dir:r,gitdir:i,headTree:n,baseTree:a,theirTree:o,allTracked:s}){const c=await Qt({fs:t,cache:e,dir:r,gitdir:i,trees:[Zt({ref:a}),Zt({ref:o})],map:async(t,[e,r])=>{if("."!==t)return e&&r&&await e.oid()===await r.oid()?null:[e?await e.type():void 0,r?await r.type():void 0].includes("blob")?t:void 0}});return 0!==c.length||s?Qt({fs:t,cache:e,dir:r,gitdir:i,trees:[Zt({ref:n}),U(),Vt()],map:async(t,[e,r,i])=>{if("."===t)return;if(!s&&!c.some(e=>Je(t,e)))return null;const n=e&&"blob"===await e.type()?await e.oid():void 0;return c.includes(t)||s&&n?(r?await r.oid():void 0)!==n?t:i?n&&"blob"===await i.type()&&await i.oid()===n?void 0:t:void 0:void 0}}):[]}({fs:t,cache:e,dir:r,gitdir:i,headTree:u.tree,baseTree:g.tree,theirTree:l.tree,allTracked:!s});if(n.length>0)throw new rr(n)}const w=await $.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async n=>lr({fs:t,cache:e,dir:r,gitdir:i,index:n,ourOid:u.tree,baseOid:g.tree,theirOid:l.tree,ourName:"HEAD",baseName:`parent of ${d.slice(0,7)}`,theirName:d.slice(0,7),dryRun:a,abortOnConflict:s,mergeDriver:f}));if(w instanceof ar)throw w;const m=await Te({fs:t,cache:e,gitdir:i,message:l.message,tree:w,parent:[h],author:l.author,committer:c,dryRun:a,noUpdateBranch:o});return!r||a||o||await ur({fs:t,dir:r,gitdir:i,stashCommit:m,parentCommit:h,wasStaged:!0}),m}async function gr({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,cache:n={},committer:a,dryRun:o=!1,noUpdateBranch:s=!1,abortOnConflict:c=!0,mergeDriver:f}){try{de("fs",t),de("gitdir",r),de("oid",i);const l=new fe(t),d=await he({fsp:l,dotgit:r}),{commit:h}=await je({fs:l,cache:n,gitdir:d,oid:i});if(h.parent&&h.parent.length>1)return await pr({fs:l,cache:n,dir:e,gitdir:d,oid:i,dryRun:o,noUpdateBranch:s,abortOnConflict:c,committer:void 0,mergeDriver:f});const u=await Ie({fs:l,gitdir:d,committer:a});if(!u)throw new Ae("committer");return await pr({fs:l,cache:n,dir:e,gitdir:d,oid:i,dryRun:o,noUpdateBranch:s,abortOnConflict:c,committer:u,mergeDriver:f})}catch(t){throw t.caller="git.cherryPick",t}}const wr=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function mr(t){const e=wr.exec(t);return e?"remotes/"===e[1]&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function yr({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){const n=await lt.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await lt.resolve({fs:t,gitdir:e,ref:n})}catch(t){if(t instanceof T)return;throw t}if(n.startsWith("refs/"))return r?n:mr(n)}class br extends e{constructor(t,e){super(`Remote does not support the "${t}" so the "${e}" parameter cannot be used.`),this.code=this.name=br.code,this.data={capability:t,parameter:e}}}br.code="RemoteCapabilityError";class _r extends e{constructor(t,e,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${e}"`),this.code=this.name=_r.code,this.data={url:t,transport:e,suggestion:r}}}_r.code="UnknownTransportError";class vr extends e{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=vr.code,this.data={url:t}}}vr.code="UrlParseError";class xr extends e{constructor(t,e,r){super(`HTTP Error: ${t} ${e}`),this.code=this.name=xr.code,this.data={statusCode:t,statusMessage:e,response:r}}}xr.code="HttpError";class kr extends e{constructor(t,e){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=kr.code,this.data={preview:t,response:e}}}kr.code="SmartHttpError";class Er extends e{constructor(){super("The operation was canceled."),this.code=this.name=Er.code,this.data={}}}function Ar({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}async function Sr(t,e){const r=Et(t);for(;;){const{value:t,done:i}=await r.next();if(t&&await e(t),i)break}r.return&&r.return()}async function Br(t){let e=0;const r=[];await Sr(t,t=>{r.push(t),e+=t.byteLength});const i=new Uint8Array(e);let n=0;for(const t of r)i.set(t,n),n+=t.byteLength;return i}Er.code="UserCanceledError";const $r=/^(https?:\/\/)([^/?#]+)@/i;function Rr(t){const e=t.match($r);return null==e?{url:t,auth:{}}:{url:t.replace($r,"$1"),auth:Pr(t,e[2])}}function Pr(t,e){const r=function(t){if("function"!=typeof URL)return null;try{return new URL(t)}catch(t){return null}}(t),i=-1!==e.indexOf(":");if(null!==r)return{username:Ir(r.username),password:i?Ir(r.password):void 0};const n=e.indexOf(":");return{username:i?e.slice(0,n):e,password:i?e.slice(n+1):void 0}}function Ir(t){try{return decodeURIComponent(t)}catch(e){return t}}class Or extends e{constructor(){super("Empty response from git server."),this.code=this.name=Or.code,this.data={}}}Or.code="EmptyServerResponseError";class jr extends e{constructor(t,e){super(`Expected "${t}" but received "${e}".`),this.code=this.name=jr.code,this.data={expected:t,actual:e}}}function Ur(t,e){const r=e.toString(16);return"0".repeat(t-r.length)+r}jr.code="ParseError";class Tr{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){"string"==typeof t&&(t=Buffer.from(t));const e=Ur(4,t.length+4);return Buffer.concat([Buffer.from(e,"utf8"),t])}static streamReader(t){const e=new At(t);return async function(){try{const t=await e.read(4);if(null==t||0===t.length)return!0;const r=t.toString("utf8");if(!/^[0-9a-fA-F]{4}$/.test(r))throw new jr("four hexadecimal digits",r);const i=parseInt(r,16);if(0===i)return null;if(1===i)return null;if(i<4)throw new jr("pkt-line length of 0, 1, or at least 4",r);const n=await e.read(i-4);if(null==n||n.length!==i-4)throw new jr(i-4+" bytes of pkt-line data",`${null==n?0:n.length} bytes`);return n}catch(e){return t.error=e,!0}}}}async function Cr(t){const e={};let r;for(;r=await t(),!0!==r;){if(null===r)continue;r=r.toString("utf8").replace(/\n$/,"");const t=r.indexOf("=");if(t>-1){const i=r.slice(0,t),n=r.slice(t+1);e[i]=n}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}async function Mr(t,{service:e}){const r=new Set,i=new Map,n=new Map,a=Tr.streamReader(t);let o=await a();for(;null===o;)o=await a();if(!0===o)throw new Or;if(o.includes("version 2"))return Cr(a);if(o.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new jr(`# service=${e}\\n`,o.toString("utf8"));let s=await a();for(;null===s;)s=await a();if(!0===s)return{capabilities:r,refs:i,symrefs:n};if(s=s.toString("utf8"),s.includes("version 2"))return Cr(a);const[c,f]=Dr(s,"\0","\\x00");if(f.split(" ").map(t=>r.add(t)),"0000000000000000000000000000000000000000 capabilities^{}"!==c){const[t,e]=Dr(c," "," ");for(i.set(e,t);;){const t=await a();if(!0===t)break;if(null!==t){const[e,r]=Dr(t.toString("utf8")," "," ");i.set(r,e)}}}for(const t of r)if(t.startsWith("symref=")){const e=t.match(/symref=([^:]+):(.*)/);3===e.length&&n.set(e[1],e[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}function Dr(t,e,r){const i=t.trim().split(e);if(2!==i.length)throw new jr(`Two strings separated by '${r}'`,t.toString("utf8"));return i}const Fr=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,Nr=(t,e)=>{(e.username||e.password)&&(t.Authorization=Ar(e)),e.headers&&Object.assign(t,e.headers)},zr=async t=>{try{const e=Buffer.from(await Br(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch(t){return{}}};class Lr{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:e,onAuth:r,onAuthSuccess:i,onAuthFailure:n,corsProxy:a,service:o,url:s,headers:c,signal:f,protocolVersion:l}){let{url:d,auth:h}=Rr(s);const u=a?Fr(a,d):d;let p,g;(h.username||h.password)&&(c.Authorization=Ar(h)),2===l&&(c["Git-Protocol"]="version=2");let w=!1;do{if(p=await t.request({onProgress:e,method:"GET",url:`${u}/info/refs?service=${o}`,headers:c,signal:f}),g=!1,401===p.statusCode||203===p.statusCode){const t=w?n:r;if(t){if(h=await t(d,{...h,headers:{...c}}),h&&h.cancel)throw new Er;h&&(Nr(c,h),w=!0,g=!0)}}else 200===p.statusCode&&w&&i&&await i(d,h)}while(g);if(200!==p.statusCode){const{response:t}=await zr(p);throw new xr(p.statusCode,p.statusMessage,t)}if(p.headers["content-type"]===`application/x-${o}-advertisement`){const t=await Mr(p.body,{service:o});return t.auth=h,t}{const{preview:t,response:e,data:r}=await zr(p);try{const t=await Mr([r],{service:o});return t.auth=h,t}catch(r){throw new kr(t,e)}}}static async connect({http:t,onProgress:e,corsProxy:r,service:i,url:n,auth:a,body:o,headers:s,signal:c}){const f=Rr(n);f&&(n=f.url),r&&(n=Fr(r,n)),s["content-type"]=`application/x-${i}-request`,s.accept=`application/x-${i}-result`,Nr(s,a);const l=await t.request({onProgress:e,method:"POST",url:`${n}/${i}`,body:o,headers:s,signal:c});if(200!==l.statusCode){const{response:t}=zr(l);throw new xr(l.statusCode,l.statusMessage,t)}return l}}class Hr{static getRemoteHelperFor({url:t}){const e=new Map;e.set("http",Lr),e.set("https",Lr);const r=function({url:t}){if(Wr.test(t))return{transport:"ssh",address:t};const e=t.match(/(\w+)(:\/\/|::)(.*)/);return null!==e?"://"===e[2]?{transport:e[1],address:e[0]}:"::"===e[2]?{transport:e[1],address:e[3]}:void 0:void 0}({url:t});if(!r)throw new vr(t);if(e.has(r.transport))return e.get(r.transport);throw new _r(t,r.transport,"ssh"===r.transport?function(t){return(t=t.replace(/^[^/@:]+@([^/@:]+):/,"https://$1/")).replace(/^ssh:\/\//,"https://")}(t):void 0)}}const Wr=/^[^/@:]+@[^/@:]+:/;class Gr{static async read({fs:t,gitdir:e}){const r=Z(e,"shallow"),i=new Set;return await S(r,async function(){const e=await t.read(r,{encoding:"utf8"});return null===e||""===e.trim()?i:void e.trim().split("\n").map(t=>i.add(t))}),i}static async write({fs:t,gitdir:e,oids:r}){const i=Z(e,"shallow");if(r.size>0){const e=[...r].join("\n")+"\n";await S(i,async function(){await t.write(i,e,{encoding:"utf8"})})}else await S(i,async function(){await t.rm(i)})}}function qr({config:t,onAuth:e}){return e?async(r,i)=>{const n=i.username||await t.get(`credential.${r}.username`);return e(r,n?{...i,username:n}:i)}:e}function Zr(t,e){const r=t.map(t=>t.split("=",1)[0]);return e.filter(t=>{const e=t.split("=",1)[0];return r.includes(e)})}const Kr={name:"isomorphic-git",version:"1.44.8",agent:"git/isomorphic-git@1.44.8"};class Vr{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){const e=this._waiting;this._waiting=null,e({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){const t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}}function Yr(t){const e=t.indexOf("\r"),r=t.indexOf("\n");return-1===e&&-1===r?-1:-1===e?r+1:-1===r?e+1:r===e+1?r+1:Math.min(e,r)+1}function Xr(t){const e=new Vr;let r="";return(async()=>{await Sr(t,t=>{for(t=t.toString("utf8"),r+=t;;){const t=Yr(r);if(-1===t)break;if(t===r.length&&"\r"===r[t-1])break;e.write(r.slice(0,t)),r=r.slice(t)}}),r.length>0&&e.write(r),e.end()})(),e}class Jr{static demux(t){const e=Tr.streamReader(t),r=new Vr,i=new Vr,n=new Vr,a=async function(){const o=await e();if(null===o)return a();if(!0===o)return r.end(),n.end(),void(t.error?i.destroy(t.error):i.end());switch(o[0]){case 1:i.write(o.slice(1));break;case 2:n.write(o.slice(1));break;case 3:{const t=o.slice(1);return n.write(t),r.end(),n.end(),void i.destroy(new Error(t.toString("utf8")))}default:r.write(o)}a()};return a(),{packetlines:r,packfile:i,progress:n}}}async function Qr({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:c,ref:f,remoteRef:l,remote:d,url:h,corsProxy:u,depth:p=null,since:g=null,exclude:w=[],relative:m=!1,tags:y=!1,singleBranch:b=!1,headers:_={},prune:v=!1,pruneTags:x=!1}){const k=f||await yr({fs:t,gitdir:c,test:!0}),E=await ot.get({fs:t,gitdir:c}),A=d||k&&await E.get(`branch.${k}.remote`)||"origin",S=h||await E.get(`remote.${A}.url`);if(void 0===S)throw new le("remote OR url");const B=l||k&&await E.get(`branch.${k}.merge`)||f||"HEAD";void 0===u&&(u=await E.get("http.corsProxy"));const $=Hr.getRemoteHelperFor({url:S}),R=await $.discover({http:r,onAuth:qr({config:E,onAuth:a}),onAuthSuccess:o,onAuthFailure:qr({config:E,onAuth:s}),corsProxy:u,service:"git-upload-pack",url:S,headers:_,protocolVersion:1}),P=R.auth,I=R.refs;if(0===I.size)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(null!==p&&!R.capabilities.has("shallow"))throw new br("shallow","depth");if(null!==g&&!R.capabilities.has("deepen-since"))throw new br("deepen-since","since");if(w.length>0&&!R.capabilities.has("deepen-not"))throw new br("deepen-not","exclude");if(!0===m&&!R.capabilities.has("deepen-relative"))throw new br("deepen-relative","relative");const{oid:O,fullref:j}=lt.resolveAgainstMap({ref:B,map:I});for(const t of I.keys())t===j||"HEAD"===t||t.startsWith("refs/heads/")||y&&t.startsWith("refs/tags/")||I.delete(t);const U=Zr([...R.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Kr.agent}`]);m&&U.push("deepen-relative");const T=b?[O]:I.values(),C=b?[k]:await lt.listRefs({fs:t,gitdir:c,filepath:"refs"});let M=[];for(let r of C)try{r=await lt.expand({fs:t,gitdir:c,ref:r});const i=await lt.resolve({fs:t,gitdir:c,ref:r});await Be({fs:t,cache:e,gitdir:c,oid:i})&&M.push(i)}catch(t){}M=[...new Set(M)];const F=await Gr.read({fs:t,gitdir:c}),N=function({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:a=null,exclude:o=[]}){const s=[];e=[...new Set(e)];let c=` ${t.join(" ")}`;for(const t of e)s.push(Tr.encode(`want ${t}${c}\n`)),c="";for(const t of i)s.push(Tr.encode(`shallow ${t}\n`));null!==n&&s.push(Tr.encode(`deepen ${n}\n`)),null!==a&&s.push(Tr.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)}\n`));for(const t of o)s.push(Tr.encode(`deepen-not ${t}\n`));s.push(Tr.flush());for(const t of r)s.push(Tr.encode(`have ${t}\n`));return s.push(Tr.encode("done\n")),s}({capabilities:U,wants:T,haves:M,shallows:R.capabilities.has("shallow")?[...F]:[],depth:p,since:g,exclude:w}),z=Buffer.from(await Br(N)),L=await $.connect({http:r,onProgress:i,corsProxy:u,service:"git-upload-pack",url:S,auth:P,body:[z],headers:_}),H=await async function(t){const{packetlines:e,packfile:r,progress:i}=Jr.demux(t),n=[],a=[],o=[];let s=!1,c=!1;return new Promise((f,l)=>{Sr(e,e=>{const d=e.toString("utf8").trim();if(d.startsWith("shallow")){const t=d.slice(-41).trim();40!==t.length&&l(new D(t)),n.push(t)}else if(d.startsWith("unshallow")){const t=d.slice(-41).trim();40!==t.length&&l(new D(t)),a.push(t)}else if(d.startsWith("ACK")){const[,t,e]=d.split(" ");o.push({oid:t,status:e}),e||(c=!0)}else d.startsWith("NAK")?(s=!0,c=!0):(c=!0,s=!0);c&&(t.error?l(t.error):f({shallows:n,unshallows:a,acks:o,nak:s,packfile:r,progress:i}))}).finally(()=>{c||(t.error?l(t.error):f({shallows:n,unshallows:a,acks:o,nak:s,packfile:r,progress:i}))})})}(L.body);L.headers&&(H.headers=L.headers);for(const r of H.shallows)if(!F.has(r))try{const{object:i}=await Mt({fs:t,cache:e,gitdir:c,oid:r}),n=new Wt(i),a=await Promise.all(n.headers().parent.map(r=>Be({fs:t,cache:e,gitdir:c,oid:r})));0===a.length||a.every(t=>t)||F.add(r)}catch(t){F.add(r)}for(const t of H.unshallows)F.delete(t);if(await Gr.write({fs:t,gitdir:c,oids:F}),b){const e=new Map([[j,O]]),r=new Map;let i=10,n=j;for(;i--;){const t=R.symrefs.get(n);if(void 0===t)break;r.set(n,t),n=t}const a=I.get(n);a&&e.set(n,a);const{pruned:o}=await lt.updateRemoteRefs({fs:t,gitdir:c,remote:A,refs:e,symrefs:r,tags:y,prune:v});v&&(H.pruned=o)}else{const{pruned:e}=await lt.updateRemoteRefs({fs:t,gitdir:c,remote:A,refs:I,symrefs:R.symrefs,tags:y,prune:v,pruneTags:x});v&&(H.pruned=e)}if(H.HEAD=R.symrefs.get("HEAD"),void 0===H.HEAD){const{oid:t}=lt.resolveAgainstMap({ref:"HEAD",map:I});for(const[e,r]of I.entries())if("HEAD"!==e&&r===t){H.HEAD=e;break}}const W=j.startsWith("refs/tags")?"tag":"branch";H.FETCH_HEAD={oid:O,description:`${W} '${mr(j)}' of ${S}`},(i||n)&&Sr(Xr(H.progress),async t=>{if(n&&await n(t),i){const e=t.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);e&&await i({phase:e[1].trim(),loaded:parseInt(e[2],10),total:parseInt(e[3],10)})}});const G=Buffer.from(await Br(H.packfile));if(L.body.error)throw L.body.error;const q=G.slice(-20).toString("hex"),K={defaultBranch:H.HEAD,fetchHead:H.FETCH_HEAD.oid,fetchHeadDescription:H.FETCH_HEAD.description};if(H.headers&&(K.headers=H.headers),v&&(K.pruned=H.pruned),""!==q&&"5041434b0000000200000000"!==G.slice(0,12).toString("hex")){K.packfile=`objects/pack/pack-${q}.pack`;const r=Z(c,K.packfile);await t.write(r,G);const n=r=>Mt({fs:t,cache:e,gitdir:c,oid:r}),a=await jt.fromPack({pack:G,getExternalRefDelta:n,onProgress:i});await t.write(r.replace(/\.pack$/,".idx"),await a.toBuffer())}return K}async function ti({fs:t,bare:e=!1,dir:r,gitdir:i=(e?r:Z(r,".git")),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(t=>i+"/"+t);for(const e of a)await t.mkdir(e);await t.write(i+"/config",`[core]\n\trepositoryformatversion = 0\n\tfilemode = false\n\tbare = ${e}\n`+(e?"":"\tlogallrefupdates = true\n")+"\tsymlinks = false\n\tignorecase = true\n"),await t.write(i+"/HEAD",`ref: refs/heads/${n}\n`)}async function ei({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:c,gitdir:f=Z(c,".git"),url:l,corsProxy:d,ref:h,remote:u="origin",depth:p,since:g,exclude:w=[],relative:m=!1,singleBranch:y=!1,noCheckout:b=!1,noTags:_=!1,headers:v={},cache:x={},nonBlocking:k=!1,batchSize:E=100}){try{de("fs",t),de("http",e),de("gitdir",f),b||de("dir",c),de("url",l);const A=new fe(t),S=await he({fsp:A,dotgit:f});return await async function({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:c,dir:f,gitdir:l,url:d,corsProxy:h,ref:u,remote:p,depth:g,since:w,exclude:m,relative:y,singleBranch:b,noCheckout:_,noTags:v,headers:x,nonBlocking:k,batchSize:E=100}){try{if(await ti({fs:t,gitdir:l}),await Ge({fs:t,gitdir:l,remote:p,url:d,force:!1}),h){const e=await ot.get({fs:t,gitdir:l});await e.set("http.corsProxy",h),await ot.save({fs:t,gitdir:l,config:e})}const{defaultBranch:A,fetchHead:S}=await Qr({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:l,ref:u,remote:p,corsProxy:h,depth:g,since:w,exclude:m,relative:y,singleBranch:b,headers:x,tags:!v});if(null===S)return;u=(u=u||A).replace("refs/heads/",""),await Qe({fs:t,cache:e,onProgress:i,onPostCheckout:c,dir:f,gitdir:l,ref:u,remote:p,noCheckout:_,nonBlocking:k,batchSize:E})}catch(e){throw await t.rmdir(l,{recursive:!0,maxRetries:10}).catch(()=>{}),e}}({fs:A,cache:x,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:c,gitdir:S,url:l,corsProxy:d,ref:h,remote:u,depth:p,since:g,exclude:w,relative:m,singleBranch:y,noCheckout:b,noTags:_,headers:v,nonBlocking:k,batchSize:E})}catch(t){throw t.caller="git.clone",t}}async function ri({fs:t,onSign:e,dir:r,gitdir:i=Z(r,".git"),message:n,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:f=!1,noUpdateBranch:l=!1,disallowEmpty:d=!1,ref:h,parent:u,tree:p,cache:g={}}){try{de("fs",t),c||de("message",n),s&&de("onSign",e);const r=new fe(t),w=await he({fsp:r,dotgit:i});return await Te({fs:r,cache:g,onSign:e,gitdir:w,message:n,author:a,committer:o,signingKey:s,amend:c,dryRun:f,noUpdateBranch:l,disallowEmpty:d,ref:h,parent:u,tree:p})}catch(t){throw t.caller="git.commit",t}}async function ii({fs:t,dir:e,gitdir:r=Z(e,".git"),fullname:i=!1,test:n=!1}){try{de("fs",t),de("gitdir",r);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await yr({fs:e,gitdir:a,fullname:i,test:n})}catch(t){throw t.caller="git.currentBranch",t}}async function ni({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i}){try{de("fs",t),de("ref",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await lt.exists({fs:t,gitdir:e,ref:r}))throw new T(r);const i=await lt.expand({fs:t,gitdir:e,ref:r});if(i===await yr({fs:t,gitdir:e,fullname:!0})){const r=await lt.resolve({fs:t,gitdir:e,ref:i});await lt.writeRef({fs:t,gitdir:e,ref:"HEAD",value:r})}await lt.deleteRef({fs:t,gitdir:e,ref:i});const n=mr(r),a=await ot.get({fs:t,gitdir:e});await a.deleteSection("branch",n),await ot.save({fs:t,gitdir:e,config:a})}({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.deleteBranch",t}}async function ai({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i}){try{de("fs",t),de("ref",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});await lt.deleteRef({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.deleteRef",t}}async function oi({fs:t,dir:e,gitdir:r=Z(e,".git"),remote:i}){try{de("fs",t),de("remote",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,remote:r}){const i=await ot.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ot.save({fs:t,gitdir:e,config:i})}({fs:e,gitdir:n,remote:i})}catch(t){throw t.caller="git.deleteRemote",t}}async function si({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i}){try{de("fs",t),de("ref",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await lt.deleteRef({fs:t,gitdir:e,ref:r})}({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.deleteTag",t}}class ci extends e{constructor(t,e,r){super(`Found multiple ${t} matching "${e}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=ci.code,this.data={nouns:t,short:e,matches:r}}}async function fi({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,oid:i}){const n=await async function({fs:t,gitdir:e,oid:r}){const i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(t=>`${i}${t}`).filter(t=>t.startsWith(r))}({fs:t,gitdir:r,oid:i}),o=await async function({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){const o=[];let s=await t.readdir(Z(r,"objects/pack"));s=s.filter(t=>t.endsWith(".idx"));for(const c of s){const s=`${r}/objects/pack/${c}`,f=await Tt({fs:t,cache:e,filename:s,getExternalRefDelta:n});if(f.error)throw new a(f.error);for(const t of f.offsets.keys())t.startsWith(i)&&o.push(t)}return o}({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:i=>Mt({fs:t,cache:e,gitdir:r,oid:i})});for(const t of o)-1===n.indexOf(t)&&n.push(t);if(1===n.length)return n[0];if(n.length>1)throw new ci("oids",i,n);throw new T(`an object matching "${i}"`)}({fs:e,cache:n,gitdir:o,oid:i})}catch(t){throw t.caller="git.expandOid",t}}async function li({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await lt.expand({fs:e,gitdir:n,ref:i})}catch(t){throw t.caller="git.expandRef",t}}async function di({fs:t,cache:e,gitdir:r,oids:i}){const n={},a=i.length,o=new Set,s=new Map,c=await Gr.read({fs:t,gitdir:r}),f=async i=>{if(s.has(i))return s.get(i);const{object:n,type:a}=await Mt({fs:t,cache:e,gitdir:r,oid:i});if("commit"!==a)throw new C(i,a,"commit");const o=Wt.from(n),{parent:f}=o.parseHeaders(),l=c.has(i)?[]:f;return s.set(i,l),l};let l=i.map((t,e)=>({index:e,oid:t}));for(;l.length;){for(const{oid:t,index:e}of l)await f(t),n[t]||(n[t]=new Set),n[t].add(e),n[t].size===a&&o.add(t);const t=new Map;for(const{oid:e,index:r}of l)if(!o.has(e))for(const i of await f(e))n[i]&&n[i].has(r)||t.set(i+":"+r,{oid:i,index:r});l=Array.from(t.values())}if(o.size<2)return[...o];const d=new Set;for(const t of o){const e=[...await f(t)],r=new Set;for(;e.length;){const t=e.pop();r.has(t)||(r.add(t),o.has(t)?d.add(t):e.push(...await f(t)))}}return[...o].filter(t=>!d.has(t))}ci.code="AmbiguousError";class hi extends e{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=hi.code,this.data={}}}async function ui({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:f=!1,abortOnConflict:l=!0,message:d,author:h,committer:u,signingKey:p,onSign:g,mergeDriver:w,allowUnrelatedHistories:m=!1}){void 0===n&&(n=await yr({fs:t,gitdir:i,fullname:!0})),n=await lt.expand({fs:t,gitdir:i,ref:n}),a=await lt.expand({fs:t,gitdir:i,ref:a});const y=await lt.resolve({fs:t,gitdir:i,ref:n}),{oid:b}=await Oe({fs:t,cache:e,gitdir:i,oid:await lt.resolve({fs:t,gitdir:i,ref:a})}),_=await di({fs:t,cache:e,gitdir:i,oids:[y,b]});if(1!==_.length){if(0!==_.length||!m)throw new or;_.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904")}const v=_[0];if(v===b)return{oid:y,alreadyMerged:!0};if(o&&v===y)return c||f||await lt.writeRef({fs:t,gitdir:i,ref:n,value:b}),{oid:b,fastForward:!0};{if(s)throw new hi;const o=await $.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async o=>lr({fs:t,cache:e,dir:r,gitdir:i,index:o,ourOid:y,theirOid:b,baseOid:v,ourName:mr(n),baseName:"base",theirName:mr(a),dryRun:c,abortOnConflict:l,mergeDriver:w}));if(o instanceof ar)throw o;return d||(d=`Merge branch '${mr(a)}' into ${mr(n)}`),{oid:await Te({fs:t,cache:e,gitdir:i,message:d,ref:n,tree:o,parent:[y,b],author:h,committer:u,signingKey:p,onSign:g,dryRun:c,noUpdateBranch:f}),tree:o,mergeCommit:!0}}}async function pi({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,dir:c,gitdir:f,ref:l,url:d,remote:h,remoteRef:u,prune:p,pruneTags:g,fastForward:w,fastForwardOnly:m,corsProxy:y,singleBranch:b,headers:_,author:v,committer:x,signingKey:k}){try{if(!l){const e=await yr({fs:t,gitdir:f});if(!e)throw new le("ref");l=e}const{fetchHead:E,fetchHeadDescription:A}=await Qr({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:f,corsProxy:y,ref:l,url:d,remote:h,remoteRef:u,singleBranch:b,headers:_,prune:p,pruneTags:g});await ui({fs:t,cache:e,gitdir:f,ours:l,theirs:E,fastForward:w,fastForwardOnly:m,message:`Merge ${A}`,author:v,committer:x,signingKey:k,dryRun:!1,noUpdateBranch:!1}),await Qe({fs:t,cache:e,onProgress:i,dir:c,gitdir:f,ref:l,remote:h,noCheckout:!1})}catch(t){throw t.caller="git.pull",t}}async function gi({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=Z(s,".git"),ref:f,url:l,remote:d,remoteRef:h,corsProxy:u,singleBranch:p,headers:g={},cache:w={}}){try{de("fs",t),de("http",e),de("gitdir",c);const m={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},y=new fe(t),b=await he({fsp:y,dotgit:c});return await pi({fs:y,cache:w,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:b,ref:f,url:l,remote:d,remoteRef:h,fastForwardOnly:!0,corsProxy:u,singleBranch:p,headers:g,author:m,committer:m})}catch(t){throw t.caller="git.fastForward",t}}async function wi({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=Z(s,".git"),ref:f,remote:l,remoteRef:d,url:h,corsProxy:u,depth:p=null,since:g=null,exclude:w=[],relative:m=!1,tags:y=!1,singleBranch:b=!1,headers:_={},prune:v=!1,pruneTags:x=!1,cache:k={}}){try{de("fs",t),de("http",e),de("gitdir",c);const s=new fe(t),E=await he({fsp:s,dotgit:c});return await Qr({fs:s,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,gitdir:E,ref:f,remote:l,remoteRef:d,url:h,corsProxy:u,depth:p,since:g,exclude:w,relative:m,tags:y,singleBranch:b,headers:_,prune:v,pruneTags:x})}catch(t){throw t.caller="git.fetch",t}}async function mi({fs:t,dir:e,gitdir:r=Z(e,".git"),oids:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oids",i);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await di({fs:e,cache:n,gitdir:a,oids:i})}catch(t){throw t.caller="git.findMergeBase",t}}async function yi({fs:t,filepath:e}){if(await t.exists(Z(e,".git")))return e;{const r=P(e);if(r===e)throw new T(`git root for ${e}`);return yi({fs:t,filepath:r})}}async function bi({fs:t,filepath:e}){try{return de("fs",t),de("filepath",e),await yi({fs:new fe(t),filepath:e})}catch(t){throw t.caller="git.findRoot",t}}async function _i({fs:t,dir:e,gitdir:r=Z(e,".git"),path:i}){try{de("fs",t),de("gitdir",r),de("path",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await $e({fs:e,gitdir:n,path:i})}catch(t){throw t.caller="git.getConfig",t}}async function vi({fs:t,dir:e,gitdir:r=Z(e,".git"),path:i}){try{de("fs",t),de("gitdir",r),de("path",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,path:r}){return(await ot.get({fs:t,gitdir:e})).getall(r)}({fs:e,gitdir:n,path:i})}catch(t){throw t.caller="git.getConfigAll",t}}function xi(t,e,r){const i=e.split("/"),n=i.pop();if("__proto__"===n||i.includes("__proto__"))return;let a=t;for(const t of i)Object.prototype.hasOwnProperty.call(a,t)||(a[t]={}),a=a[t];a[n]=r}async function ki({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:a,headers:o={},forPush:s=!1}){try{de("http",t),de("url",a);const c=Hr.getRemoteHelperFor({url:a}),f=await c.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:1}),l={capabilities:[...f.capabilities]};for(const[t,e]of f.refs)xi(l,t,e);for(const[t,e]of f.symrefs)xi(l,t,e);return l}catch(t){throw t.caller="git.getRemoteInfo",t}}function Ei(t,e,r,i){const n=[];for(const[a,o]of t.refs){if(e&&!a.startsWith(e))continue;if(a.endsWith("^{}")){if(i){const t=a.replace("^{}",""),e=n[n.length-1],r=e?.ref===t?e:n.find(e=>e.ref===t);void 0!==r&&(r.peeled=o)}continue}const s={ref:a,oid:o};r&&t.symrefs.has(a)&&(s.target=t.symrefs.get(a)),n.push(s)}return n}async function Ai({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:a,headers:o={},forPush:s=!1,protocolVersion:c=2}){try{de("http",t),de("url",a);const f=Hr.getRemoteHelperFor({url:a}),l=await f.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:c});if(2===l.protocolVersion)return{protocolVersion:l.protocolVersion,capabilities:l.capabilities2};const d={};for(const t of l.capabilities){const[e,r]=t.split("=");d[e]=r||!0}return{protocolVersion:1,capabilities:d,refs:Ei(l,void 0,!0,!0)}}catch(t){throw t.caller="git.getRemoteInfo2",t}}async function Si({object:t}){try{de("object",t),"string"==typeof t?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));const e="blob",{oid:r,object:i}=await async function({type:t,object:e,format:r="content",oid:i}){return"deflated"!==r&&("wrapped"!==r&&(e=wt.wrap({type:t,object:e})),i=await y(e)),{oid:i,object:e}}({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function Bi({fs:t,onProgress:e,dir:r,gitdir:i=Z(r,".git"),filepath:n,cache:a={}}){try{de("fs",t),de("dir",r),de("gitdir",r),de("filepath",n);const o=new fe(t),s=await he({fsp:o,dotgit:i});return await async function({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:a}){try{a=Z(i,a);const o=await t.read(a),s=r=>Mt({fs:t,cache:e,gitdir:n,oid:r}),c=await jt.fromPack({pack:o,getExternalRefDelta:s,onProgress:r});return await t.write(a.replace(/\.pack$/,".idx"),await c.toBuffer()),{oids:[...c.hashes]}}catch(t){throw t.caller="git.indexPack",t}}({fs:o,cache:a,onProgress:e,dir:r,gitdir:s,filepath:n})}catch(t){throw t.caller="git.indexPack",t}}async function $i({fs:t,bare:e=!1,dir:r,gitdir:i=(e?r:Z(r,".git")),defaultBranch:n="master"}){try{de("fs",t),de("gitdir",i),e||de("dir",r);const a=new fe(t),o=await he({fsp:a,dotgit:i});return await ti({fs:a,bare:e,dir:r,gitdir:o,defaultBranch:n})}catch(t){throw t.caller="git.init",t}}hi.code="FastForwardError";class Ri extends e{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=Ri.code,this.data={depth:t}}}async function Pi({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:a}){const o=await Gr.read({fs:t,gitdir:r});if(!i)throw new le("oid");if(!n)throw new le("ancestor");if(i===n)return!1;const s=[i],c=new Set;let f=0;for(;s.length;){if(f++===a)throw new Ri(a);const i=s.shift(),{type:l,object:d}=await Mt({fs:t,cache:e,gitdir:r,oid:i});if("commit"!==l)throw new C(i,l,"commit");const h=Wt.from(d).parse();for(const t of h.parent)if(t===n)return!0;if(!o.has(i))for(const t of h.parent)c.has(t)||(s.push(t),c.add(t))}return!1}async function Ii({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,ancestor:n,depth:a=-1,cache:o={}}){try{de("fs",t),de("gitdir",r),de("oid",i),de("ancestor",n);const e=new fe(t),s=await he({fsp:e,dotgit:r});return await Pi({fs:e,cache:o,gitdir:s,oid:i,ancestor:n,depth:a})}catch(t){throw t.caller="git.isDescendent",t}}async function Oi({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i}){try{de("fs",t),de("dir",e),de("gitdir",r),de("filepath",i);const n=new fe(t),a=await he({fsp:n,dotgit:r});return me.isIgnored({fs:n,dir:e,gitdir:a,filepath:i})}catch(t){throw t.caller="git.isIgnored",t}}async function ji({fs:t,dir:e,gitdir:r=Z(e,".git"),remote:i}){try{de("fs",t),de("gitdir",r);const e=new fe(t),n=await he({fsp:e,dotgit:r});return lt.listBranches({fs:e,gitdir:n,remote:i})}catch(t){throw t.caller="git.listBranches",t}}async function Ui({fs:t,gitdir:e,ref:r,cache:i}){if(r){const n=await lt.resolve({gitdir:e,fs:t,ref:r}),a=[];return await Ti({fs:t,cache:i,gitdir:e,oid:n,filenames:a,prefix:""}),a}return $.acquire({fs:t,gitdir:e,cache:i},async function(t){return t.entries.map(t=>t.path)})}async function Ti({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:a}){const{tree:o}=await ze({fs:t,cache:e,gitdir:r,oid:i});for(const i of o)"tree"===i.type?await Ti({fs:t,cache:e,gitdir:r,oid:i.oid,filenames:n,prefix:Z(a,i.path)}):n.push(Z(a,i.path))}async function Ci({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i,cache:n={}}){try{de("fs",t),de("gitdir",r);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await Ui({fs:e,cache:n,gitdir:a,ref:i})}catch(t){throw t.caller="git.listFiles",t}}async function Mi({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await lt.resolve({gitdir:r,fs:t,ref:i})}catch(t){if(t instanceof T)return[];throw t}return(await ze({fs:t,cache:e,gitdir:r,oid:n})).tree.map(t=>({target:t.path,note:t.oid}))}({fs:e,cache:n,gitdir:a,ref:i})}catch(t){throw t.caller="git.listNotes",t}}async function Di({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i}){try{de("fs",t),de("gitdir",r);const e=new fe(t),n=await he({fsp:e,dotgit:r});return lt.listRefs({fs:e,gitdir:n,filepath:i})}catch(t){throw t.caller="git.listRefs",t}}async function Fi({fs:t,dir:e,gitdir:r=Z(e,".git")}){try{de("fs",t),de("gitdir",r);const e=new fe(t),i=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e}){const r=await ot.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async t=>({remote:t,url:await r.get(`remote.${t}.url`)})))}({fs:e,gitdir:i})}catch(t){throw t.caller="git.listRemotes",t}}async function Ni({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:a,headers:o={},forPush:s=!1,protocolVersion:c=2,prefix:f,symrefs:l,peelTags:d}){try{de("http",t),de("url",a);const h=await Lr.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,headers:o,protocolVersion:c});if(1===h.protocolVersion)return Ei(h,f,l,d);const u=await async function({prefix:t,symrefs:e,peelTags:r}){const i=[];return i.push(Tr.encode("command=ls-refs\n")),i.push(Tr.encode(`agent=${Kr.agent}\n`)),(r||e||t)&&i.push(Tr.delim()),r&&i.push(Tr.encode("peel")),e&&i.push(Tr.encode("symrefs")),t&&i.push(Tr.encode(`ref-prefix ${t}`)),i.push(Tr.flush()),i}({prefix:f,symrefs:l,peelTags:d});return async function(t){const e=Tr.streamReader(t),r=[];let i;for(;i=await e(),!0!==i;){if(null===i)continue;i=i.toString("utf8").replace(/\n$/,"");const[t,e,...n]=i.split(" "),a={ref:e,oid:t};for(const t of n){const[e,r]=t.split(":");"symref-target"===e?a.target=r:"peeled"===e&&(a.peeled=r)}r.push(a)}return r}((await Lr.connect({http:t,auth:h.auth,headers:o,corsProxy:n,service:s?"git-receive-pack":"git-upload-pack",url:a,body:u})).body)}catch(t){throw t.caller="git.listServerRefs",t}}async function zi({fs:t,dir:e,gitdir:r=Z(e,".git")}){try{de("fs",t),de("gitdir",r);const e=new fe(t),i=await he({fsp:e,dotgit:r});return lt.listTags({fs:e,gitdir:i})}catch(t){throw t.caller="git.listTags",t}}function Li(t,e){return t.committer.timestamp-e.committer.timestamp}Ri.code="MaxDepthError";const Hi="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function Wi({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===Hi)return;const a=i;let o;const s=await Gt({fs:t,cache:e,gitdir:r,oid:i}),c=s.tree;return n===s.oid?o=s.path:(o=await Gi({fs:t,cache:e,gitdir:r,tree:c,fileId:n,oid:a}),Array.isArray(o)&&(0===o.length?o=void 0:1===o.length&&(o=o[0]))),o}async function Gi({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:a,filepaths:o=[],parentPath:s=""}){const c=i.entries().map(function(i){let c;return i.oid===n?(c=Z(s,i.path),o.push(c)):"tree"===i.type&&(c=Mt({fs:t,cache:e,gitdir:r,oid:i.oid}).then(function({object:c}){return Gi({fs:t,cache:e,gitdir:r,tree:gt.from(c),fileId:n,oid:a,filepaths:o,parentPath:Z(s,i.path)})})),c});return await Promise.all(c),o}async function qi({fs:t,cache:e,gitdir:r,commit:i,shallow:n}){const a=n||!i.commit.parent[0]?"4b825dc642cb6eb9a060e54bf8d69288fbee4904":i.commit.parent[0];return Qt({fs:t,cache:e,gitdir:r,trees:[Zt({ref:i.oid}),Zt({ref:a})],map:async(t,[e,r])=>{const[i,n]=await Promise.all([e&&e.type(),r&&r.type()]);if("tree"===i)return n&&"tree"!==n?[null,await r.oid(),t]:void 0;if("tree"===n)return i?[await e.oid(),null,t]:void 0;const[a,o]=await Promise.all([e?e.oid():null,r?r.oid():null]);return a!==o?[a,o,t]:void 0}})}async function Zi({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i,ref:n="HEAD",depth:a,since:o,author:s,force:c,follow:f,includeChanges:l=!1,cache:d={}}){try{de("fs",t),de("gitdir",r),de("ref",n);const e=new fe(t),h=await he({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:a,since:o,author:s,force:c,follow:f,includeChanges:l}){const d=void 0===o?void 0:Math.floor(o.valueOf()/1e3),h=null==s?void 0:new RegExp(s,"i"),u=[],p=t=>{(({commit:t})=>void 0===h||!!t.author&&h.test(`${t.author.name} <${t.author.email}>`))(t)&&u.push(t)},g=await Gr.read({fs:t,gitdir:r}),w=await lt.resolve({fs:t,gitdir:r,ref:n}),m=[await je({fs:t,cache:e,gitdir:r,oid:w})];let y,b,_,v;function x(t){v&&i&&p(t)}for(;m.length>0;){const n=m.pop();if(void 0!==d&&n.commit.committer.timestamp<=d)break;if(i){let a;try{a=await Fe({fs:t,cache:e,gitdir:r,oid:n.commit.tree,filepath:i}),!_||y===a.oid&&b===a.mode||p(_),y=a.oid,b=a.mode,_=n,v=!0}catch(a){if(!(a instanceof T))throw a;{let o=f&&y;if(o&&(o=await Wi({fs:t,cache:e,gitdir:r,oid:n.commit.tree,fileId:y}),o))if(Array.isArray(o)){if(_){const n=await Wi({fs:t,cache:e,gitdir:r,oid:_.commit.tree,fileId:y});if(Array.isArray(n)){if(o=o.filter(t=>-1===n.indexOf(t)),1!==o.length){o=!1,_&&p(_);break}o=o[0],i=o,_&&p(_)}}}else i=o,_&&p(_);if(!o){if(v&&y&&(p(_),!c))break;if(!c&&!f)throw a}_=n,v=!1}}}else p(n);if(void 0!==a&&u.length===a){x(n);break}if(!g.has(n.oid))for(const i of n.commit.parent){const n=await je({fs:t,cache:e,gitdir:r,oid:i});m.map(t=>t.oid).includes(n.oid)||m.push(n)}0===m.length&&x(n),m.sort((t,e)=>Li(t.commit,e.commit))}if(l)for(const i of u)i.commit.changes=await qi({fs:t,cache:e,gitdir:r,commit:i,shallow:g.has(i.oid)});return u}({fs:e,cache:d,gitdir:h,filepath:i,ref:n,depth:a,since:o,author:s,force:c,follow:f,includeChanges:l})}catch(t){throw t.caller="git.log",t}}async function Ki({fs:t,onSign:e,dir:r,gitdir:i=Z(r,".git"),ours:n,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:f=!1,abortOnConflict:l=!0,message:d,author:h,committer:u,signingKey:p,cache:g={},mergeDriver:w,allowUnrelatedHistories:m=!1}){try{de("fs",t),p&&de("onSign",e);const y=new fe(t),b=await he({fsp:y,dotgit:i}),_=await Pe({fs:y,gitdir:b,author:h});if(!(_||s&&o))throw new Ae("author");const v=await Ie({fs:y,gitdir:b,author:_,committer:u});if(!(v||s&&o))throw new Ae("committer");return await ui({fs:y,cache:g,dir:r,gitdir:b,ours:n,theirs:a,fastForward:o,fastForwardOnly:s,dryRun:c,noUpdateBranch:f,abortOnConflict:l,message:d,author:_,committer:v,signingKey:p,onSign:e,mergeDriver:w,allowUnrelatedHistories:m})}catch(t){throw t.caller="git.merge",t}}const Vi={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function Yi({fs:t,cache:e,dir:r,gitdir:i=Z(r,".git"),oids:n}){const a=new w,o=[];function s(t,e){const r=Buffer.from(t,e);o.push(r),a.update(r)}async function c({stype:t,object:e}){const r=Vi[t];let i=e.length,n=i>15?128:0;const a=15&i;i>>>=4;let o=(n|r|a).toString(16);for(s(o,"hex");n;)n=i>127?128:0,o=n|127&i,s(Ur(2,o),"hex"),i>>>=7;s(Buffer.from(await be(e)))}s("PACK"),s("00000002","hex"),s(Ur(8,n.length),"hex");for(const r of n){const{type:n,object:a}=await Mt({fs:t,cache:e,gitdir:i,oid:r});await c({write:s,object:a,stype:n})}const f=a.digest();return o.push(f),o}async function Xi({fs:t,dir:e,gitdir:r=Z(e,".git"),oids:i,write:n=!1,cache:a={}}){try{de("fs",t),de("gitdir",r),de("oids",i);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,oids:i,write:n}){const a=await Yi({fs:t,cache:e,gitdir:r,oids:i}),o=Buffer.from(await Br(a)),s=`pack-${o.slice(-20).toString("hex")}.pack`;return n?(await t.write(Z(r,`objects/pack/${s}`),o),{filename:s}):{filename:s,packfile:new Uint8Array(o)}}({fs:e,cache:a,gitdir:o,oids:i,write:n})}catch(t){throw t.caller="git.packObjects",t}}async function Ji({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=Z(s,".git"),ref:f,url:l,remote:d,remoteRef:h,prune:u=!1,pruneTags:p=!1,fastForward:g=!0,fastForwardOnly:w=!1,corsProxy:m,singleBranch:y,headers:b={},author:_,committer:v,signingKey:x,cache:k={}}){try{de("fs",t),de("gitdir",c);const E=new fe(t),A=await he({fsp:E,dotgit:c}),S=await Pe({fs:E,gitdir:A,author:_});if(!S)throw new Ae("author");const B=await Ie({fs:E,gitdir:A,author:S,committer:v});if(!B)throw new Ae("committer");return await pi({fs:E,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:A,ref:f,url:l,remote:d,remoteRef:h,fastForward:g,fastForwardOnly:w,corsProxy:m,singleBranch:y,headers:b,author:S,committer:B,signingKey:x,prune:u,pruneTags:p})}catch(t){throw t.caller="git.pull",t}}async function Qi({fs:t,cache:e,dir:r,gitdir:i=Z(r,".git"),oids:n}){const a=new Set;async function o(r){if(a.has(r))return;a.add(r);const{type:n,object:s}=await Mt({fs:t,cache:e,gitdir:i,oid:r});if("tag"===n){const t=Lt.from(s).headers().object;await o(t)}else if("commit"===n){const t=Wt.from(s).headers().tree;await o(t)}else if("tree"===n){const t=gt.from(s);for(const e of t)"blob"===e.type&&a.add(e.oid),"tree"===e.type&&await o(e.oid)}}for(const t of n)await o(t);return a}class tn extends e{constructor(t,e){super(`One or more branches were not updated: ${t}`),this.code=this.name=tn.code,this.data={prettyDetails:t,result:e}}}tn.code="GitPushError";class en extends e{constructor(t){let e="";"not-fast-forward"===t?e=" because it was not a simple fast-forward":"tag-exists"===t&&(e=" because tag already exists"),super(`Push rejected${e}. Use "force: true" to override.`),this.code=this.name=en.code,this.data={reason:t}}}async function rn({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,dir:c,gitdir:f=Z(c,".git"),ref:l,remoteRef:d,remote:h="origin",url:u,force:p=!1,delete:g=!1,corsProxy:w,headers:m={},cache:y={},signal:b}){try{de("fs",t),de("http",e),de("gitdir",f);const c=new fe(t),_=await he({fsp:c,dotgit:f});return await async function({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPrePush:c,gitdir:f,ref:l,remoteRef:d,remote:h,url:u,force:p=!1,delete:g=!1,corsProxy:w,headers:m={},signal:y}){const b=l||await yr({fs:t,gitdir:f});if(void 0===b)throw new le("ref");const _=await ot.get({fs:t,gitdir:f});h=h||await _.get(`branch.${b}.pushRemote`)||await _.get("remote.pushDefault")||await _.get(`branch.${b}.remote`)||"origin";const v=u||await _.get(`remote.${h}.pushurl`)||await _.get(`remote.${h}.url`);if(void 0===v)throw new le("remote OR url");const x=d||await _.get(`branch.${b}.merge`);if(void 0===v)throw new le("remoteRef");void 0===w&&(w=await _.get("http.corsProxy"));const k=await lt.expand({fs:t,gitdir:f,ref:b}),E=g?"0000000000000000000000000000000000000000":await lt.resolve({fs:t,gitdir:f,ref:k}),A=Hr.getRemoteHelperFor({url:v}),S=await A.discover({http:r,onAuth:qr({config:_,onAuth:a}),onAuthSuccess:o,onAuthFailure:qr({config:_,onAuth:s}),corsProxy:w,service:"git-receive-pack",url:v,headers:m,protocolVersion:1,signal:y}),B=S.auth;let $;if(x)try{$=await lt.expandAgainstMap({ref:x,map:S.refs})}catch(t){if(!(t instanceof T))throw t;$=x.startsWith("refs/")?x:`refs/heads/${x}`}else $=k;const R=S.refs.get($)||"0000000000000000000000000000000000000000";if(c&&!await c({remote:h,url:v,localRef:{ref:g?"(delete)":k,oid:E},remoteRef:{ref:$,oid:R}}))throw new Er;const P=!S.capabilities.has("no-thin");let I=new Set;if(!g){const r=[...S.refs.values()];let i=new Set;if("0000000000000000000000000000000000000000"!==R){let n=[];try{n=await di({fs:t,cache:e,gitdir:f,oids:[E,R]})}catch(t){n=[]}for(const t of n)r.push(t);P&&(i=await Qi({fs:t,cache:e,gitdir:f,oids:n}))}if(!r.includes(E)){const i=await async function({fs:t,cache:e,dir:r,gitdir:i=Z(r,".git"),start:n,finish:a}){const o=await Gr.read({fs:t,gitdir:i}),s=new Set,c=new Set;for(const e of n)s.add(await lt.resolve({fs:t,gitdir:i,ref:e}));for(const e of a)try{const r=await lt.resolve({fs:t,gitdir:i,ref:e});c.add(r)}catch(t){}const f=new Set;async function l(r){f.add(r);const{type:n,object:a}=await Mt({fs:t,cache:e,gitdir:i,oid:r});if("tag"===n)return l(Lt.from(a).headers().object);if("commit"!==n)throw new C(r,n,"commit");if(!o.has(r)){const t=Wt.from(a).headers().parent;for(r of t)c.has(r)||f.has(r)||await l(r)}}for(const t of s)await l(t);return f}({fs:t,cache:e,gitdir:f,start:[E],finish:r});I=await Qi({fs:t,cache:e,gitdir:f,oids:i})}if(P){try{const r=await lt.resolve({fs:t,gitdir:f,ref:`refs/remotes/${h}/HEAD`,depth:2}),{oid:n}=await lt.resolveAgainstMap({ref:r.replace(`refs/remotes/${h}/`,""),fullref:r,map:S.refs}),a=[n];for(const r of await Qi({fs:t,cache:e,gitdir:f,oids:a}))i.add(r)}catch(t){}for(const t of i)I.delete(t)}if(E===R&&(p=!0),!p){if(k.startsWith("refs/tags")&&"0000000000000000000000000000000000000000"!==R)throw new en("tag-exists");if("0000000000000000000000000000000000000000"!==E&&"0000000000000000000000000000000000000000"!==R&&!await Pi({fs:t,cache:e,gitdir:f,oid:E,ancestor:R,depth:-1}))throw new en("not-fast-forward")}}const O=Zr([...S.capabilities],["report-status","side-band-64k",`agent=${Kr.agent}`]),j=await async function({capabilities:t=[],triplets:e=[]}){const r=[];let i=`\0 ${t.join(" ")}`;for(const t of e)r.push(Tr.encode(`${t.oldoid} ${t.oid} ${t.fullRef}${i}\n`)),i="";return r.push(Tr.flush()),r}({capabilities:O,triplets:[{oldoid:R,oid:E,fullRef:$}]}),U=g?[]:await Yi({fs:t,cache:e,gitdir:f,oids:[...I]}),M=await A.connect({http:r,onProgress:i,corsProxy:w,service:"git-receive-pack",url:v,auth:B,headers:m,body:[...j,...U],signal:y}),{packfile:D,progress:F}=await Jr.demux(M.body);n&&Sr(Xr(F),async t=>{await n(t)});const N=await async function(t){const e={};let r="";const i=Tr.streamReader(t);let n=await i();for(;!0!==n;)null!==n&&(r+=n.toString("utf8")+"\n"),n=await i();const a=r.toString("utf8").split("\n");if(n=a.shift(),!n.startsWith("unpack "))throw new jr('unpack ok" or "unpack [error message]',n);e.ok="unpack ok"===n,e.ok||(e.error=n.slice(7)),e.refs={};for(const t of a){if(""===t.trim())continue;const r=t.slice(0,2),i=t.slice(3);let n=i.indexOf(" ");-1===n&&(n=i.length);const a=i.slice(0,n),o=i.slice(n+1);e.refs[a]={ok:"ok"===r,error:o}}return e}(D);if(M.headers&&(N.headers=M.headers),h&&N.ok&&N.refs[$].ok&&!k.startsWith("refs/tags")){const e=`refs/remotes/${h}/${$.replace("refs/heads/","")}`;g?await lt.deleteRef({fs:t,gitdir:f,ref:e}):await lt.writeRef({fs:t,gitdir:f,ref:e,value:E})}if(N.ok&&Object.values(N.refs).every(t=>t.ok))return N;{const t=Object.entries(N.refs).filter(([t,e])=>!e.ok).map(([t,e])=>`\n - ${t}: ${e.error}`).join("");throw new tn(t,N)}}({fs:c,cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,gitdir:_,ref:l,remoteRef:d,remote:h,url:u,force:p,delete:g,corsProxy:w,headers:m,signal:b})}catch(t){throw t.caller="git.push",t}}async function nn({fs:t,cache:e,gitdir:r,oid:i}){const{type:n,object:a}=await Mt({fs:t,cache:e,gitdir:r,oid:i});if("tag"===n)return nn({fs:t,cache:e,gitdir:r,oid:i=Lt.from(a).parse().object});if("blob"!==n)throw new C(i,n,"blob");return{oid:i,blob:new Uint8Array(a)}}async function an({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){return void 0!==n&&(i=await De({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await nn({fs:t,cache:e,gitdir:r,oid:i})}async function on({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,filepath:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await an({fs:e,cache:a,gitdir:o,oid:i,filepath:n})}catch(t){throw t.caller="git.readBlob",t}}async function sn({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await je({fs:e,cache:n,gitdir:a,oid:i})}catch(t){throw t.caller="git.readCommit",t}}async function cn({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i="refs/notes/commits",oid:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("ref",i),de("oid",n);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){const a=await lt.resolve({gitdir:r,fs:t,ref:i}),{blob:o}=await an({fs:t,cache:e,gitdir:r,oid:a,filepath:n});return o}({fs:e,cache:a,gitdir:o,ref:i,oid:n})}catch(t){throw t.caller="git.readNote",t}}async function fn({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,format:n="parsed",filepath:a,encoding:o,cache:s={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new fe(t),c=await he({fsp:e,dotgit:r});void 0!==a&&(i=await De({fs:e,cache:s,gitdir:c,oid:i,filepath:a}));const f="parsed"===n?"content":n,l=await Mt({fs:e,cache:s,gitdir:c,oid:i,format:f});if(l.oid=i,"parsed"===n)switch(l.format="parsed",l.type){case"commit":l.object=Wt.from(l.object).parse();break;case"tree":l.object=gt.from(l.object).entries();break;case"blob":o?l.object=l.object.toString(o):(l.object=new Uint8Array(l.object),l.format="content");break;case"tag":l.object=Lt.from(l.object).parse();break;default:throw new C(l.oid,l.type,"blob|commit|tag|tree")}else"deflated"!==l.format&&"wrapped"!==l.format||(l.type=l.format);return l}catch(t){throw t.caller="git.readObject",t}}async function ln({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await async function({fs:t,cache:e,gitdir:r,oid:i}){const{type:n,object:a}=await Mt({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if("tag"!==n)throw new C(i,n,"tag");const o=Lt.from(a);return{oid:i,tag:o.parse(),payload:o.payload()}}({fs:e,cache:n,gitdir:a,oid:i})}catch(t){throw t.caller="git.readTag",t}}async function dn({fs:t,dir:e,gitdir:r=Z(e,".git"),oid:i,filepath:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("oid",i);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await ze({fs:e,cache:a,gitdir:o,oid:i,filepath:n})}catch(t){throw t.caller="git.readTree",t}}async function hn({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i,cache:n={}}){try{de("fs",t),de("gitdir",r),de("filepath",i);const e=new fe(t),a=await he({fsp:e,dotgit:r});await $.acquire({fs:e,gitdir:a,cache:n},async function(t){const e=Array.isArray(i)?i:[i];for(const r of e)t.delete({filepath:r})})}catch(t){throw t.caller="git.remove",t}}async function un({fs:t,onSign:e,dir:r,gitdir:i=Z(r,".git"),ref:n="refs/notes/commits",oid:a,author:o,committer:s,signingKey:c,cache:f={}}){try{de("fs",t),de("gitdir",i),de("oid",a);const r=new fe(t),l=await he({fsp:r,dotgit:i}),d=await Pe({fs:r,gitdir:l,author:o});if(!d)throw new Ae("author");const h=await Ie({fs:r,gitdir:l,author:d,committer:s});if(!h)throw new Ae("committer");return await async function({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:a,author:o,committer:s,signingKey:c}){let f;try{f=await lt.resolve({gitdir:i,fs:t,ref:n})}catch(t){if(!(t instanceof T))throw t}let l=(await ze({fs:t,cache:e,gitdir:i,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;l=l.filter(t=>t.path!==a);const d=await Le({fs:t,gitdir:i,tree:l});return await Te({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:f&&[f],message:"Note removed by 'isomorphic-git removeNote'\n",author:o,committer:s,signingKey:c})}({fs:r,cache:f,onSign:e,gitdir:l,ref:n,oid:a,author:d,committer:h,signingKey:c})}catch(t){throw t.caller="git.removeNote",t}}async function pn({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i,oldref:n,checkout:a=!1}){try{de("fs",t),de("gitdir",r),de("ref",i),de("oldref",n);const e=new fe(t),o=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!q(i,!0))throw new F(i,M.clean(i));if(!q(r,!0))throw new F(r,M.clean(r));const a=`refs/heads/${r}`,o=`refs/heads/${i}`;if(await lt.exists({fs:t,gitdir:e,ref:o}))throw new He("branch",i,!1);const s=await lt.resolve({fs:t,gitdir:e,ref:a,depth:1});await lt.writeRef({fs:t,gitdir:e,ref:o,value:s}),await lt.deleteRef({fs:t,gitdir:e,ref:a});const c=await yr({fs:t,gitdir:e,fullname:!0});(n||c===a)&&await lt.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:o})}({fs:e,gitdir:o,ref:i,oldref:n,checkout:a})}catch(t){throw t.caller="git.renameBranch",t}}async function gn({gitdir:t,type:e,object:r}){return y(wt.wrap({type:e,object:r}))}async function wn({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i,ref:n,cache:a={}}){try{de("fs",t),de("gitdir",r),de("filepath",i);const o=new fe(t),s=await he({fsp:o,dotgit:r});let c,f;try{c=await lt.resolve({fs:o,gitdir:s,ref:n||"HEAD"})}catch(t){if(n||!(t instanceof T))throw t}if(c)try{c=await De({fs:o,cache:a,gitdir:s,oid:c,filepath:i})}catch(t){if(!(t instanceof T||t instanceof Me||t instanceof C&&t.data.filepath))throw t;c=null}let l={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0};const d=e&&await o.read(Z(e,i));d&&(f=await gn({gitdir:s,type:"blob",object:d}),c===f&&(l=await o.lstat(Z(e,i)))),await $.acquire({fs:o,gitdir:s,cache:a},async function(t){t.delete({filepath:i}),c&&t.insert({filepath:i,stats:l,oid:c})})}catch(t){throw t.caller="git.reset",t}}async function mn({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i,depth:n}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new fe(t),a=await he({fsp:e,dotgit:r});return await lt.resolve({fs:e,gitdir:a,ref:i,depth:n})}catch(t){throw t.caller="git.resolveRef",t}}async function yn({fs:t,dir:e,gitdir:r=Z(e,".git"),path:i,value:n,append:a=!1}){try{de("fs",t),de("gitdir",r),de("path",i);const e=new fe(t),o=await he({fsp:e,dotgit:r}),s=await ot.get({fs:e,gitdir:o});a?await s.append(i,n):await s.set(i,n),await ot.save({fs:e,gitdir:o,config:s})}catch(t){throw t.caller="git.setConfig",t}}async function bn({fs:t,gitdir:e,commit:r}){const i=Wt.from(r).toObject();return await _e({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}en.code="PushRejectedError";class _n{static get timezoneOffsetForRefLogEntry(){const t=(new Date).getTimezoneOffset(),e=Math.abs(Math.floor(t/60)),r=Math.abs(t%60).toString().padStart(2,"0");return`${t>0?"-":"+"}${e.toString().padStart(2,"0")}${r}`}static createStashReflogEntry(t,e,r){const i=t.name.replace(/\s/g,""),n=Math.floor(Date.now()/1e3),a=_n.timezoneOffsetForRefLogEntry;return`0000000000000000000000000000000000000000 ${e} ${i} ${t.email} ${n} ${a}\t${r}\n`}static getStashReflogEntry(t,e=!1){return t.split("\n").filter(t=>t).reverse().map((t,r)=>e?`stash@{${r}}: ${t.split("\t")[1]}`:t)}}class vn{constructor({fs:t,dir:e,gitdir:r=Z(e,".git")}){Object.assign(this,{fs:t,dir:e,gitdir:r,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return Z(this.gitdir,vn.refStash)}get refLogsStashPath(){return Z(this.gitdir,vn.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Pe({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Ae("author");return this._author}async getStashSHA(t,e){return await this.fs.exists(this.refStashPath)?(e||await this.readStashReflogs({parsed:!1}))[t].split(" ")[1]:null}async writeStashCommit({message:t,tree:e,parent:r}){return bn({fs:this.fs,gitdir:this.gitdir,commit:{message:t,tree:e,parent:r,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(t){const e=await this.readStashReflogs({parsed:!1});if(0!==t&&(t<0||t>e.length-1))throw new F(`stash@${t}`,"number that is in range of [0, num of stash pushed]");const r=await this.getStashSHA(t,e);return r?je({fs:this.fs,cache:{},gitdir:this.gitdir,oid:r}):{}}async writeStashRef(t){return lt.writeRef({fs:this.fs,gitdir:this.gitdir,ref:vn.refStash,value:t})}async writeStashReflogEntry({stashCommit:t,message:e}){const r=await this.getAuthor(),i=_n.createStashReflogEntry(r,t,e),n=this.refLogsStashPath;await S(n,async()=>{const t=await this.fs.exists(n)?await this.fs.read(n,"utf8"):"";await this.fs.write(n,t+i,"utf8")})}async readStashReflogs({parsed:t=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];const e=await this.fs.read(this.refLogsStashPath,"utf8");return _n.getStashReflogEntry(e,t)}}async function xn({fs:t,dir:e,gitdir:r,message:i=""}){const n=new vn({fs:t,dir:e,gitdir:r});await n.getAuthor();const a=await yr({fs:t,gitdir:r,fullname:!1}),o=await lt.resolve({fs:t,gitdir:r,ref:"HEAD"}),s=(await sn({fs:t,dir:e,gitdir:r,oid:o})).commit.message,c=[o];let f=null,l=Zt({ref:"HEAD"});const d=await hr({fs:t,dir:e,gitdir:r,treePair:[Zt({ref:"HEAD"}),"stage"]});if(d){const t=await n.writeStashCommit({message:`stash-Index: WIP on ${a} - ${(new Date).toISOString()}`,tree:d,parent:c});c.push(t),f=d,l=U()}const h=await hr({fs:t,dir:e,gitdir:r,treePair:[l,"workdir"]});if(h){const t=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${(new Date).toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(t),f=h}if(!f||!d&&!h)throw new T("changes, nothing to stash");const u=(i.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${s}`;return{stashCommit:await n.writeStashCommit({message:u,tree:f,parent:c}),stashMsg:u,branch:a,stashMgr:n}}async function kn({fs:t,dir:e,gitdir:r,message:i=""}){const{stashCommit:n,stashMsg:a,branch:o,stashMgr:s}=await xn({fs:t,dir:e,gitdir:r,message:i});return await s.writeStashRef(n),await s.writeStashReflogEntry({stashCommit:n,message:a}),await er({fs:t,dir:e,gitdir:r,ref:o,track:!1,force:!0}),n}async function En({fs:t,dir:e,gitdir:r,message:i=""}){const{stashCommit:n}=await xn({fs:t,dir:e,gitdir:r,message:i});return n}async function An({fs:t,dir:e,gitdir:r,refIdx:i=0}){const n=new vn({fs:t,dir:e,gitdir:r}),a=await n.readStashCommit(i),{parent:o=null}=a.commit?a.commit:{};if(o&&Array.isArray(o))for(let i=0;i<o.length-1;i++){const n=(await je({fs:t,cache:{},gitdir:r,oid:o[i+1]})).commit.message.startsWith("stash-Index");await ur({fs:t,dir:e,gitdir:r,stashCommit:o[i+1],parentCommit:o[i],wasStaged:n})}}async function Sn({fs:t,dir:e,gitdir:r,refIdx:i=0}){const n=new vn({fs:t,dir:e,gitdir:r});if(!(await n.readStashCommit(i)).commit)return;const a=n.refStashPath;await S(a,async()=>{await t.exists(a)&&await t.rm(a)});const o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);const s=n.refLogsStashPath;await S(s,async()=>{if(o.length){await t.write(s,o.reverse().join("\n")+"\n","utf8");const e=o[o.length-1].split(" ")[1];await n.writeStashRef(e)}else await t.rm(s)})}async function Bn({fs:t,dir:e,gitdir:r}){return new vn({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function $n({fs:t,dir:e,gitdir:r}){const i=new vn({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await S(n,async()=>{await Promise.all(n.map(async e=>{if(await t.exists(e))return t.rm(e)}))})}async function Rn({fs:t,dir:e,gitdir:r,refIdx:i=0}){await An({fs:t,dir:e,gitdir:r,refIdx:i}),await Sn({fs:t,dir:e,gitdir:r,refIdx:i})}async function Pn({fs:t,dir:e,gitdir:r=Z(e,".git"),op:i="push",message:n="",refIdx:a=0}){de("fs",t),de("dir",e),de("gitdir",r),de("op",i);const o={push:kn,apply:An,drop:Sn,list:Bn,clear:$n,pop:Rn,create:En},s=["apply","drop","pop"];try{const c=new fe(t),f=await he({fsp:c,dotgit:r});["refs","logs","logs/refs"].map(t=>Z(f,t)).forEach(async t=>{await c.exists(t)||await c.mkdir(t)});const l=o[i];if(l){if(s.includes(i)&&a<0)throw new F(`stash@${a}`,"number that is in range of [0, num of stash pushed]");return await l({fs:c,dir:e,gitdir:f,message:n,refIdx:a})}throw new Error(`To be implemented: ${i}`)}catch(t){throw t.caller="git.stash",t}}async function In({fs:t,dir:e,gitdir:r=Z(e,".git"),filepath:i,cache:n={},refresh:a=!0}){try{de("fs",t),de("gitdir",r),de("filepath",i);const o=new fe(t),s=await he({fsp:o,dotgit:r}),c=await async function({fs:t,cache:e,gitdir:r}){let i;try{i=await lt.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(t){if(t instanceof T)return[];throw t}const{tree:n}=await ze({fs:t,cache:e,gitdir:r,oid:i});return n}({fs:o,cache:n,gitdir:s}),f=await On({fs:o,cache:n,gitdir:s,tree:c,path:i}),l=await $.acquire({fs:o,gitdir:s,cache:n},async function(t){for(const e of t)if(e.path===i)return e;return null});if(null===f&&null===l&&await me.isIgnored({fs:o,gitdir:s,dir:e,filepath:i}))return"ignored";const d=await o.lstat(Z(e,i)),h=null!==f,u=null!==l,p=null!==d&&(h||u||await async function({fs:t,dir:e,filepath:r}){const i=r.replace(/\\/g,"/").split("/").filter(t=>""!==t&&"."!==t);let n=e;for(const e of i){let r;try{r=await t._readdir(n)}catch(t){if("ENOENT"===t.code||"ENOTDIR"===t.code)return!1;throw t}if(!r.some(t=>t.normalize()===e.normalize()))return!1;n=Z(n,e)}return!0}({fs:o,dir:e,filepath:i})),g=async()=>{if(u&&!k(l,d))return l.oid;{const t=await ot.get({fs:o,gitdir:s}),r=await t.get("core.autocrlf"),c=await o.read(Z(e,i),{autocrlf:r}),f=await gn({gitdir:s,type:"blob",object:c});return a&&u&&!l.flags.intentToAdd&&l.oid===f&&-1!==d.size&&await $.acquire({fs:o,gitdir:s,cache:n},async function(t){t.insert({filepath:i,stats:d,oid:f})}),f}};if(!h&&!p&&!u)return"absent";if(!h&&!p&&u)return"*absent";if(!h&&p&&!u)return"*added";if(!h&&p&&u)return await g()===l.oid?"added":"*added";if(h&&!p&&!u)return"deleted";if(h&&!p&&u)return l.oid,"*deleted";if(h&&p&&!u)return await g()===f?"*undeleted":"*undeletemodified";if(h&&p&&u){const t=await g();return t===f?t===l.oid?"unmodified":"*unmodified":t===l.oid?"modified":"*modified"}}catch(t){throw t.caller="git.status",t}}async function On({fs:t,cache:e,gitdir:r,tree:i,path:n}){"string"==typeof n&&(n=n.split("/"));const a=n.shift();for(const o of i)if(o.path===a){if(0===n.length)return o.oid;const{type:i,object:a}=await Mt({fs:t,cache:e,gitdir:r,oid:o.oid});if("tree"===i)return On({fs:t,cache:e,gitdir:r,tree:gt.from(a),path:n});if("blob"===i)throw new C(o.oid,i,"blob",n.join("/"))}return null}async function jn({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{de("fs",t),de("gitdir",r),de("ref",i);const f=new fe(t),l=await he({fsp:f,dotgit:r});return await Qt({fs:f,cache:o,dir:e,gitdir:l,trees:[Zt({ref:i}),Vt({refresh:c}),U()],map:async function(t,[r,i,o]){if(!r&&!o&&i&&!s&&await me.isIgnored({fs:f,dir:e,filepath:t}))return null;if(!n.some(e=>Je(t,e)))return null;if(a&&!a(t))return;const[c,l,d]=await Promise.all([r&&r.type(),i&&i.type(),o&&o.type()]),h=[c,l,d].includes("blob");if(("tree"===c||"special"===c)&&!h)return;if("commit"===c)return null;if(("tree"===l||"special"===l)&&!h)return;if("commit"===d)return null;if(("tree"===d||"special"===d)&&!h)return;const u="blob"===c?await r.oid():void 0,p="blob"===d?await o.oid():void 0;let g;"blob"!==c&&"blob"===l&&"blob"!==d?g="42":"blob"===l&&(g=await i.oid());const w=[void 0,u,g,p],m=w.map(t=>w.indexOf(t));return m.shift(),[t,...m]}})}catch(t){throw t.caller="git.statusMatrix",t}}async function Un({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i,object:n,force:a=!1}){try{de("fs",t),de("gitdir",r),de("ref",i);const e=new fe(t);if(void 0===i)throw new le("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;const o=await he({fsp:e,dotgit:r}),s=await lt.resolve({fs:e,gitdir:o,ref:n||"HEAD"});if(!a&&await lt.exists({fs:e,gitdir:o,ref:i}))throw new He("tag",i);await lt.writeRef({fs:e,gitdir:o,ref:i,value:s})}catch(t){throw t.caller="git.tag",t}}async function Tn({fs:t,dir:e,gitdir:r=Z(e,".git"),cache:i={},filepath:n,oid:a,mode:o,add:s,remove:c,force:f}){try{de("fs",t),de("gitdir",r),de("filepath",n);const l=new fe(t),d=await he({fsp:l,dotgit:r});if(c)return await $.acquire({fs:l,gitdir:d,cache:i},async function(t){if(!f){const t=await l.lstat(Z(e,n));if(t){if(t.isDirectory())throw new Me("directory");return}}t.has({filepath:n})&&t.delete({filepath:n})});let h;if(!a){if(h=await l.lstat(Z(e,n)),!h)throw new T(`file at "${n}" on disk and "remove" not set`);if(h.isDirectory())throw new Me("directory")}return await $.acquire({fs:l,gitdir:d,cache:i},async function(t){if(!s&&!t.has({filepath:n}))throw new T(`file at "${n}" in index and "add" not set`);let r;if(a)r={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{r=h;const t=r.isSymbolicLink()?await l.readlink(Z(e,n)):await l.read(Z(e,n));a=await _e({fs:l,gitdir:d,type:"blob",format:"content",object:t})}return t.insert({filepath:n,oid:a,stats:r}),a})}catch(t){throw t.caller="git.updateIndex",t}}function Cn(){try{return Kr.version}catch(t){throw t.caller="git.version",t}}async function Mn({fs:t,dir:e,gitdir:r=Z(e,".git"),trees:i,map:n,reduce:a,iterate:o,cache:s={}}){try{de("fs",t),de("gitdir",r),de("trees",i);const c=new fe(t),f=await he({fsp:c,dotgit:r});return await Qt({fs:c,cache:s,dir:e,gitdir:f,trees:i,map:n,reduce:a,iterate:o})}catch(t){throw t.caller="git.walk",t}}async function Dn({fs:t,dir:e,gitdir:r=Z(e,".git"),blob:i}){try{de("fs",t),de("gitdir",r),de("blob",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await _e({fs:e,gitdir:n,type:"blob",object:i,format:"content"})}catch(t){throw t.caller="git.writeBlob",t}}async function Fn({fs:t,dir:e,gitdir:r=Z(e,".git"),commit:i}){try{de("fs",t),de("gitdir",r),de("commit",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await bn({fs:e,gitdir:n,commit:i})}catch(t){throw t.caller="git.writeCommit",t}}async function Nn({fs:t,dir:e,gitdir:r=Z(e,".git"),type:i,object:n,format:a="parsed",oid:o,encoding:s}){try{const e=new fe(t),c=await he({fsp:e,dotgit:r});if("parsed"===a){switch(i){case"commit":n=Wt.from(n).toObject();break;case"tree":n=gt.from(n).toObject();break;case"blob":n=Buffer.from(n,s);break;case"tag":n=Lt.from(n).toObject();break;default:throw new C(o||"",i,"blob|commit|tag|tree")}a="content"}return await _e({fs:e,gitdir:c,type:i,object:n,oid:o,format:a})}catch(t){throw t.caller="git.writeObject",t}}async function zn({fs:t,dir:e,gitdir:r=Z(e,".git"),ref:i,value:n,force:a=!1,symbolic:o=!1}){try{de("fs",t),de("gitdir",r),de("ref",i),de("value",n);const e=new fe(t);if(!q(i,!0))throw new F(i,M.clean(i));const s=await he({fsp:e,dotgit:r});if(!a&&await lt.exists({fs:e,gitdir:s,ref:i}))throw new He("ref",i);o?await lt.writeSymbolicRef({fs:e,gitdir:s,ref:i,value:n}):(n=await lt.resolve({fs:e,gitdir:s,ref:n}),await lt.writeRef({fs:e,gitdir:s,ref:i,value:n}))}catch(t){throw t.caller="git.writeRef",t}}async function Ln({fs:t,dir:e,gitdir:r=Z(e,".git"),tag:i}){try{de("fs",t),de("gitdir",r),de("tag",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await async function({fs:t,gitdir:e,tag:r}){const i=Lt.from(r).toObject();return await _e({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}({fs:e,gitdir:n,tag:i})}catch(t){throw t.caller="git.writeTag",t}}async function Hn({fs:t,dir:e,gitdir:r=Z(e,".git"),tree:i}){try{de("fs",t),de("gitdir",r),de("tree",i);const e=new fe(t),n=await he({fsp:e,dotgit:r});return await Le({fs:e,gitdir:n,tree:i})}catch(t){throw t.caller="git.writeTree",t}}const Wn={Errors:t,STAGE:U,TREE:Zt,WORKDIR:Vt,add:xe,abortMerge:pe,addNote:We,addRemote:qe,annotatedTag:Ze,branch:Ke,cherryPick:gr,checkout:er,clone:ei,commit:ri,getConfig:_i,getConfigAll:vi,setConfig:yn,currentBranch:ii,deleteBranch:ni,deleteRef:ai,deleteRemote:oi,deleteTag:si,expandOid:fi,expandRef:li,fastForward:gi,fetch:wi,findMergeBase:mi,findRoot:bi,getRemoteInfo:ki,getRemoteInfo2:Ai,hashBlob:Si,indexPack:Bi,init:$i,isDescendent:Ii,isIgnored:Oi,listBranches:ji,listFiles:Ci,listNotes:Mi,listRefs:Di,listRemotes:Fi,listServerRefs:Ni,listTags:zi,log:Zi,merge:Ki,packObjects:Xi,pull:Ji,push:rn,readBlob:on,readCommit:sn,readNote:cn,readObject:fn,readTag:ln,readTree:dn,remove:hn,removeNote:un,renameBranch:pn,resetIndex:wn,updateIndex:Tn,resolveRef:mn,status:In,statusMatrix:jn,tag:Un,version:Cn,walk:Mn,writeBlob:Dn,writeCommit:Fn,writeObject:Nn,writeRef:zn,writeTag:Ln,writeTree:Hn,stash:Pn}})(),i})());
|
|
3
3
|
//# sourceMappingURL=index.umd.min.js.map
|