mc-publish/dist/index.js

58 lines
578 KiB
JavaScript
Raw Permalink Normal View History

2024-01-15 09:25:43 -05:00
import './sourcemap-register.cjs';import{createRequire as t}from"module";var r={3803:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const s=n(7147);r.FILE_SYSTEM_ADAPTER={lstat:s.lstat,stat:s.stat,lstatSync:s.lstatSync,statSync:s.statSync,readdir:s.readdir,readdirSync:s.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},8838:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const n=process.versions.node.split(".");if(n[0]===undefined||n[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const s=Number.parseInt(n[0],10);const i=Number.parseInt(n[1],10);const o=10;const a=10;const l=s>o;const c=s===o&&i>=a;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=l||c},5667:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const s=n(4507);const i=n(9560);const o=n(8662);r.Settings=o.default;function scandir(t,r,n){if(typeof r==="function"){s.read(t,getSettings(),r);return}s.read(t,getSettings(r),n)}r.scandir=scandir;function scandirSync(t,r){const n=getSettings(r);return i.read(t,n)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof o.default){return t}return new o.default(t)}},4507:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const s=n(109);const i=n(5288);const o=n(8838);const a=n(6297);const l=n(3847);function read(t,r,n){if(!r.stats&&o.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,n);return}readdir(t,r,n)}r.read=read;function readdirWithFileTypes(t,r,n){r.fs.readdir(t,{withFileTypes:true},((s,o)=>{if(s!==null){callFailureCallback(n,s);return}const a=o.map((n=>({dirent:n,name:n.name,path:l.joinPathSegments(t,n.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(n,a);return}const c=a.map((t=>makeRplTaskEntry(t,r)));i(c,((t,r)=>{if(t!==null){callFailureCallback(n,t);return}callSuccessCallback(n,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return n=>{if(!t.dirent.isSymbolicLink()){n(null,t);return}r.fs.stat(t.path,((s,i)=>{if(s!==null){if(r.throwErrorOnBrokenSymbolicLink){n(s);return}n(null,t);return}t.dirent=a.fs.createDirentFromStats(t.name,i);n(null,t)}))}}function readdir(t,r,n){r.fs.readdir(t,((o,c)=>{if(o!==null){callFailureCallback(n,o);return}const u=c.map((n=>{const i=l.joinPathSegments(t,n,r.pathSegmentSeparator);return t=>{s.stat(i,r.fsStatSettings,((s,o)=>{if(s!==null){t(s);return}const l={name:n,path:i,dirent:a.fs.createDirentFromStats(n,o)};if(r.stats){l.stats=o}t(null,l)}))}}));i(u,((t,r)=>{if(t!==null){callFailureCallback(n,t);return}callSuccessCallback(n,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},3847:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,n){if(t.endsWith(n)){return t+r}return t+n+r}r.joinPathSegments=joinPathSegments},9560:(t,r,n)=>{Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const s=n(109);const i=n(8838);const o=n(6297);const a=n(3847);function read(t,r){if(!r.stats&&i.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const n=r.fs.readdirSync(t,{withFileTypes:true});return n.map((n=>{const s={dirent:n,name:n.name,path:a.joinPathSegments(t,n.name,r.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(s.path);s.dirent=o.fs.createDirentFromStats(s.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return s}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const n=r.fs.readdirSync(t);return n.m
2022-05-31 14:18:28 -04:00
/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/
2024-01-14 16:53:58 -05:00
const s=n(3837);const i=n(1861);const isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);const transform=t=>r=>t===true?Number(r):String(r);const isValidValue=t=>typeof t==="number"||typeof t==="string"&&t!=="";const isNumber=t=>Number.isInteger(+t);const zeros=t=>{let r=`${t}`;let n=-1;if(r[0]==="-")r=r.slice(1);if(r==="0")return false;while(r[++n]==="0");return n>0};const stringify=(t,r,n)=>{if(typeof t==="string"||typeof r==="string"){return true}return n.stringify===true};const pad=(t,r,n)=>{if(r>0){let n=t[0]==="-"?"-":"";if(n)t=t.slice(1);t=n+t.padStart(n?r-1:r,"0")}if(n===false){return String(t)}return t};const toMaxLen=(t,r)=>{let n=t[0]==="-"?"-":"";if(n){t=t.slice(1);r--}while(t.length<r)t="0"+t;return n?"-"+t:t};const toSequence=(t,r)=>{t.negatives.sort(((t,r)=>t<r?-1:t>r?1:0));t.positives.sort(((t,r)=>t<r?-1:t>r?1:0));let n=r.capture?"":"?:";let s="";let i="";let o;if(t.positives.length){s=t.positives.join("|")}if(t.negatives.length){i=`-(${n}${t.negatives.join("|")})`}if(s&&i){o=`${s}|${i}`}else{o=s||i}if(r.wrap){return`(${n}${o})`}return o};const toRange=(t,r,n,s)=>{if(n){return i(t,r,{wrap:false,...s})}let o=String.fromCharCode(t);if(t===r)return o;let a=String.fromCharCode(r);return`[${o}-${a}]`};const toRegex=(t,r,n)=>{if(Array.isArray(t)){let r=n.wrap===true;let s=n.capture?"":"?:";return r?`(${s}${t.join("|")})`:t.join("|")}return i(t,r,n)};const rangeError=(...t)=>new RangeError("Invalid range arguments: "+s.inspect(...t));const invalidRange=(t,r,n)=>{if(n.strictRanges===true)throw rangeError([t,r]);return[]};const invalidStep=(t,r)=>{if(r.strictRanges===true){throw new TypeError(`Expected step "${t}" to be a number`)}return[]};const fillNumbers=(t,r,n=1,s={})=>{let i=Number(t);let o=Number(r);if(!Number.isInteger(i)||!Number.isInteger(o)){if(s.strictRanges===true)throw rangeError([t,r]);return[]}if(i===0)i=0;if(o===0)o=0;let a=i>o;let l=String(t);let c=String(r);let u=String(n);n=Math.max(Math.abs(n),1);let d=zeros(l)||zeros(c)||zeros(u);let p=d?Math.max(l.length,c.length,u.length):0;let h=d===false&&stringify(t,r,s)===false;let m=s.transform||transform(h);if(s.toRegex&&n===1){return toRange(toMaxLen(t,p),toMaxLen(r,p),true,s)}let g={negatives:[],positives:[]};let push=t=>g[t<0?"negatives":"positives"].push(Math.abs(t));let y=[];let b=0;while(a?i>=o:i<=o){if(s.toRegex===true&&n>1){push(i)}else{y.push(pad(m(i,b),p,h))}i=a?i-n:i+n;b++}if(s.toRegex===true){return n>1?toSequence(g,s):toRegex(y,null,{wrap:false,...s})}return y};const fillLetters=(t,r,n=1,s={})=>{if(!isNumber(t)&&t.length>1||!isNumber(r)&&r.length>1){return invalidRange(t,r,s)}let i=s.transform||(t=>String.fromCharCode(t));let o=`${t}`.charCodeAt(0);let a=`${r}`.charCodeAt(0);let l=o>a;let c=Math.min(o,a);let u=Math.max(o,a);if(s.toRegex&&n===1){return toRange(c,u,false,s)}let d=[];let p=0;while(l?o>=a:o<=a){d.push(i(o,p));o=l?o-n:o+n;p++}if(s.toRegex===true){return toRegex(d,null,{wrap:false,options:s})}return d};const fill=(t,r,n,s={})=>{if(r==null&&isValidValue(t)){return[t]}if(!isValidValue(t)||!isValidValue(r)){return invalidRange(t,r,s)}if(typeof n==="function"){return fill(t,r,1,{transform:n})}if(isObject(n)){return fill(t,r,0,n)}let i={...s};if(i.capture===true)i.wrap=true;n=n||i.step||1;if(!isNumber(n)){if(n!=null&&!isObject(n))return invalidStep(n,i);return fill(t,r,1,n)}if(isNumber(t)&&isNumber(r)){return fillNumbers(t,r,n,i)}return fillLetters(t,r,Math.max(Math.abs(n),1),i)};t.exports=fill},6435:t=>{
2022-05-31 14:18:28 -04:00
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/
2024-01-14 16:53:58 -05:00
t.exports=function isExtglob(t){if(typeof t!=="string"||t===""){return false}var r;while(r=/(\\).|([@?!+*]\(.*\))/g.exec(t)){if(r[2])return true;t=t.slice(r.index+r[0].length)}return false}},4466:(t,r,n)=>{
2022-05-31 14:18:28 -04:00
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
2024-01-14 16:53:58 -05:00
var s=n(6435);var i={"{":"}","(":")","[":"]"};var strictCheck=function(t){if(t[0]==="!"){return true}var r=0;var n=-2;var s=-2;var o=-2;var a=-2;var l=-2;while(r<t.length){if(t[r]==="*"){return true}if(t[r+1]==="?"&&/[\].+)]/.test(t[r])){return true}if(s!==-1&&t[r]==="["&&t[r+1]!=="]"){if(s<r){s=t.indexOf("]",r)}if(s>r){if(l===-1||l>s){return true}l=t.indexOf("\\",r);if(l===-1||l>s){return true}}}if(o!==-1&&t[r]==="{"&&t[r+1]!=="}"){o=t.indexOf("}",r);if(o>r){l=t.indexOf("\\",r);if(l===-1||l>o){return true}}}if(a!==-1&&t[r]==="("&&t[r+1]==="?"&&/[:!=]/.test(t[r+2])&&t[r+3]!==")"){a=t.indexOf(")",r);if(a>r){l=t.indexOf("\\",r);if(l===-1||l>a){return true}}}if(n!==-1&&t[r]==="("&&t[r+1]!=="|"){if(n<r){n=t.indexOf("|",r)}if(n!==-1&&t[n+1]!==")"){a=t.indexOf(")",n);if(a>n){l=t.indexOf("\\",n);if(l===-1||l>a){return true}}}}if(t[r]==="\\"){var c=t[r+1];r+=2;var u=i[c];if(u){var d=t.indexOf(u,r);if(d!==-1){r=d+1}}if(t[r]==="!"){return true}}else{r++}}return false};var relaxedCheck=function(t){if(t[0]==="!"){return true}var r=0;while(r<t.length){if(/[*?{}()[\]]/.test(t[r])){return true}if(t[r]==="\\"){var n=t[r+1];r+=2;var s=i[n];if(s){var o=t.indexOf(s,r);if(o!==-1){r=o+1}}if(t[r]==="!"){return true}}else{r++}}return false};t.exports=function isGlob(t,r){if(typeof t!=="string"||t===""){return false}if(s(t)){return true}var n=strictCheck;if(r&&r.strict===false){n=relaxedCheck}return n(t)}},5680:t=>{
2022-05-31 14:18:28 -04:00
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
2024-01-14 16:53:58 -05:00
t.exports=function(t){if(typeof t==="number"){return t-t===0}if(typeof t==="string"&&t.trim()!==""){return Number.isFinite?Number.isFinite(+t):isFinite(+t)}return false}},2578:(t,r,n)=>{const s=n(2781);const i=s.PassThrough;const o=Array.prototype.slice;t.exports=merge2;function merge2(){const t=[];const r=o.call(arguments);let n=false;let s=r[r.length-1];if(s&&!Array.isArray(s)&&s.pipe==null){r.pop()}else{s={}}const a=s.end!==false;const l=s.pipeError===true;if(s.objectMode==null){s.objectMode=true}if(s.highWaterMark==null){s.highWaterMark=64*1024}const c=i(s);function addStream(){for(let r=0,n=arguments.length;r<n;r++){t.push(pauseStreams(arguments[r],s))}mergeStream();return this}function mergeStream(){if(n){return}n=true;let r=t.shift();if(!r){process.nextTick(endStream);return}if(!Array.isArray(r)){r=[r]}let s=r.length+1;function next(){if(--s>0){return}n=false;mergeStream()}function pipe(t){function onend(){t.removeListener("merge2UnpipeEnd",onend);t.removeListener("end",onend);if(l){t.removeListener("error",onerror)}next()}function onerror(t){c.emit("error",t)}if(t._readableState.endEmitted){return next()}t.on("merge2UnpipeEnd",onend);t.on("end",onend);if(l){t.on("error",onerror)}t.pipe(c,{end:false});t.resume()}for(let t=0;t<r.length;t++){pipe(r[t])}next()}function endStream(){n=false;c.emit("queueDrain");if(a){c.end()}}c.setMaxListeners(0);c.add=addStream;c.on("unpipe",(function(t){t.emit("merge2UnpipeEnd")}));if(r.length){addStream.apply(null,r)}return c}function pauseStreams(t,r){if(!Array.isArray(t)){if(!t._readableState&&t.pipe){t=t.pipe(i(r))}if(!t._readableState||!t.pause||!t.pipe){throw new Error("Only readable stream can be merged.")}t.pause()}else{for(let n=0,s=t.length;n<s;n++){t[n]=pauseStreams(t[n],r)}}return t}},6228:(t,r,n)=>{const s=n(3837);const i=n(610);const o=n(8569);const a=n(479);const isEmptyString=t=>t===""||t==="./";const micromatch=(t,r,n)=>{r=[].concat(r);t=[].concat(t);let s=new Set;let i=new Set;let a=new Set;let l=0;let onResult=t=>{a.add(t.output);if(n&&n.onResult){n.onResult(t)}};for(let a=0;a<r.length;a++){let c=o(String(r[a]),{...n,onResult:onResult},true);let u=c.state.negated||c.state.negatedExtglob;if(u)l++;for(let r of t){let t=c(r,true);let n=u?!t.isMatch:t.isMatch;if(!n)continue;if(u){s.add(t.output)}else{s.delete(t.output);i.add(t.output)}}}let c=l===r.length?[...a]:[...i];let u=c.filter((t=>!s.has(t)));if(n&&u.length===0){if(n.failglob===true){throw new Error(`No matches found for "${r.join(", ")}"`)}if(n.nonull===true||n.nullglob===true){return n.unescape?r.map((t=>t.replace(/\\/g,""))):r}}return u};micromatch.match=micromatch;micromatch.matcher=(t,r)=>o(t,r);micromatch.isMatch=(t,r,n)=>o(r,n)(t);micromatch.any=micromatch.isMatch;micromatch.not=(t,r,n={})=>{r=[].concat(r).map(String);let s=new Set;let i=[];let onResult=t=>{if(n.onResult)n.onResult(t);i.push(t.output)};let o=new Set(micromatch(t,r,{...n,onResult:onResult}));for(let t of i){if(!o.has(t)){s.add(t)}}return[...s]};micromatch.contains=(t,r,n)=>{if(typeof t!=="string"){throw new TypeError(`Expected a string: "${s.inspect(t)}"`)}if(Array.isArray(r)){return r.some((r=>micromatch.contains(t,r,n)))}if(typeof r==="string"){if(isEmptyString(t)||isEmptyString(r)){return false}if(t.includes(r)||t.startsWith("./")&&t.slice(2).includes(r)){return true}}return micromatch.isMatch(t,r,{...n,contains:true})};micromatch.matchKeys=(t,r,n)=>{if(!a.isObject(t)){throw new TypeError("Expected the first argument to be an object")}let s=micromatch(Object.keys(t),r,n);let i={};for(let r of s)i[r]=t[r];return i};micromatch.some=(t,r,n)=>{let s=[].concat(t);for(let t of[].concat(r)){let r=o(String(t),n);if(s.some((t=>r(t)))){return true}}return false};micromatch.every=(t,r,n)=>{let s=[].concat(t);for(let t of[].concat(r)){let r=o(String(t),n);if(!s.every((t=>r(t)))){return false}}return true};micromatch.all=(t,r,n)=>{if(typeof t!=="string"){throw new TypeError(`Expected a string: "${s.inspect(t)}"`)}return[].concat(r).every((r=>o(r,n)(t)))};micromatch.capture=(t,r,n)=>{let s=a.isWindows(n);let i=o.makeRe(String(t),{...n,capture:true})
/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
if(!globalThis.DOMException){try{const{MessageChannel:t}=n(1267),r=(new t).port1,s=new ArrayBuffer;r.postMessage(s,[s,s])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}}t.exports=globalThis.DOMException},8119:(t,r,n)=>{
2022-05-31 14:18:28 -04:00
/**
* @license node-stream-zip | (c) 2020 Antelle | https://github.com/antelle/node-stream-zip/blob/master/LICENSE
* Portions copyright https://github.com/cthackers/adm-zip | https://raw.githubusercontent.com/cthackers/adm-zip/master/LICENSE
*/
2024-01-15 09:25:43 -05:00
let s=n(7147);const i=n(3837);const o=n(1017);const a=n(2361);const l=n(9796);const c=n(2781);const u={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSIGFIRST:80,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,MAXFILECOMMENT:65535,ENDL64HDR:20,ENDL64SIG:117853008,ENDL64SIGFIRST:80,ENDL64OFS:8,END64HDR:56,END64SIG:101075792,END64SIGFIRST:80,END64SUB:24,END64TOT:32,END64SIZ:40,END64OFF:48,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,FLG_ENC:0,FLG_COMP1:1,FLG_COMP2:2,FLG_DESC:4,FLG_ENH:8,FLG_STR:16,FLG_LNG:1024,FLG_MSK:4096,FLG_ENTRY_ENC:1,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535};const StreamZip=function(t){let r,n,i,c,d,p;const h=false,m=this,g=t.storeEntries!==false?{}:null,y=t.file,b=t.nameEncoding?new TextDecoder(t.nameEncoding):null;open();function open(){if(t.fd){r=t.fd;readFile()}else{s.open(y,"r",((t,n)=>{if(t){return m.emit("error",t)}r=n;readFile()}))}}function readFile(){s.fstat(r,((r,s)=>{if(r){return m.emit("error",r)}n=s.size;i=t.chunkSize||Math.round(n/1e3);i=Math.max(Math.min(i,Math.min(128*1024,n)),Math.min(1024,n));readCentralDirectory()}))}function readUntilFoundCallback(t,r){if(t||!r){return m.emit("error",t||new Error("Archive read error"))}let n=c.lastPos;let s=n-c.win.position;const i=c.win.buffer;const o=c.minPos;while(--n>=o&&--s>=0){if(i.length-s>=4&&i[s]===c.firstByte){if(i.readUInt32LE(s)===c.sig){c.lastBufferPosition=s;c.lastBytesRead=r;c.complete();return}}}if(n===o){return m.emit("error",new Error("Bad archive"))}c.lastPos=n+1;c.chunkSize*=2;if(n<=o){return m.emit("error",new Error("Bad archive"))}const a=Math.min(c.chunkSize,n-o);c.win.expandLeft(a,readUntilFoundCallback)}function readCentralDirectory(){const t=Math.min(u.ENDHDR+u.MAXFILECOMMENT,n);c={win:new FileWindowBuffer(r),totalReadLength:t,minPos:n-t,lastPos:n,chunkSize:Math.min(1024,i),firstByte:u.ENDSIGFIRST,sig:u.ENDSIG,complete:readCentralDirectoryComplete};c.win.read(n-c.chunkSize,c.chunkSize,readUntilFoundCallback)}function readCentralDirectoryComplete(){const t=c.win.buffer;const r=c.lastBufferPosition;try{d=new CentralDirectoryHeader;d.read(t.slice(r,r+u.ENDHDR));d.headerOffset=c.win.position+r;if(d.commentLength){m.comment=t.slice(r+u.ENDHDR,r+u.ENDHDR+d.commentLength).toString()}else{m.comment=null}m.entriesCount=d.volumeEntries;m.centralDirectory=d;if(d.volumeEntries===u.EF_ZIP64_OR_16&&d.totalEntries===u.EF_ZIP64_OR_16||d.size===u.EF_ZIP64_OR_32||d.offset===u.EF_ZIP64_OR_32){readZip64CentralDirectoryLocator()}else{c={};readEntries()}}catch(t){m.emit("error",t)}}function readZip64CentralDirectoryLocator(){const t=u.ENDL64HDR;if(c.lastBufferPosition>t){c.lastBufferPosition-=t;readZip64CentralDirectoryLocatorComplete()}else{c={win:c.win,totalReadLength:t,minPos:c.win.position-t,lastPos:c.win.position,chunkSize:c.chunkSize,firstByte:u.ENDL64SIGFIRST,sig:u.ENDL64SIG,complete:readZip64CentralDirectoryLocatorComplete};c.win.read(c.lastPos-c.chunkSize,c.chunkSize,readUntilFoundCallback)}}function readZip64CentralDirectoryLocatorComplete(){const t=c.win.buffer;const r=new CentralDirectoryLoc64Header;r.read(t.slice(c.lastBufferPosition,c.lastBufferPosition+u.ENDL64HDR));const s=n-r.headerOffset;c={win:c.win,totalReadLength:s,minPos:r.headerOffset,lastPos:c.lastPos,chunkSize:c.chunkSize,firstByte:u.END64SIGFIRST,sig:u.END64SIG,complete:readZip64CentralDirectoryComplete};c.win.read(n-c.chunkSize,c.chunkSize,readUntilFoundCallback)}functi
2022-05-31 14:18:28 -04:00
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
2024-01-14 16:53:58 -05:00
let r;t.exports=typeof queueMicrotask==="function"?queueMicrotask.bind(typeof window!=="undefined"?window:global):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},2113:t=>{function reusify(t){var r=new t;var n=r;function get(){var s=r;if(s.next){r=s.next}else{r=new t;n=r}s.next=null;return s}function release(t){n.next=t;n=t}return{get:get,release:release}}t.exports=reusify},5288:(t,r,n)=>{
2022-05-31 14:18:28 -04:00
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
2024-01-15 09:25:43 -05:00
t.exports=runParallel;const s=n(9795);function runParallel(t,r){let n,i,o;let a=true;if(Array.isArray(t)){n=[];i=t.length}else{o=Object.keys(t);n={};i=o.length}function done(t){function end(){if(r)r(t,n);r=null}if(a)s(end);else end()}function each(t,r,s){n[t]=s;if(--i===0||r){done(r)}}if(!i){done(null)}else if(o){o.forEach((function(r){t[r]((function(t,n){each(r,t,n)}))}))}else{t.forEach((function(t,r){t((function(t,n){each(r,t,n)}))}))}a=false}},1532:(t,r,n)=>{const s=Symbol("SemVer ANY");class Comparator{static get ANY(){return s}constructor(t,r){r=i(r);if(t instanceof Comparator){if(t.loose===!!r.loose){return t}else{t=t.value}}t=t.trim().split(/\s+/).join(" ");c("comparator",t,r);this.options=r;this.loose=!!r.loose;this.parse(t);if(this.semver===s){this.value=""}else{this.value=this.operator+this.semver.version}c("comp",this)}parse(t){const r=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR];const n=t.match(r);if(!n){throw new TypeError(`Invalid comparator: ${t}`)}this.operator=n[1]!==undefined?n[1]:"";if(this.operator==="="){this.operator=""}if(!n[2]){this.semver=s}else{this.semver=new u(n[2],this.options.loose)}}toString(){return this.value}test(t){c("Comparator.test",t,this.options.loose);if(this.semver===s||t===s){return true}if(typeof t==="string"){try{t=new u(t,this.options)}catch(t){return false}}return l(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof Comparator)){throw new TypeError("a Comparator is required")}if(this.operator===""){if(this.value===""){return true}return new d(t.value,r).test(this.value)}else if(t.operator===""){if(t.value===""){return true}return new d(this.value,r).test(t.semver)}r=i(r);if(r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")){return false}if(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))){return false}if(this.operator.startsWith(">")&&t.operator.startsWith(">")){return true}if(this.operator.startsWith("<")&&t.operator.startsWith("<")){return true}if(this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")){return true}if(l(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")){return true}if(l(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")){return true}return false}}t.exports=Comparator;const i=n(785);const{safeRe:o,t:a}=n(9523);const l=n(5098);const c=n(427);const u=n(8088);const d=n(9828)},9828:(t,r,n)=>{class Range{constructor(t,r){r=o(r);if(t instanceof Range){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{return new Range(t.raw,r)}}if(t instanceof a){this.raw=t.value;this.set=[[t]];this.format();return this}this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;this.raw=t.trim().split(/\s+/).join(" ");this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length));if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${this.raw}`)}if(this.set.length>1){const t=this.set[0];this.set=this.set.filter((t=>!isNullSet(t[0])));if(this.set.length===0){this.set=[t]}else if(this.set.length>1){for(const t of this.set){if(t.length===1&&isAny(t[0])){this.set=[t];break}}}}this.format()}format(){this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim();return this.range}toString(){return this.range}parseRange(t){const r=(this.options.includePrerelease&&g)|(this.options.loose&&y);const n=r+":"+t;const s=i.get(n);if(s){return s}const o=this.options.loose;const c=o?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];t=t.replace(c,hyphenReplace(this.options.includePrerelease));l("hyphen replace",t);t=t.replace(u[d.COMPARATORTRIM],p);l("comparator trim",t);t=t.replace(u[d.TILDETRIM],h);l("tilde trim",t);t=t.replace(u[d.CARETTRIM],m);l("caret trim",t);let b=t.split(" ").map((t=>parseComparator(t,this.options))).join(" ").split(/\s+/).map((t=>replaceGTE0(t,this.options)));if(o){b=b.filter((t=>{l("loose invalid filter",t,this.options);return!!t.match(u[d.COMPARATORLOOSE])}))}l("range list",b);const _=new
2022-05-31 14:18:28 -04:00
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/
2024-01-15 09:25:43 -05:00
const s=n(5680);const toRegexRange=(t,r,n)=>{if(s(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(r===void 0||t===r){return String(t)}if(s(r)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let i={relaxZeros:true,...n};if(typeof i.strictZeros==="boolean"){i.relaxZeros=i.strictZeros===false}let o=String(i.relaxZeros);let a=String(i.shorthand);let l=String(i.capture);let c=String(i.wrap);let u=t+":"+r+"="+o+a+l+c;if(toRegexRange.cache.hasOwnProperty(u)){return toRegexRange.cache[u].result}let d=Math.min(t,r);let p=Math.max(t,r);if(Math.abs(d-p)===1){let n=t+"|"+r;if(i.capture){return`(${n})`}if(i.wrap===false){return n}return`(?:${n})`}let h=hasPadding(t)||hasPadding(r);let m={min:t,max:r,a:d,b:p};let g=[];let y=[];if(h){m.isPadded=h;m.maxLen=String(m.max).length}if(d<0){let t=p<0?Math.abs(p):1;y=splitToPatterns(t,Math.abs(d),m,i);d=m.a=0}if(p>=0){g=splitToPatterns(d,p,m,i)}m.negatives=y;m.positives=g;m.result=collatePatterns(y,g,i);if(i.capture===true){m.result=`(${m.result})`}else if(i.wrap!==false&&g.length+y.length>1){m.result=`(?:${m.result})`}toRegexRange.cache[u]=m;return m.result};function collatePatterns(t,r,n){let s=filterPatterns(t,r,"-",false,n)||[];let i=filterPatterns(r,t,"",false,n)||[];let o=filterPatterns(t,r,"-?",true,n)||[];let a=s.concat(o).concat(i);return a.join("|")}function splitToRanges(t,r){let n=1;let s=1;let i=countNines(t,n);let o=new Set([r]);while(t<=i&&i<=r){o.add(i);n+=1;i=countNines(t,n)}i=countZeros(r+1,s)-1;while(t<i&&i<=r){o.add(i);s+=1;i=countZeros(r+1,s)-1}o=[...o];o.sort(compare);return o}function rangeToPattern(t,r,n){if(t===r){return{pattern:t,count:[],digits:0}}let s=zip(t,r);let i=s.length;let o="";let a=0;for(let t=0;t<i;t++){let[r,i]=s[t];if(r===i){o+=r}else if(r!=="0"||i!=="9"){o+=toCharacterClass(r,i,n)}else{a++}}if(a){o+=n.shorthand===true?"\\d":"[0-9]"}return{pattern:o,count:[a],digits:i}}function splitToPatterns(t,r,n,s){let i=splitToRanges(t,r);let o=[];let a=t;let l;for(let t=0;t<i.length;t++){let r=i[t];let c=rangeToPattern(String(a),String(r),s);let u="";if(!n.isPadded&&l&&l.pattern===c.pattern){if(l.count.length>1){l.count.pop()}l.count.push(c.count[0]);l.string=l.pattern+toQuantifier(l.count);a=r+1;continue}if(n.isPadded){u=padZeros(r,n,s)}c.string=u+c.pattern+toQuantifier(c.count);o.push(c);a=r+1;l=c}return o}function filterPatterns(t,r,n,s,i){let o=[];for(let i of t){let{string:t}=i;if(!s&&!contains(r,"string",t)){o.push(n+t)}if(s&&contains(r,"string",t)){o.push(n+t)}}return o}function zip(t,r){let n=[];for(let s=0;s<t.length;s++)n.push([t[s],r[s]]);return n}function compare(t,r){return t>r?1:r>t?-1:0}function contains(t,r,n){return t.some((t=>t[r]===n))}function countNines(t,r){return Number(String(t).slice(0,-r)+"9".repeat(r))}function countZeros(t,r){return t-t%Math.pow(10,r)}function toQuantifier(t){let[r=0,n=""]=t;if(n||r>1){return`{${r+(n?","+n:"")}}`}return""}function toCharacterClass(t,r,n){return`[${t}${r-t===1?"":"-"}${r}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,r,n){if(!r.isPadded){return t}let s=Math.abs(r.maxLen-String(t).length);let i=n.relaxZeros!==false;switch(s){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:{return i?`0{0,${s}}`:`0{${s}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},4920:(t,r,n)=>{var s=n(5642);var i=n(8215);t.exports={parse:function(t){var r=s.parse(t.toString());return i.compile(r)}}},8215:t=>{function compile(t){var r=[];var n=[];var s="";var i=Object.create(null);var o=i;var a=false;return reduce(t);function reduce(t){var r;for(var n=0;n<t.length;n++){r=t[n];switch(r.type){case"Assign":assign(r);break;case"ObjectPath":setPath(r);break;case"ArrayPath":addTableArray(r);break}}return i}function genError(t,r,n){var s=new Error(t);s.line=r;s.column=n;throw s}function assign(t){var i=t.key;var a=t.value;var l=t.line;var c=t.column;var u;if(s){u=s+"."+i}else{u=i}if(typeof o[i]!=="undefined"){genError("Cannot redefine existing key '
2022-08-21 08:22:53 -04:00
/**
2024-01-14 16:53:58 -05:00
* @license
* web-streams-polyfill v3.3.2
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
* This code is released under the MIT license.
* SPDX-License-Identifier: MIT
2022-08-21 08:22:53 -04:00
*/
2024-04-27 05:55:35 -04:00
(function(t,n){true?n(r):0})(this,(function(t){"use strict";const r=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol:t=>`Symbol(${t})`;function noop(){return undefined}function typeIsObject(t){return typeof t==="object"&&t!==null||typeof t==="function"}const n=noop;function setFunctionName(t,r){try{Object.defineProperty(t,"name",{value:r,configurable:true})}catch(t){}}const s=Promise;const i=Promise.prototype.then;const o=Promise.reject.bind(s);function newPromise(t){return new s(t)}function promiseResolvedWith(t){return newPromise((r=>r(t)))}function promiseRejectedWith(t){return o(t)}function PerformPromiseThen(t,r,n){return i.call(t,r,n)}function uponPromise(t,r,s){PerformPromiseThen(PerformPromiseThen(t,r,s),undefined,n)}function uponFulfillment(t,r){uponPromise(t,r)}function uponRejection(t,r){uponPromise(t,undefined,r)}function transformPromiseWith(t,r,n){return PerformPromiseThen(t,r,n)}function setPromiseIsHandledToTrue(t){PerformPromiseThen(t,undefined,n)}let _queueMicrotask=t=>{if(typeof queueMicrotask==="function"){_queueMicrotask=queueMicrotask}else{const t=promiseResolvedWith(undefined);_queueMicrotask=r=>PerformPromiseThen(t,r)}return _queueMicrotask(t)};function reflectCall(t,r,n){if(typeof t!=="function"){throw new TypeError("Argument is not a function")}return Function.prototype.apply.call(t,r,n)}function promiseCall(t,r,n){try{return promiseResolvedWith(reflectCall(t,r,n))}catch(t){return promiseRejectedWith(t)}}const a=16384;class SimpleQueue{constructor(){this._cursor=0;this._size=0;this._front={_elements:[],_next:undefined};this._back=this._front;this._cursor=0;this._size=0}get length(){return this._size}push(t){const r=this._back;let n=r;if(r._elements.length===a-1){n={_elements:[],_next:undefined}}r._elements.push(t);if(n!==r){this._back=n;r._next=n}++this._size}shift(){const t=this._front;let r=t;const n=this._cursor;let s=n+1;const i=t._elements;const o=i[n];if(s===a){r=t._next;s=0}--this._size;this._cursor=s;if(t!==r){this._front=r}i[n]=undefined;return o}forEach(t){let r=this._cursor;let n=this._front;let s=n._elements;while(r!==s.length||n._next!==undefined){if(r===s.length){n=n._next;s=n._elements;r=0;if(s.length===0){break}}t(s[r]);++r}}peek(){const t=this._front;const r=this._cursor;return t._elements[r]}}const l=r("[[AbortSteps]]");const c=r("[[ErrorSteps]]");const u=r("[[CancelSteps]]");const d=r("[[PullSteps]]");const p=r("[[ReleaseSteps]]");function ReadableStreamReaderGenericInitialize(t,r){t._ownerReadableStream=r;r._reader=t;if(r._state==="readable"){defaultReaderClosedPromiseInitialize(t)}else if(r._state==="closed"){defaultReaderClosedPromiseInitializeAsResolved(t)}else{defaultReaderClosedPromiseInitializeAsRejected(t,r._storedError)}}function ReadableStreamReaderGenericCancel(t,r){const n=t._ownerReadableStream;return ReadableStreamCancel(n,r)}function ReadableStreamReaderGenericRelease(t){const r=t._ownerReadableStream;if(r._state==="readable"){defaultReaderClosedPromiseReject(t,new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`))}else{defaultReaderClosedPromiseResetToRejected(t,new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`))}r._readableStreamController[p]();r._reader=undefined;t._ownerReadableStream=undefined}function readerLockException(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function defaultReaderClosedPromiseInitialize(t){t._closedPromise=newPromise(((r,n)=>{t._closedPromise_resolve=r;t._closedPromise_reject=n}))}function defaultReaderClosedPromiseInitializeAsRejected(t,r){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseReject(t,r)}function defaultReaderClosedPromiseInitializeAsResolved(t){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseResolve(t)}function defaultReaderClosedPromiseReject(t,r){if(t._closedPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined}function defaul
2024-01-14 16:53:58 -05:00
/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const i=65536;async function*toIterator(t,r=true){for(const n of t){if("stream"in n){yield*n.stream()}else if(ArrayBuffer.isView(n)){if(r){let t=n.byteOffset;const r=n.byteOffset+n.byteLength;while(t!==r){const s=Math.min(r-t,i);const o=n.buffer.slice(t,t+s);t+=o.byteLength;yield new Uint8Array(o)}}else{yield n}}else{let t=0,r=n;while(t!==r.size){const n=r.slice(t,Math.min(r.size,t+i));const s=await n.arrayBuffer();t+=s.byteLength;yield new Uint8Array(s)}}}}const o=class Blob{#s=[];#i="";#o=0;#a="transparent";constructor(t=[],r={}){if(typeof t!=="object"||t===null){throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.")}if(typeof t[Symbol.iterator]!=="function"){throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.")}if(typeof r!=="object"&&typeof r!=="function"){throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.")}if(r===null)r={};const n=new TextEncoder;for(const r of t){let t;if(ArrayBuffer.isView(r)){t=new Uint8Array(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength))}else if(r instanceof ArrayBuffer){t=new Uint8Array(r.slice(0))}else if(r instanceof Blob){t=r}else{t=n.encode(`${r}`)}this.#o+=ArrayBuffer.isView(t)?t.byteLength:t.size;this.#s.push(t)}this.#a=`${r.endings===undefined?"transparent":r.endings}`;const s=r.type===undefined?"":String(r.type);this.#i=/^[\x20-\x7E]*$/.test(s)?s:""}get size(){return this.#o}get type(){return this.#i}async text(){const t=new TextDecoder;let r="";for await(const n of toIterator(this.#s,false)){r+=t.decode(n,{stream:true})}r+=t.decode();return r}async arrayBuffer(){const t=new Uint8Array(this.size);let r=0;for await(const n of toIterator(this.#s,false)){t.set(n,r);r+=n.length}return t.buffer}stream(){const t=toIterator(this.#s,true);return new globalThis.ReadableStream({type:"bytes",async pull(r){const n=await t.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await t.return()}})}slice(t=0,r=this.size,n=""){const{size:s}=this;let i=t<0?Math.max(s+t,0):Math.min(t,s);let o=r<0?Math.max(s+r,0):Math.min(r,s);const a=Math.max(o-i,0);const l=this.#s;const c=[];let u=0;for(const t of l){if(u>=a){break}const r=ArrayBuffer.isView(t)?t.byteLength:t.size;if(i&&r<=i){i-=r;o-=r}else{let n;if(ArrayBuffer.isView(t)){n=t.subarray(i,Math.min(r,o));u+=n.byteLength}else{n=t.slice(i,Math.min(r,o));u+=n.size}o-=r;c.push(n);i=0}}const d=new Blob([],{type:String(n).toLowerCase()});d.#o=a;d.#s=c;return d}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](t){return t&&typeof t==="object"&&typeof t.constructor==="function"&&(typeof t.stream==="function"||typeof t.arrayBuffer==="function")&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}};Object.defineProperties(o.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});const a=o;const l=a},8010:(t,r,n)=>{n.d(r,{Ct:()=>p,au:()=>formDataToBlob});var s=n(1410);var i=n(3213);
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */var{toStringTag:o,iterator:a,hasInstance:l}=Symbol,c=Math.random,u="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),f=(t,r,n)=>(t+="",/^(Blob|File)$/.test(r&&r[o])?[(n=n!==void 0?n+"":r[o]=="File"?r.name:"blob",t),r.name!==n||r[o]=="blob"?new i.Z([r],n,r):r]:[t,r+""]),e=(t,r)=>(r?t:t.replace(/\r?\n|\r/g,"\r\n")).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(t,r,n)=>{if(r.length<n){throw new TypeError(`Failed to execute '${t}' on 'FormData': ${n} arguments required, but only ${r.length} present.`)}};const d=null&&F;const p=class FormData{#l=[];constructor(...t){if(t.length)throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`)}get[o](){return"FormData"}[a](){return this.entries()}static[l](t){return t&&typeof t==="object"&&t[o]==="FormData"&&!u.some((r=>typeof t[r]!="function"))}append(...t){x("append",arguments,2);this.#l.push(f(...t))}delete(t){x("delete",arguments,1);t+="";this.#l=this.#l.filter((([r])=>r!==t))}get(t){x("get",arguments,1);t+="";for(var r=this.#l,n=r.length,s=0;s<n;s++)if(r[s][0]===t)return r[s][1];return null}getAll(t,r){x("getAll",arguments,1);r=[];t+="";this.#l.forEach((n=>n[0]===t&&r.push(n[1])));return r}has(t){x("has",arguments,1);t+="";return this.#l.some((r=>r[0]===t))}forEach(t,r){x("forEach",arguments,1);for(var[n,s]of this)t.call(r,s,n,this)}set(...t){x("set",arguments,2);var r=[],n=!0;t=f(...t);this.#l.forEach((s=>{s[0]===t[0]?n&&(n=!r.push(t)):r.push(s)}));n&&r.push(t);this.#l=r}*entries(){yield*this.#l}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}};function formDataToBlob(t,r=s.Z){var n=`${c()}${c()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),i=[],o=`--${n}\r\nContent-Disposition: form-data; name="`;t.forEach(((t,r)=>typeof t=="string"?i.push(o+e(r)+`"\r\n\r\n${t.replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n")}\r\n`):i.push(o+e(r)+`"; filename="${e(t.name,1)}"\r\nContent-Type: ${t.type||"application/octet-stream"}\r\n\r\n`,t,"\r\n")));i.push(`--${n}--`);return new r(i,{type:"multipart/form-data; boundary="+n})}},4037:(t,r,n)=>{n.r(r);n.d(r,{toFormData:()=>toFormData});var s=n(2185);var i=n(8010);let o=0;const a={START_BOUNDARY:o++,HEADER_FIELD_START:o++,HEADER_FIELD:o++,HEADER_VALUE_START:o++,HEADER_VALUE:o++,HEADER_VALUE_ALMOST_DONE:o++,HEADERS_ALMOST_DONE:o++,PART_DATA_START:o++,PART_DATA:o++,END:o++};let l=1;const c={PART_BOUNDARY:l,LAST_BOUNDARY:l*=2};const u=10;const d=13;const p=32;const h=45;const m=58;const g=97;const y=122;const lower=t=>t|32;const noop=()=>{};class MultipartParser{constructor(t){this.index=0;this.flags=0;this.onHeaderEnd=noop;this.onHeaderField=noop;this.onHeadersEnd=noop;this.onHeaderValue=noop;this.onPartBegin=noop;this.onPartData=noop;this.onPartEnd=noop;this.boundaryChars={};t="\r\n--"+t;const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++){r[n]=t.charCodeAt(n);this.boundaryChars[r[n]]=true}this.boundary=r;this.lookbehind=new Uint8Array(this.boundary.length+8);this.state=a.START_BOUNDARY}write(t){let r=0;const n=t.length;let s=this.index;let{lookbehind:i,boundary:o,boundaryChars:l,index:b,state:_,flags:S}=this;const E=this.boundary.length;const v=E-1;const R=t.length;let w;let C;const mark=t=>{this[t+"Mark"]=r};const clear=t=>{delete this[t+"Mark"]};const callback=(t,r,n,s)=>{if(r===undefined||r!==n){this[t](s&&s.subarray(r,n))}};const dataCallback=(n,s)=>{const i=n+"Mark";if(!(i in this)){return}if(s){callback(n,this[i],r,t);delete this[i]}else{callback(n,this[i],t.length,t);this[i]=0}};for(r=0;r<n;r++){w=t[r];switch(_){case a.START_BOUNDARY:if(b===o.length-2){if(w===h){S|=c.LAST_BOUNDARY}else if(w!==d){return}b++;break}else if(b-1===o.length-2){if(S&c.LAST_BOUNDARY&&w===h){_=a.END;S=0}else if(!(S&c.LAST_BOUNDARY)&&w===u){b=0;callback("onPartBegin");_=a.HEADER_FIELD_START}else{return}break}if(w!==o[b+2]){b=-2}if(w===o[b+2]){b++}break;case a.HEADER_FIELD_START:_=a.HEADER_FIELD;mark("onHeaderField");b=0;case a.HEADER_FIELD:if(w===d){clear("onHeade
2021-09-26 15:31:45 -04:00
//# sourceMappingURL=index.js.map