!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/.*",()=>h("track",t)),e.get("/album/.*",()=>h("album",t)),e.get("/playlist/.*",()=>h("playlist",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"};asyncfunctionh(t,e){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)})}constr=newURL(e.url),n=r.pathname.split("/")[2];if(""===n)returnnewResponse("ID needs to be specified",{status:400,headers:{"content-type":"text/plain"}});if(format=r.searchParams.get("f"),null===format)"-"!==n[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]}switch(t){case"track":returnawaitasyncfunction(t,e,r){constn=awaitfetch(`https://api.deezer.com/track/${t}?access_token=${r}`),i=awaitn.json();if(void0!==i.error)returnnewResponse(JSON.stringify(i.error),{status:403,headers:{"content-type":"application/json"}});if(result=awaitc(i,e),"object"==typeofresult)returnresult;returnnewResponse(null,{status:302,headers:{location:result}})}(n,format,access_token);case"album":case"playlist":returnawaitasyncfunction(t,e,r,n){consti=awaitfetch(`https://api.deezer.com/${t}/${e}?access_token=${n}&limit=-1`),s=awaiti.json();if(void0!==s.error)returnnewResponse(JSON.stringify(s.error),{status:403,headers:{"content-type":"application/json"}});varo="#EXTM3U\n";for(consttofs.tracks.data){conste=awaitc(t,r);if("object"==typeofe)returne;o+=`#EXTINF:${t.duration},${t.title}\n${e}\n`}returnnewResponse(o,{status:200,headers:{"content-type":"audio/mpegurl"}})}(t,n,format,access_token)}}asyncfunctionc(t,e){constr=t.id,n=t.md5_origin,h=t.media_version;return"0"===t["filesize_"+e]?newResponse("Format unavailable",{status:403,headers:{"content-type":"text/plain"}}):(e=a[e],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