3 lines
101 KiB
JavaScript
3 lines
101 KiB
JavaScript
/*! For license information please see 3246.b4f537eb074a0a938bae.js.LICENSE.txt */
|
|
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3246],{251:(e,t)=>{t.read=function(e,t,i,a,r){var n,s,o=8*r-a-1,c=(1<<o)-1,l=c>>1,m=-7,p=i?r-1:0,u=i?-1:1,d=e[t+p];for(p+=u,n=d&(1<<-m)-1,d>>=-m,m+=o;m>0;n=256*n+e[t+p],p+=u,m-=8);for(s=n&(1<<-m)-1,n>>=-m,m+=a;m>0;s=256*s+e[t+p],p+=u,m-=8);if(0===n)n=1-l;else{if(n===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,a),n-=l}return(d?-1:1)*s*Math.pow(2,n-a)},t.write=function(e,t,i,a,r,n){var s,o,c,l=8*n-r-1,m=(1<<l)-1,p=m>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:n-1,f=a?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=m):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+p>=1?u/c:u*Math.pow(2,1-p))*c>=2&&(s++,c/=2),s+p>=m?(o=0,s=m):s+p>=1?(o=(t*c-1)*Math.pow(2,r),s+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,r),s=0));r>=8;e[i+d]=255&o,d+=f,o/=256,r-=8);for(s=s<<r|o,l+=r;l>0;e[i+d]=255&s,d+=f,s/=256,l-=8);e[i+d-f]|=128*h}},3246:(e,t,i)=>{"use strict";i.d(t,{parseBlob:()=>tt,cc:()=>at,selectCover:()=>it});var a=i(93853),r=i(4017),n=Uint8Array,s=Uint16Array,o=Int32Array,c=new n([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,0,0,0]),l=new n([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,0,0]),m=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var i=new s(31),a=0;a<31;++a)i[a]=t+=1<<e[a-1];var r=new o(i[30]);for(a=1;a<30;++a)for(var n=i[a];n<i[a+1];++n)r[n]=n-i[a]<<5|a;return{b:i,r}},u=p(c,2),d=u.b,f=u.r;d[28]=258,f[258]=28;for(var h=p(l,0),g=h.b,T=(h.r,new s(32768)),x=0;x<32768;++x){var k=(43690&x)>>1|(21845&x)<<1;k=(61680&(k=(52428&k)>>2|(13107&k)<<2))>>4|(3855&k)<<4,T[x]=((65280&k)>>8|(255&k)<<8)>>1}var b=function(e,t,i){for(var a=e.length,r=0,n=new s(t);r<a;++r)e[r]&&++n[e[r]-1];var o,c=new s(t);for(r=1;r<t;++r)c[r]=c[r-1]+n[r-1]<<1;if(i){o=new s(1<<t);var l=15-t;for(r=0;r<a;++r)if(e[r])for(var m=r<<4|e[r],p=t-e[r],u=c[e[r]-1]++<<p,d=u|(1<<p)-1;u<=d;++u)o[T[u]>>l]=m}else for(o=new s(a),r=0;r<a;++r)e[r]&&(o[r]=T[c[e[r]-1]++]>>15-e[r]);return o},y=new n(288);for(x=0;x<144;++x)y[x]=8;for(x=144;x<256;++x)y[x]=9;for(x=256;x<280;++x)y[x]=7;for(x=280;x<288;++x)y[x]=8;var v=new n(32);for(x=0;x<32;++x)v[x]=5;var w=b(y,9,1),I=b(v,5,1),A=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},S=function(e,t,i){var a=t/8|0;return(e[a]|e[a+1]<<8)>>(7&t)&i},E=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],C=function(e,t,i){var a=new Error(t||_[e]);if(a.code=e,Error.captureStackTrace&&Error.captureStackTrace(a,C),!i)throw a;return a},M=function(e,t,i,a){var r=e.length,s=a?a.length:0;if(!r||t.f&&!t.l)return i||new n(0);var o=!i,p=o||2!=t.i,u=t.i;o&&(i=new n(3*r));var f,h=function(e){var t=i.length;if(e>t){var a=new n(Math.max(2*t,e));a.set(i),i=a}},T=t.f||0,x=t.p||0,k=t.b||0,y=t.l,v=t.d,_=t.m,M=t.n,R=8*r;do{if(!y){T=S(e,x,1);var z=S(e,x+1,3);if(x+=3,!z){var N=e[(f=x,(j=4+((f+7)/8|0))-4)]|e[j-3]<<8,L=j+N;if(L>r){u&&C(0);break}p&&h(k+N),i.set(e.subarray(j,L),k),t.b=k+=N,t.p=x=8*L,t.f=T;continue}if(1==z)y=w,v=I,_=9,M=5;else if(2==z){var B=S(e,x,31)+257,U=S(e,x+10,15)+4,P=B+S(e,x+5,31)+1;x+=14;for(var D=new n(P),O=new n(19),F=0;F<U;++F)O[m[F]]=S(e,x+3*F,7);x+=3*U;var X=A(O),G=(1<<X)-1,W=b(O,X,1);for(F=0;F<P;){var j,$=W[S(e,x,G)];if(x+=15&$,(j=$>>4)<16)D[F++]=j;else{var q=0,H=0;for(16==j?(H=3+S(e,x,3),x+=2,q=D[F-1]):17==j?(H=3+S(e,x,7),x+=3):18==j&&(H=11+S(e,x,127),x+=7);H--;)D[F++]=q}}var Y=D.subarray(0,B),K=D.subarray(B);_=A(Y),M=A(K),y=b(Y,_,1),v=b(K,M,1)}else C(1);if(x>R){u&&C(0);break}}p&&h(k+131072);for(var Z=(1<<_)-1,V=(1<<M)-1,J=x;;J=x){var Q=(q=y[E(e,x)&Z])>>4;if((x+=15&q)>R){u&&C(0);break}if(q||C(2),Q<256)i[k++]=Q;else{if(256==Q){J=x,y=null;break}var ee=Q-254;if(Q>264){var te=c[F=Q-257];ee=S(e,x,(1<<te)-1)+d[F],x+=te}var ie=v[E(e,x)&V],ae=ie>>4;if(ie||C(3),x+=15&ie,K=g[ae],ae>3&&(te=l[ae],K+=E(e,x)&(1<<te)-1,x+=te),x>R){u&&C(0);break}p&&h(k+131072);var re=k+ee;if(k<K){var ne=s-K,se=Math.min(K,re);for(ne+k<0&&C(3);k<se;++k)i[k]=a[ne+k]}for(;k<re;++k)i[k]=i[k-K]}}t.l=y,t.p=J,t.b=k,t.f=T,y&&(T=1,t.m=_,t.d=v,t.n=M)}while(!T);return k!=i.length&&o?function(e,t,i){return(null==t||t<0)&&(t=0),(null==i||i>e.length)&&(i=e.length),new n(e.subarray(t,i))}(i,0,k):i.subarray(0,k)},R=new n(0);function z(e,t){var i,a,r=function(e){31==e[0]&&139==e[1]&&8==e[2]||C(6,"invalid gzip data");var t=e[3],i=10;4&t&&(i+=2+(e[10]|e[11]<<8));for(var a=(t>>3&1)+(t>>4&1);a>0;a-=!e[i++]);return i+(2&t)}(e);return r+8>e.length&&C(6,"invalid gzip data"),M(e.subarray(r,-8),{i:2},t&&t.out||new n((a=(i=e).length,(i[a-4]|i[a-3]<<8|i[a-2]<<16|i[a-1]<<24)>>>0)),t&&t.dictionary)}function N(e,t){return M(e.subarray((i=e,a=t&&t.dictionary,(8!=(15&i[0])||i[0]>>4>7||(i[0]<<8|i[1])%31)&&C(6,"invalid zlib data"),(i[1]>>5&1)==+!a&&C(6,"invalid zlib data: "+(32&i[1]?"need":"unexpected")+" dictionary"),2+(i[1]>>3&4)),-4),{i:2},t&&t.out,t&&t.dictionary);var i,a}var L="undefined"!=typeof TextDecoder&&new TextDecoder;try{L.decode(R,{stream:!0})}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;var B=i(17833);const U=67324752,P=33639248,D={get:e=>(r.UINT16_LE.get(e,6),{signature:r.UINT32_LE.get(e,0),compressedSize:r.UINT32_LE.get(e,8),uncompressedSize:r.UINT32_LE.get(e,12)}),len:16},O={get(e){const t=r.UINT16_LE.get(e,6);return{signature:r.UINT32_LE.get(e,0),minVersion:r.UINT16_LE.get(e,4),dataDescriptor:!!(8&t),compressedMethod:r.UINT16_LE.get(e,8),compressedSize:r.UINT32_LE.get(e,18),uncompressedSize:r.UINT32_LE.get(e,22),filenameLength:r.UINT16_LE.get(e,26),extraFieldLength:r.UINT16_LE.get(e,28),filename:null}},len:30},F={get:e=>({signature:r.UINT32_LE.get(e,0),nrOfThisDisk:r.UINT16_LE.get(e,4),nrOfThisDiskWithTheStart:r.UINT16_LE.get(e,6),nrOfEntriesOnThisDisk:r.UINT16_LE.get(e,8),nrOfEntriesOfSize:r.UINT16_LE.get(e,10),sizeOfCd:r.UINT32_LE.get(e,12),offsetOfStartOfCd:r.UINT32_LE.get(e,16),zipFileCommentLength:r.UINT16_LE.get(e,20)}),len:22},X={get(e){const t=r.UINT16_LE.get(e,8);return{signature:r.UINT32_LE.get(e,0),minVersion:r.UINT16_LE.get(e,6),dataDescriptor:!!(8&t),compressedMethod:r.UINT16_LE.get(e,10),compressedSize:r.UINT32_LE.get(e,20),uncompressedSize:r.UINT32_LE.get(e,24),filenameLength:r.UINT16_LE.get(e,28),extraFieldLength:r.UINT16_LE.get(e,30),fileCommentLength:r.UINT16_LE.get(e,32),relativeOffsetOfLocalHeader:r.UINT32_LE.get(e,42),filename:null}},len:46};function G(e){const t=new Uint8Array(r.UINT32_LE.len);return r.UINT32_LE.put(t,0,e),t}const W=B("tokenizer:inflate"),j=262144,$=G(134695760),q=G(101010256);class H{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(j)}async isZip(){return await this.peekSignature()===U}peekSignature(){return this.tokenizer.peekToken(r.UINT32_LE)}async findEndOfCentralDirectoryLocator(){const e=this.tokenizer,t=Math.min(16384,e.fileInfo.size),i=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(i,{position:e.fileInfo.size-t});for(let a=i.length-4;a>=0;a--)if(i[a]===q[0]&&i[a+1]===q[1]&&i[a+2]===q[2]&&i[a+3]===q[3])return e.fileInfo.size-t+a;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess())return void W("Cannot reading central-directory without random-read support");W("Reading central-directory...");const e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){W("Central-directory 32-bit signature found");const i=await this.tokenizer.readToken(F,t),a=[];this.tokenizer.setPosition(i.offsetOfStartOfCd);for(let e=0;e<i.nrOfEntriesOfSize;++e){const t=await this.tokenizer.readToken(X);if(t.signature!==P)throw new Error("Expected Central-File-Header signature");t.filename=await this.tokenizer.readToken(new r.StringType(t.filenameLength,"utf-8")),await this.tokenizer.ignore(t.extraFieldLength),await this.tokenizer.ignore(t.fileCommentLength),a.push(t),W(`Add central-directory file-entry: n=${e+1}/${a.length}: filename=${a[e].filename}`)}return this.tokenizer.setPosition(e),a}this.tokenizer.setPosition(e)}async unzip(e){const t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let i=!1;do{const t=await this.readLocalFileHeader();if(!t)break;const a=e(t);let r;if(i=!!a.stop,await this.tokenizer.ignore(t.extraFieldLength),t.dataDescriptor&&0===t.compressedSize){const e=[];let i=j;W("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let r=-1;for(;r<0&&i===j;){i=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),r=Y(this.syncBuffer.subarray(0,i),$);const t=r>=0?r:i;if(a.handler){const i=new Uint8Array(t);await this.tokenizer.readBuffer(i),e.push(i)}else await this.tokenizer.ignore(t)}W(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),a.handler&&await this.inflate(t,K(e),a.handler)}else a.handler?(W(`Reading compressed-file-data: ${t.compressedSize} bytes`),r=new Uint8Array(t.compressedSize),await this.tokenizer.readBuffer(r),await this.inflate(t,r,a.handler)):(W(`Ignoring compressed-file-data: ${t.compressedSize} bytes`),await this.tokenizer.ignore(t.compressedSize));if(W(`Reading data-descriptor at pos=${this.tokenizer.position}`),t.dataDescriptor&&134695760!==(await this.tokenizer.readToken(D)).signature)throw new Error("Expected data-descriptor-signature at position "+(this.tokenizer.position-D.len))}while(!i)}async iterateOverCentralDirectory(e,t){for(const i of e){const e=t(i);if(e.handler){this.tokenizer.setPosition(i.relativeOffsetOfLocalHeader);const t=await this.readLocalFileHeader();if(t){await this.tokenizer.ignore(t.extraFieldLength);const a=new Uint8Array(i.compressedSize);await this.tokenizer.readBuffer(a),await this.inflate(t,a,e.handler)}}if(e.stop)break}}inflate(e,t,i){return 0===e.compressedMethod?i(t):(W(`Decompress filename=${e.filename}, compressed-size=${t.length}`),i(31==(a=t)[0]&&139==a[1]&&8==a[2]?z(a,r):8!=(15&a[0])||a[0]>>4>7||(a[0]<<8|a[1])%31?function(e,t){return M(e,{i:2},t&&t.out,t&&t.dictionary)}(a,r):N(a,r)));var a,r}async readLocalFileHeader(){const e=await this.tokenizer.peekToken(r.UINT32_LE);if(e===U){const e=await this.tokenizer.readToken(O);return e.filename=await this.tokenizer.readToken(new r.StringType(e.filenameLength,"utf-8")),e}if(e===P)return!1;if(3759263696===e)throw new Error("Encrypted ZIP");throw new Error("Unexpected signature")}}function Y(e,t){const i=e.length,a=t.length;if(a>i)return-1;for(let r=0;r<=i-a;r++){let i=!0;for(let n=0;n<a;n++)if(e[r+n]!==t[n]){i=!1;break}if(i)return r}return-1}function K(e){const t=e.reduce(((e,t)=>e+t.length),0),i=new Uint8Array(t);let a=0;for(const t of e)i.set(t,a),a+=t.length;return i}var Z=i(78523);const V={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},J=4100;async function Q(e){return(new ie).fromBuffer(e)}function ee(e){switch(e.toLowerCase()){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:"application/vnd.oasis.opendocument.text-template"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:"application/vnd.oasis.opendocument.spreadsheet-template"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:"application/vnd.oasis.opendocument.presentation-template"};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:"application/vnd.oasis.opendocument.graphics"};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:"application/vnd.oasis.opendocument.graphics-template"};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:"application/vnd.openxmlformats-officedocument.presentationml.slideshow"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.template"};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.template"};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:"application/vnd.openxmlformats-officedocument.presentationml.template"};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"}}}function te(e,t,i){i={offset:0,...i};for(const[a,r]of t.entries())if(i.mask){if(r!==(i.mask[a]&e[a+i.offset]))return!1}else if(r!==e[a+i.offset])return!1;return!0}class ie{constructor(e){this.detectors=[...e?.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:e?.signal}}async fromTokenizer(e){const t=e.position;for(const i of this.detectors){const a=await i.detect(e);if(a)return a;if(t!==e.position)return}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(a.vY(t,this.tokenizerOptions))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){const t=await a.Xx(e,this.tokenizerOptions);try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){const{sampleSize:i=J}=t;let r,n;const s=e.getReader({mode:"byob"});try{const{value:e,done:t}=await s.read(new Uint8Array(i));if(n=e,!t&&e)try{r=await this.fromBuffer(e.slice(0,i))}catch(e){if(!(e instanceof a.d1))throw e;r=void 0}n=e}finally{s.releaseLock()}const o=new TransformStream({async start(e){e.enqueue(n)},transform(e,t){t.enqueue(e)}}),c=e.pipeThrough(o);return c.fileType=r,c}check(e,t){return te(this.buffer,e,t)}checkString(e,t){return this.check((i=e,[...i].map((e=>e.charCodeAt(0)))),t);var i}detectConfident=async e=>{if(this.buffer=new Uint8Array(J),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.detectConfident(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(V);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let i;return await new H(e).unzip((e=>{switch(e.filename){case"META-INF/mozilla.rsa":return i={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return i={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return{async handler(e){const t=new TextDecoder("utf-8").decode(e).trim();i=ee(t)},stop:!0};case"[Content_Types].xml":return{async handler(e){let t=new TextDecoder("utf-8").decode(e);const a=t.indexOf('.main+xml"');if(-1===a){const e="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";t.includes(`ContentType="${e}"`)&&(i=ee(e))}else{t=t.slice(0,Math.max(0,a));const e=t.lastIndexOf('"'),r=t.slice(Math.max(0,e+1));i=ee(r)}},stop:!0};default:return/classes\d*\.dex/.test(e.filename)?(i={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})),i??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const n=new Uint8Array(8);return await e.readBuffer(n),te(n,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:te(n,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:te(n,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:te(n,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:te(n,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:te(n,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{const s=1350;if(s===await e.ignore(s)){const o=10485760,c=new Uint8Array(Math.min(o,e.fileInfo.size-s));if(await e.readBuffer(c,{mayBeLess:!0}),(0,Z.mK)(c,(new TextEncoder).encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}}catch(l){if(!(l instanceof a.d1))throw l}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const m=await this.readTiffHeader(!1);if(m)return m}if(this.check([77,77])){const p=await this.readTiffHeader(!0);if(p)return p}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function u(){const t=await e.peekNumber(r.UINT8);let i=128,a=0;for(;0===(t&i)&&0!==i;)++a,i>>=1;const n=new Uint8Array(a+1);return await e.readBuffer(n),n}async function d(){const e=await u(),t=await u();t[0]^=128>>t.length-1;const i=Math.min(6,t.length),a=new DataView(e.buffer),r=new DataView(t.buffer,t.length-i,i);return{id:(0,Z.AW)(a),len:(0,Z.AW)(r)}}async function f(t){for(;t>0;){const i=await d();if(17026===i.id)return(await e.readToken(new r.StringType(i.len))).replaceAll(/\00.*$/g,"");await e.ignore(i.len),--t}}const h=await d();switch(await f(h.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const g=new r.StringType(4,"latin1").get(this.buffer,2);if(g.match("^d*")&&g>=1e3&&g<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),"debian-binary"===await e.readToken(new r.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((e=>this.checkString(e,{offset:6}))))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){async function T(){return{length:await e.readToken(r.INT32_BE),type:await e.readToken(new r.StringType(4,"latin1"))}}await e.ignore(8);do{const x=await T();if(x.length<0)return;switch(x.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(x.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const k=new r.StringType(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(k){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return k.startsWith("3g")?k.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function b(){const t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(r.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const y=await b();let v=y.size-24;if(te(y.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const w=new Uint8Array(16);if(v-=await e.readBuffer(w),te(w,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(te(w,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(v)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new r.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const I=new DataView(this.buffer.buffer).getUint32(12,!0);if(I>12&&this.buffer.length>=I+16)try{const A=(new TextDecoder).decode(this.buffer.slice(16,I+16));if(JSON.parse(A).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}return this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:this.checkString("SCRM",{offset:44})?{ext:"s3m",mime:"audio/x-s3m"}:this.check([71])&&this.check([71],{offset:188})||this.check([71],{offset:4})&&this.check([71],{offset:196})?{ext:"mts",mime:"video/mp2t"}:this.check([66,79,79,75,77,79,66,73],{offset:60})?{ext:"mobi",mime:"application/x-mobipocket-ebook"}:this.check([68,73,67,77],{offset:128})?{ext:"dcm",mime:"application/dicom"}:this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])?{ext:"lnk",mime:"application/x.ms.shortcut"}:this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])?{ext:"alias",mime:"application/x.apple.alias"}:this.checkString("Kaydara FBX Binary \0")?{ext:"fbx",mime:"application/x.autodesk.fbx"}:this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8}))?{ext:"eot",mime:"application/vnd.ms-fontobject"}:this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29])?{ext:"indd",mime:"application/x-indesign"}:(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const i=Number.parseInt(new r.StringType(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(i))return!1;let a=256;for(let i=t;i<t+148;i++)a+=e[i];for(let i=t+156;i<t+512;i++)a+=e[i];return i===a}(this.buffer)?{ext:"tar",mime:"application/x-tar"}:this.check([255,254])?this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0:this.checkString("-----BEGIN PGP MESSAGE-----")?{ext:"pgp",mime:"application/pgp-encrypted"}:void 0)};detectImprecise=async e=>{if(this.buffer=new Uint8Array(J),await e.peekBuffer(this.buffer,{length:Math.min(8,e.fileInfo.size),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}};async readTiffTag(e){const t=await this.tokenizer.readToken(e?r.UINT16_BE:r.UINT16_LE);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?r.UINT16_BE:r.UINT16_LE);for(let i=0;i<t;++i){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t=(e?r.UINT16_BE:r.UINT16_LE).get(this.buffer,2),i=(e?r.UINT32_BE:r.UINT32_LE).get(this.buffer,4);if(42===t){if(i>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(i>=8){const t=(e?r.UINT16_BE:r.UINT16_LE).get(this.buffer,8),i=(e?r.UINT16_BE:r.UINT16_LE).get(this.buffer,10);if(28===t&&254===i||31===t&&11===i)return{ext:"nef",mime:"image/x-nikon-nef"}}}return await this.tokenizer.ignore(i),await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(43===t)return{ext:"tif",mime:"image/tiff"}}}new Set(["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","rm","ppsm","ppsx"]),new Set(["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia"]);var ae=i(58597),re=i(50864),ne=i(45207);const se={multiple:!1},oe={year:se,track:se,disk:se,title:se,artist:se,artists:{multiple:!0,unique:!0},albumartist:se,album:se,date:se,originaldate:se,originalyear:se,releasedate:se,comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!1,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:se,subtitle:{multiple:!0},discsubtitle:se,totaltracks:se,totaldiscs:se,compilation:se,rating:{multiple:!0},bpm:se,mood:se,media:se,catalognumber:{multiple:!0,unique:!0},tvShow:se,tvShowSort:se,tvSeason:se,tvEpisode:se,tvEpisodeId:se,tvNetwork:se,podcast:se,podcasturl:se,releasestatus:se,releasetype:{multiple:!0},releasecountry:se,script:se,language:se,copyright:se,license:se,encodedby:se,encodersettings:se,gapless:se,barcode:se,isrc:{multiple:!0},asin:se,musicbrainz_recordingid:se,musicbrainz_trackid:se,musicbrainz_albumid:se,musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:se,musicbrainz_workid:se,musicbrainz_trmid:se,musicbrainz_discid:se,acoustid_id:se,acoustid_fingerprint:se,musicip_puid:se,musicip_fingerprint:se,website:se,"performer:instrument":{multiple:!0,unique:!0},averageLevel:se,peakLevel:se,notes:{multiple:!0,unique:!1},key:se,originalalbum:se,originalartist:se,discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:se,discogs_label_id:se,discogs_master_release_id:se,discogs_votes:se,discogs_rating:se,replaygain_track_peak:se,replaygain_track_gain:se,replaygain_album_peak:se,replaygain_album_gain:se,replaygain_track_minmax:se,replaygain_album_minmax:se,replaygain_undo:se,description:{multiple:!0},longDescription:se,category:{multiple:!0},hdVideo:se,keywords:{multiple:!0},movement:se,movementIndex:se,movementTotal:se,podcastId:se,showMovement:se,stik:se};class ce{static toIntOrNull(e){const t=Number.parseInt(e,10);return Number.isNaN(t)?null:t}static normalizeTrack(e){const t=e.toString().split("/");return{no:Number.parseInt(t[0],10)||null,of:Number.parseInt(t[1],10)||null}}constructor(e,t){this.tagTypes=e,this.tagMap=t}mapGenericTag(e,t){e={id:e.id,value:e.value},this.postMap(e,t);const i=this.getCommonName(e.id);return i?{id:i,value:e.value}:null}getCommonName(e){return this.tagMap[e]}postMap(e,t){}}ce.maxRatingScore=1;const le={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"};class me extends ce{constructor(){super(["ID3v1"],le)}}class pe extends ce{constructor(e,t){const i={};for(const e of Object.keys(t))i[e.toUpperCase()]=t[e];super(e,i)}getCommonName(e){return this.tagMap[e.toUpperCase()]}}var ue=i(56185);const de={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer",USLT:"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode","TXXX:ISRC":"isrc",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"releasedate",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl",GRP1:"grouping"};class fe extends pe{static toRating(e){return{source:e.email,rating:e.rating>0?(e.rating-1)/254*ce.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],de)}postMap(e,t){switch(e.id){case"UFID":{const t=e.value;"http://musicbrainz.org"===t.owner_identifier&&(e.id+=`:${t.owner_identifier}`,e.value=(0,ue.sc)(t.identifier,"latin1"))}break;case"PRIV":{const i=e.value;switch(i.owner_identifier){case"AverageLevel":case"PeakValue":e.id+=`:${i.owner_identifier}`,e.value=4===i.data.length?r.UINT32_LE.get(i.data,0):null,null===e.value&&t.addWarning("Failed to parse PRIV:PeakValue");break;default:t.addWarning(`Unknown PRIV owner-identifier: ${i.data}`)}}break;case"POPM":e.value=fe.toRating(e.value)}}}const he={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"};class ge extends ce{static toRating(e){return{rating:Number.parseFloat(e+1)/5}}constructor(){super(["asf"],he)}postMap(e){switch(e.id){case"WM/SharedUserRating":{const t=e.id.split(":");e.value=ge.toRating(e.value),e.id=t[0];break}}}}const Te={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"originalalbum",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm"};class xe extends pe{constructor(){super(["ID3v2.2"],Te)}}const ke={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Releasedate:"releasedate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"};class be extends pe{constructor(){super(["APEv2"],ke)}}const ye={"©nam":"title","©ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","©alb":"album","©day":"date","©cmt":"comment","©com":"comment",trkn:"track",disk:"disk","©gen":"genre",covr:"picture","©wrt":"composer","©lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","©grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","©cpy":"copyright","----:com.apple.iTunes:LICENSE":"license","©too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear","----:com.apple.iTunes:RELEASEDATE":"releasedate",desc:"description",ldes:"longDescription","©mvn":"movement","©mvi":"movementIndex","©mvc":"movementTotal","©wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik",rate:"rating"};class ve extends pe{constructor(){super(["iTunes"],ye)}postMap(e,t){"rate"===e.id&&(e.value={source:void 0,rating:Number.parseFloat(e.value)/100})}}const we={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",RELEASEDATE:"releasedate",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",KEY:"key",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"};class Ie extends ce{static toRating(e,t,i){return{source:e?e.toLowerCase():void 0,rating:Number.parseFloat(t)/i*ce.maxRatingScore}}constructor(){super(["vorbis"],we)}postMap(e){if("RATING"===e.id)e.value=Ie.toRating(void 0,e.value,100);else if(0===e.id.indexOf("RATING:")){const t=e.id.split(":");e.value=Ie.toRating(t[1],e.value,1),e.id=t[0]}}}const Ae={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",IPRT:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"};class Se extends ce{constructor(){super(["exif"],Ae)}}const Ee={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:DATE_RELEASED":"releasedate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"};class _e extends pe{constructor(){super(["matroska"],Ee)}}const Ce={NAME:"title",AUTH:"artist","(c) ":"copyright",ANNO:"comment"};class Me extends ce{constructor(){super(["AIFF"],Ce)}}var Re=i(63324);class ze{constructor(){this.tagMappers={},[new me,new xe,new fe,new ve,new ve,new Ie,new be,new ge,new Se,new _e,new Me].forEach((e=>{this.registerTagMapper(e)}))}mapTag(e,t,i){if(this.tagMappers[e])return this.tagMappers[e].mapGenericTag(t,i);throw new Re.nK(`No generic tag mapper defined for tag-format: ${e}`)}registerTagMapper(e){for(const t of e.tagTypes)this.tagMappers[t]=e}}var Ne=i(47675);const Le=B("music-metadata:collector"),Be=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","AIFF","ID3v1"];class Ue{constructor(e){this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null},movementIndex:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new ze,this.opts=e;let t=1;for(const e of Be)this.originPriority[e]=t++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(e){Le(`streamInfo: type=${e.type?ne.vQ[e.type]:"?"}, codec=${e.codecName}`),this.format.trackInfo.push(e)}setFormat(e,t){Le(`format: ${e} = ${t}`),this.format[e]=t,this.opts?.observer&&this.opts.observer({metadata:this,tag:{type:"format",id:e,value:t}})}async addTag(e,t,i){Le(`tag ${e}.${t} = ${i}`),this.native[e]||(this.format.tagTypes.push(e),this.native[e]=[]),this.native[e].push({id:t,value:i}),await this.toCommon(e,t,i)}addWarning(e){this.quality.warnings.push({message:e})}async postMap(e,t){switch(t.id){case"artist":if(this.commonOrigin.artist===this.originPriority[e])return this.postMap("artificial",{id:"artists",value:t.value});this.common.artists||this.setGenericTag("artificial",{id:"artists",value:t.value});break;case"artists":if(!(this.common.artist&&this.commonOrigin.artist!==this.originPriority.artificial||this.common.artists&&-1!==this.common.artists.indexOf(t.value))){const e={id:"artist",value:(i=(this.common.artists||[]).concat([t.value])).length>2?`${i.slice(0,i.length-1).join(", ")} & ${i[i.length-1]}`:i.join(" & ")};this.setGenericTag("artificial",e)}break;case"picture":return this.postFixPicture(t.value).then((i=>{null!==i&&(t.value=i,this.setGenericTag(e,t))}));case"totaltracks":return void(this.common.track.of=ce.toIntOrNull(t.value));case"totaldiscs":return void(this.common.disk.of=ce.toIntOrNull(t.value));case"movementTotal":return void(this.common.movementIndex.of=ce.toIntOrNull(t.value));case"track":case"disk":case"movementIndex":{const e=this.common[t.id].of;return this.common[t.id]=ce.normalizeTrack(t.value),void(this.common[t.id].of=null!=e?e:this.common[t.id].of)}case"bpm":case"year":case"originalyear":t.value=Number.parseInt(t.value,10);break;case"date":{const e=Number.parseInt(t.value.substr(0,4),10);Number.isNaN(e)||(this.common.year=e);break}case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":t.value="string"==typeof t.value?Number.parseInt(t.value,10):t.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":t.value=(0,ue.th)(t.value);break;case"replaygain_track_minmax":t.value=t.value.split(",").map((e=>Number.parseInt(e,10)));break;case"replaygain_undo":{const e=t.value.split(",").map((e=>Number.parseInt(e,10)));t.value={leftChannel:e[0],rightChannel:e[1]};break}case"gapless":case"compilation":case"podcast":case"showMovement":t.value="1"===t.value||1===t.value;break;case"isrc":{const e=this.common[t.id];if(e&&-1!==e.indexOf(t.value))return;break}case"comment":"string"==typeof t.value&&(t.value={text:t.value}),"iTunPGAP"===t.value.descriptor&&this.setGenericTag(e,{id:"gapless",value:"1"===t.value.text});break;case"lyrics":"string"==typeof t.value&&(t.value=function(e){const t=e.split("\n"),i=[],a=/\[(\d{2}):(\d{2})\.(\d{2})\]/;for(const e of t){const t=e.match(a);if(t){const r=1e3*(60*Number.parseInt(t[1],10)+Number.parseInt(t[2],10))+10*Number.parseInt(t[3],10),n=e.replace(a,"").trim();i.push({timestamp:r,text:n})}}return{contentType:Ne.MW.lyrics,timeStampFormat:Ne.sd.milliseconds,syncText:i}}(t.value))}var i;null!==t.value&&this.setGenericTag(e,t)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}async postFixPicture(e){if(e.data&&e.data.length>0){if(!e.format){const t=await Q(Uint8Array.from(e.data));if(!t)return null;e.format=t.mime}return e.format=e.format.toLocaleLowerCase(),"image/jpg"===e.format&&(e.format="image/jpeg"),e}return this.addWarning("Empty picture tag found"),null}async toCommon(e,t,i){const a={id:t,value:i},r=this.tagMapper.mapTag(e,a,this);r&&await this.postMap(e,r)}setGenericTag(e,t){Le(`common.${t.id} = ${t.value}`);const i=this.commonOrigin[t.id]||1e3,a=this.originPriority[e];if(r=t.id,oe[r]&&!oe[r].multiple){if(!(a<=i))return Le(`Ignore native tag (singleton): ${e}.${t.id} = ${t.value}`);this.common[t.id]=t.value,this.commonOrigin[t.id]=a}else if(a===i)!function(e){return!oe[e].multiple||oe[e].unique||!1}(t.id)||-1===this.common[t.id].indexOf(t.value)?this.common[t.id].push(t.value):Le(`Ignore duplicate value: ${e}.${t.id} = ${t.value}`);else{if(!(a<i))return Le(`Ignore native tag (list): ${e}.${t.id} = ${t.value}`);this.common[t.id]=[t.value],this.commonOrigin[t.id]=a}var r;this.opts?.observer&&this.opts.observer({metadata:this,tag:{type:"common",id:t.id,value:t.value}})}}const Pe={parserType:"mpeg",extensions:[".mp2",".mp3",".m2a",".aac","aacp"],mimeTypes:["audio/mpeg","audio/mp3","audio/aacs","audio/aacp"],load:async()=>(await Promise.all([i.e(8621),i.e(8764)]).then(i.bind(i,58764))).MpegParser},De={parserType:"apev2",extensions:[".ape"],mimeTypes:["audio/ape","audio/monkeys-audio"],load:async()=>(await Promise.resolve().then(i.bind(i,10283))).APEv2Parser},Oe={parserType:"asf",extensions:[".asf"],mimeTypes:["audio/ms-wma","video/ms-wmv","audio/ms-asf","video/ms-asf","application/vnd.ms-asf"],load:async()=>(await i.e(2626).then(i.bind(i,72626))).AsfParser},Fe={parserType:"dsdiff",extensions:[".dff"],mimeTypes:["audio/dsf","audio/dsd"],load:async()=>(await Promise.all([i.e(8621),i.e(7408)]).then(i.bind(i,47408))).DsdiffParser},Xe={parserType:"aiff",extensions:[".aif","aiff","aifc"],mimeTypes:["audio/aiff","audio/aif","audio/aifc","application/aiff"],load:async()=>(await Promise.all([i.e(8621),i.e(8790)]).then(i.bind(i,78790))).AIFFParser},Ge={parserType:"dsf",extensions:[".dsf"],mimeTypes:["audio/dsf"],load:async()=>(await Promise.all([i.e(8621),i.e(46)]).then(i.bind(i,60046))).DsfParser},We={parserType:"flac",extensions:[".flac"],mimeTypes:["audio/flac"],load:async()=>(await Promise.all([i.e(8621),i.e(2465)]).then(i.bind(i,62465))).FlacParser},je={parserType:"matroska",extensions:[".mka",".mkv",".mk3d",".mks","webm"],mimeTypes:["audio/matroska","video/matroska","audio/webm","video/webm"],load:async()=>(await i.e(1930).then(i.bind(i,21930))).MatroskaParser},$e={parserType:"mp4",extensions:[".mp4",".m4a",".m4b",".m4pa","m4v","m4r","3gp"],mimeTypes:["audio/mp4","audio/m4a","video/m4v","video/mp4"],load:async()=>(await i.e(3272).then(i.bind(i,53272))).MP4Parser},qe={parserType:"musepack",extensions:[".mpc"],mimeTypes:["audio/musepack"],load:async()=>(await Promise.all([i.e(8621),i.e(984)]).then(i.bind(i,60984))).MusepackParser},He={parserType:"ogg",extensions:[".ogg",".ogv",".oga",".ogm",".ogx",".opus",".spx"],mimeTypes:["audio/ogg","audio/opus","audio/speex","video/ogg"],load:async()=>(await i.e(628).then(i.bind(i,30628))).OggParser},Ye={parserType:"wavpack",extensions:[".wv",".wvp"],mimeTypes:["audio/wavpack"],load:async()=>(await i.e(5420).then(i.bind(i,35420))).WavPackParser},Ke={parserType:"riff",extensions:[".wav","wave",".bwf"],mimeTypes:["audio/vnd.wave","audio/wav","audio/wave"],load:async()=>(await Promise.all([i.e(8621),i.e(6438)]).then(i.bind(i,66438))).WaveParser},Ze=B("music-metadata:parser:factory");class Ve{constructor(){this.parsers=[],[We,Pe,De,$e,je,Ke,He,Oe,Xe,Ye,qe,Ge,Fe].forEach((e=>this.registerParser(e)))}registerParser(e){this.parsers.push(e)}async parse(e,t,i){if(e.supportsRandomAccess()?(Ze("tokenizer supports random-access, scanning for appending headers"),await at(e,i)):Ze("tokenizer does not support random-access, cannot scan for appending headers"),!t){const i=new Uint8Array(4100);if(e.fileInfo.mimeType&&(t=this.findLoaderForContentType(e.fileInfo.mimeType)),!t&&e.fileInfo.path&&(t=this.findLoaderForExtension(e.fileInfo.path)),!t){Ze("Guess parser on content..."),await e.peekBuffer(i,{mayBeLess:!0});const a=await Q(i);if(!a||!a.mime)throw new Re.e6("Failed to determine audio format");if(Ze(`Guessed file type is mime=${a.mime}, extension=${a.ext}`),!(t=this.findLoaderForContentType(a.mime)))throw new Re.qq(`Guessed MIME-type not supported: ${a.mime}`)}}Ze(`Loading ${t.parserType} parser...`);const a=new Ue(i),r=new(await t.load())(a,e,i??{});return Ze(`Parser ${t.parserType} loaded`),await r.parse(),a.toCommonMetadata()}findLoaderForExtension(e){if(!e)return;const t=function(e){const t=e.lastIndexOf(".");return-1===t?"":e.slice(t)}(e).toLocaleLowerCase()||e;return this.parsers.find((e=>-1!==e.extensions.indexOf(t)))}findLoaderForContentType(e){let t;if(!e)return;try{t=function(e){const t=ae.parse(e),i=(0,re.qg)(t.type);return{type:i.type,subtype:i.subtype,suffix:i.suffix,parameters:t.parameters}}(e)}catch(t){return void Ze(`Invalid HTTP Content-Type header value: ${e}`)}const i=0===t.subtype.indexOf("x-")?t.subtype.substring(2):t.subtype;return this.parsers.find((e=>e.mimeTypes.find((e=>-1!==e.indexOf(`${t.type}/${i}`)))))}getSupportedMimeTypes(){const e=new Set;return this.parsers.forEach((t=>{t.mimeTypes.forEach((t=>{e.add(t),e.add(t.replace("/","/x-"))}))})),Array.from(e)}}var Je=i(10283),Qe=i(68191);const et="LYRICS200";async function tt(e,t={}){const i={mimeType:e.type,size:e.size};return e instanceof File&&(i.path=e.name),async function(e,t,i={}){const r=(0,a.Xx)(e,{fileInfo:"string"==typeof t?{mimeType:t}:t});try{return await function(e,t){return(new Ve).parse(e,void 0,t)}(r,i)}finally{await r.close()}}(e.stream(),i,t)}function it(e){return e?e.reduce(((e,t)=>t.name&&t.name.toLowerCase()in["front","cover","cover (front)"]?t:e)):null}async function at(e,t={}){let i=e.fileInfo.size;if(await(0,Qe.zc)(e)){i-=128;const t=await async function(e){const t=e.fileInfo.size;if(t>=143){const i=new Uint8Array(15),a=e.position;await e.readBuffer(i,{position:t-143}),e.setPosition(a);const r=new TextDecoder("latin1").decode(i);if(r.slice(6)===et)return Number.parseInt(r.slice(0,6),10)+15}return 0}(e);i-=t}t.apeHeader=await Je.APEv2Parser.findApeFooterOffset(e,i)}},4017:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AnsiStringType:()=>L,Float16_BE:()=>w,Float16_LE:()=>I,Float32_BE:()=>A,Float32_LE:()=>S,Float64_BE:()=>E,Float64_LE:()=>_,Float80_BE:()=>C,Float80_LE:()=>M,INT16_BE:()=>d,INT16_LE:()=>f,INT24_BE:()=>g,INT24_LE:()=>h,INT32_BE:()=>T,INT32_LE:()=>x,INT64_BE:()=>v,INT64_LE:()=>b,INT8:()=>u,IgnoreType:()=>R,StringType:()=>N,UINT16_BE:()=>o,UINT16_LE:()=>s,UINT24_BE:()=>l,UINT24_LE:()=>c,UINT32_BE:()=>p,UINT32_LE:()=>m,UINT64_BE:()=>y,UINT64_LE:()=>k,UINT8:()=>n,Uint8ArrayType:()=>z});var a=i(251);function r(e){return new DataView(e.buffer,e.byteOffset)}const n={len:1,get:(e,t)=>r(e).getUint8(t),put:(e,t,i)=>(r(e).setUint8(t,i),t+1)},s={len:2,get:(e,t)=>r(e).getUint16(t,!0),put:(e,t,i)=>(r(e).setUint16(t,i,!0),t+2)},o={len:2,get:(e,t)=>r(e).getUint16(t),put:(e,t,i)=>(r(e).setUint16(t,i),t+2)},c={len:3,get(e,t){const i=r(e);return i.getUint8(t)+(i.getUint16(t+1,!0)<<8)},put(e,t,i){const a=r(e);return a.setUint8(t,255&i),a.setUint16(t+1,i>>8,!0),t+3}},l={len:3,get(e,t){const i=r(e);return(i.getUint16(t)<<8)+i.getUint8(t+2)},put(e,t,i){const a=r(e);return a.setUint16(t,i>>8),a.setUint8(t+2,255&i),t+3}},m={len:4,get:(e,t)=>r(e).getUint32(t,!0),put:(e,t,i)=>(r(e).setUint32(t,i,!0),t+4)},p={len:4,get:(e,t)=>r(e).getUint32(t),put:(e,t,i)=>(r(e).setUint32(t,i),t+4)},u={len:1,get:(e,t)=>r(e).getInt8(t),put:(e,t,i)=>(r(e).setInt8(t,i),t+1)},d={len:2,get:(e,t)=>r(e).getInt16(t),put:(e,t,i)=>(r(e).setInt16(t,i),t+2)},f={len:2,get:(e,t)=>r(e).getInt16(t,!0),put:(e,t,i)=>(r(e).setInt16(t,i,!0),t+2)},h={len:3,get(e,t){const i=c.get(e,t);return i>8388607?i-16777216:i},put(e,t,i){const a=r(e);return a.setUint8(t,255&i),a.setUint16(t+1,i>>8,!0),t+3}},g={len:3,get(e,t){const i=l.get(e,t);return i>8388607?i-16777216:i},put(e,t,i){const a=r(e);return a.setUint16(t,i>>8),a.setUint8(t+2,255&i),t+3}},T={len:4,get:(e,t)=>r(e).getInt32(t),put:(e,t,i)=>(r(e).setInt32(t,i),t+4)},x={len:4,get:(e,t)=>r(e).getInt32(t,!0),put:(e,t,i)=>(r(e).setInt32(t,i,!0),t+4)},k={len:8,get:(e,t)=>r(e).getBigUint64(t,!0),put:(e,t,i)=>(r(e).setBigUint64(t,i,!0),t+8)},b={len:8,get:(e,t)=>r(e).getBigInt64(t,!0),put:(e,t,i)=>(r(e).setBigInt64(t,i,!0),t+8)},y={len:8,get:(e,t)=>r(e).getBigUint64(t),put:(e,t,i)=>(r(e).setBigUint64(t,i),t+8)},v={len:8,get:(e,t)=>r(e).getBigInt64(t),put:(e,t,i)=>(r(e).setBigInt64(t,i),t+8)},w={len:2,get(e,t){return a.read(e,t,!1,10,this.len)},put(e,t,i){return a.write(e,i,t,!1,10,this.len),t+this.len}},I={len:2,get(e,t){return a.read(e,t,!0,10,this.len)},put(e,t,i){return a.write(e,i,t,!0,10,this.len),t+this.len}},A={len:4,get:(e,t)=>r(e).getFloat32(t),put:(e,t,i)=>(r(e).setFloat32(t,i),t+4)},S={len:4,get:(e,t)=>r(e).getFloat32(t,!0),put:(e,t,i)=>(r(e).setFloat32(t,i,!0),t+4)},E={len:8,get:(e,t)=>r(e).getFloat64(t),put:(e,t,i)=>(r(e).setFloat64(t,i),t+8)},_={len:8,get:(e,t)=>r(e).getFloat64(t,!0),put:(e,t,i)=>(r(e).setFloat64(t,i,!0),t+8)},C={len:10,get(e,t){return a.read(e,t,!1,63,this.len)},put(e,t,i){return a.write(e,i,t,!1,63,this.len),t+this.len}},M={len:10,get(e,t){return a.read(e,t,!0,63,this.len)},put(e,t,i){return a.write(e,i,t,!0,63,this.len),t+this.len}};class R{constructor(e){this.len=e}get(e,t){}}class z{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}}class N{constructor(e,t){this.len=e,this.encoding=t,this.textDecoder=new TextDecoder(t)}get(e,t){return this.textDecoder.decode(e.subarray(t,t+this.len))}}class L{constructor(e){this.len=e,this.textDecoder=new TextDecoder("windows-1252")}get(e,t=0){return this.textDecoder.decode(e.subarray(t,t+this.len))}}},5031:(e,t,i)=>{"use strict";i.d(t,{e:()=>o});var a=i(78523),r=i(56185),n=i(63324);const s=/^[\x21-\x7e©][\x20-\x7e\x00()]{3}/,o={len:4,get:(e,t)=>{const i=(0,a.SW)(e.slice(t,t+o.len),"latin1");if(!i.match(s))throw new n.gP(`FourCC contains invalid characters: ${r.DY(i)} "${i}"`);return i},put:(e,t,i)=>{const r=(0,a.Al)(i);if(4!==r.length)throw new n.nK("Invalid length");return e.set(r,t),t+4}}},6585:e=>{var t=1e3,i=60*t,a=60*i,r=24*a,n=7*r;function s(e,t,i,a){var r=t>=1.5*i;return Math.round(e/i)+" "+a+(r?"s":"")}e.exports=function(e,o){o=o||{};var c,l,m=typeof e;if("string"===m&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return o*n;case"days":case"day":case"d":return o*r;case"hours":case"hour":case"hrs":case"hr":case"h":return o*a;case"minutes":case"minute":case"mins":case"min":case"m":return o*i;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(e);if("number"===m&&isFinite(e))return o.long?(c=e,(l=Math.abs(c))>=r?s(c,l,r,"day"):l>=a?s(c,l,a,"hour"):l>=i?s(c,l,i,"minute"):l>=t?s(c,l,t,"second"):c+" ms"):function(e){var n=Math.abs(e);return n>=r?Math.round(e/r)+"d":n>=a?Math.round(e/a)+"h":n>=i?Math.round(e/i)+"m":n>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},10283:(e,t,i)=>{"use strict";i.r(t),i.d(t,{APEv2Parser:()=>y,ApeContentError:()=>b});var a=i(17833),r=i(93853),n=i(4017),s=i(78523),o=i(56185),c=i(74604),l=i(5031);const m={len:52,get:(e,t)=>({ID:l.e.get(e,t),version:n.UINT32_LE.get(e,t+4)/1e3,descriptorBytes:n.UINT32_LE.get(e,t+8),headerBytes:n.UINT32_LE.get(e,t+12),seekTableBytes:n.UINT32_LE.get(e,t+16),headerDataBytes:n.UINT32_LE.get(e,t+20),apeFrameDataBytes:n.UINT32_LE.get(e,t+24),apeFrameDataBytesHigh:n.UINT32_LE.get(e,t+28),terminatingDataBytes:n.UINT32_LE.get(e,t+32),fileMD5:new n.Uint8ArrayType(16).get(e,t+36)})},p={len:24,get:(e,t)=>({compressionLevel:n.UINT16_LE.get(e,t),formatFlags:n.UINT16_LE.get(e,t+2),blocksPerFrame:n.UINT32_LE.get(e,t+4),finalFrameBlocks:n.UINT32_LE.get(e,t+8),totalFrames:n.UINT32_LE.get(e,t+12),bitsPerSample:n.UINT16_LE.get(e,t+16),channel:n.UINT16_LE.get(e,t+18),sampleRate:n.UINT32_LE.get(e,t+20)})},u={len:32,get:(e,t)=>({ID:new n.StringType(8,"ascii").get(e,t),version:n.UINT32_LE.get(e,t+8),size:n.UINT32_LE.get(e,t+12),fields:n.UINT32_LE.get(e,t+16),flags:f(n.UINT32_LE.get(e,t+20))})},d={len:8,get:(e,t)=>({size:n.UINT32_LE.get(e,t),flags:f(n.UINT32_LE.get(e,t+4))})};function f(e){return{containsHeader:h(e,31),containsFooter:h(e,30),isHeader:h(e,29),readOnly:h(e,0),dataType:(6&e)>>1}}function h(e,t){return!!(e&1<<t)}var g=i(63324);const T=a("music-metadata:parser:APEv2"),x="APEv2",k="APETAGEX";class b extends((0,g.fO)("APEv2")){}class y extends c.s{constructor(){super(...arguments),this.ape={}}static tryParseApeHeader(e,t,i){return new y(e,t,i).tryParseApeHeader()}static calculateDuration(e){let t=e.totalFrames>1?e.blocksPerFrame*(e.totalFrames-1):0;return t+=e.finalFrameBlocks,t/e.sampleRate}static async findApeFooterOffset(e,t){const i=new Uint8Array(u.len),a=e.position;if(t<=u.len)T(`Offset is too small to read APE footer: offset=${t}`);else if(t>u.len){await e.readBuffer(i,{position:t-u.len}),e.setPosition(a);const r=u.get(i,0);if("APETAGEX"===r.ID)return r.flags.isHeader?T("APE Header found at offset="+(t-u.len)):(T("APE Footer found at offset="+(t-u.len)),t-=r.size),{footer:r,offset:t}}}static parseTagFooter(e,t,i){const a=u.get(t,t.length-u.len);if(a.ID!==k)throw new b("Unexpected APEv2 Footer ID preamble value");return r.vY(t),new y(e,r.vY(t),i).parseTags(a)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position<u.len)return void T("No APEv2 header found, end-of-file reached");const e=await this.tokenizer.peekToken(u);if(e.ID===k)return await this.tokenizer.ignore(u.len),this.parseTags(e);if(T(`APEv2 header not found at offset=${this.tokenizer.position}`),this.tokenizer.fileInfo.size){const e=this.tokenizer.fileInfo.size-this.tokenizer.position,t=new Uint8Array(e);return await this.tokenizer.readBuffer(t),y.parseTagFooter(this.metadata,t,this.options)}}async parse(){const e=await this.tokenizer.readToken(m);if("MAC "!==e.ID)throw new b("Unexpected descriptor ID");this.ape.descriptor=e;const t=e.descriptorBytes-m.len,i=await(t>0?this.parseDescriptorExpansion(t):this.parseHeader());return await this.tokenizer.ignore(i.forwardBytes),this.tryParseApeHeader()}async parseTags(e){const t=new Uint8Array(256);let i=e.size-u.len;T(`Parse APE tags at offset=${this.tokenizer.position}, size=${i}`);for(let a=0;a<e.fields;a++){if(i<d.len){this.metadata.addWarning(`APEv2 Tag-header: ${e.fields-a} items remaining, but no more tag data to read.`);break}const r=await this.tokenizer.readToken(d);i-=d.len+r.size,await this.tokenizer.peekBuffer(t,{length:Math.min(t.length,i)});let c=o.sX(t,0,t.length);const l=await this.tokenizer.readToken(new n.StringType(c,"ascii"));switch(await this.tokenizer.ignore(1),i-=l.length+1,r.flags.dataType){case 0:{const e=(await this.tokenizer.readToken(new n.StringType(r.size,"utf8"))).split(/\x00/g);await Promise.all(e.map((e=>this.metadata.addTag(x,l,e))));break}case 1:if(this.options.skipCovers)await this.tokenizer.ignore(r.size);else{const e=new Uint8Array(r.size);await this.tokenizer.readBuffer(e),c=o.sX(e,0,e.length);const t=(0,s.SW)(e.slice(0,c)),i=e.slice(c+1);await this.metadata.addTag(x,l,{description:t,data:i})}break;case 2:T(`Ignore external info ${l}`),await this.tokenizer.ignore(r.size);break;case 3:T(`Ignore external info ${l}`),this.metadata.addWarning(`APEv2 header declares a reserved datatype for "${l}"`),await this.tokenizer.ignore(r.size)}}}async parseDescriptorExpansion(e){return await this.tokenizer.ignore(e),this.parseHeader()}async parseHeader(){const e=await this.tokenizer.readToken(p);if(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("container","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",e.bitsPerSample),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.channel),this.metadata.setFormat("duration",y.calculateDuration(e)),!this.ape.descriptor)throw new b("Missing APE descriptor");return{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}}},17833:(e,t,i)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;t.splice(1,0,i,"color: inherit");let a=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(a++,"%c"===e&&(r=a))})),t.splice(r,0,i)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=i(40736)(t);const{formatters:a}=e.exports;a.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},40736:(e,t,i)=>{e.exports=function(e){function t(e){let i,r,n,s=null;function o(...e){if(!o.enabled)return;const a=o,r=Number(new Date),n=r-(i||r);a.diff=n,a.prev=i,a.curr=r,i=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,r)=>{if("%%"===i)return"%";s++;const n=t.formatters[r];if("function"==typeof n){const t=e[s];i=n.call(a,t),e.splice(s,1),s--}return i})),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=a,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(r!==t.namespaces&&(r=t.namespaces,n=t.enabled(e)),n),set:e=>{s=e}}),"function"==typeof t.init&&t.init(o),o}function a(e,i){const a=t(this.namespace+(void 0===i?":":i)+e);return a.log=this.log,a}function r(e,t){let i=0,a=0,r=-1,n=0;for(;i<e.length;)if(a<t.length&&(t[a]===e[i]||"*"===t[a]))"*"===t[a]?(r=a,n=i,a++):(i++,a++);else{if(-1===r)return!1;a=r+1,n++,i=n}for(;a<t.length&&"*"===t[a];)a++;return a===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of i)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const i of t.skips)if(r(e,i))return!1;for(const i of t.names)if(r(e,i))return!0;return!1},t.humanize=i(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{t[i]=e[i]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let i=0;for(let t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return t.colors[Math.abs(i)%t.colors.length]},t.enable(t.load()),t}},45207:(e,t,i)=>{"use strict";i.d(t,{S:()=>r,vQ:()=>n,yK:()=>a});const a={10:"shot",20:"scene",30:"track",40:"part",50:"album",60:"edition",70:"collection"},r={video:1,audio:2,complex:3,logo:4,subtitle:17,button:18,control:32},n={[r.video]:"video",[r.audio]:"audio",[r.complex]:"complex",[r.logo]:"logo",[r.subtitle]:"subtitle",[r.button]:"button",[r.control]:"control"}},47675:(e,t,i)=>{"use strict";i.d(t,{Jp:()=>u,MW:()=>s,St:()=>c,YF:()=>p,aY:()=>d,n5:()=>n,nl:()=>m,sd:()=>o,yW:()=>l});var a=i(4017),r=i(56185);const n={0:"Other",1:"32x32 pixels 'file icon' (PNG only)",2:"Other file icon",3:"Cover (front)",4:"Cover (back)",5:"Leaflet page",6:"Media (e.g. label side of CD)",7:"Lead artist/lead performer/soloist",8:"Artist/performer",9:"Conductor",10:"Band/Orchestra",11:"Composer",12:"Lyricist/text writer",13:"Recording Location",14:"During recording",15:"During performance",16:"Movie/video screen capture",17:"A bright coloured fish",18:"Illustration",19:"Band/artist logotype",20:"Publisher/Studio logotype"},s={other:0,lyrics:1,text:2,movement_part:3,events:4,chord:5,trivia_pop:6},o={notSynchronized0:0,mpegFrameNumber:1,milliseconds:2},c={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},l={len:10,get:(e,t)=>({fileIdentifier:new a.StringType(3,"ascii").get(e,t),version:{major:a.INT8.get(e,t+3),revision:a.INT8.get(e,t+4)},flags:{unsynchronisation:r.mh(e,t+5,7),isExtendedHeader:r.mh(e,t+5,6),expIndicator:r.mh(e,t+5,5),footer:r.mh(e,t+5,4)},size:c.get(e,t+6)})},m={len:10,get:(e,t)=>({size:a.UINT32_BE.get(e,t),extendedFlags:a.UINT16_BE.get(e,t+4),sizeOfPadding:a.UINT32_BE.get(e,t+6),crcDataPresent:r.mh(e,t+4,31)})},p={len:1,get:(e,t)=>{switch(e[t]){case 0:return{encoding:"latin1"};case 1:return{encoding:"utf-16le",bom:!0};case 2:return{encoding:"utf-16le",bom:!1};default:return{encoding:"utf8",bom:!1}}}},u={len:4,get:(e,t)=>({encoding:p.get(e,t),language:new a.StringType(3,"latin1").get(e,t+1)})},d={len:6,get:(e,t)=>{const i=u.get(e,t);return{encoding:i.encoding,language:i.language,timeStampFormat:a.UINT8.get(e,t+4),contentType:a.UINT8.get(e,t+5)}}}},50864:(e,t)=>{"use strict";var i=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;function a(e,t,i){this.type=e,this.subtype=t,this.suffix=i}t.qg=function(e){if(!e)throw new TypeError("argument string is required");if("string"!=typeof e)throw new TypeError("argument string is required to be a string");var t=i.exec(e.toLowerCase());if(!t)throw new TypeError("invalid media type");var r,n=t[1],s=t[2],o=s.lastIndexOf("+");return-1!==o&&(r=s.substr(o+1),s=s.substr(0,o)),new a(n,s,r)}},56185:(e,t,i)=>{"use strict";i.d(t,{DY:()=>u,F6:()=>l,cD:()=>p,f5:()=>m,mh:()=>n,qW:()=>o,sX:()=>s,sc:()=>c,th:()=>d});var a=i(4017),r=i(63324);function n(e,t,i){return!!(e[t]&1<<i)}function s(e,t,i,a){let r=t;if("utf-16le"===a){for(;0!==e[r]||0!==e[r+1];){if(r>=i)return i;r+=2}return r}for(;0!==e[r];){if(r>=i)return i;r++}return r}function o(e){const t=e.indexOf("\0");return-1===t?e:e.substr(0,t)}function c(e,t){if(255===e[0]&&254===e[1])return c(e.subarray(2),t);if("utf-16le"===t&&254===e[0]&&255===e[1]){if(1&e.length)throw new r.gP("Expected even number of octets for 16-bit unicode string");return c(function(e){const t=e.length;if(1&t)throw new r.gP("Buffer length must be even");for(let i=0;i<t;i+=2){const t=e[i];e[i]=e[i+1],e[i+1]=t}return e}(e),t)}return new a.StringType(e.length,t).get(e,0)}function l(e){return(e=e.replace(/^\x00+/g,"")).replace(/\x00+$/g,"")}function m(e,t,i,a){const r=i%8;let n=e[t+~~(i/8)];n&=255>>r;const s=8-r,o=a-s;return o<0?n>>=8-r-a:o>0&&(n<<=o,n|=m(e,t,i+s,o)),n}function p(e,t,i){return 1===m(e,t,i,1)}function u(e){const t=[];for(let i=0,a=e.length;i<a;i++){const a=Number(e.charCodeAt(i)).toString(16);t.push(1===a.length?`0${a}`:a)}return t.join(" ")}function d(e){const t=e.split(" ").map((e=>e.trim().toLowerCase()));if(t.length>=1){const e=Number.parseFloat(t[0]);return 2===t.length&&"db"===t[1]?{dB:e,ratio:(a=e,10**(a/10))}:{dB:(i=e,10*Math.log10(i)),ratio:e}}var i,a}},58597:(e,t)=>{"use strict";var i=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,a=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function c(e){var t=String(e);if(r.test(t))return t;if(t.length>0&&!a.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(s,"\\$1")+'"'}function l(e){this.parameters=Object.create(null),this.type=e}t.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,i=e.type;if(!i||!o.test(i))throw new TypeError("invalid type");var a=i;if(t&&"object"==typeof t)for(var n,s=Object.keys(t).sort(),l=0;l<s.length;l++){if(n=s[l],!r.test(n))throw new TypeError("invalid parameter name");a+="; "+n+"="+c(t[n])}return a},t.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var a=t.indexOf(";"),r=-1!==a?t.slice(0,a).trim():t.trim();if(!o.test(r))throw new TypeError("invalid media type");var s=new l(r.toLowerCase());if(-1!==a){var c,m,p;for(i.lastIndex=a;m=i.exec(t);){if(m.index!==a)throw new TypeError("invalid parameter format");a+=m[0].length,c=m[1].toLowerCase(),34===(p=m[2]).charCodeAt(0)&&-1!==(p=p.slice(1,-1)).indexOf("\\")&&(p=p.replace(n,"$1")),s.parameters[c]=p}if(a!==t.length)throw new TypeError("invalid parameter format")}return s}},63324:(e,t,i)=>{"use strict";i.d(t,{e6:()=>r,fO:()=>l,gP:()=>o,nK:()=>c,qq:()=>n});const a=e=>class extends Error{constructor(t){super(t),this.name=e}};class r extends(a("CouldNotDetermineFileTypeError")){}class n extends(a("UnsupportedFileTypeError")){}class s extends(a("UnexpectedFileContentError")){constructor(e,t){super(t),this.fileType=e}toString(){return`${this.name} (FileType: ${this.fileType}): ${this.message}`}}class o extends(a("FieldDecodingError")){}class c extends(a("InternalParserError")){}const l=e=>class extends s{constructor(t){super(e,t)}}},68191:(e,t,i)=>{"use strict";i.d(t,{Bn:()=>u,jR:()=>l,zc:()=>d});var a=i(17833),r=i(4017),n=i(56185),s=i(74604),o=i(10283);const c=a("music-metadata:parser:ID3v1"),l=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"],m={len:128,get:(e,t)=>{const i=new p(3).get(e,t);return"TAG"===i?{header:i,title:new p(30).get(e,t+3),artist:new p(30).get(e,t+33),album:new p(30).get(e,t+63),year:new p(4).get(e,t+93),comment:new p(28).get(e,t+97),zeroByte:r.UINT8.get(e,t+127),track:r.UINT8.get(e,t+126),genre:r.UINT8.get(e,t+127)}:null}};class p{constructor(e){this.len=e,this.stringType=new r.StringType(e,"latin1")}get(e,t){let i=this.stringType.get(e,t);return i=n.qW(i),i=i.trim(),i.length>0?i:void 0}}class u extends s.s{constructor(e,t,i){super(e,t,i),this.apeHeader=i.apeHeader}static getGenre(e){if(e<l.length)return l[e]}async parse(){if(!this.tokenizer.fileInfo.size)return void c("Skip checking for ID3v1 because the file-size is unknown");if(this.apeHeader){this.tokenizer.ignore(this.apeHeader.offset-this.tokenizer.position);const e=new o.APEv2Parser(this.metadata,this.tokenizer,this.options);await e.parseTags(this.apeHeader.footer)}const e=this.tokenizer.fileInfo.size-m.len;if(this.tokenizer.position>e)return void c("Already consumed the last 128 bytes");const t=await this.tokenizer.readToken(m,e);if(t){c("ID3v1 header found at: pos=%s",this.tokenizer.fileInfo.size-m.len);const e=["title","artist","album","comment","track","year"];for(const i of e)t[i]&&""!==t[i]&&await this.addTag(i,t[i]);const i=u.getGenre(t.genre);i&&await this.addTag("genre",i)}else c("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-m.len)}async addTag(e,t){await this.metadata.addTag("ID3v1",e,t)}}async function d(e){if(e.fileInfo.size>=128){const t=new Uint8Array(3),i=e.position;return await e.readBuffer(t,{position:e.fileInfo.size-128}),e.setPosition(i),"TAG"===new TextDecoder("latin1").decode(t)}return!1}},74604:(e,t,i)=>{"use strict";i.d(t,{s:()=>a});class a{constructor(e,t,i){this.metadata=e,this.tokenizer=t,this.options=i}}},78523:(e,t,i)=>{"use strict";i.d(t,{AS:()=>g,AW:()=>T,Al:()=>u,EY:()=>f,SW:()=>l,mK:()=>x});const a=Object.prototype.toString,r="[object Uint8Array]",n="[object ArrayBuffer]";function s(e,t,i){return!!e&&(e.constructor===t||a.call(e)===i)}function o(e){return s(e,Uint8Array,r)}const c={utf8:new globalThis.TextDecoder("utf8")};function l(e,t="utf8"){return function(e){if(!function(e){return o(e)||function(e){return s(e,ArrayBuffer,n)}(e)}(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}(e),c[t]??=new globalThis.TextDecoder(t),c[t].decode(e)}function m(e){if("string"!=typeof e)throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}const p=new globalThis.TextEncoder;function u(e){return m(e),p.encode(e)}const d=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function f(e){!function(e){if(!o(e))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}(e);let t="";for(let i=0;i<e.length;i++)t+=d[e[i]];return t}const h={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function g(e){if(m(e),e.length%2!=0)throw new Error("Invalid Hex string length.");const t=e.length/2,i=new Uint8Array(t);for(let a=0;a<t;a++){const t=h[e[2*a]],r=h[e[2*a+1]];if(void 0===t||void 0===r)throw new Error("Invalid Hex character encountered at position "+2*a);i[a]=t<<4|r}return i}function T(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}function x(e,t){return-1!==function(e,t){const i=e.length,a=t.length;if(0===a)return-1;if(a>i)return-1;const r=i-a;for(let i=0;i<=r;i++){let r=!0;for(let n=0;n<a;n++)if(e[i+n]!==t[n]){r=!1;break}if(r)return i}return-1}(e,t)}},93853:(e,t,i)=>{"use strict";i.d(t,{d1:()=>a,vY:()=>d,Xx:()=>u});class a extends Error{constructor(){super("End-Of-Stream"),this.name="EndOfStreamError"}}class r extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}}class n{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){const i=await this.read(e,t);return this.peekQueue.push(e.subarray(0,i)),i}async read(e,t=!1){if(0===e.length)return 0;let i=this.readFromPeekBuffer(e);if(this.endOfStream||(i+=await this.readRemainderFromStream(e.subarray(i),t)),0===i)throw new a;return i}readFromPeekBuffer(e){let t=e.length,i=0;for(;this.peekQueue.length>0&&t>0;){const a=this.peekQueue.pop();if(!a)throw new Error("peekData should be defined");const r=Math.min(a.length,t);e.set(a.subarray(0,r),i),i+=r,t-=r,r<a.length&&this.peekQueue.push(a.subarray(r))}return i}async readRemainderFromStream(e,t){let i=0;for(;i<e.length&&!this.endOfStream;){if(this.interrupted)throw new r;const a=await this.readFromStream(e.subarray(i),t);if(0===a)break;i+=a}if(!t&&i<e.length)throw new a;return i}}class s extends n{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}}class o extends s{async readFromStream(e,t){if(0===e.length)return 0;const i=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return i.done&&(this.endOfStream=i.done),i.value?(e.set(i.value),i.value.length):0}}class c extends n{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){const i=Math.min(t.length,e.length);return e.set(t.subarray(0,i)),i<t.length?this.buffer=t.subarray(i):this.buffer=null,i}async readFromStream(e,t){if(0===e.length)return 0;let i=0;for(this.buffer&&(i+=this.writeChunk(e,this.buffer));i<e.length&&!this.endOfStream;){const t=await this.reader.read();if(t.done){this.endOfStream=!0;break}t.value&&(i+=this.writeChunk(e.subarray(i),t.value))}if(0===i&&this.endOfStream)throw new a;return i}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}class l{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",(()=>{this.abort()}))}async readToken(e,t=this.position){const i=new Uint8Array(e.len);if(await this.readBuffer(i,{position:t})<e.len)throw new a;return e.get(i,0)}async peekToken(e,t=this.position){const i=new Uint8Array(e.len);if(await this.peekBuffer(i,{position:t})<e.len)throw new a;return e.get(i,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new a;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new a;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await(this.onClose?.())}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}}class m extends l{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){const i=this.normalizeOptions(e,t),r=i.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===i.length)return 0;const n=await this.streamReader.read(e.subarray(0,i.length),i.mayBeLess);if(this.position+=n,(!t||!t.mayBeLess)&&n<i.length)throw new a;return n}async peekBuffer(e,t){const i=this.normalizeOptions(e,t);let r=0;if(i.position){const t=i.position-this.position;if(t>0){const a=new Uint8Array(i.length+t);return r=await this.peekBuffer(a,{mayBeLess:i.mayBeLess}),e.set(a.subarray(t)),r-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(i.length>0){try{r=await this.streamReader.peek(e.subarray(0,i.length),i.mayBeLess)}catch(e){if(t?.mayBeLess&&e instanceof a)return 0;throw e}if(!i.mayBeLess&&r<i.length)throw new a}return r}async ignore(e){const t=Math.min(256e3,e),i=new Uint8Array(t);let a=0;for(;a<e;){const r=e-a,n=await this.readBuffer(i,{length:Math.min(t,r)});if(n<0)return n;a+=n}return a}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}class p extends l{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.position&&(this.position=t.position);const i=await this.peekBuffer(e,t);return this.position+=i,i}async peekBuffer(e,t){const i=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-i.position,i.length);if(!i.mayBeLess&&r<i.length)throw new a;return e.set(this.uint8Array.subarray(i.position,i.position+r)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function u(e,t){const i=function(e){try{const t=e.getReader({mode:"byob"});return t instanceof ReadableStreamDefaultReader?new c(t):new o(t)}catch(t){if(t instanceof TypeError)return new c(e.getReader());throw t}}(e),a=t??{},r=a.onClose;return a.onClose=async()=>{if(await i.close(),r)return r()},new m(i,a)}function d(e,t){return new p(e,t)}}}]);
|
|
//# sourceMappingURL=3246.b4f537eb074a0a938bae.js.map
|