@tutkli/jikan-ts 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  - 📄 Configurable Logging
19
19
  - 📦 ESM with tree shaking support
20
20
 
21
- #### 📖 Check out the [documentation page](https://tutkli.github.io/jikan-ts/)!
21
+ #### 📖 Check out the [documentation page](https://tutkli.github.io/jikan-ts-docs/)!
22
22
 
23
23
  ## Installation
24
24
 
@@ -106,7 +106,7 @@ See also: [tslog Settings](https://tslog.js.org/#/?id=settings).
106
106
 
107
107
  ## Documentation
108
108
 
109
- Check out the [documentation page](https://tutkli.github.io/jikan-ts/)!
109
+ Check out the [documentation page](https://tutkli.github.io/jikan-ts-docs/)!
110
110
 
111
111
  ## Leave you feedback
112
112
 
package/dist/index.js CHANGED
@@ -1,23 +1 @@
1
- var Gr=Object.create;var We=Object.defineProperty;var Xr=Object.getOwnPropertyDescriptor;var Yr=Object.getOwnPropertyNames;var Zr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty;var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var en=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Yr(e))!Qr.call(t,n)&&n!==r&&We(t,n,{get:()=>e[n],enumerable:!(i=Xr(e,n))||i.enumerable});return t};var tn=(t,e,r)=>(r=t!=null?Gr(Zr(t)):{},en(e||!t||!t.__esModule?We(r,"default",{value:t,enumerable:!0}):r,t));var ge=m((is,dt)=>{"use strict";dt.exports=function(e,r){return function(){for(var n=new Array(arguments.length),s=0;s<n.length;s++)n[s]=arguments[s];return e.apply(r,n)}}});var g=m((ss,yt)=>{"use strict";var mn=ge(),be=Object.prototype.toString,xe=function(t){return function(e){var r=be.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function L(t){return t=t.toLowerCase(),function(r){return xe(r)===t}}function Ae(t){return Array.isArray(t)}function Y(t){return typeof t>"u"}function dn(t){return t!==null&&!Y(t)&&t.constructor!==null&&!Y(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}var ht=L("ArrayBuffer");function hn(t){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ht(t.buffer),e}function gn(t){return typeof t=="string"}function yn(t){return typeof t=="number"}function gt(t){return t!==null&&typeof t=="object"}function X(t){if(xe(t)!=="object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}var bn=L("Date"),xn=L("File"),An=L("Blob"),Rn=L("FileList");function Re(t){return be.call(t)==="[object Function]"}function wn(t){return gt(t)&&Re(t.pipe)}function En(t){var e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||be.call(t)===e||Re(t.toString)&&t.toString()===e)}var vn=L("URLSearchParams");function Sn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Cn(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function we(t,e){if(!(t===null||typeof t>"u"))if(typeof t!="object"&&(t=[t]),Ae(t))for(var r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}function ye(){var t={};function e(n,s){X(t[s])&&X(n)?t[s]=ye(t[s],n):X(n)?t[s]=ye({},n):Ae(n)?t[s]=n.slice():t[s]=n}for(var r=0,i=arguments.length;r<i;r++)we(arguments[r],e);return t}function kn(t,e,r){return we(e,function(n,s){r&&typeof n=="function"?t[s]=mn(n,r):t[s]=n}),t}function Pn(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}function On(t,e,r,i){t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)}function Jn(t,e,r){var i,n,s,a={};e=e||{};do{for(i=Object.getOwnPropertyNames(t),n=i.length;n-- >0;)s=i[n],a[s]||(e[s]=t[s],a[s]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e}function Ln(t,e,r){t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;var i=t.indexOf(e,r);return i!==-1&&i===r}function Nn(t){if(!t)return null;var e=t.length;if(Y(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r}var In=function(t){return function(e){return t&&e instanceof t}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));yt.exports={isArray:Ae,isArrayBuffer:ht,isBuffer:dn,isFormData:En,isArrayBufferView:hn,isString:gn,isNumber:yn,isObject:gt,isPlainObject:X,isUndefined:Y,isDate:bn,isFile:xn,isBlob:An,isFunction:Re,isStream:wn,isURLSearchParams:vn,isStandardBrowserEnv:Cn,forEach:we,merge:ye,extend:kn,trim:Sn,stripBOM:Pn,inherits:On,toFlatObject:Jn,kindOf:xe,kindOfTest:L,endsWith:Ln,toArray:Nn,isTypedArray:In,isFileList:Rn}});var Ee=m((as,xt)=>{"use strict";var _=g();function bt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}xt.exports=function(e,r,i){if(!r)return e;var n;if(i)n=i(r);else if(_.isURLSearchParams(r))n=r.toString();else{var s=[];_.forEach(r,function(u,p){u===null||typeof u>"u"||(_.isArray(u)?p=p+"[]":u=[u],_.forEach(u,function(l){_.isDate(l)?l=l.toISOString():_.isObject(l)&&(l=JSON.stringify(l)),s.push(bt(p)+"="+bt(l))}))}),n=s.join("&")}if(n){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}});var Rt=m((os,At)=>{"use strict";var Tn=g();function Z(){this.handlers=[]}Z.prototype.use=function(e,r,i){return this.handlers.push({fulfilled:e,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1};Z.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Z.prototype.forEach=function(e){Tn.forEach(this.handlers,function(i){i!==null&&e(i)})};At.exports=Z});var Et=m((us,wt)=>{"use strict";var jn=g();wt.exports=function(e,r){jn.forEach(e,function(n,s){s!==r&&s.toUpperCase()===r.toUpperCase()&&(e[r]=n,delete e[s])})}});var N=m((cs,kt)=>{"use strict";var vt=g();function B(t,e,r,i,n){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n)}vt.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var St=B.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(t){Ct[t]={value:t}});Object.defineProperties(B,Ct);Object.defineProperty(St,"isAxiosError",{value:!0});B.from=function(t,e,r,i,n,s){var a=Object.create(St);return vt.toFlatObject(t,a,function(u){return u!==Error.prototype}),B.call(a,t.message,e,r,i,n),a.name=t.name,s&&Object.assign(a,s),a};kt.exports=B});var ve=m((ps,Pt)=>{"use strict";Pt.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var Se=m((ls,Ot)=>{"use strict";var w=g();function qn(t,e){e=e||new FormData;var r=[];function i(s){return s===null?"":w.isDate(s)?s.toISOString():w.isArrayBuffer(s)||w.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function n(s,a){if(w.isPlainObject(s)||w.isArray(s)){if(r.indexOf(s)!==-1)throw Error("Circular reference detected in "+a);r.push(s),w.forEach(s,function(u,p){if(!w.isUndefined(u)){var c=a?a+"."+p:p,l;if(u&&!a&&typeof u=="object"){if(w.endsWith(p,"{}"))u=JSON.stringify(u);else if(w.endsWith(p,"[]")&&(l=w.toArray(u))){l.forEach(function(f){!w.isUndefined(f)&&e.append(c,i(f))});return}}n(u,c)}}),r.pop()}else e.append(a,i(s))}return n(t),e}Ot.exports=qn});var Lt=m((fs,Jt)=>{"use strict";var Ce=N();Jt.exports=function(e,r,i){var n=i.config.validateStatus;!i.status||!n||n(i.status)?e(i):r(new Ce("Request failed with status code "+i.status,[Ce.ERR_BAD_REQUEST,Ce.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}});var It=m((ms,Nt)=>{"use strict";var Q=g();Nt.exports=Q.isStandardBrowserEnv()?function(){return{write:function(r,i,n,s,a,o){var u=[];u.push(r+"="+encodeURIComponent(i)),Q.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),Q.isString(s)&&u.push("path="+s),Q.isString(a)&&u.push("domain="+a),o===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){var i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var jt=m((ds,Tt)=>{"use strict";Tt.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}});var Mt=m((hs,qt)=>{"use strict";qt.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}});var ke=m((gs,_t)=>{"use strict";var Mn=jt(),_n=Mt();_t.exports=function(e,r){return e&&!Mn(r)?_n(e,r):r}});var Dt=m((ys,Bt)=>{"use strict";var Pe=g(),Bn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];Bt.exports=function(e){var r={},i,n,s;return e&&Pe.forEach(e.split(`
2
- `),function(o){if(s=o.indexOf(":"),i=Pe.trim(o.substr(0,s)).toLowerCase(),n=Pe.trim(o.substr(s+1)),i){if(r[i]&&Bn.indexOf(i)>=0)return;i==="set-cookie"?r[i]=(r[i]?r[i]:[]).concat([n]):r[i]=r[i]?r[i]+", "+n:n}}),r}});var Vt=m((bs,Ut)=>{"use strict";var Ft=g();Ut.exports=Ft.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function n(s){var a=s;return e&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=n(window.location.href),function(a){var o=Ft.isString(a)?n(a):a;return o.protocol===i.protocol&&o.host===i.host}}():function(){return function(){return!0}}()});var W=m((xs,Wt)=>{"use strict";var Oe=N(),Dn=g();function $t(t){Oe.call(this,t??"canceled",Oe.ERR_CANCELED),this.name="CanceledError"}Dn.inherits($t,Oe,{__CANCEL__:!0});Wt.exports=$t});var zt=m((As,Ht)=>{"use strict";Ht.exports=function(e){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}});var Je=m((Rs,Kt)=>{"use strict";var H=g(),Fn=Lt(),Un=It(),Vn=Ee(),$n=ke(),Wn=Dt(),Hn=Vt(),zn=ve(),k=N(),Kn=W(),Gn=zt();Kt.exports=function(e){return new Promise(function(i,n){var s=e.data,a=e.headers,o=e.responseType,u;function p(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}H.isFormData(s)&&H.isStandardBrowserEnv()&&delete a["Content-Type"];var c=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(l+":"+f)}var d=$n(e.baseURL,e.url);c.open(e.method.toUpperCase(),Vn(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function P(){if(c){var R="getAllResponseHeaders"in c?Wn(c.getAllResponseHeaders()):null,T=!o||o==="text"||o==="json"?c.responseText:c.response,J={data:T,status:c.status,statusText:c.statusText,headers:R,config:e,request:c};Fn(function(fe){i(fe),p()},function(fe){n(fe),p()},J),c=null}}if("onloadend"in c?c.onloadend=P:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(P)},c.onabort=function(){c&&(n(new k("Request aborted",k.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new k("Network Error",k.ERR_NETWORK,e,c,c)),c=null},c.ontimeout=function(){var T=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",J=e.transitional||zn;e.timeoutErrorMessage&&(T=e.timeoutErrorMessage),n(new k(T,J.clarifyTimeoutError?k.ETIMEDOUT:k.ECONNABORTED,e,c)),c=null},H.isStandardBrowserEnv()){var $=(e.withCredentials||Hn(d))&&e.xsrfCookieName?Un.read(e.xsrfCookieName):void 0;$&&(a[e.xsrfHeaderName]=$)}"setRequestHeader"in c&&H.forEach(a,function(T,J){typeof s>"u"&&J.toLowerCase()==="content-type"?delete a[J]:c.setRequestHeader(J,T)}),H.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(u=function(R){c&&(n(!R||R&&R.type?new Kn:R),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u))),s||(s=null);var E=Gn(d);if(E&&["http","https","file"].indexOf(E)===-1){n(new k("Unsupported protocol "+E+":",k.ERR_BAD_REQUEST,e));return}c.send(s)})}});var Xt=m((ws,Gt)=>{Gt.exports=null});var te=m((Es,er)=>{"use strict";var y=g(),Yt=Et(),Zt=N(),Xn=ve(),Yn=Se(),Zn={"Content-Type":"application/x-www-form-urlencoded"};function Qt(t,e){!y.isUndefined(t)&&y.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Qn(){var t;return typeof XMLHttpRequest<"u"?t=Je():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(t=Je()),t}function ei(t,e,r){if(y.isString(t))try{return(e||JSON.parse)(t),y.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(t)}var ee={transitional:Xn,adapter:Qn(),transformRequest:[function(e,r){if(Yt(r,"Accept"),Yt(r,"Content-Type"),y.isFormData(e)||y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.isURLSearchParams(e))return Qt(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i=y.isObject(e),n=r&&r["Content-Type"],s;if((s=y.isFileList(e))||i&&n==="multipart/form-data"){var a=this.env&&this.env.FormData;return Yn(s?{"files[]":e}:e,a&&new a)}else if(i||n==="application/json")return Qt(r,"application/json"),ei(e);return e}],transformResponse:[function(e){var r=this.transitional||ee.transitional,i=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,s=!i&&this.responseType==="json";if(s||n&&y.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?Zt.from(a,Zt.ERR_BAD_RESPONSE,this,null,this.response):a}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xt()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};y.forEach(["delete","get","head"],function(e){ee.headers[e]={}});y.forEach(["post","put","patch"],function(e){ee.headers[e]=y.merge(Zn)});er.exports=ee});var rr=m((vs,tr)=>{"use strict";var ti=g(),ri=te();tr.exports=function(e,r,i){var n=this||ri;return ti.forEach(i,function(a){e=a.call(n,e,r)}),e}});var Le=m((Ss,nr)=>{"use strict";nr.exports=function(e){return!!(e&&e.__CANCEL__)}});var ar=m((Cs,sr)=>{"use strict";var ir=g(),Ne=rr(),ni=Le(),ii=te(),si=W();function Ie(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si}sr.exports=function(e){Ie(e),e.headers=e.headers||{},e.data=Ne.call(e,e.data,e.headers,e.transformRequest),e.headers=ir.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ir.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var r=e.adapter||ii.adapter;return r(e).then(function(n){return Ie(e),n.data=Ne.call(e,n.data,n.headers,e.transformResponse),n},function(n){return ni(n)||(Ie(e),n&&n.response&&(n.response.data=Ne.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var Te=m((ks,or)=>{"use strict";var A=g();or.exports=function(e,r){r=r||{};var i={};function n(c,l){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge(c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function s(c){if(A.isUndefined(r[c])){if(!A.isUndefined(e[c]))return n(void 0,e[c])}else return n(e[c],r[c])}function a(c){if(!A.isUndefined(r[c]))return n(void 0,r[c])}function o(c){if(A.isUndefined(r[c])){if(!A.isUndefined(e[c]))return n(void 0,e[c])}else return n(void 0,r[c])}function u(c){if(c in r)return n(e[c],r[c]);if(c in e)return n(void 0,e[c])}var p={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return A.forEach(Object.keys(e).concat(Object.keys(r)),function(l){var f=p[l]||s,d=f(l);A.isUndefined(d)&&f!==u||(i[l]=d)}),i}});var je=m((Ps,ur)=>{ur.exports={version:"0.27.2"}});var lr=m((Os,pr)=>{"use strict";var ai=je().version,O=N(),qe={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){qe[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var cr={};qe.transitional=function(e,r,i){function n(s,a){return"[Axios v"+ai+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return function(s,a,o){if(e===!1)throw new O(n(a," has been removed"+(r?" in "+r:"")),O.ERR_DEPRECATED);return r&&!cr[a]&&(cr[a]=!0,console.warn(n(a," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,a,o):!0}};function oi(t,e,r){if(typeof t!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(t),n=i.length;n-- >0;){var s=i[n],a=e[s];if(a){var o=t[s],u=o===void 0||a(o,s,t);if(u!==!0)throw new O("option "+s+" must be "+u,O.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new O("Unknown option "+s,O.ERR_BAD_OPTION)}}pr.exports={assertOptions:oi,validators:qe}});var yr=m((Js,gr)=>{"use strict";var dr=g(),ui=Ee(),fr=Rt(),mr=ar(),re=Te(),ci=ke(),hr=lr(),D=hr.validators;function F(t){this.defaults=t,this.interceptors={request:new fr,response:new fr}}F.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=re(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var i=r.transitional;i!==void 0&&hr.assertOptions(i,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1);var n=[],s=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(s=s&&d.synchronous,n.unshift(d.fulfilled,d.rejected))});var a=[];this.interceptors.response.forEach(function(d){a.push(d.fulfilled,d.rejected)});var o;if(!s){var u=[mr,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(a),o=Promise.resolve(r);u.length;)o=o.then(u.shift(),u.shift());return o}for(var p=r;n.length;){var c=n.shift(),l=n.shift();try{p=c(p)}catch(f){l(f);break}}try{o=mr(p)}catch(f){return Promise.reject(f)}for(;a.length;)o=o.then(a.shift(),a.shift());return o};F.prototype.getUri=function(e){e=re(this.defaults,e);var r=ci(e.baseURL,e.url);return ui(r,e.params,e.paramsSerializer)};dr.forEach(["delete","get","head","options"],function(e){F.prototype[e]=function(r,i){return this.request(re(i||{},{method:e,url:r,data:(i||{}).data}))}});dr.forEach(["post","put","patch"],function(e){function r(i){return function(s,a,o){return this.request(re(o||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}F.prototype[e]=r(),F.prototype[e+"Form"]=r(!0)});gr.exports=F});var xr=m((Ls,br)=>{"use strict";var pi=W();function U(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var r=this;this.promise.then(function(i){if(r._listeners){var n,s=r._listeners.length;for(n=0;n<s;n++)r._listeners[n](i);r._listeners=null}}),this.promise.then=function(i){var n,s=new Promise(function(a){r.subscribe(a),n=a}).then(i);return s.cancel=function(){r.unsubscribe(n)},s},t(function(n){r.reason||(r.reason=new pi(n),e(r.reason))})}U.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};U.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};U.prototype.unsubscribe=function(e){if(this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}};U.source=function(){var e,r=new U(function(n){e=n});return{token:r,cancel:e}};br.exports=U});var Rr=m((Ns,Ar)=>{"use strict";Ar.exports=function(e){return function(i){return e.apply(null,i)}}});var Er=m((Is,wr)=>{"use strict";var li=g();wr.exports=function(e){return li.isObject(e)&&e.isAxiosError===!0}});var Cr=m((Ts,Me)=>{"use strict";var vr=g(),fi=ge(),ne=yr(),mi=Te(),di=te();function Sr(t){var e=new ne(t),r=fi(ne.prototype.request,e);return vr.extend(r,ne.prototype,e),vr.extend(r,e),r.create=function(n){return Sr(mi(t,n))},r}var x=Sr(di);x.Axios=ne;x.CanceledError=W();x.CancelToken=xr();x.isCancel=Le();x.VERSION=je().version;x.toFormData=Se();x.AxiosError=N();x.Cancel=x.CanceledError;x.all=function(e){return Promise.all(e)};x.spread=Rr();x.isAxiosError=Er();Me.exports=x;Me.exports.default=x});var Pr=m((js,kr)=>{kr.exports=Cr()});var rn=Symbol("cache-parser");function j(t){return(typeof t=="string"||typeof t=="number")&&(t=Number(t))>=0&&t<1/0}function v(t){return t===!0||typeof t=="number"||typeof t=="string"&&t!=="false"}var q=Number;function He(t){var e=Object.defineProperty({},rn,{enumerable:!1,value:1});if(!t||typeof t!="string")return e;var r=function(p){var c={},l=p.toLowerCase().replace(/\s+/g,"").split(",");for(var f in l){var d,P=l[f].split("=",2);c[P[0]]=(d=P[1])==null||d}return c}(t),i=r["max-age"],n=r["max-stale"],s=r["min-fresh"],a=r["s-maxage"],o=r["stale-if-error"],u=r["stale-while-revalidate"];return v(r.immutable)&&(e.immutable=!0),j(i)&&(e.maxAge=q(i)),j(n)&&(e.maxStale=q(n)),j(s)&&(e.minFresh=q(s)),v(r["must-revalidate"])&&(e.mustRevalidate=!0),v(r["must-understand"])&&(e.mustUnderstand=!0),v(r["no-cache"])&&(e.noCache=!0),v(r["no-store"])&&(e.noStore=!0),v(r["no-transform"])&&(e.noTransform=!0),v(r["only-if-cached"])&&(e.onlyIfCached=!0),v(r.private)&&(e.private=!0),v(r["proxy-revalidate"])&&(e.proxyRevalidate=!0),v(r.public)&&(e.public=!0),j(a)&&(e.sMaxAge=q(a)),j(o)&&(e.staleIfError=q(o)),j(u)&&(e.staleWhileRevalidate=q(u)),e}var sn=Symbol();function ze(){var t,e,r=new Promise(function(i,n){t=i,e=n});return r.resolve=t,r.reject=e,r[sn]=1,r}function Ke(t){var e=typeof t;if(t&&e==="object"&&!(t instanceof Date||t instanceof RegExp)){for(var r=Array.isArray(t)?[]:{},i=Object.keys(t).sort(function(a,o){return a>o?1:-1}),n=i.length;n--;){var s=i[n];r[s]=Ke(t[s])}return String(t.constructor)+JSON.stringify(r,i)}return e+String(t)}function Ge(t){t=Ke(t);for(var e=5381,r=0;r<t.length;)e=33*e^t.charCodeAt(r++);return e}var M={d:(t,e)=>{for(var r in e)M.o(e,r)&&!M.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},h={};M.d(h,{h4:()=>b,UN:()=>ut,uu:()=>ot,Kd:()=>he,ZF:()=>fn,nv:()=>me,p:()=>tt,E7:()=>Ze,NQ:()=>Ye,xK:()=>ct,G6:()=>rt,LN:()=>st,Bw:()=>de,Ad:()=>Qe,$k:()=>at,v8:()=>ln,Jk:()=>nt,tI:()=>it,iS:()=>et});var un=(t=>{var e={};return M.d(e,t),e})({parse:()=>He}),b=Object.freeze({IfModifiedSince:"if-modified-since",LastModified:"last-modified",IfNoneMatch:"if-none-match",CacheControl:"cache-control",ETag:"etag",Expires:"expires",Age:"age",XAxiosCacheEtag:"x-axios-cache-etag",XAxiosCacheLastModified:"x-axios-cache-last-modified",XAxiosCacheStaleIfError:"x-axios-cache-stale-if-error"}),Ye=t=>{if(!t)return"not enough headers";let e=t[b.CacheControl];if(e){let{noCache:i,noStore:n,mustRevalidate:s,maxAge:a,immutable:o}=(0,un.parse)(String(e));if(i||n)return"dont cache";if(o)return 31536e6;if(s)return 0;if(a!==void 0){let u=t[b.Age];return u?1e3*(a-Number(u)):1e3*a}}let r=t[b.Expires];if(r){let i=Date.parse(String(r))-Date.now();return i>=0?i:"dont cache"}return"not enough headers"},cn=(t=>{var e={};return M.d(e,t),e})({deferred:()=>ze});function Ze(t){return t?e=>t(e)||e===304:e=>e>=200&&e<300||e===304}function Qe(t="get",e=[]){return t=t.toLowerCase(),e.some(r=>r===t)}function et(t,e){var r;e.headers||(e.headers={});let{etag:i,modifiedSince:n}=e.cache;if(i){let s=i===!0?(r=t.data)===null||r===void 0?void 0:r.headers[b.ETag]:i;s&&(e.headers[b.IfNoneMatch]=s)}n&&(e.headers[b.IfModifiedSince]=n===!0?t.data.headers[b.LastModified]||new Date(t.createdAt).toUTCString():n.toUTCString())}function tt(t,e){return t.status===304&&e?(t.cached=!0,t.data=e.data,t.status=e.status,t.statusText=e.statusText,t.headers=Object.assign(Object.assign({},e.headers),t.headers),e):{data:t.data,status:t.status,statusText:t.statusText,headers:t.headers}}function rt(t){let e=async r=>{var i;let n=r.id=t.generateKey(r);if(r.cache===!1||(r.cache=Object.assign(Object.assign({},t.defaults.cache),r.cache),!Qe(r.method,r.cache.methods)))return r;let s=await t.storage.get(n,r),a=r.cache.override;e:if(s.state==="empty"||s.state==="stale"||a){if(t.waiting[n]&&!a&&(s=await t.storage.get(n,r),s.state!=="empty"))break e;return t.waiting[n]=(0,cn.deferred)(),(i=t.waiting[n])===null||i===void 0||i.catch(()=>{}),await t.storage.set(n,{state:"loading",previous:a?s.data?"stale":"empty":s.state,data:s.data,createdAt:a&&!s.createdAt?Date.now():s.createdAt},r),s.state==="stale"&&et(s,r),r.validateStatus=Ze(r.validateStatus),r}let o;if(s.state==="loading"){let u=t.waiting[n];if(!u)return await t.storage.remove(n,r),r;try{o=await u}catch{return r}}else o=s.data;return r.adapter=()=>Promise.resolve({config:r,data:o.data,headers:o.headers,status:o.status,statusText:o.statusText,cached:!0,id:n}),r};return{onFulfilled:e,apply:()=>t.interceptors.request.use(e)}}async function nt(t,e){var r;if(typeof e=="function")return e(t);let{statusCheck:i,responseMatch:n,containsHeaders:s}=e;if(i&&!await i(t.status)||n&&!await n(t))return!1;if(s){for(let[a,o]of Object.entries(s))if(!await o((r=t.headers[a.toLowerCase()])!==null&&r!==void 0?r:t.headers[a]))return!1}return!0}async function it(t,e,r){if(typeof r=="function")return r(e);for(let[i,n]of Object.entries(r)){if(n==="delete"){await t.remove(i,e.config);continue}let s=await t.get(i,e.config);if(s.state==="loading")continue;let a=await n(s,e);a!=="delete"?a!=="ignore"&&await t.set(i,a,e.config):await t.remove(i,e.config)}}function st(t){let e=async(n,s)=>{var a;await t.storage.remove(n,s),(a=t.waiting[n])===null||a===void 0||a.reject(),delete t.waiting[n]},r=async n=>{var s,a,o;let u=n.id=(s=(o=n.config).id)!==null&&s!==void 0?s:o.id=t.generateKey(n.config);if((a=n.cached)!==null&&a!==void 0||(n.cached=!1),n.cached)return n;let p=n.config.cache;if(!p)return Object.assign(Object.assign({},n),{cached:!1});let c=n.config,l=await t.storage.get(u,c);if(p?.update&&await it(t.storage,n,p.update),l.state!=="loading")return n;if(!l.data&&!await nt(n,p.cachePredicate))return await e(u,c),n;for(let E of Object.keys(n.headers))E.startsWith("x-axios-cache")&&delete n.headers[E];p.etag&&p.etag!==!0&&(n.headers[b.XAxiosCacheEtag]=p.etag),p.modifiedSince&&(n.headers[b.XAxiosCacheLastModified]=p.modifiedSince===!0?"use-cache-timestamp":p.modifiedSince.toUTCString());let f=p.ttl||-1;if(p?.interpretHeader){let E=t.headerInterpreter(n.headers);if(E==="dont cache")return await e(u,c),n;f=E==="not enough headers"?f:E}let d=tt(n,l.data);typeof f=="function"&&(f=await f(n)),p.staleIfError&&(n.headers[b.XAxiosCacheStaleIfError]=String(f));let P={state:"cached",ttl:f,createdAt:Date.now(),data:d},$=t.waiting[u];return $&&($.resolve(P.data),delete t.waiting[u]),await t.storage.set(u,P,c),n},i=async n=>{var s;let a=n.config;if(!a?.cache||!a.id)throw n;let o=await t.storage.get(a.id,a),u=a.cache;if(o.state!=="loading"||o.previous!=="stale")throw await e(a.id,a),n;if(u?.staleIfError){let p=typeof u.staleIfError=="function"?await u.staleIfError(n.response,o,n):u.staleIfError;if(p===!0||typeof p=="number"&&o.createdAt+p>Date.now())return(s=t.waiting[a.id])===null||s===void 0||s.resolve(o.data),delete t.waiting[a.id],await t.storage.set(a.id,{state:"stale",createdAt:Date.now(),data:o.data},a),{cached:!0,config:a,id:a.id,data:o.data.data,headers:o.data.headers,status:o.data.status,statusText:o.data.statusText}}throw n};return{onFulfilled:r,onRejected:i,apply:()=>t.interceptors.response.use(r,i)}}var at=t=>!!t&&!!t["is-storage"];function me(t){let e=t.data.headers;return b.ETag in e||b.LastModified in e||b.XAxiosCacheEtag in e||b.XAxiosCacheStaleIfError in e||b.XAxiosCacheLastModified in e}function de(t){return t.createdAt+t.ttl<=Date.now()}function he({set:t,find:e,remove:r}){return{"is-storage":1,set:t,remove:r,get:async(i,n)=>{let s=await e(i,n);if(!s)return{state:"empty"};if(s.state!=="cached"||!de(s))return s;if(me(s)){let a={state:"stale",createdAt:s.createdAt,data:s.data};return await t(i,a,n),a}return await r(i,n),{state:"empty"}}}}function ot(t=!1){let e=he({set:(r,i)=>{e.data[r]=i},remove:r=>{delete e.data[r]},find:r=>{let i=e.data[r];return t&&i!==void 0?typeof structuredClone=="function"?structuredClone(i):JSON.parse(JSON.stringify(i)):i}});return e.data=Object.create(null),e}var pn=(t=>{var e={};return M.d(e,t),e})({hash:()=>Ge}),Xe=/^\/|\/$/g;function ut(t){return e=>{if(e.id)return e.id;let r=t(e);return typeof r=="string"||typeof r=="number"?`${r}`:`${(0,pn.hash)(r)}`}}var ct=ut(({baseURL:t="",url:e="",method:r="get",params:i,data:n})=>(t&&(t=t.replace(Xe,"")),e&&(e=e.replace(Xe,"")),r&&(r=r.toLowerCase()),{url:t+(t&&e?"/":"")+e,params:i,method:r,data:n}));function ln(t,e={}){var r,i,n,s,a;let o=t;if(o.storage=e.storage||ot(),!at(o.storage))throw new Error("Use buildStorage() function");return o.waiting=e.waiting||{},o.generateKey=e.generateKey||ct,o.headerInterpreter=e.headerInterpreter||Ye,o.requestInterceptor=e.requestInterceptor||rt(o),o.responseInterceptor=e.responseInterceptor||st(o),o.debug=e.debug,o.defaults.cache={update:e.update||{},ttl:(r=e.ttl)!==null&&r!==void 0?r:3e5,methods:e.methods||["get"],cachePredicate:e.cachePredicate||{statusCheck:u=>u>=200&&u<400},etag:(i=e.etag)===null||i===void 0||i,modifiedSince:(n=e.modifiedSince)!==null&&n!==void 0?n:e.etag===!1,interpretHeader:(s=e.interpretHeader)===null||s===void 0||s,staleIfError:(a=e.staleIfError)===null||a===void 0||a,override:!1},o.requestInterceptor.apply(),o.responseInterceptor.apply(),o}function fn(t,e=""){return he({find:r=>{let i=t.getItem(e+r);return i?JSON.parse(i):void 0},remove:r=>{t.removeItem(e+r)},set:(r,i)=>{let n=()=>t.setItem(e+r,JSON.stringify(i));try{return n()}catch{let a=Object.entries(t).filter(o=>o[0].startsWith(e)).map(o=>[o[0],JSON.parse(o[1])]);for(let o of a)o[1].state==="cached"&&de(o[1])&&!me(o[1])&&t.removeItem(o[0]);try{return n()}catch{let u=a.sort((p,c)=>(p[1].createdAt||0)-(c[1].createdAt||0));for(let p of u){t.removeItem(p[0]);try{return n()}catch{}}}t.removeItem(e+r)}}})}var Ui=h.h4,Vi=h.UN,pt=h.uu,$i=h.Kd,Wi=h.ZF,Hi=h.nv,zi=h.p,Ki=h.E7,lt=h.NQ,ft=h.xK,Gi=h.G6,Xi=h.LN,Yi=h.Bw,Zi=h.Ad,Qi=h.$k,mt=h.v8,es=h.Jk,ts=h.tI,rs=h.iS;var Hr=tn(Pr(),1);var Or=(e=>(e.REST="https://api.jikan.moe/v4",e))(Or||{});var Jr=(f=>(f.AnimeSearch="/anime",f.AnimeFullById="/anime/{id}/full",f.AnimeById="/anime/{id}",f.AnimeCharacters="/anime/{id}/characters",f.AnimeStaff="/anime/{id}/staff",f.AnimeEpisodes="/anime/{id}/episodes",f.AnimeEpisodeById="/anime/{id}/episodes/{episode}",f.AnimeVideos="/anime/{id}/videos",f.AnimeVideosEpisodes="/anime/{id}/videos/episodes",f.AnimePictures="/anime/{id}/pictures",f.AnimeStatistics="/anime/{id}/statistics",f.AnimeRecommendations="/anime/{id}/recommendations",f))(Jr||{}),Lr=(o=>(o.MangaSearch="/manga",o.MangaFullById="/manga/{id}/full",o.MangaById="/manga/{id}",o.MangaCharacters="/manga/{id}/characters",o.MangaPictures="/manga/{id}/pictures",o.MangaStatistics="/manga/{id}/statistics",o.MangaRecommendations="/manga/{id}/recommendations",o))(Lr||{}),Nr=(r=>(r.TopAnime="/top/anime",r.TopManga="/top/manga",r))(Nr||{});var z={storage:pt(),generateKey:ft,headerInterpreter:lt,debug:void 0};var K={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function G(t,e,r,i=!1){let n=String(e),s=(o,u)=>`\x1B[${u[0]}m${o}\x1B[${u[1]}m`,a=(o,u)=>u!=null&&typeof u=="string"?s(o,K[u]):u!=null&&Array.isArray(u)?u.reduce((p,c)=>a(p,c),o):u!=null&&u[o.trim()]!=null?a(o,u[o.trim()]):u!=null&&u["*"]!=null?a(o,u["*"]):o;return n.replace(/{{(.+?)}}/g,(o,u)=>{let p=r[u]!=null?r[u]:i?"":o;return t.stylePrettyLogs?a(p,t?.prettyLogStyles?.[u])+s("",K.reset):p})}function S(t,e){let r={seen:[],stylize:gi};return e!=null&&Ei(r,e),V(r.showHidden)&&(r.showHidden=!1),V(r.depth)&&(r.depth=2),V(r.colors)&&(r.colors=!0),V(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=yi),ie(r,t,r.depth)}S.colors=K;S.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function hi(t){return typeof t=="boolean"}function V(t){return t==null}function gi(t){return t}function yi(t,e){let r=S.styles[e];return r!=null&&S?.colors?.[r]?.[0]!=null&&S?.colors?.[r]?.[1]!=null?"\x1B["+S.colors[r][0]+"m"+t+"\x1B["+S.colors[r][1]+"m":t}function _e(t){return typeof t=="function"}function Tr(t){return typeof t=="string"}function bi(t){return typeof t=="number"}function jr(t){return t===null}function qr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Be(t){return se(t)&&Ve(t)==="[object RegExp]"}function se(t){return typeof t=="object"&&t!==null}function De(t){return se(t)&&(Ve(t)==="[object Error]"||t instanceof Error)}function Ir(t){return se(t)&&Ve(t)==="[object Date]"}function Ve(t){return Object.prototype.toString.call(t)}function xi(t){let e={};return t.forEach(r=>{e[r]=!0}),e}function Ai(t,e,r,i,n){let s=[];for(let a=0,o=e.length;a<o;++a)qr(e,String(a))?s.push(Ue(t,e,r,i,String(a),!0)):s.push("");return n.forEach(a=>{a.match(/^\d+$/)||s.push(Ue(t,e,r,i,a,!0))}),s}function Fe(t){return"["+Error.prototype.toString.call(t)+"]"}function ie(t,e,r=0){if(t.customInspect&&e!=null&&_e(e)&&e?.inspect!==S&&!(e?.constructor&&e?.constructor.prototype===e)){let c=e?.inspect(r,t);return Tr(c)||(c=ie(t,c,r)),c}let i=Ri(t,e);if(i)return i;let n=Object.keys(e),s=xi(n);try{t.showHidden&&Object.getOwnPropertyNames&&(n=Object.getOwnPropertyNames(e))}catch{}if(De(e)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return Fe(e);if(n.length===0){if(_e(e)){let c=e.name?": "+e.name:"";return t.stylize("[Function"+c+"]","special")}if(Be(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ir(e))return t.stylize(Date.prototype.toString.call(e),"date");if(De(e))return Fe(e)}let a="",o=!1,u=[`{
3
- `,`
4
- }`];if(Array.isArray(e)&&(o=!0,u=[`[
5
- `,`
6
- ]`]),_e(e)&&(a=" [Function"+(e.name?": "+e.name:"")+"]"),Be(e)&&(a=" "+RegExp.prototype.toString.call(e)),Ir(e)&&(a=" "+Date.prototype.toUTCString.call(e)),De(e)&&(a=" "+Fe(e)),n.length===0&&(!o||e.length==0))return u[0]+a+u[1];if(r<0)return Be(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);let p;return o?p=Ai(t,e,r,s,n):p=n.map(c=>Ue(t,e,r,s,c,o)),t.seen.pop(),wi(p,a,u)}function Ue(t,e,r,i,n,s){let a,o,u;u={value:void 0};try{u.value=e[n]}catch{}try{Object.getOwnPropertyDescriptor&&(u=Object.getOwnPropertyDescriptor(e,n)||u)}catch{}if(u.get?u.set?o=t.stylize("[Getter/Setter]","special"):o=t.stylize("[Getter]","special"):u.set&&(o=t.stylize("[Setter]","special")),qr(i,n)||(a="["+n+"]"),o||(t.seen.indexOf(u.value)<0?(jr(r)?o=ie(t,u.value,void 0):o=ie(t,u.value,r-1),o.indexOf(`
7
- `)>-1&&(s?o=o.split(`
8
- `).map(p=>" "+p).join(`
9
- `).substr(2):o=`
10
- `+o.split(`
11
- `).map(p=>" "+p).join(`
12
- `))):o=t.stylize("[Circular]","special")),V(a)){if(s&&n.match(/^\d+$/))return o;a=JSON.stringify(""+n),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,"\\'").replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+o}function Ri(t,e){if(V(e))return t.stylize("undefined","undefined");if(Tr(e)){let r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\\'")+"'";return t.stylize(r,"string")}if(bi(e))return t.stylize(""+e,"number");if(hi(e))return t.stylize(""+e,"boolean");if(jr(e))return t.stylize("null","null")}function wi(t,e,r){return r[0]+(e===""?"":e+`
13
- `)+" "+t.join(`,
14
- `)+" "+r[1]}function Ei(t,e){if(!e||!se(e))return t;let r=Object.keys(e),i=r.length;for(;i--;)t[r[i]]=e[r[i]];return t}var vi={runtime:"Browser",browser:window?.navigator.userAgent};function Mr(t,e,r,i){return{...vi,name:i,date:new Date,logLevelId:t,logLevelName:e,path:Si(r)}}function Si(t){try{throw new Error("getStackTrace")}catch(e){let r=window.location.origin,i=e;if(i?.stack){let n=i?.stack?.split(`
15
- `)?.filter(f=>!f.includes("Error: "))?.[t]?.replace(/^\s+at\s+/gm,"");n?.slice(-1)===")"&&(n=n?.match(/\(([^)]+)\)/)?.[1]);let s=n?.includes(":")?n?.replace("global code@","")?.replace("file://","")?.replace(r,"")?.replace(/^\s+at\s+/gm,"")?.split(":"):void 0,a=s?.pop(),o=s?.pop(),u=s?.pop()?.split("?")?.[0],p=u?.split("/").pop(),c=`${r}${u}:${o}`,l=n?.split(" (");return{fullFilePath:n,fileName:p,fileColumn:a,fileLine:o,filePath:u,filePathWithLine:c,method:l?.[0]}}return{fullFilePath:void 0,fileName:void 0,fileColumn:void 0,fileLine:void 0,filePath:void 0,filePathWithLine:void 0,method:void 0}}}function $e(t){let e=window.location.origin;return t?.stack?.split(`
16
- `)?.filter(r=>!r.includes("Error: "))?.reduce((r,i)=>{i?.slice(-1)===")"&&(i=i.match(/\(([^)]+)\)/)?.[1]??""),i=i.replace(/^\s+at\s+/gm,"");let n=i.split(" ("),s=i?.slice(-1)===")"?i?.match(/\(([^)]+)\)/)?.[1]:i,a=s?.includes(":")?s?.replace("global code@","")?.replace("file://","")?.replace(e,"")?.replace(/^\s+at\s+/gm,"")?.split(":"):void 0,o=a?.pop(),u=a?.pop(),p=a?.pop()?.split("?")[0],c=p?.split("/")?.pop()?.split("?")[0],l=`${e}${p}:${u}`;return p!=null&&p.length>0&&r.push({fullFilePath:s,fileName:c,fileColumn:o,fileLine:u,filePath:p,filePathWithLine:l,method:n?.[1]!=null?n?.[0]:void 0}),r},[])}function ae(t){return t instanceof Error}function _r(t,e,r){return[t,...e].reduce((i,n)=>(ae(n)?i.errors.push(Ci(n,r)):i.args.push(n),i),{args:[],errors:[]})}function Ci(t,e){let r=$e(t).map(n=>G(e,e.prettyErrorStackTemplate,{...n},!0)),i={errorName:` ${t.name} `,errorMessage:t.message,errorStack:r.join(`
17
- `)};return G(e,e.prettyErrorTemplate,i)}function Br(t,e,r,i){let n=(r.length>0&&e.length>0?`
18
- `:"")+r.join(`
19
- `);i.prettyInspectOptions.colors=i.stylePrettyLogs,e=e.map(s=>typeof s=="object"?S(s,i.prettyInspectOptions):s),console.log(t+e.join(" ")+n)}function Dr(t){console.log(e(t));function e(r){let i=new Set;return JSON.stringify(r,(n,s)=>{if(typeof s=="object"&&s!==null){if(i.has(s))return"[Circular]";i.add(s)}return s})}}function I(t,e=2,r=0){return t!=null&&isNaN(t)?"":(t=t!=null?t+r:t,e===2?t==null?"--":t<10?"0"+t:t.toString():t==null?"---":t<10?"00"+t:t<100?"0"+t:t.toString())}var oe=class{constructor(e,r,i=4){this.logObj=r,this.stackDepthLevel=i;let n=![typeof window,typeof document].includes("undefined"),s=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";this.runtime=n?"browser":s?"nodejs":"unknown";let a=n?((window?.chrome||window.Intl&&Intl?.v8BreakIterator)&&"CSS"in window)!=null:!1,o=n?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1;this.stackDepthLevel=o?4:this.stackDepthLevel,this.settings={type:e?.type??"pretty",name:e?.name,parentNames:e?.parentNames,minLevel:e?.minLevel??0,argumentsArrayName:e?.argumentsArrayName,prettyLogTemplate:e?.prettyLogTemplate??"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} [{{filePathWithLine}}{{nameWithDelimiterPrefix}}] ",prettyErrorTemplate:e?.prettyErrorTemplate??`
20
- {{errorName}} {{errorMessage}}
21
- error stack:
22
- {{errorStack}}`,prettyErrorStackTemplate:e?.prettyErrorStackTemplate??` \u2022 {{fileName}} {{method}}
23
- {{filePathWithLine}}`,prettyErrorParentNamesSeparator:e?.prettyErrorParentNamesSeparator??":",prettyErrorLoggerNameDelimiter:e?.prettyErrorLoggerNameDelimiter??" ",stylePrettyLogs:e?.stylePrettyLogs??!0,prettyLogStyles:e?.prettyLogStyles??{logLevelName:{"*":["bold","black","bgWhiteBright","dim"],SILLY:["bold","white"],TRACE:["bold","whiteBright"],DEBUG:["bold","green"],INFO:["bold","blue"],WARN:["bold","yellow"],ERROR:["bold","red"],FATAL:["bold","redBright"]},dateIsoStr:"white",filePathWithLine:"white",name:["white","bold"],nameWithDelimiterPrefix:["white","bold"],nameWithDelimiterSuffix:["white","bold"],errorName:["bold","bgRedBright","whiteBright"],fileName:["yellow"]},prettyInspectOptions:e?.prettyInspectOptions??{colors:!0,compact:!1,depth:1/0},metaProperty:e?.metaProperty??"_meta",maskPlaceholder:e?.maskPlaceholder??"[***]",maskValuesOfKeys:e?.maskValuesOfKeys??["password"],maskValuesOfKeysCaseInsensitive:e?.maskValuesOfKeysCaseInsensitive??!1,maskValuesRegEx:e?.maskValuesRegEx,prefix:[...e?.prefix??[]],attachedTransports:[...e?.attachedTransports??[]],overwrite:{mask:e?.overwrite?.mask,toLogObj:e?.overwrite?.toLogObj,addMeta:e?.overwrite?.addMeta,formatMeta:e?.overwrite?.formatMeta,formatLogObj:e?.overwrite?.formatLogObj,transportFormatted:e?.overwrite?.transportFormatted,transportJSON:e?.overwrite?.transportJSON}},this.settings.stylePrettyLogs=this.settings.stylePrettyLogs&&n&&!a?!1:this.settings.stylePrettyLogs}log(e,r,...i){if(e<this.settings.minLevel)return;let n=[...this.settings.prefix,...i],s=this.settings.overwrite?.mask!=null?this.settings.overwrite?.mask(n):this.settings.maskValuesOfKeys!=null&&this.settings.maskValuesOfKeys.length>0?this._mask(n):n,a=this.logObj!=null?this._recursiveCloneAndExecuteFunctions(this.logObj):void 0,o=this.settings.overwrite?.toLogObj!=null?this.settings.overwrite?.toLogObj(s,a):this._toLogObj(s,a),u=this.settings.overwrite?.addMeta!=null?this.settings.overwrite?.addMeta(o,e,r):this._addMetaToLogObj(o,e,r),p,c;return this.settings.overwrite?.formatMeta!=null&&(p=this.settings.overwrite?.formatMeta(u?.[this.settings.metaProperty])),this.settings.overwrite?.formatLogObj!=null&&(c=this.settings.overwrite?.formatLogObj(s,this.settings)),this.settings.type==="pretty"&&(p=this._prettyFormatLogObjMeta(u?.[this.settings.metaProperty]),c=_r(a,s,this.settings)),p!=null&&c!=null?this.settings.overwrite?.transportFormatted!=null?this.settings.overwrite?.transportFormatted(p,c.args,c.errors,this.settings):Br(p,c.args,c.errors,this.settings):this.settings.overwrite?.transportJSON!=null?this.settings.overwrite?.transportJSON(u):this.settings.type!=="hidden"&&Dr(u),this.settings.attachedTransports!=null&&this.settings.attachedTransports.length>0&&this.settings.attachedTransports.forEach(l=>{l(u)}),u}attachTransport(e){this.settings.attachedTransports.push(e)}getSubLogger(e,r){let i={...this.settings,...e,parentNames:this.settings?.parentNames!=null&&this.settings?.name!=null?[...this.settings.parentNames,this.settings.name]:this.settings?.name!=null?[this.settings.name]:void 0,prefix:[...this.settings.prefix,...e?.prefix??[]]};return new this.constructor(i,r??this.logObj,this.stackDepthLevel)}_mask(e){let r=this.settings.maskValuesOfKeysCaseInsensitive!==!0?this.settings.maskValuesOfKeys:this.settings.maskValuesOfKeys.map(i=>i.toLowerCase());return e?.map(i=>this._recursiveCloneAndMaskValuesOfKeys(i,r))}_recursiveCloneAndMaskValuesOfKeys(e,r,i=[]){return i.includes(e)?{...e}:(typeof e=="object"&&i.push(e),ae(e)||void 0?e:Array.isArray(e)?e.map(n=>this._recursiveCloneAndMaskValuesOfKeys(n,r,i)):e instanceof Date?new Date(e.getTime()):e!=null&&typeof e=="object"?Object.getOwnPropertyNames(e).reduce((n,s)=>(n[s]=r.includes(this.settings?.maskValuesOfKeysCaseInsensitive!==!0?s:s.toLowerCase())?this.settings.maskPlaceholder:this._recursiveCloneAndMaskValuesOfKeys(e[s],r,i),n),Object.create(Object.getPrototypeOf(e))):(n=>(this.settings?.maskValuesRegEx?.forEach(s=>{n=n?.replace(s,this.settings.maskPlaceholder)}),n))(e))}_recursiveCloneAndExecuteFunctions(e,r=[]){return r.includes(e)?{...e}:(typeof e=="object"&&r.push(e),Array.isArray(e)?e.map(i=>this._recursiveCloneAndExecuteFunctions(i,r)):e instanceof Date?new Date(e.getTime()):e&&typeof e=="object"?Object.getOwnPropertyNames(e).reduce((i,n)=>(Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n)),i[n]=typeof e[n]=="function"?e[n]():this._recursiveCloneAndExecuteFunctions(e[n],r),i),Object.create(Object.getPrototypeOf(e))):e)}_toLogObj(e,r={}){return e=e?.map(i=>ae(i)?this._toErrorObject(i):i),this.settings.argumentsArrayName==null?e.length===1&&!Array.isArray(e[0])&&(e[0],void 0)!==!0&&!(e[0]instanceof Date)?r=typeof e[0]=="object"?{...e[0],...r}:{0:e[0],...r}:r={...r,...e}:r={...r,[this.settings.argumentsArrayName]:e},r}_toErrorObject(e){return{nativeError:e,name:e.name??"Error",message:e.message,stack:$e(e)}}_addMetaToLogObj(e,r,i){return{...e,[this.settings.metaProperty]:Mr(r,i,this.stackDepthLevel,this.settings.name,this.settings.parentNames)}}_prettyFormatLogObjMeta(e){if(e==null)return"";let r=this.settings.prettyLogTemplate,i={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):(i.yyyy=e?.date?.getFullYear()??"----",i.mm=I(e?.date?.getMonth(),2,1),i.dd=I(e?.date?.getDate(),2),i.hh=I(e?.date?.getHours(),2),i.MM=I(e?.date?.getMinutes(),2),i.ss=I(e?.date?.getSeconds(),2),i.ms=I(e?.date?.getMilliseconds(),3)),i.rawIsoStr=e?.date?.toISOString(),i.dateIsoStr=e?.date?.toISOString().replace("T"," ").replace("Z",""),i.logLevelName=e?.logLevelName,i.filePathWithLine=e?.path?.filePathWithLine,i.fullFilePath=e?.path?.fullFilePath;let n=this.settings.parentNames?.join(this.settings.prettyErrorParentNamesSeparator);return n=n!=null&&e?.name!=null?n+this.settings.prettyErrorParentNamesSeparator:void 0,i.name=e?.name!=null||n!=null?(n??"")+e?.name:"",i.nameWithDelimiterPrefix=i.name.length>0?this.settings.prettyErrorLoggerNameDelimiter+i.name:"",i.nameWithDelimiterSuffix=i.name.length>0?i.name+this.settings.prettyErrorLoggerNameDelimiter:"",G(this.settings,r,i)}};var ue=class extends oe{constructor(e,r){super(e,r,5)}log(e,r,...i){return super.log(e,r,...i)}silly(...e){return super.log(0,"SILLY",...e)}trace(...e){return super.log(1,"TRACE",...e)}debug(...e){return super.log(2,"DEBUG",...e)}info(...e){return super.log(3,"INFO",...e)}warn(...e){return super.log(4,"WARN",...e)}error(...e){return super.log(5,"ERROR",...e)}fatal(...e){return super.log(6,"FATAL",...e)}getSubLogger(e,r){return super.getSubLogger(e,r)}};var ki={prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} [{{name}}] ",name:"Jikan-ts Logger"},Fr=(t=ki)=>new ue(t),Ur=(t,e)=>(e!==void 0&&e.info(`[Request Config] ${t.method?.toUpperCase()||""} | ${t.url||""}`),t),Vr=(t,e)=>{throw e!==void 0&&e.error(`[Request Error] CODE ${t.code||"UNKNOWN"} | ${t.message}`),t},$r=(t,e)=>(e!==void 0&&(e.info(),console.log(t.data)),t),Wr=(t,e)=>{throw e!==void 0&&e.error(`[ Response Error ] CODE ${t.code||"UNKNOWN"} | ${t.message}`),t};var C=class{api;logger;constructor(e){this.api=mt(Hr.default.create({baseURL:e?.baseURL??"https://api.jikan.moe/v4",headers:{"Content-Type":"application/json"}}),{storage:e?.cacheOptions?.storage??z.storage,generateKey:e?.cacheOptions?.generateKey??z.generateKey,headerInterpreter:e?.cacheOptions?.headerInterpreter??z.headerInterpreter,debug:e?.cacheOptions?.debug??z.debug}),e?.loggerOptions?.enabled&&(this.logger=Fr(e.loggerOptions.settings)),this.addHttpInterceptors()}addHttpInterceptors(){this.api.interceptors.request.use(e=>Ur(e,this.logger),e=>Vr(e,this.logger)),this.api.interceptors.response.use(e=>$r(e,this.logger),e=>Wr(e,this.logger))}};var ce=class extends C{constructor(e){super(e)}async getAnimeSearch(e){return new Promise((r,i)=>{let n=`${"/anime"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeFullById(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/full".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeById(e){return new Promise((r,i)=>{let n=`${"/anime/{id}".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeCharacters(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/characters".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeStaff(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/staff".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeEpisodes(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/episodes".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeEpisodeById(e,r){return new Promise((i,n)=>{let s=`${"/anime/{id}/episodes/{episode}".replace("{id}",String(e)).replace("{episode}",String(r))}`;this.api.get(s).then(a=>i(a.data)).catch(a=>n(a))})}async getAnimeVideos(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/videos".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeEpisodeVideos(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/videos/episodes".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimePictures(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/pictures".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeStatistics(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/statistics".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getAnimeRecommendations(e){return new Promise((r,i)=>{let n=`${"/anime/{id}/recommendations".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}};var pe=class extends C{constructor(e){super(e)}async getMangaSearch(e){return new Promise((r,i)=>{let n=`${"/manga"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaFullById(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/full".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaById(e){return new Promise((r,i)=>{let n=`${"/manga/{id}".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaCharacters(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/characters".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaPictures(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/pictures".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaStatistics(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/statistics".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}async getMangaRecommendations(e){return new Promise((r,i)=>{let n=`${"/manga/{id}/recommendations".replace("{id}",String(e))}`;this.api.get(n).then(s=>r(s.data)).catch(s=>i(s))})}};var le=class extends C{constructor(e){super(e)}async getTopAnime(e){return new Promise((r,i)=>{let n=`${"/top/anime"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}async getTopManga(e){return new Promise((r,i)=>{let n=`${"/top/manga"}`;this.api.get(n,{params:e}).then(s=>r(s.data)).catch(s=>i(s))})}};var zr=class extends C{anime;manga;top;constructor(e){super(e),this.anime=new ce(e),this.manga=new pe(e),this.top=new le(e)}};var Pi=(a=>(a.tv="TV",a.movie="Movie",a.ova="Ova",a.special="Special",a.ona="Ona",a.music="Music",a))(Pi||{}),Oi=(i=>(i.finished="Finished Airing",i.airing="Currently Airing",i.complete="Complete",i))(Oi||{}),Ji=(a=>(a.g="g",a.pg="pg",a.pg13="pg13",a.r17="r17",a.r="r",a.rx="rx",a))(Ji||{}),Li=(n=>(n.spring="spring",n.summer="summer",n.fall="fall",n.winter="winter",n))(Li||{});var Ni=(r=>(r.main="Main",r.supporting="Supporting",r))(Ni||{});var Ii=(o=>(o.manga="Manga",o.novel="Novel",o.lightnovel="Lightnovel",o.oneshot="Oneshot",o.doujin="Doujin",o.manwha="Manwha",o.manhua="Manhua",o))(Ii||{}),Ti=(s=>(s.publishing="Publishing",s.complete="Complete",s.hiatus="Hiatus",s.discontinued="Discontinued",s.upcoming="Upcoming",s))(Ti||{});var ji=(r=>(r.asc="asc",r.desc="desc",r))(ji||{}),qi=(c=>(c.mal_id="mal_id",c.title="title",c.start_date="start_date",c.end_date="end_date",c.score="score",c.scored_by="scored_by",c.rank="rank",c.popularity="popularity",c.members="members",c.favorites="favorites",c))(qi||{}),Mi=(i=>(i.type="type",i.rating="rating",i.episodes="episodes",i))(Mi||{}),_i=(r=>(r.chapters="chapters",r.volumes="volumes",r))(_i||{});var Bi=(n=>(n.airing="airing",n.upcoming="upcoming",n.bypopularity="bypopularity",n.favorite="favorite",n))(Bi||{}),Di=(n=>(n.publishing="publishing",n.upcoming="upcoming",n.bypopularity="bypopularity",n.favorite="favorite",n))(Di||{});export{ce as AnimeClient,Jr as AnimeEndpoints,Ji as AnimeRating,Mi as AnimeSearchOrder,Li as AnimeSeason,Oi as AnimeStatus,Pi as AnimeType,C as BaseClient,Or as BaseURL,Ni as CharacterRole,z as DEFAULT_CACHE_OPTIONS,ki as DEFAULT_LOGGER_SETTINGS,zr as JikanClient,pe as MangaClient,Lr as MangaEndpoints,_i as MangaSearchOrder,Ti as MangaStatus,Ii as MangaType,qi as SearchOrder,ji as SortOptions,Bi as TopAnimeFilter,le as TopClient,Nr as TopEndpoints,Di as TopMangaFilter,Fr as createLogger,Ur as handleRequest,Vr as handleRequestError,$r as handleResponse,Wr as handleResponseError};
1
+ import{setupCache as L}from"axios-cache-interceptor";import _ from"axios";var R=(n=>(n.REST="https://api.jikan.moe/v4",n))(R||{});var l=(m=>(m.AnimeSearch="/anime",m.AnimeFullById="/anime/{id}/full",m.AnimeById="/anime/{id}",m.AnimeCharacters="/anime/{id}/characters",m.AnimeStaff="/anime/{id}/staff",m.AnimeEpisodes="/anime/{id}/episodes",m.AnimeEpisodeById="/anime/{id}/episodes/{episode}",m.AnimeVideos="/anime/{id}/videos",m.AnimeVideosEpisodes="/anime/{id}/videos/episodes",m.AnimePictures="/anime/{id}/pictures",m.AnimeStatistics="/anime/{id}/statistics",m.AnimeRecommendations="/anime/{id}/recommendations",m))(l||{}),A=(t=>(t.MangaSearch="/manga",t.MangaFullById="/manga/{id}/full",t.MangaById="/manga/{id}",t.MangaCharacters="/manga/{id}/characters",t.MangaPictures="/manga/{id}/pictures",t.MangaStatistics="/manga/{id}/statistics",t.MangaRecommendations="/manga/{id}/recommendations",t))(A||{}),x=(s=>(s.TopAnime="/top/anime",s.TopManga="/top/manga",s))(x||{});import{buildMemoryStorage as y,defaultHeaderInterpreter as E,defaultKeyGenerator as I}from"axios-cache-interceptor";var g={storage:y(),generateKey:I,headerInterpreter:E,debug:void 0};import{Logger as S}from"tslog";var M={prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} [{{name}}] ",name:"Jikan-ts Logger"},f=(o=M)=>new S(o),k=(o,n)=>(n!==void 0&&n.info(`[Request Config] ${o.method?.toUpperCase()||""} | ${o.url||""}`),o),J=(o,n)=>{throw n!==void 0&&n.error(`[Request Error] CODE ${o.code||"UNKNOWN"} | ${o.message}`),o},b=(o,n)=>(n!==void 0&&(n.info(),console.log(o.data)),o),C=(o,n)=>{throw n!==void 0&&n.error(`[ Response Error ] CODE ${o.code||"UNKNOWN"} | ${o.message}`),o};var c=class{api;logger;constructor(n){this.api=L(_.create({baseURL:n?.baseURL??"https://api.jikan.moe/v4",headers:{"Content-Type":"application/json"}}),{storage:n?.cacheOptions?.storage??g.storage,generateKey:n?.cacheOptions?.generateKey??g.generateKey,headerInterpreter:n?.cacheOptions?.headerInterpreter??g.headerInterpreter,debug:n?.cacheOptions?.debug??g.debug}),n?.loggerOptions?.enabled&&(this.logger=f(n.loggerOptions.settings)),this.addHttpInterceptors()}addHttpInterceptors(){this.api.interceptors.request.use(n=>k(n,this.logger),n=>J(n,this.logger)),this.api.interceptors.response.use(n=>b(n,this.logger),n=>C(n,this.logger))}};var u=class extends c{constructor(n){super(n)}async getAnimeSearch(n){return new Promise((s,r)=>{let i=`${"/anime"}`;this.api.get(i,{params:n}).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeFullById(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/full".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeById(n){return new Promise((s,r)=>{let i=`${"/anime/{id}".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeCharacters(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/characters".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeStaff(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/staff".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeEpisodes(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/episodes".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeEpisodeById(n,s){return new Promise((r,i)=>{let e=`${"/anime/{id}/episodes/{episode}".replace("{id}",String(n)).replace("{episode}",String(s))}`;this.api.get(e).then(a=>r(a.data)).catch(a=>i(a))})}async getAnimeVideos(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/videos".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeEpisodeVideos(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/videos/episodes".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimePictures(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/pictures".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeStatistics(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/statistics".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getAnimeRecommendations(n){return new Promise((s,r)=>{let i=`${"/anime/{id}/recommendations".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}};var d=class extends c{constructor(n){super(n)}async getMangaSearch(n){return new Promise((s,r)=>{let i=`${"/manga"}`;this.api.get(i,{params:n}).then(e=>s(e.data)).catch(e=>r(e))})}async getMangaFullById(n){return new Promise((s,r)=>{let i=`${"/manga/{id}/full".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getMangaById(n){return new Promise((s,r)=>{let i=`${"/manga/{id}".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getMangaCharacters(n){return new Promise((s,r)=>{let i=`${"/manga/{id}/characters".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getMangaPictures(n){return new Promise((s,r)=>{let i=`${"/manga/{id}/pictures".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getMangaStatistics(n){return new Promise((s,r)=>{let i=`${"/manga/{id}/statistics".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}async getMangaRecommendations(n){return new Promise((s,r)=>{let i=`${"/manga/{id}/recommendations".replace("{id}",String(n))}`;this.api.get(i).then(e=>s(e.data)).catch(e=>r(e))})}};var h=class extends c{constructor(n){super(n)}async getTopAnime(n){return new Promise((s,r)=>{let i=`${"/top/anime"}`;this.api.get(i,{params:n}).then(e=>s(e.data)).catch(e=>r(e))})}async getTopManga(n){return new Promise((s,r)=>{let i=`${"/top/manga"}`;this.api.get(i,{params:n}).then(e=>s(e.data)).catch(e=>r(e))})}};var P=class extends c{anime;manga;top;constructor(n){super(n),this.anime=new u(n),this.manga=new d(n),this.top=new h(n)}};var w=(a=>(a.tv="TV",a.movie="Movie",a.ova="Ova",a.special="Special",a.ona="Ona",a.music="Music",a))(w||{}),v=(r=>(r.finished="Finished Airing",r.airing="Currently Airing",r.complete="Complete",r))(v||{}),$=(a=>(a.g="g",a.pg="pg",a.pg13="pg13",a.r17="r17",a.r="r",a.rx="rx",a))($||{}),T=(i=>(i.spring="spring",i.summer="summer",i.fall="fall",i.winter="winter",i))(T||{});var B=(s=>(s.main="Main",s.supporting="Supporting",s))(B||{});var V=(t=>(t.manga="Manga",t.novel="Novel",t.lightnovel="Lightnovel",t.oneshot="Oneshot",t.doujin="Doujin",t.manwha="Manwha",t.manhua="Manhua",t))(V||{}),j=(e=>(e.publishing="Publishing",e.complete="Complete",e.hiatus="Hiatus",e.discontinued="Discontinued",e.upcoming="Upcoming",e))(j||{});var N=(s=>(s.asc="asc",s.desc="desc",s))(N||{}),O=(p=>(p.mal_id="mal_id",p.title="title",p.start_date="start_date",p.end_date="end_date",p.score="score",p.scored_by="scored_by",p.rank="rank",p.popularity="popularity",p.members="members",p.favorites="favorites",p))(O||{}),q=(r=>(r.type="type",r.rating="rating",r.episodes="episodes",r))(q||{}),U=(s=>(s.chapters="chapters",s.volumes="volumes",s))(U||{});var D=(i=>(i.airing="airing",i.upcoming="upcoming",i.bypopularity="bypopularity",i.favorite="favorite",i))(D||{}),K=(i=>(i.publishing="publishing",i.upcoming="upcoming",i.bypopularity="bypopularity",i.favorite="favorite",i))(K||{});export{u as AnimeClient,l as AnimeEndpoints,$ as AnimeRating,q as AnimeSearchOrder,T as AnimeSeason,v as AnimeStatus,w as AnimeType,c as BaseClient,R as BaseURL,B as CharacterRole,g as DEFAULT_CACHE_OPTIONS,M as DEFAULT_LOGGER_SETTINGS,P as JikanClient,d as MangaClient,A as MangaEndpoints,U as MangaSearchOrder,j as MangaStatus,V as MangaType,O as SearchOrder,N as SortOptions,D as TopAnimeFilter,h as TopClient,x as TopEndpoints,K as TopMangaFilter,f as createLogger,k as handleRequest,J as handleRequestError,b as handleResponse,C as handleResponseError};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tutkli/jikan-ts",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Node.js wrapper for the Jikan API with build-in typings.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -30,31 +30,26 @@
30
30
  "name": "Clara Castillo",
31
31
  "url": "https://github.com/tutkli"
32
32
  },
33
- "licenses": [
34
- {
35
- "type": "MIT",
36
- "url": "https://github.com/tutkli/jikan-ts/blob/main/LICENSE"
37
- }
38
- ],
33
+ "license": "MIT",
39
34
  "bugs": {
40
35
  "url": "https://github.com/tutkli/jikan-ts/issues"
41
36
  },
42
37
  "homepage": "https://github.com/tutkli/jikan-ts#readme",
43
38
  "dependencies": {
44
- "axios": "^0.27.2",
45
- "axios-cache-interceptor": "^0.10.7",
46
- "tslib": "^2.4.1",
47
- "tslog": "4.5.0"
39
+ "axios": "1.2.1",
40
+ "axios-cache-interceptor": "1.0.0",
41
+ "tslog": "4.7.1"
48
42
  },
49
43
  "devDependencies": {
50
44
  "@swc/core": "1.3.24",
51
45
  "@swc/jest": "^0.2.23",
52
46
  "@types/jest": "29.2.4",
53
- "@types/node": "18.11.17",
54
- "@typescript-eslint/eslint-plugin": "5.47.0",
55
- "@typescript-eslint/parser": "5.47.0",
47
+ "@types/node": "18.11.18",
48
+ "@typescript-eslint/eslint-plugin": "5.47.1",
49
+ "@typescript-eslint/parser": "5.47.1",
56
50
  "dts-bundle-generator": "^7.1.0",
57
- "esbuild": "0.16.10",
51
+ "esbuild": "0.16.12",
52
+ "esbuild-node-externals": "^1.6.0",
58
53
  "eslint": "8.30.0",
59
54
  "eslint-config-prettier": "^8.5.0",
60
55
  "eslint-plugin-jest": "^27.1.4",
package/CHANGELOG.md DELETED
@@ -1,132 +0,0 @@
1
- # v0.6 (21/12/2022)
2
-
3
- ### BREAKING CHANGES
4
-
5
- - `JikanUniqueResponse` has been removed. Now all the request return `JikanResponse` with the corresponding data Type.
6
- - `JikanUniqueResource` has been renamed to `JikanResource`.
7
-
8
- ### MangaClient
9
-
10
- - Correct `getMangaStatistics` function name.
11
- - Correct `getEpisodeVideos` function name.
12
-
13
- ### AnimeClient
14
-
15
- - Correct `getEpisodeVideos` function name.
16
-
17
- ### Tests
18
-
19
- - Complete coverage of all the clients.
20
-
21
- ### Docs
22
-
23
- - Remove typedoc documentation generator.
24
- - Launch new documentation page! https://tutkli.github.io/jikan-ts-docs/
25
-
26
- <!-- CHANGELOG SPLIT MARKER -->
27
-
28
- # v0.5.52 (26/11/2022)
29
-
30
- ### Build
31
-
32
- - Remove yarn-check from package as it has vulnerable dependencies
33
-
34
- ### Docs
35
-
36
- - Complete docs overhaul
37
-
38
-
39
- <!-- CHANGELOG SPLIT MARKER -->
40
-
41
- # v0.5.5 (26/11/2022)
42
-
43
- ### Build
44
-
45
- - Replace parcel with esbuild
46
- - Update dependencies
47
-
48
- ### Clients
49
-
50
- - Replace Pino with tslog
51
- - Fix exporting TopClient
52
-
53
- <!-- CHANGELOG SPLIT MARKER -->
54
-
55
- # v0.5.42 (13/11/2022)
56
-
57
- ### Models
58
-
59
- - Fix typo in anime model
60
-
61
- <!-- CHANGELOG SPLIT MARKER -->
62
-
63
- # v0.5.4 (13/11/2022)
64
-
65
- ### Build
66
-
67
- - Add .npmignore
68
-
69
- <!-- CHANGELOG SPLIT MARKER -->
70
-
71
- # v0.5.3 (13/11/2022)
72
-
73
- ### Bugs
74
-
75
- - Fix pino logger imports
76
-
77
- <!-- CHANGELOG SPLIT MARKER -->
78
-
79
- # v0.5.2 (12/11/2022)
80
-
81
- ### Config
82
-
83
- - Change TS module config to "es2022"
84
-
85
- ### Bugs
86
-
87
- - Fix pino logger imports
88
-
89
- <!-- CHANGELOG SPLIT MARKER -->
90
-
91
- # v0.5.1 (12/11/2022)
92
-
93
- ### Modules
94
-
95
- - Fix exporting Params module
96
-
97
- ### Build
98
-
99
- - Add lint script
100
-
101
- <!-- CHANGELOG SPLIT MARKER -->
102
-
103
- # v0.5.0 (12/11/2022)
104
-
105
- ### Test
106
-
107
- - Added Client tests
108
-
109
- <!-- CHANGELOG SPLIT MARKER -->
110
-
111
- # v0.4.0 (12/11/2022)
112
-
113
- ### Clients
114
-
115
- - Added TopClient
116
- - Added search queryParams to AnimeClient, MangaClient and TopClient.
117
-
118
- ### Docs
119
-
120
- - Improve models and clients documentation
121
-
122
- <!-- CHANGELOG SPLIT MARKER -->
123
-
124
- # v0.3.0 (12/11/2022)
125
-
126
- ### Clients
127
-
128
- - More endpoints added to the MangaClient:
129
- - getMangaCharacters
130
- - getMangaPictures
131
- - getMangaStatistics
132
- - getMangaRecommendations