!function(t){vare={};functionr(n){if(e[n])returne[n].exports;vari=e[n]={i:n,l:!1,exports:{}};returnt[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)returnt;if(4&e&&"object"==typeoft&&t&&t.__esModule)returnt;varn=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeoft)for(variint)r.d(n,i,function(e){returnt[e]}.bind(null,i));returnn},r.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returnr.d(e,"a",e),e},r.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){constn=r(1),s=r(2);addEventListener("fetch",t=>{t.respondWith(asyncfunction(t){conste=newn;e.get("/track/.*",()=>asyncfunction(t){conste=newURL(t.url),r=e.pathname.split("/")[2];if(""===r)returnnewResponse("Track ID needs to be specified",{status:400,headers:{"content-type":"text/plain"}});if(access_token=awaitKV.get("access_token"),null===access_token){constt=awaitfetch("https://connect.deezer.com/oauth/access_token.php?grant_type=client_credentials&client_id=447462&client_secret=a83bf7f38ad2f137e444727cfc3775cf&output=json"),e=awaitt.json();if(void0!==e.error)returnnewResponse("Couldn't get access token from Deezer",{status:500,headers:{"content-type":"text/plain"}});access_token=e.access_token,awaitKV.put("access_token",access_token,{expirationTtl:Number(e.expires)})}constn=awaitfetch(`https://api.deezer.com/track/${r}?access_token=${access_token}`),h=awaitn.json();if(void0!==h.error)returnnewResponse(JSON.stringify(h.error),{status:403,headers:{"content-type":"application/json"}});constc=h.md5_origin,u=h.media_version;if(format=e.searchParams.get("f"),null===format)"-"!==r[0]?format="320":format="misc";elseif(format=format.toLowerCase(),void0===a[format]){if(index=Object.values(a).indexOf(format),-1===index)returnnewResponse("Invalid format",{status:400,headers:{"content-type":"text/plain"}});format=Object.keys(a)[index]}if("0"===h["filesize_"+format])returnnewResponse("Format unavailable",{status:403,headers:{"content-type":"text/plain"}});format=a[format];constf=awaitasyncfunction(t,e,r,n){consta=news.ModeOfOperation.ecb(o);for(result=[t,e,r,n].join("¤"),buf=newArrayBuffer(result.length),result_hash=newUint8Array(buf),i=0;i<result.length;i++)result_hash[i]=result.charCodeAt(i);returnresult_hash=awaitcrypto.subtle.digest("MD5",result_hash),result_hash=Array.from(newUint8Array(result_hash)),result_hash=result_hash.reduce((function(t,e){returnt+"0".concat(e.toString(16)).substr(-2,2)}),""),result=result_hash+"¤"+result+"¤",result+="\0".repeat(result.length%16?16-result.length%16:0),result=Array.from(result).map((function(t){returnt.charCodeAt(0)})),result=(result=a.encrypt(result)).reduce((function(t,e){returnt+"0".concat(e.toString(16)).substr(-2,2)}),""),`https://e-cdns-proxy-${t[0]}.dzcdn.net/api/1/${result}`}(c,format,r,u);returnnewResponse(null,{status:302,headers:{location:f}})}(t));returnawaite.route(t)}(t.request))});consto=[106,111,54,97,101,121,54,104,97,105,100,50,84,101,105,104];consta={64:"10",128:"1",320:"3",flac:"9",misc:"0"}},function(t,e){constr=t=>e=>e.method.toLowerCase()===t.toLowerCase(),n=r("connect"),i=r("delete"),s=r("get"),o=r("head"),a=r("options"),h=r("patch"),c=r("post"),u=r("put"),f=r("trace"),l=t=>e=>{constr=newURL(e.url).pathname;return(r.match(t)||[])[0]===r};t.exports=class{constructor(){this.routes=[]}handle(t,e){returnthis.routes.push({conditions:t,handler:e}),this}connect(t,e){returnthis.handle([n,l(t)],e)}delete(t,e){returnthis.handle([i,l(t)],e)}get(t,e){returnthis.handle([s,l(t)],e)}head(t,e){returnthis.handle([o,l(t)],e)}options(t,e){returnthis.handle([a,l(t)],e)}patch(t,e){returnthis.handle([h,l(t)],e)}pos