iboot-http-client 1.3.3 → 1.3.4
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/dist/iboot-http-client.cjs.js +1 -1
- package/dist/iboot-http-client.cjs.js.map +1 -1
- package/dist/iboot-http-client.es.js +47 -47
- package/dist/iboot-http-client.es.js.map +1 -1
- package/dist/iboot-http-client.umd.js +1 -1
- package/dist/iboot-http-client.umd.js.map +1 -1
- package/dist/types/router-dapter/nextjs.d.ts +1 -1
- package/dist/types/router.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
8
|
-
`)}}class i extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class n extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}})(ze)),ze}var Ve={},Ye,It;function br(){if(It)return Ye;It=1;var o=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n=(a,v)=>{for(var f in v)o(a,f,{get:v[f],enumerable:!0})},s=(a,v,f,w)=>{if(v&&typeof v=="object"||typeof v=="function")for(let P of t(v))!i.call(a,P)&&P!==f&&o(a,P,{get:()=>v[P],enumerable:!(w=e(v,P))||w.enumerable});return a},u=a=>s(o({},"__esModule",{value:!0}),a),r={};n(r,{RequestCookies:()=>g,ResponseCookies:()=>h,parseCookie:()=>_,parseSetCookie:()=>c,stringifyCookie:()=>d}),Ye=u(r);function d(a){var v;const f=["path"in a&&a.path&&`Path=${a.path}`,"expires"in a&&(a.expires||a.expires===0)&&`Expires=${(typeof a.expires=="number"?new Date(a.expires):a.expires).toUTCString()}`,"maxAge"in a&&typeof a.maxAge=="number"&&`Max-Age=${a.maxAge}`,"domain"in a&&a.domain&&`Domain=${a.domain}`,"secure"in a&&a.secure&&"Secure","httpOnly"in a&&a.httpOnly&&"HttpOnly","sameSite"in a&&a.sameSite&&`SameSite=${a.sameSite}`,"partitioned"in a&&a.partitioned&&"Partitioned","priority"in a&&a.priority&&`Priority=${a.priority}`].filter(Boolean),w=`${a.name}=${encodeURIComponent((v=a.value)!=null?v:"")}`;return f.length===0?w:`${w}; ${f.join("; ")}`}function _(a){const v=new Map;for(const f of a.split(/; */)){if(!f)continue;const w=f.indexOf("=");if(w===-1){v.set(f,"true");continue}const[P,C]=[f.slice(0,w),f.slice(w+1)];try{v.set(P,decodeURIComponent(C??"true"))}catch{}}return v}function c(a){if(!a)return;const[[v,f],...w]=_(a),{domain:P,expires:C,httponly:q,maxage:M,path:G,samesite:H,secure:Z,partitioned:ee,priority:B}=Object.fromEntries(w.map(([ae,K])=>[ae.toLowerCase(),K])),Y={name:v,value:decodeURIComponent(f),domain:P,...C&&{expires:new Date(C)},...q&&{httpOnly:!0},...typeof M=="string"&&{maxAge:Number(M)},path:G,...H&&{sameSite:R(H)},...Z&&{secure:!0},...B&&{priority:O(B)},...ee&&{partitioned:!0}};return m(Y)}function m(a){const v={};for(const f in a)a[f]&&(v[f]=a[f]);return v}var b=["strict","lax","none"];function R(a){return a=a.toLowerCase(),b.includes(a)?a:void 0}var y=["low","medium","high"];function O(a){return a=a.toLowerCase(),y.includes(a)?a:void 0}function l(a){if(!a)return[];var v=[],f=0,w,P,C,q,M;function G(){for(;f<a.length&&/\s/.test(a.charAt(f));)f+=1;return f<a.length}function H(){return P=a.charAt(f),P!=="="&&P!==";"&&P!==","}for(;f<a.length;){for(w=f,M=!1;G();)if(P=a.charAt(f),P===","){for(C=f,f+=1,G(),q=f;f<a.length&&H();)f+=1;f<a.length&&a.charAt(f)==="="?(M=!0,f=q,v.push(a.substring(w,C)),w=f):f=C+1}else f+=1;(!M||f>=a.length)&&v.push(a.substring(w,a.length))}return v}var g=class{constructor(a){this._parsed=new Map,this._headers=a;const v=a.get("cookie");if(v){const f=_(v);for(const[w,P]of f)this._parsed.set(w,{name:w,value:P})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...a){const v=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(v)}getAll(...a){var v;const f=Array.from(this._parsed);if(!a.length)return f.map(([P,C])=>C);const w=typeof a[0]=="string"?a[0]:(v=a[0])==null?void 0:v.name;return f.filter(([P])=>P===w).map(([P,C])=>C)}has(a){return this._parsed.has(a)}set(...a){const[v,f]=a.length===1?[a[0].name,a[0].value]:a,w=this._parsed;return w.set(v,{name:v,value:f}),this._headers.set("cookie",Array.from(w).map(([P,C])=>d(C)).join("; ")),this}delete(a){const v=this._parsed,f=Array.isArray(a)?a.map(w=>v.delete(w)):v.delete(a);return this._headers.set("cookie",Array.from(v).map(([w,P])=>d(P)).join("; ")),f}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(a=>`${a.name}=${encodeURIComponent(a.value)}`).join("; ")}},h=class{constructor(a){this._parsed=new Map;var v,f,w;this._headers=a;const P=(w=(f=(v=a.getSetCookie)==null?void 0:v.call(a))!=null?f:a.get("set-cookie"))!=null?w:[],C=Array.isArray(P)?P:l(P);for(const q of C){const M=c(q);M&&this._parsed.set(M.name,M)}}get(...a){const v=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(v)}getAll(...a){var v;const f=Array.from(this._parsed.values());if(!a.length)return f;const w=typeof a[0]=="string"?a[0]:(v=a[0])==null?void 0:v.name;return f.filter(P=>P.name===w)}has(a){return this._parsed.has(a)}set(...a){const[v,f,w]=a.length===1?[a[0].name,a[0].value,a[0]]:a,P=this._parsed;return P.set(v,E({name:v,value:f,...w})),p(P,this._headers),this}delete(...a){const[v,f,w]=typeof a[0]=="string"?[a[0]]:[a[0].name,a[0].path,a[0].domain];return this.set({name:v,path:f,domain:w,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(d).join("; ")}};function p(a,v){v.delete("set-cookie");for(const[,f]of a){const w=d(f);v.append("set-cookie",w)}}function E(a={name:"",value:""}){return typeof a.expires=="number"&&(a.expires=new Date(a.expires)),a.maxAge&&(a.expires=new Date(Date.now()+a.maxAge*1e3)),(a.path===null||a.path===void 0)&&(a.path="/"),a}return Ye}var Ot;function Ke(){return Ot||(Ot=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});function e(i,n){for(var s in n)Object.defineProperty(i,s,{enumerable:!0,get:n[s]})}e(o,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=br()})(Ve)),Ve}var Nt;function wr(){return Nt||(Nt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});function e(d,_){for(var c in _)Object.defineProperty(d,c,{enumerable:!0,get:_[c]})}e(o,{INTERNALS:function(){return u},NextRequest:function(){return r}});const t=Pt(),i=St(),n=gr(),s=Ke(),u=Symbol("internal request");class r extends Request{constructor(_,c={}){const m=typeof _!="string"&&"url"in _?_.url:String(_);(0,i.validateURL)(m),_ instanceof Request?super(_,c):super(m,c);const b=new t.NextURL(m,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:c.nextConfig});this[u]={cookies:new s.RequestCookies(this.headers),geo:c.geo||{},ip:c.ip,nextUrl:b,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?m:b.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[u].cookies}get geo(){return this[u].geo}get ip(){return this[u].ip}get nextUrl(){return this[u].nextUrl}get page(){throw new n.RemovedPageError}get ua(){throw new n.RemovedUAError}get url(){return this[u].url}}})(Ie)),Ie}var $e={},Je={},xt;function Er(){return xt||(xt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(i,n,s){const u=Reflect.get(i,n,s);return typeof u=="function"?u.bind(i):u}static set(i,n,s,u){return Reflect.set(i,n,s,u)}static has(i,n){return Reflect.has(i,n)}static deleteProperty(i,n){return Reflect.deleteProperty(i,n)}}})(Je)),Je}var Ct;function vr(){return Ct||(Ct=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"NextResponse",{enumerable:!0,get:function(){return _}});const e=Ke(),t=Pt(),i=St(),n=Er(),s=Ke(),u=Symbol("internal response"),r=new Set([301,302,303,307,308]);function d(c,m){var b;if(!(c==null||(b=c.request)==null)&&b.headers){if(!(c.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const R=[];for(const[y,O]of c.request.headers)m.set("x-middleware-request-"+y,O),R.push(y);m.set("x-middleware-override-headers",R.join(","))}}class _ extends Response{constructor(m,b={}){super(m,b);const R=this.headers,y=new s.ResponseCookies(R),O=new Proxy(y,{get(l,g,h){switch(g){case"delete":case"set":return(...p)=>{const E=Reflect.apply(l[g],l,p),a=new Headers(R);return E instanceof s.ResponseCookies&&R.set("x-middleware-set-cookie",E.getAll().map(v=>(0,e.stringifyCookie)(v)).join(",")),d(b,a),E};default:return n.ReflectAdapter.get(l,g,h)}}});this[u]={cookies:O,url:b.url?new t.NextURL(b.url,{headers:(0,i.toNodeOutgoingHttpHeaders)(R),nextConfig:b.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[u].cookies}static json(m,b){const R=Response.json(m,b);return new _(R.body,R)}static redirect(m,b){const R=typeof b=="number"?b:b?.status??307;if(!r.has(R))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const y=typeof b=="object"?b:{},O=new Headers(y?.headers);return O.set("Location",(0,i.validateURL)(m)),new _(null,{...y,headers:O,status:R})}static rewrite(m,b){const R=new Headers(b?.headers);return R.set("x-middleware-rewrite",(0,i.validateURL)(m)),d(b,R),new _(null,{...b,headers:R})}static next(m){const b=new Headers(m?.headers);return b.set("x-middleware-next","1"),d(m,b),new _(null,{...m,headers:b})}}})($e)),$e}var Qe={},Lt;function Rr(){return Lt||(Lt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"ImageResponse",{enumerable:!0,get:function(){return e}});function e(){throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}})(Qe)),Qe}var Ze={},et={exports:{}},kt;function Pr(){return kt||(kt=1,(()=>{var o={226:function(n,s){(function(u,r){var d="1.0.35",_="",c="?",m="function",b="undefined",R="object",y="string",O="major",l="model",g="name",h="type",p="vendor",E="version",a="architecture",v="console",f="mobile",w="tablet",P="smarttv",C="wearable",q="embedded",M=350,G="Amazon",H="Apple",Z="ASUS",ee="BlackBerry",B="Browser",Y="Chrome",ae="Edge",K="Firefox",te="Google",ge="Huawei",ue="LG",ce="Microsoft",be="Motorola",re="Opera",le="Samsung",we="Sharp",ne="Sony",de="Xiaomi",U="Zebra",Ee="Facebook",ve="Chromium OS",Re="Mac OS",Pe=function(I,x){var S={};for(var L in I)x[L]&&x[L].length%2===0?S[L]=x[L].concat(I[L]):S[L]=I[L];return S},J=function(I){for(var x={},S=0;S<I.length;S++)x[I[S].toUpperCase()]=I[S];return x},$t=function(I,x){return typeof I===y?he(x).indexOf(he(I))!==-1:!1},he=function(I){return I.toLowerCase()},qr=function(I){return typeof I===y?I.replace(/[^\d\.]/g,_).split(".")[0]:r},st=function(I,x){if(typeof I===y)return I=I.replace(/^\s\s*/,_),typeof x===b?I:I.substring(0,M)},fe=function(I,x){for(var S=0,L,$,W,N,T,z;S<x.length&&!T;){var ut=x[S],Zt=x[S+1];for(L=$=0;L<ut.length&&!T&&ut[L];)if(T=ut[L++].exec(I),T)for(W=0;W<Zt.length;W++)z=T[++$],N=Zt[W],typeof N===R&&N.length>0?N.length===2?typeof N[1]==m?this[N[0]]=N[1].call(this,z):this[N[0]]=N[1]:N.length===3?typeof N[1]===m&&!(N[1].exec&&N[1].test)?this[N[0]]=z?N[1].call(this,z,N[2]):r:this[N[0]]=z?z.replace(N[1],N[2]):r:N.length===4&&(this[N[0]]=z?N[3].call(this,z.replace(N[1],N[2])):r):this[N]=z||r;S+=2}},at=function(I,x){for(var S in x)if(typeof x[S]===R&&x[S].length>0){for(var L=0;L<x[S].length;L++)if($t(x[S][L],I))return S===c?r:S}else if($t(x[S],I))return S===c?r:S;return I},Hr={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Jt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Qt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,E],[/opios[\/ ]+([\w\.]+)/i],[E,[g,re+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[g,re]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[g,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[g,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[g,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+B],E],[/\bfocus\/([\w\.]+)/i],[E,[g,K+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[g,re+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[g,re+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[g,"MIUI "+B]],[/fxios\/([-\w\.]+)/i],[E,[g,K]],[/\bqihu|(qi?ho?o?|360)browser/i],[[g,"360 "+B]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1 "+B],E],[/(comodo_dragon)\/([\w\.]+)/i],[[g,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[g,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Ee],E],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[g,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[g,Y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,Y+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[g,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[E,at,Hr]],[/(webkit|khtml)\/([\w\.]+)/i],[g,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[g,K+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[g,E],[/(cobalt)\/([\w\.]+)/i],[g,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[a,"amd64"]],[/(ia32(?=;))/i],[[a,he]],[/((?:i[346]|x)86)[;\)]/i],[[a,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[a,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[a,"armhf"]],[/windows (ce|mobile); ppc;/i],[[a,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[a,/ower/,_,he]],[/(sun4\w)[;\)]/i],[[a,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[a,he]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[p,le],[h,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[p,le],[h,f]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[p,H],[h,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[p,H],[h,w]],[/(macintosh);/i],[l,[p,H]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[p,we],[h,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[p,ge],[h,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[p,ge],[h,f]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[p,de],[h,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[p,de],[h,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[p,"OPPO"],[h,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[p,"Vivo"],[h,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[p,"Realme"],[h,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[p,be],[h,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[p,be],[h,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[p,ue],[h,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[p,ue],[h,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[p,"Lenovo"],[h,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[p,"Nokia"],[h,f]],[/(pixel c)\b/i],[l,[p,te],[h,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[p,te],[h,f]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[p,ne],[h,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[p,ne],[h,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[p,"OnePlus"],[h,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[p,G],[h,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[p,G],[h,f]],[/(playbook);[-\w\),; ]+(rim)/i],[l,p,[h,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[p,ee],[h,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[p,Z],[h,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[p,Z],[h,f]],[/(nexus 9)/i],[l,[p,"HTC"],[h,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[l,/_/g," "],[h,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[p,"Acer"],[h,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[p,"Meizu"],[h,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,l,[h,f]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,l,[h,w]],[/(surface duo)/i],[l,[p,ce],[h,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[p,"Fairphone"],[h,f]],[/(u304aa)/i],[l,[p,"AT&T"],[h,f]],[/\bsie-(\w*)/i],[l,[p,"Siemens"],[h,f]],[/\b(rct\w+) b/i],[l,[p,"RCA"],[h,w]],[/\b(venue[\d ]{2,7}) b/i],[l,[p,"Dell"],[h,w]],[/\b(q(?:mv|ta)\w+) b/i],[l,[p,"Verizon"],[h,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[p,"Barnes & Noble"],[h,w]],[/\b(tm\d{3}\w+) b/i],[l,[p,"NuVision"],[h,w]],[/\b(k88) b/i],[l,[p,"ZTE"],[h,w]],[/\b(nx\d{3}j) b/i],[l,[p,"ZTE"],[h,f]],[/\b(gen\d{3}) b.+49h/i],[l,[p,"Swiss"],[h,f]],[/\b(zur\d{3}) b/i],[l,[p,"Swiss"],[h,w]],[/\b((zeki)?tb.*\b) b/i],[l,[p,"Zeki"],[h,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],l,[h,w]],[/\b(ns-?\w{0,9}) b/i],[l,[p,"Insignia"],[h,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[p,"NextBook"],[h,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],l,[h,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],l,[h,f]],[/\b(ph-1) /i],[l,[p,"Essential"],[h,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[p,"Envizen"],[h,w]],[/\b(trio[-\w\. ]+) b/i],[l,[p,"MachSpeed"],[h,w]],[/\btu_(1491) b/i],[l,[p,"Rotor"],[h,w]],[/(shield[\w ]+) b/i],[l,[p,"Nvidia"],[h,w]],[/(sprint) (\w+)/i],[p,l,[h,f]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[p,ce],[h,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[p,U],[h,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[p,U],[h,f]],[/smart-tv.+(samsung)/i],[p,[h,P]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[p,le],[h,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,ue],[h,P]],[/(apple) ?tv/i],[p,[l,H+" TV"],[h,P]],[/crkey/i],[[l,Y+"cast"],[p,te],[h,P]],[/droid.+aft(\w)( bui|\))/i],[l,[p,G],[h,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[p,we],[h,P]],[/(bravia[\w ]+)( bui|\))/i],[l,[p,ne],[h,P]],[/(mitv-\w{5}) bui/i],[l,[p,de],[h,P]],[/Hbbtv.*(technisat) (.*);/i],[p,l,[h,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,st],[l,st],[h,P]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,P]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,l,[h,v]],[/droid.+; (shield) bui/i],[l,[p,"Nvidia"],[h,v]],[/(playstation [345portablevi]+)/i],[l,[p,ne],[h,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[p,ce],[h,v]],[/((pebble))app/i],[p,l,[h,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[p,H],[h,C]],[/droid.+; (glass) \d/i],[l,[p,te],[h,C]],[/droid.+; (wt63?0{2,3})\)/i],[l,[p,U],[h,C]],[/(quest( 2| pro)?)/i],[l,[p,Ee],[h,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,q]],[/(aeobc)\b/i],[l,[p,G],[h,q]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[h,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[h,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,f]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[g,ae+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[g,[E,at,Jt]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,"Windows"],[E,at,Jt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Re],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,E],[/\(bb(10);/i],[E,[g,ee]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[g,K+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[g,Y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,ve],E],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,E],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,E]]},F=function(I,x){if(typeof I===R&&(x=I,I=r),!(this instanceof F))return new F(I,x).getResult();var S=typeof u!==b&&u.navigator?u.navigator:r,L=I||(S&&S.userAgent?S.userAgent:_),$=S&&S.userAgentData?S.userAgentData:r,W=x?Pe(Qt,x):Qt,N=S&&S.userAgent==L;return this.getBrowser=function(){var T={};return T[g]=r,T[E]=r,fe.call(T,L,W.browser),T[O]=qr(T[E]),N&&S&&S.brave&&typeof S.brave.isBrave==m&&(T[g]="Brave"),T},this.getCPU=function(){var T={};return T[a]=r,fe.call(T,L,W.cpu),T},this.getDevice=function(){var T={};return T[p]=r,T[l]=r,T[h]=r,fe.call(T,L,W.device),N&&!T[h]&&$&&$.mobile&&(T[h]=f),N&&T[l]=="Macintosh"&&S&&typeof S.standalone!==b&&S.maxTouchPoints&&S.maxTouchPoints>2&&(T[l]="iPad",T[h]=w),T},this.getEngine=function(){var T={};return T[g]=r,T[E]=r,fe.call(T,L,W.engine),T},this.getOS=function(){var T={};return T[g]=r,T[E]=r,fe.call(T,L,W.os),N&&!T[g]&&$&&$.platform!="Unknown"&&(T[g]=$.platform.replace(/chrome os/i,ve).replace(/macos/i,Re)),T},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return L},this.setUA=function(T){return L=typeof T===y&&T.length>M?st(T,M):T,this},this.setUA(L),this};F.VERSION=d,F.BROWSER=J([g,E,O]),F.CPU=J([a]),F.DEVICE=J([l,p,h,v,f,P,w,C,q]),F.ENGINE=F.OS=J([g,E]),typeof s!==b?(n.exports&&(s=n.exports=F),s.UAParser=F):typeof u!==b&&(u.UAParser=F);var ie=typeof u!==b&&(u.jQuery||u.Zepto);if(ie&&!ie.ua){var ye=new F;ie.ua=ye.getResult(),ie.ua.get=function(){return ye.getUA()},ie.ua.set=function(I){ye.setUA(I);var x=ye.getResult();for(var S in x)ie.ua[S]=x[S]}}})(typeof window=="object"?window:this)}},e={};function t(n){var s=e[n];if(s!==void 0)return s.exports;var u=e[n]={exports:{}},r=!0;try{o[n].call(u.exports,u,u.exports,t),r=!1}finally{r&&delete e[n]}return u.exports}typeof t<"u"&&(t.ab=__dirname+"/");var i=t(226);et.exports=i})()),et.exports}var Ut;function Dt(){return Ut||(Ut=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});function e(r,d){for(var _ in d)Object.defineProperty(r,_,{enumerable:!0,get:d[_]})}e(o,{isBot:function(){return n},userAgent:function(){return u},userAgentFromString:function(){return s}});const t=i(Pr());function i(r){return r&&r.__esModule?r:{default:r}}function n(r){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(r)}function s(r){return{...(0,t.default)(r),isBot:r===void 0?!1:n(r)}}function u({headers:r}){return s(r.get("user-agent")||void 0)}})(Ze)),Ze}var tt={},Mt;function yr(){return Mt||(Mt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})(tt)),tt}var jt;function Tr(){return jt||(jt=1,(function(o,e){const t={NextRequest:wr().NextRequest,NextResponse:vr().NextResponse,ImageResponse:Rr().ImageResponse,userAgentFromString:Dt().userAgentFromString,userAgent:Dt().userAgent,URLPattern:yr().URLPattern};o.exports=t,e.NextRequest=t.NextRequest,e.NextResponse=t.NextResponse,e.ImageResponse=t.ImageResponse,e.userAgentFromString=t.userAgentFromString,e.userAgent=t.userAgent,e.URLPattern=t.URLPattern})(me,me.exports)),me.exports}var Sr=Tr();class Ar{async parseRequest(e){const t=new URL(e.url);let i,n;if(e.method!=="GET"){const r=e.headers.get(X)||"";if(k.debug({"content-type":r},"Content-Type"),r.includes(j.applicationJson))try{i=await e.json()}catch{k.warn("request body is null!")}else if(r.includes(j.multipartFormData))n=await e.formData();else if(r.includes(j.applicationXwwwFormUrlencoded)){const d=await e.text();i=pe(d,["m"])}}const s=e.headers,u={};return e.cookies.getAll().forEach(r=>{u[r.name]=r.value}),k.debug({body:i,formData:n},"NextJsAdapter.parseRequest"),{url:t,headers:s,body:i,formData:n,cookies:u,raw:e,clone(){return e.clone()}}}createResponse(e){const t=Sr.NextResponse.json(e.body);if(Object.entries(e.cookies).forEach(([i,n])=>{typeof n=="object"&&n.value?t.cookies.set(i,n.value,n.options):typeof n=="string"&&t.cookies.set(i,n)}),e.cleanCookies){const i={set(n,s,u){t.cookies.set(n,s,u)},delete(n,s){t.cookies.delete({...s,name:n})}};e.cleanCookies(i)}return t}setCookie(e,t,i,n){e.cookies[t]={value:i,options:n}}}var rt=(o=>(o[o.login=0]="login",o[o.logout=1]="logout",o))(rt||{});const nt={login:"login",logout:"logout",unknown:""},X="Content-Type",j={applicationJson:"application/json",multipartFormData:"multipart/form-data",applicationXwwwFormUrlencoded:"application/x-www-form-urlencoded"};class Ir{config;http;adapter;constructor({config:e,adapter:t,headerStorage:i}){this.config=e;const n=Xt(i);this.http=new Kt({...n,userType:Te.TYPE_C,helloURL:e.helloURL}),this.adapter=t}async handleRequest(e){const t=await this.adapter.parseRequest(e),i=await this.processRequest(t);return this.adapter.createResponse(i)}async processRequest(e){const t=e.url.searchParams,i=t.get("m")??"unknown",s={...nt,...this.config.APIMAP}[i];if(!s||s.length===0)return this.createErrorResponse(404,"API not found");let u;if((s.startsWith("admin/")||s.startsWith("api/"))&&(u=Wt(e.cookies),k.debug(u,"token"),!u||u.username.length===0||u.token.length===0))return this.createErrorResponse(409,"Authentication required");k.debug({hostUrl:s,token:u},"processRequest");const r=e.clone(),d=r.method;if(d==="GET"){const _=pe(t.toString(),["m"]),c=await this.http.get({url:s,data:_,token:u});return this.createResponse({url:s,result:c})}else if(d==="POST"){let _;const c=e.headers.get(X)||"";if(c.includes(j.applicationJson)||c.includes(j.applicationXwwwFormUrlencoded))_=e.body;else if(c.includes(j.multipartFormData)){const b=c.match(/boundary=([^\s;]+)/);if(!b)return this.createErrorResponse(411,"Missing boundary in form data");const R=await r.arrayBuffer();_={boundary:b[1],buffer:Buffer.from(R)};const O=e.formData;if(O)for(const[l,g]of Object.entries(O))l!=="file"&&(_[l]=g)}else return this.createErrorResponse(410,"Unsupported content type");const m=await this.http.post({url:s,data:_,token:u});return this.createResponse({url:s,result:m})}return this.createErrorResponse(405,"Method not allowed, only supported GET or POST")}createResponse({url:e,result:t}){const i={};i[X]=j.applicationJson;const n={status:t.success?200:t.code,headers:i,cookies:{},body:t};if(t.success)switch(e){case nt[rt[0]]:const s=t.data;Vt(s,n);break;case nt[rt[1]]:n.cleanCookies=u=>Yt(u);break}return n}createErrorResponse(e,t){const i={};return i[X]=j.applicationJson,{status:e,headers:i,cookies:{},body:{code:e,success:!1,msg:t}}}}const Or="zh-CN",qt="_device_id_key",Ht="_current_website_key",Ft="Get request error!",it="Post request error!",D={IBOOT_DEVICE_ID:"dvid",IBOOT_LANG:"lang",IBOOT_WEBSITE_ID:"wid",IBOOT_WEBSITE_NO:"wno",IBOOT_TOKEN:"token",IBOOT_USER:"user"},V={DEVICE_ID:"Device-Id",LANG:"Lang",WEBSITE_ID:"Website-Id",WEBSITE_NO:"Website-No"},Gt=o=>{if(!o.get)throw new Error("The get method of IStorage has not been implemented.");const e=o.get(qt)??"",t=o.get(Ht),i=t!=null?JSON.parse(t):null,n={};return e.length>0&&(n["Device-Id"]=e),i&&(n.Lang=i.language,i.websiteId&&(n["Website-Id"]=i.websiteId),i.websiteNo&&(n["Website-No"]=i.websiteNo)),n},Nr=({deviceId:o,website:e},t)=>{if(!t.set)throw new Error("The set method of IStorage has not been implemented.");t.set(qt,o),e&&t.set(Ht,JSON.stringify(e))},xr=o=>`${process.env.BASE_URL||"/api/services"}?m=${o}`,Bt=async(o,e)=>{let t=xr(o);if(e?.data){const r=new URLSearchParams(e.data);t+=`&${r}`}const i=e&&e.storage&&e.storage.get?Gt(e.storage):{},n=e?.headers;if(n)for(const r in n){const d=n[r];d&&(i[r]=d)}k.info({url:t,headers:i},"GET");const s=await fetch(t,{method:"GET",headers:i,cache:e?.useCache?"force-cache":"default"});if(s.ok){const r=Object.fromEntries(s.headers.entries()),d={...await s.json(),headers:r};return k.debug(d,"GET_RESULT"),d}const u={code:s.status,success:!1,msg:s.statusText};return k.error(u),u},ot=async(o,e)=>{const t=e?.data??{},i=e?.headers;let n;const s=e&&e.storage&&e.storage.get?Gt(e.storage):{},u=new Headers(s);if(t instanceof FormData?n=t:(n=JSON.stringify(t),u.set(X,j.applicationJson)),i)for(let _ in i){const c=i[_];c&&u.set(_,c)}k.info({url:o,headers:u},"POST");const r=await fetch(o,{method:"POST",headers:u,body:n});if(r.ok){const _=Object.fromEntries(r.headers.entries()),c={...await r.json(),headers:_};return k.debug(c,"POST_RESULT"),c}const d={code:r.status,success:!1,msg:r.statusText};return k.error(d),d},Cr=async(o,e)=>{const t=await Bt(o,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??Ft);return}throw Error(t.msg??Ft)},Lr=async(o,e)=>{const t=await ot(o,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??it);return}throw Error(t.msg??it)},kr=async(o,e)=>{const t=await ot(o,e);return t.success?(e?.showSuccess&&e.showSuccess(t.msg??"SUCCESS"),!0):(e?.showError&&e.showError(t.msg??it),!1)},Xt=o=>{if(o.get){const e=o.get(V.DEVICE_ID),t=o.get(V.LANG),i=o.get(V.WEBSITE_ID),n=o.get(V.WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),i&&i.length>0&&(s.websiteId=i),n&&n.length>0&&(s.websiteNo=n),s}throw new Error("The get method of IStorage has not been implemented.")},Ur=(o,e)=>{if(o.set)e.deviceId&&o.set(V.DEVICE_ID,e.deviceId),e.lang&&o.set(V.LANG,e.lang),e.websiteId&&o.set(V.WEBSITE_ID,e.websiteId),e.websiteNo&&o.set(V.WEBSITE_NO,e.websiteNo);else throw new Error("The set method of IStorage has not been implemented.")},Dr=o=>{if(o.get){const e=o.get(D.IBOOT_DEVICE_ID),t=o.get(D.IBOOT_LANG),i=o.get(D.IBOOT_WEBSITE_ID),n=o.get(D.IBOOT_WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),i&&i.length>0&&(s.websiteId=i),n&&n.length>0&&(s.websiteNo=n),s}throw new Error("The get method of ICookies has not been implemented.")},Mr=(o,e)=>{if(o.set)e.deviceId&&o.set(D.IBOOT_DEVICE_ID,e.deviceId),e.lang&&o.set(D.IBOOT_LANG,e.lang),e.websiteId&&o.set(D.IBOOT_WEBSITE_ID,e.websiteId),e.websiteNo&&o.set(D.IBOOT_WEBSITE_NO,e.websiteNo);else throw new Error("The set method of ICookies has not been implemented.")},jr=o=>{if(o.get){const e=o.get(D.IBOOT_USER);if(e&&e.length>0)return JSON.parse(e)}},Wt=o=>{if(o.get){const e=o[D.IBOOT_USER];if(e&&e.length>0){const t=JSON.parse(e),i=t.username,n=t.userType.toString(),s=o[D.IBOOT_TOKEN];if(s)return{username:i,utype:n,token:s}}}},zt=()=>({path:"/",secure:process.env.APP_ENV==="production",httpOnly:!0,sameSite:"strict"}),_e={maxAge:-1,httpOnly:!0,path:"/"},Vt=(o,e)=>{const{id:t,name:i,username:n,nickname:s,headImg:u,token:r,lastLoginTime:d,deviceId:_,userType:c,mustChangePwd:m}=o,b={id:t,name:i,username:n,nickname:s||i,headImg:u,lastLoginTime:d,deviceId:_,userType:c,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:m};e.cookies[D.IBOOT_TOKEN]={value:r,options:zt()},e.cookies[D.IBOOT_USER]={value:JSON.stringify(b),options:zt()}},Yt=o=>{if(!o.set)throw new Error("cookies set function is undefined");if(o.set(D.IBOOT_TOKEN,"",_e),o.set(D.IBOOT_USER,"",_e),!o.delete)throw new Error("cookies delete function is undefined");o.delete(D.IBOOT_TOKEN,_e),o.delete(D.IBOOT_USER,_e)};class Kt{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version="1";lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV==="production"||k.warn("This is currently a development environment!"),this.baseUrl=process.env.APP_BASEURL,this.apiKey=process.env.APP_APIKEY,this.userFrom=process.env.APP_USERFROM??"1",this.helloMethod=e.helloURL??"",this.userType=e.userType??Te.TYPE_MGT,this.deviceId=e.deviceId??Ae(10),this.lang=e.lang??Or,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}encrypt(e){const t=Q.enc.Utf8.parse(this.apiKey);return Q.AES.encrypt(e,t).toString()}decrypt(e){const t=Q.enc.Utf8.parse(this.apiKey);return Q.AES.decrypt(e,t,{mode:Q.mode.ECB}).toString(Q.enc.Utf8)}convertUrlParameter(e){const t=[];for(const i in e){let n=e[i];if(n&&typeof n=="string")n=n.trim();else if(n&&typeof n=="object"){if(Se(n)){if(n.length===0)continue;for(let s=0;s<n.length;s++){const u=n[s];for(const r in u){const d=u[r]??void 0;if(d){if(typeof d=="object")Se(d)&&d.forEach((_,c)=>{if(_)for(const m in _){const b=_[m];if(b&&b.toString().length>0){const R=`[${s.toString()}].${r+`[${c.toString()}].${m}`}=${se(b)}`;t.push(i+R)}}});else if(d.toString().length>0){const _=`[${s.toString()}].${r}=${se(d.toString())}`;t.push(i+_)}}}}}else for(const s in n){const u=n[s];if(u!=null&&u!=""&&u.length!=0){const r=`.${s}=${se(u)}`;t.push(i+r)}}continue}else n&&typeof n=="function"&&(n=null);n!=null&&n!=""&&n.length!=0&&t.push(i+"="+se(n))}return t&&t.join("&")}async sign(e){const t="&key="+await this.helloIboot(),i=[];for(const d in e)i.push(d);i.sort((d,_)=>d.toLowerCase().localeCompare(_.toLowerCase()));const n=[];i.forEach(d=>{let _=e[d];typeof _=="object"&&(_=JSON.stringify(_)),n.push(d+"="+_)});const s=n.join("&"),u=tr.md5((s+t).toLocaleUpperCase()),r={params:s,md5:u};return k.debug(r,"API_SIGN"),u}assemblyParameter(e,t){const i=e??{};return i.timestamp=Date.now()+"",i.echostr=Ae(10),i.version=this.version,i.deviceId=this.deviceId,i.webid=this.websiteId,i.apiKey=this.apiKey,t&&t.length>0&&(i.username=t),i}async assemblyHeader({urlParams:e,token:t}){const i={"Res-Type":"json","Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};i[X]=j.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(i.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(i["Web-Id"]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(i["Web-No"]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(i.Authorization=t.token,i.Username=t.username),t.xcsrf&&(i[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));const n=pe(e),s=await this.sign(n);return i.Sign=s,i}async helloIboot(){if(this.helloMethod.length<=0)return this.apiKey;const e=this.getApiUrl(this.helloMethod),t={"Res-Type":"json","Api-Key":this.apiKey};t[X]=j.applicationXwwwFormUrlencoded;const i={url:e,headers:t};k.debug(i,"HELLO");const n=await fetch(e,{method:"GET",headers:t,credentials:"include",cache:"force-cache"});if(n.ok){const s=await n.json();return k.debug(s.data,"HELLO RESULT"),s.data}throw new Error("hello iBoot error!")}getApiUrl(e){return`${this.baseUrl}/${e}`}async csrf(){const e=await this.get({url:"guest/csrf"});if(e.success){const t=e.data;if(t)return t.csrfToken.toString()}}async get({url:e,data:t,token:i,cache:n="default"}){const s=this.assemblyParameter(t),u=this.convertUrlParameter(s),r=await this.assemblyHeader({urlParams:u,token:i}),d=`${this.getApiUrl(e)}?${u.toString()}`,_={url:d,headers:r};k.info(_,"GET");const c=await fetch(d,{method:"GET",headers:r,credentials:"include",cache:n});if(c.ok){const b=Object.fromEntries(c.headers.entries()),R={...await c.json(),headers:b};return k.debug(R,"GET_RESULT"),R}const m={code:c.status,success:!1,msg:c.statusText};return k.error(m),m}async post({url:e,data:t,token:i,cache:n="default"}){const s={...t},u=s.buffer??void 0,r=s.boundary??void 0;u&&delete s.buffer,r&&delete s.boundary;const d=this.assemblyParameter(s),_=this.convertUrlParameter(d),c=await this.assemblyHeader({urlParams:_,token:i});u&&r&&(c[X]=`multipart/form-data; boundary=${r}`);const m=this.getApiUrl(e),b={url:m,headers:c,params:d};k.info(b,"POST");const R=u?`${m}?${_}`:m,y=await fetch(R,{method:"POST",headers:c,body:u||_,credentials:"include",cache:n});if(y.ok){const l=Object.fromEntries(y.headers.entries()),g={...await y.json(),headers:l};return k.debug(g,"POST_RESULT"),g}const O={code:y.status,success:!1,msg:y.statusText};return k.error(O),O}async stream({url:e,data:t,token:i}){t=t?{...t}:{};const n=t.buffer??void 0,s=t.boundary??void 0;n&&delete t.buffer,s&&delete t.boundary;const u=this.assemblyParameter(t),r=this.convertUrlParameter(u),d=await this.assemblyHeader({urlParams:r,token:i});n&&s&&(d[X]=`multipart/form-data; boundary=${s}`),d.Connection="keep-alive",d["X-Accel-Buffering"]="no",d["Cache-Control"]="no-cache";const _=this.getApiUrl(e);try{const c=n?`${_}?${r}`:_,m={url:_,headers:d,params:u};k.info(m,"STREAM");const b=await fetch(c,{method:"POST",headers:d,body:n||r.toString(),credentials:"include"});if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);if(!b.body)throw new Error("No response body");const R=Object.fromEntries(b.headers.entries());return new Response(b.body,{headers:R})}catch(c){throw c}}}A.ACCOUNT_TYPE_MAP=rr,A.CONTENT_TYPE_KEY=X,A.CONTENT_TYPE_MAP=j,A.HTTPRouter=Ir,A.HttpClient=Kt,A.NextJsAdapter=Ar,A.USER_FORM_MAP=nr,A.USER_SEX_MAP=ir,A.USER_TYPE_MAP=Te,A.cleanToken=Yt,A.dateFormat=sr,A.get=Bt,A.getLoginUser=jr,A.getServerHttpCookies=Dr,A.getServerHttpOpts=Xt,A.getToken=Wt,A.iGet=Cr,A.iPost=Lr,A.iPostSuccess=kr,A.isArray=Se,A.logger=k,A.post=ot,A.randomString=Ae,A.setClientRequestHeader=Nr,A.setServerHttpCookies=Mr,A.setServerHttpHeaders=Ur,A.setToken=Vt,A.urlEncode=se,A.urlParamToJson=pe,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
|
|
8
|
+
`)}}class i extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class n extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}})(ze)),ze}var Ve={},Ye,It;function br(){if(It)return Ye;It=1;var o=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n=(a,v)=>{for(var f in v)o(a,f,{get:v[f],enumerable:!0})},s=(a,v,f,w)=>{if(v&&typeof v=="object"||typeof v=="function")for(let P of t(v))!i.call(a,P)&&P!==f&&o(a,P,{get:()=>v[P],enumerable:!(w=e(v,P))||w.enumerable});return a},u=a=>s(o({},"__esModule",{value:!0}),a),r={};n(r,{RequestCookies:()=>g,ResponseCookies:()=>h,parseCookie:()=>_,parseSetCookie:()=>c,stringifyCookie:()=>d}),Ye=u(r);function d(a){var v;const f=["path"in a&&a.path&&`Path=${a.path}`,"expires"in a&&(a.expires||a.expires===0)&&`Expires=${(typeof a.expires=="number"?new Date(a.expires):a.expires).toUTCString()}`,"maxAge"in a&&typeof a.maxAge=="number"&&`Max-Age=${a.maxAge}`,"domain"in a&&a.domain&&`Domain=${a.domain}`,"secure"in a&&a.secure&&"Secure","httpOnly"in a&&a.httpOnly&&"HttpOnly","sameSite"in a&&a.sameSite&&`SameSite=${a.sameSite}`,"partitioned"in a&&a.partitioned&&"Partitioned","priority"in a&&a.priority&&`Priority=${a.priority}`].filter(Boolean),w=`${a.name}=${encodeURIComponent((v=a.value)!=null?v:"")}`;return f.length===0?w:`${w}; ${f.join("; ")}`}function _(a){const v=new Map;for(const f of a.split(/; */)){if(!f)continue;const w=f.indexOf("=");if(w===-1){v.set(f,"true");continue}const[P,C]=[f.slice(0,w),f.slice(w+1)];try{v.set(P,decodeURIComponent(C??"true"))}catch{}}return v}function c(a){if(!a)return;const[[v,f],...w]=_(a),{domain:P,expires:C,httponly:q,maxage:M,path:G,samesite:H,secure:Z,partitioned:ee,priority:B}=Object.fromEntries(w.map(([ae,K])=>[ae.toLowerCase(),K])),Y={name:v,value:decodeURIComponent(f),domain:P,...C&&{expires:new Date(C)},...q&&{httpOnly:!0},...typeof M=="string"&&{maxAge:Number(M)},path:G,...H&&{sameSite:R(H)},...Z&&{secure:!0},...B&&{priority:O(B)},...ee&&{partitioned:!0}};return m(Y)}function m(a){const v={};for(const f in a)a[f]&&(v[f]=a[f]);return v}var b=["strict","lax","none"];function R(a){return a=a.toLowerCase(),b.includes(a)?a:void 0}var y=["low","medium","high"];function O(a){return a=a.toLowerCase(),y.includes(a)?a:void 0}function l(a){if(!a)return[];var v=[],f=0,w,P,C,q,M;function G(){for(;f<a.length&&/\s/.test(a.charAt(f));)f+=1;return f<a.length}function H(){return P=a.charAt(f),P!=="="&&P!==";"&&P!==","}for(;f<a.length;){for(w=f,M=!1;G();)if(P=a.charAt(f),P===","){for(C=f,f+=1,G(),q=f;f<a.length&&H();)f+=1;f<a.length&&a.charAt(f)==="="?(M=!0,f=q,v.push(a.substring(w,C)),w=f):f=C+1}else f+=1;(!M||f>=a.length)&&v.push(a.substring(w,a.length))}return v}var g=class{constructor(a){this._parsed=new Map,this._headers=a;const v=a.get("cookie");if(v){const f=_(v);for(const[w,P]of f)this._parsed.set(w,{name:w,value:P})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...a){const v=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(v)}getAll(...a){var v;const f=Array.from(this._parsed);if(!a.length)return f.map(([P,C])=>C);const w=typeof a[0]=="string"?a[0]:(v=a[0])==null?void 0:v.name;return f.filter(([P])=>P===w).map(([P,C])=>C)}has(a){return this._parsed.has(a)}set(...a){const[v,f]=a.length===1?[a[0].name,a[0].value]:a,w=this._parsed;return w.set(v,{name:v,value:f}),this._headers.set("cookie",Array.from(w).map(([P,C])=>d(C)).join("; ")),this}delete(a){const v=this._parsed,f=Array.isArray(a)?a.map(w=>v.delete(w)):v.delete(a);return this._headers.set("cookie",Array.from(v).map(([w,P])=>d(P)).join("; ")),f}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(a=>`${a.name}=${encodeURIComponent(a.value)}`).join("; ")}},h=class{constructor(a){this._parsed=new Map;var v,f,w;this._headers=a;const P=(w=(f=(v=a.getSetCookie)==null?void 0:v.call(a))!=null?f:a.get("set-cookie"))!=null?w:[],C=Array.isArray(P)?P:l(P);for(const q of C){const M=c(q);M&&this._parsed.set(M.name,M)}}get(...a){const v=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(v)}getAll(...a){var v;const f=Array.from(this._parsed.values());if(!a.length)return f;const w=typeof a[0]=="string"?a[0]:(v=a[0])==null?void 0:v.name;return f.filter(P=>P.name===w)}has(a){return this._parsed.has(a)}set(...a){const[v,f,w]=a.length===1?[a[0].name,a[0].value,a[0]]:a,P=this._parsed;return P.set(v,E({name:v,value:f,...w})),p(P,this._headers),this}delete(...a){const[v,f,w]=typeof a[0]=="string"?[a[0]]:[a[0].name,a[0].path,a[0].domain];return this.set({name:v,path:f,domain:w,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(d).join("; ")}};function p(a,v){v.delete("set-cookie");for(const[,f]of a){const w=d(f);v.append("set-cookie",w)}}function E(a={name:"",value:""}){return typeof a.expires=="number"&&(a.expires=new Date(a.expires)),a.maxAge&&(a.expires=new Date(Date.now()+a.maxAge*1e3)),(a.path===null||a.path===void 0)&&(a.path="/"),a}return Ye}var Ot;function Ke(){return Ot||(Ot=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});function e(i,n){for(var s in n)Object.defineProperty(i,s,{enumerable:!0,get:n[s]})}e(o,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=br()})(Ve)),Ve}var Nt;function wr(){return Nt||(Nt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});function e(d,_){for(var c in _)Object.defineProperty(d,c,{enumerable:!0,get:_[c]})}e(o,{INTERNALS:function(){return u},NextRequest:function(){return r}});const t=Pt(),i=St(),n=gr(),s=Ke(),u=Symbol("internal request");class r extends Request{constructor(_,c={}){const m=typeof _!="string"&&"url"in _?_.url:String(_);(0,i.validateURL)(m),_ instanceof Request?super(_,c):super(m,c);const b=new t.NextURL(m,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:c.nextConfig});this[u]={cookies:new s.RequestCookies(this.headers),geo:c.geo||{},ip:c.ip,nextUrl:b,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?m:b.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[u].cookies}get geo(){return this[u].geo}get ip(){return this[u].ip}get nextUrl(){return this[u].nextUrl}get page(){throw new n.RemovedPageError}get ua(){throw new n.RemovedUAError}get url(){return this[u].url}}})(Ie)),Ie}var $e={},Je={},xt;function Er(){return xt||(xt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(i,n,s){const u=Reflect.get(i,n,s);return typeof u=="function"?u.bind(i):u}static set(i,n,s,u){return Reflect.set(i,n,s,u)}static has(i,n){return Reflect.has(i,n)}static deleteProperty(i,n){return Reflect.deleteProperty(i,n)}}})(Je)),Je}var Ct;function vr(){return Ct||(Ct=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"NextResponse",{enumerable:!0,get:function(){return _}});const e=Ke(),t=Pt(),i=St(),n=Er(),s=Ke(),u=Symbol("internal response"),r=new Set([301,302,303,307,308]);function d(c,m){var b;if(!(c==null||(b=c.request)==null)&&b.headers){if(!(c.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const R=[];for(const[y,O]of c.request.headers)m.set("x-middleware-request-"+y,O),R.push(y);m.set("x-middleware-override-headers",R.join(","))}}class _ extends Response{constructor(m,b={}){super(m,b);const R=this.headers,y=new s.ResponseCookies(R),O=new Proxy(y,{get(l,g,h){switch(g){case"delete":case"set":return(...p)=>{const E=Reflect.apply(l[g],l,p),a=new Headers(R);return E instanceof s.ResponseCookies&&R.set("x-middleware-set-cookie",E.getAll().map(v=>(0,e.stringifyCookie)(v)).join(",")),d(b,a),E};default:return n.ReflectAdapter.get(l,g,h)}}});this[u]={cookies:O,url:b.url?new t.NextURL(b.url,{headers:(0,i.toNodeOutgoingHttpHeaders)(R),nextConfig:b.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[u].cookies}static json(m,b){const R=Response.json(m,b);return new _(R.body,R)}static redirect(m,b){const R=typeof b=="number"?b:b?.status??307;if(!r.has(R))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const y=typeof b=="object"?b:{},O=new Headers(y?.headers);return O.set("Location",(0,i.validateURL)(m)),new _(null,{...y,headers:O,status:R})}static rewrite(m,b){const R=new Headers(b?.headers);return R.set("x-middleware-rewrite",(0,i.validateURL)(m)),d(b,R),new _(null,{...b,headers:R})}static next(m){const b=new Headers(m?.headers);return b.set("x-middleware-next","1"),d(m,b),new _(null,{...m,headers:b})}}})($e)),$e}var Qe={},Lt;function Rr(){return Lt||(Lt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"ImageResponse",{enumerable:!0,get:function(){return e}});function e(){throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}})(Qe)),Qe}var Ze={},et={exports:{}},kt;function Pr(){return kt||(kt=1,(()=>{var o={226:function(n,s){(function(u,r){var d="1.0.35",_="",c="?",m="function",b="undefined",R="object",y="string",O="major",l="model",g="name",h="type",p="vendor",E="version",a="architecture",v="console",f="mobile",w="tablet",P="smarttv",C="wearable",q="embedded",M=350,G="Amazon",H="Apple",Z="ASUS",ee="BlackBerry",B="Browser",Y="Chrome",ae="Edge",K="Firefox",te="Google",ge="Huawei",ue="LG",ce="Microsoft",be="Motorola",re="Opera",le="Samsung",we="Sharp",ne="Sony",de="Xiaomi",U="Zebra",Ee="Facebook",ve="Chromium OS",Re="Mac OS",Pe=function(I,x){var S={};for(var L in I)x[L]&&x[L].length%2===0?S[L]=x[L].concat(I[L]):S[L]=I[L];return S},J=function(I){for(var x={},S=0;S<I.length;S++)x[I[S].toUpperCase()]=I[S];return x},$t=function(I,x){return typeof I===y?he(x).indexOf(he(I))!==-1:!1},he=function(I){return I.toLowerCase()},qr=function(I){return typeof I===y?I.replace(/[^\d\.]/g,_).split(".")[0]:r},st=function(I,x){if(typeof I===y)return I=I.replace(/^\s\s*/,_),typeof x===b?I:I.substring(0,M)},fe=function(I,x){for(var S=0,L,$,W,N,T,z;S<x.length&&!T;){var ut=x[S],Zt=x[S+1];for(L=$=0;L<ut.length&&!T&&ut[L];)if(T=ut[L++].exec(I),T)for(W=0;W<Zt.length;W++)z=T[++$],N=Zt[W],typeof N===R&&N.length>0?N.length===2?typeof N[1]==m?this[N[0]]=N[1].call(this,z):this[N[0]]=N[1]:N.length===3?typeof N[1]===m&&!(N[1].exec&&N[1].test)?this[N[0]]=z?N[1].call(this,z,N[2]):r:this[N[0]]=z?z.replace(N[1],N[2]):r:N.length===4&&(this[N[0]]=z?N[3].call(this,z.replace(N[1],N[2])):r):this[N]=z||r;S+=2}},at=function(I,x){for(var S in x)if(typeof x[S]===R&&x[S].length>0){for(var L=0;L<x[S].length;L++)if($t(x[S][L],I))return S===c?r:S}else if($t(x[S],I))return S===c?r:S;return I},Hr={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Jt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Qt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,E],[/opios[\/ ]+([\w\.]+)/i],[E,[g,re+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[g,re]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[g,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[g,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[g,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+B],E],[/\bfocus\/([\w\.]+)/i],[E,[g,K+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[g,re+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[g,re+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[g,"MIUI "+B]],[/fxios\/([-\w\.]+)/i],[E,[g,K]],[/\bqihu|(qi?ho?o?|360)browser/i],[[g,"360 "+B]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1 "+B],E],[/(comodo_dragon)\/([\w\.]+)/i],[[g,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[g,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Ee],E],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[g,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[g,Y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,Y+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[g,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[E,at,Hr]],[/(webkit|khtml)\/([\w\.]+)/i],[g,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[g,K+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[g,E],[/(cobalt)\/([\w\.]+)/i],[g,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[a,"amd64"]],[/(ia32(?=;))/i],[[a,he]],[/((?:i[346]|x)86)[;\)]/i],[[a,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[a,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[a,"armhf"]],[/windows (ce|mobile); ppc;/i],[[a,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[a,/ower/,_,he]],[/(sun4\w)[;\)]/i],[[a,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[a,he]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[p,le],[h,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[p,le],[h,f]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[p,H],[h,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[p,H],[h,w]],[/(macintosh);/i],[l,[p,H]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[p,we],[h,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[p,ge],[h,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[p,ge],[h,f]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[p,de],[h,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[p,de],[h,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[p,"OPPO"],[h,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[p,"Vivo"],[h,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[p,"Realme"],[h,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[p,be],[h,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[p,be],[h,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[p,ue],[h,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[p,ue],[h,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[p,"Lenovo"],[h,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[p,"Nokia"],[h,f]],[/(pixel c)\b/i],[l,[p,te],[h,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[p,te],[h,f]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[p,ne],[h,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[p,ne],[h,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[p,"OnePlus"],[h,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[p,G],[h,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[p,G],[h,f]],[/(playbook);[-\w\),; ]+(rim)/i],[l,p,[h,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[p,ee],[h,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[p,Z],[h,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[p,Z],[h,f]],[/(nexus 9)/i],[l,[p,"HTC"],[h,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[l,/_/g," "],[h,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[p,"Acer"],[h,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[p,"Meizu"],[h,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,l,[h,f]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,l,[h,w]],[/(surface duo)/i],[l,[p,ce],[h,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[p,"Fairphone"],[h,f]],[/(u304aa)/i],[l,[p,"AT&T"],[h,f]],[/\bsie-(\w*)/i],[l,[p,"Siemens"],[h,f]],[/\b(rct\w+) b/i],[l,[p,"RCA"],[h,w]],[/\b(venue[\d ]{2,7}) b/i],[l,[p,"Dell"],[h,w]],[/\b(q(?:mv|ta)\w+) b/i],[l,[p,"Verizon"],[h,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[p,"Barnes & Noble"],[h,w]],[/\b(tm\d{3}\w+) b/i],[l,[p,"NuVision"],[h,w]],[/\b(k88) b/i],[l,[p,"ZTE"],[h,w]],[/\b(nx\d{3}j) b/i],[l,[p,"ZTE"],[h,f]],[/\b(gen\d{3}) b.+49h/i],[l,[p,"Swiss"],[h,f]],[/\b(zur\d{3}) b/i],[l,[p,"Swiss"],[h,w]],[/\b((zeki)?tb.*\b) b/i],[l,[p,"Zeki"],[h,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],l,[h,w]],[/\b(ns-?\w{0,9}) b/i],[l,[p,"Insignia"],[h,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[p,"NextBook"],[h,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],l,[h,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],l,[h,f]],[/\b(ph-1) /i],[l,[p,"Essential"],[h,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[p,"Envizen"],[h,w]],[/\b(trio[-\w\. ]+) b/i],[l,[p,"MachSpeed"],[h,w]],[/\btu_(1491) b/i],[l,[p,"Rotor"],[h,w]],[/(shield[\w ]+) b/i],[l,[p,"Nvidia"],[h,w]],[/(sprint) (\w+)/i],[p,l,[h,f]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[p,ce],[h,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[p,U],[h,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[p,U],[h,f]],[/smart-tv.+(samsung)/i],[p,[h,P]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[p,le],[h,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,ue],[h,P]],[/(apple) ?tv/i],[p,[l,H+" TV"],[h,P]],[/crkey/i],[[l,Y+"cast"],[p,te],[h,P]],[/droid.+aft(\w)( bui|\))/i],[l,[p,G],[h,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[p,we],[h,P]],[/(bravia[\w ]+)( bui|\))/i],[l,[p,ne],[h,P]],[/(mitv-\w{5}) bui/i],[l,[p,de],[h,P]],[/Hbbtv.*(technisat) (.*);/i],[p,l,[h,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,st],[l,st],[h,P]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,P]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,l,[h,v]],[/droid.+; (shield) bui/i],[l,[p,"Nvidia"],[h,v]],[/(playstation [345portablevi]+)/i],[l,[p,ne],[h,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[p,ce],[h,v]],[/((pebble))app/i],[p,l,[h,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[p,H],[h,C]],[/droid.+; (glass) \d/i],[l,[p,te],[h,C]],[/droid.+; (wt63?0{2,3})\)/i],[l,[p,U],[h,C]],[/(quest( 2| pro)?)/i],[l,[p,Ee],[h,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,q]],[/(aeobc)\b/i],[l,[p,G],[h,q]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[h,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[h,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,f]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[g,ae+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[g,[E,at,Jt]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,"Windows"],[E,at,Jt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Re],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,E],[/\(bb(10);/i],[E,[g,ee]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[g,K+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[g,Y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,ve],E],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,E],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,E]]},F=function(I,x){if(typeof I===R&&(x=I,I=r),!(this instanceof F))return new F(I,x).getResult();var S=typeof u!==b&&u.navigator?u.navigator:r,L=I||(S&&S.userAgent?S.userAgent:_),$=S&&S.userAgentData?S.userAgentData:r,W=x?Pe(Qt,x):Qt,N=S&&S.userAgent==L;return this.getBrowser=function(){var T={};return T[g]=r,T[E]=r,fe.call(T,L,W.browser),T[O]=qr(T[E]),N&&S&&S.brave&&typeof S.brave.isBrave==m&&(T[g]="Brave"),T},this.getCPU=function(){var T={};return T[a]=r,fe.call(T,L,W.cpu),T},this.getDevice=function(){var T={};return T[p]=r,T[l]=r,T[h]=r,fe.call(T,L,W.device),N&&!T[h]&&$&&$.mobile&&(T[h]=f),N&&T[l]=="Macintosh"&&S&&typeof S.standalone!==b&&S.maxTouchPoints&&S.maxTouchPoints>2&&(T[l]="iPad",T[h]=w),T},this.getEngine=function(){var T={};return T[g]=r,T[E]=r,fe.call(T,L,W.engine),T},this.getOS=function(){var T={};return T[g]=r,T[E]=r,fe.call(T,L,W.os),N&&!T[g]&&$&&$.platform!="Unknown"&&(T[g]=$.platform.replace(/chrome os/i,ve).replace(/macos/i,Re)),T},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return L},this.setUA=function(T){return L=typeof T===y&&T.length>M?st(T,M):T,this},this.setUA(L),this};F.VERSION=d,F.BROWSER=J([g,E,O]),F.CPU=J([a]),F.DEVICE=J([l,p,h,v,f,P,w,C,q]),F.ENGINE=F.OS=J([g,E]),typeof s!==b?(n.exports&&(s=n.exports=F),s.UAParser=F):typeof u!==b&&(u.UAParser=F);var ie=typeof u!==b&&(u.jQuery||u.Zepto);if(ie&&!ie.ua){var ye=new F;ie.ua=ye.getResult(),ie.ua.get=function(){return ye.getUA()},ie.ua.set=function(I){ye.setUA(I);var x=ye.getResult();for(var S in x)ie.ua[S]=x[S]}}})(typeof window=="object"?window:this)}},e={};function t(n){var s=e[n];if(s!==void 0)return s.exports;var u=e[n]={exports:{}},r=!0;try{o[n].call(u.exports,u,u.exports,t),r=!1}finally{r&&delete e[n]}return u.exports}typeof t<"u"&&(t.ab=__dirname+"/");var i=t(226);et.exports=i})()),et.exports}var Ut;function Dt(){return Ut||(Ut=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0});function e(r,d){for(var _ in d)Object.defineProperty(r,_,{enumerable:!0,get:d[_]})}e(o,{isBot:function(){return n},userAgent:function(){return u},userAgentFromString:function(){return s}});const t=i(Pr());function i(r){return r&&r.__esModule?r:{default:r}}function n(r){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(r)}function s(r){return{...(0,t.default)(r),isBot:r===void 0?!1:n(r)}}function u({headers:r}){return s(r.get("user-agent")||void 0)}})(Ze)),Ze}var tt={},Mt;function yr(){return Mt||(Mt=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})(tt)),tt}var jt;function Tr(){return jt||(jt=1,(function(o,e){const t={NextRequest:wr().NextRequest,NextResponse:vr().NextResponse,ImageResponse:Rr().ImageResponse,userAgentFromString:Dt().userAgentFromString,userAgent:Dt().userAgent,URLPattern:yr().URLPattern};o.exports=t,e.NextRequest=t.NextRequest,e.NextResponse=t.NextResponse,e.ImageResponse=t.ImageResponse,e.userAgentFromString=t.userAgentFromString,e.userAgent=t.userAgent,e.URLPattern=t.URLPattern})(me,me.exports)),me.exports}var Sr=Tr();class Ar{async parseRequest(e){const t=new URL(e.url);let i,n;if(e.method!=="GET"){const r=e.headers.get(X)||"";if(k.debug({"content-type":r},"Content-Type"),r.includes(j.applicationJson))try{i=await e.json()}catch{k.warn("request body is null!")}else if(r.includes(j.multipartFormData))n=await e.formData();else if(r.includes(j.applicationXwwwFormUrlencoded)){const d=await e.text();i=pe(d,["m"])}}const s=e.headers,u={};return e.cookies.getAll().forEach(r=>{u[r.name]=r.value}),i&&k.debug(i,"NextJsAdapter.parseRequest"),n&&k.debug(n,"NextJsAdapter.parseRequest"),{url:t,headers:s,body:i,formData:n,cookies:u,raw:e,clone(){return e.clone()}}}createResponse(e){const t=Sr.NextResponse.json(e.body);if(Object.entries(e.cookies).forEach(([i,n])=>{typeof n=="object"&&n.value?t.cookies.set(i,n.value,n.options):typeof n=="string"&&t.cookies.set(i,n)}),e.cleanCookies){const i={set(n,s,u){t.cookies.set(n,s,u)},delete(n,s){t.cookies.delete({...s,name:n})}};e.cleanCookies(i)}return t}setCookie(e,t,i,n){e.cookies[t]={value:i,options:n}}}var rt=(o=>(o[o.login=0]="login",o[o.logout=1]="logout",o))(rt||{});const nt={login:"login",logout:"logout",unknown:""},X="Content-Type",j={applicationJson:"application/json",multipartFormData:"multipart/form-data",applicationXwwwFormUrlencoded:"application/x-www-form-urlencoded"};class Ir{config;http;adapter;constructor({config:e,adapter:t,headerStorage:i}){this.config=e;const n=Xt(i);this.http=new Kt({...n,userType:Te.TYPE_C,helloURL:e.helloURL}),this.adapter=t}async handleRequest(e){const t=await this.adapter.parseRequest(e),i=await this.processRequest(t);return this.adapter.createResponse(i)}async processRequest(e){const t=e.url.searchParams,i=t.get("m")??"unknown",s={...nt,...this.config.APIMAP}[i];if(!s||s.length===0)return this.createErrorResponse(404,"API not found");let u;if((s.startsWith("admin/")||s.startsWith("api/"))&&(u=Wt(e.cookies),k.debug(u,"token"),!u||u.username.length===0||u.token.length===0))return this.createErrorResponse(409,"Authentication required");k.debug({hostUrl:s,token:u},"processRequest");const r=e.clone(),d=r.method;if(d==="GET"){const _=pe(t.toString(),["m"]),c=await this.http.get({url:s,data:_,token:u});return this.createResponse({url:s,result:c})}else if(d==="POST"){let _;const c=e.headers.get(X)||"";if(c.includes(j.applicationJson)||c.includes(j.applicationXwwwFormUrlencoded))e.body&&(_={...e.body});else if(c.includes(j.multipartFormData)){const b=c.match(/boundary=([^\s;]+)/);if(!b)return this.createErrorResponse(411,"Missing boundary in form data");const R=await r.arrayBuffer();_={boundary:b[1],buffer:Buffer.from(R)};const O=e.formData;if(O)for(const[l,g]of Object.entries(O))l!=="file"&&(_[l]=g)}else return this.createErrorResponse(410,"Unsupported content type");const m=await this.http.post({url:s,data:_,token:u});return this.createResponse({url:s,result:m})}return this.createErrorResponse(405,"Method not allowed, only supported GET or POST")}createResponse({url:e,result:t}){const i={};i[X]=j.applicationJson;const n={status:t.success?200:t.code,headers:i,cookies:{},body:t};if(t.success)switch(e){case nt[rt[0]]:const s=t.data;Vt(s,n);break;case nt[rt[1]]:n.cleanCookies=u=>Yt(u);break}return n}createErrorResponse(e,t){const i={};return i[X]=j.applicationJson,{status:e,headers:i,cookies:{},body:{code:e,success:!1,msg:t}}}}const Or="zh-CN",qt="_device_id_key",Ht="_current_website_key",Ft="Get request error!",it="Post request error!",D={IBOOT_DEVICE_ID:"dvid",IBOOT_LANG:"lang",IBOOT_WEBSITE_ID:"wid",IBOOT_WEBSITE_NO:"wno",IBOOT_TOKEN:"token",IBOOT_USER:"user"},V={DEVICE_ID:"Device-Id",LANG:"Lang",WEBSITE_ID:"Website-Id",WEBSITE_NO:"Website-No"},Gt=o=>{if(!o.get)throw new Error("The get method of IStorage has not been implemented.");const e=o.get(qt)??"",t=o.get(Ht),i=t!=null?JSON.parse(t):null,n={};return e.length>0&&(n["Device-Id"]=e),i&&(n.Lang=i.language,i.websiteId&&(n["Website-Id"]=i.websiteId),i.websiteNo&&(n["Website-No"]=i.websiteNo)),n},Nr=({deviceId:o,website:e},t)=>{if(!t.set)throw new Error("The set method of IStorage has not been implemented.");t.set(qt,o),e&&t.set(Ht,JSON.stringify(e))},xr=o=>`${process.env.BASE_URL||"/api/services"}?m=${o}`,Bt=async(o,e)=>{let t=xr(o);if(e?.data){const r=new URLSearchParams(e.data);t+=`&${r}`}const i=e&&e.storage&&e.storage.get?Gt(e.storage):{},n=e?.headers;if(n)for(const r in n){const d=n[r];d&&(i[r]=d)}k.info({url:t,headers:i},"GET");const s=await fetch(t,{method:"GET",headers:i,cache:e?.useCache?"force-cache":"default"});if(s.ok){const r=Object.fromEntries(s.headers.entries()),d={...await s.json(),headers:r};return k.debug(d,"GET_RESULT"),d}const u={code:s.status,success:!1,msg:s.statusText};return k.error(u),u},ot=async(o,e)=>{const t=e?.data??{},i=e?.headers;let n;const s=e&&e.storage&&e.storage.get?Gt(e.storage):{},u=new Headers(s);if(t instanceof FormData?n=t:(n=JSON.stringify(t),u.set(X,j.applicationJson)),i)for(let _ in i){const c=i[_];c&&u.set(_,c)}k.info({url:o,headers:u},"POST");const r=await fetch(o,{method:"POST",headers:u,body:n});if(r.ok){const _=Object.fromEntries(r.headers.entries()),c={...await r.json(),headers:_};return k.debug(c,"POST_RESULT"),c}const d={code:r.status,success:!1,msg:r.statusText};return k.error(d),d},Cr=async(o,e)=>{const t=await Bt(o,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??Ft);return}throw Error(t.msg??Ft)},Lr=async(o,e)=>{const t=await ot(o,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??it);return}throw Error(t.msg??it)},kr=async(o,e)=>{const t=await ot(o,e);return t.success?(e?.showSuccess&&e.showSuccess(t.msg??"SUCCESS"),!0):(e?.showError&&e.showError(t.msg??it),!1)},Xt=o=>{if(o.get){const e=o.get(V.DEVICE_ID),t=o.get(V.LANG),i=o.get(V.WEBSITE_ID),n=o.get(V.WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),i&&i.length>0&&(s.websiteId=i),n&&n.length>0&&(s.websiteNo=n),s}throw new Error("The get method of IStorage has not been implemented.")},Ur=(o,e)=>{if(o.set)e.deviceId&&o.set(V.DEVICE_ID,e.deviceId),e.lang&&o.set(V.LANG,e.lang),e.websiteId&&o.set(V.WEBSITE_ID,e.websiteId),e.websiteNo&&o.set(V.WEBSITE_NO,e.websiteNo);else throw new Error("The set method of IStorage has not been implemented.")},Dr=o=>{if(o.get){const e=o.get(D.IBOOT_DEVICE_ID),t=o.get(D.IBOOT_LANG),i=o.get(D.IBOOT_WEBSITE_ID),n=o.get(D.IBOOT_WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),i&&i.length>0&&(s.websiteId=i),n&&n.length>0&&(s.websiteNo=n),s}throw new Error("The get method of ICookies has not been implemented.")},Mr=(o,e)=>{if(o.set)e.deviceId&&o.set(D.IBOOT_DEVICE_ID,e.deviceId),e.lang&&o.set(D.IBOOT_LANG,e.lang),e.websiteId&&o.set(D.IBOOT_WEBSITE_ID,e.websiteId),e.websiteNo&&o.set(D.IBOOT_WEBSITE_NO,e.websiteNo);else throw new Error("The set method of ICookies has not been implemented.")},jr=o=>{if(o.get){const e=o.get(D.IBOOT_USER);if(e&&e.length>0)return JSON.parse(e)}},Wt=o=>{if(o.get){const e=o[D.IBOOT_USER];if(e&&e.length>0){const t=JSON.parse(e),i=t.username,n=t.userType.toString(),s=o[D.IBOOT_TOKEN];if(s)return{username:i,utype:n,token:s}}}},zt=()=>({path:"/",secure:process.env.APP_ENV==="production",httpOnly:!0,sameSite:"strict"}),_e={maxAge:-1,httpOnly:!0,path:"/"},Vt=(o,e)=>{const{id:t,name:i,username:n,nickname:s,headImg:u,token:r,lastLoginTime:d,deviceId:_,userType:c,mustChangePwd:m}=o,b={id:t,name:i,username:n,nickname:s||i,headImg:u,lastLoginTime:d,deviceId:_,userType:c,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:m};e.cookies[D.IBOOT_TOKEN]={value:r,options:zt()},e.cookies[D.IBOOT_USER]={value:JSON.stringify(b),options:zt()}},Yt=o=>{if(!o.set)throw new Error("cookies set function is undefined");if(o.set(D.IBOOT_TOKEN,"",_e),o.set(D.IBOOT_USER,"",_e),!o.delete)throw new Error("cookies delete function is undefined");o.delete(D.IBOOT_TOKEN,_e),o.delete(D.IBOOT_USER,_e)};class Kt{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version="1";lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV==="production"||k.warn("This is currently a development environment!"),this.baseUrl=process.env.APP_BASEURL,this.apiKey=process.env.APP_APIKEY,this.userFrom=process.env.APP_USERFROM??"1",this.helloMethod=e.helloURL??"",this.userType=e.userType??Te.TYPE_MGT,this.deviceId=e.deviceId??Ae(10),this.lang=e.lang??Or,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}encrypt(e){const t=Q.enc.Utf8.parse(this.apiKey);return Q.AES.encrypt(e,t).toString()}decrypt(e){const t=Q.enc.Utf8.parse(this.apiKey);return Q.AES.decrypt(e,t,{mode:Q.mode.ECB}).toString(Q.enc.Utf8)}convertUrlParameter(e){const t=[];for(const i in e){let n=e[i];if(n&&typeof n=="string")n=n.trim();else if(n&&typeof n=="object"){if(Se(n)){if(n.length===0)continue;for(let s=0;s<n.length;s++){const u=n[s];for(const r in u){const d=u[r]??void 0;if(d){if(typeof d=="object")Se(d)&&d.forEach((_,c)=>{if(_)for(const m in _){const b=_[m];if(b&&b.toString().length>0){const R=`[${s.toString()}].${r+`[${c.toString()}].${m}`}=${se(b)}`;t.push(i+R)}}});else if(d.toString().length>0){const _=`[${s.toString()}].${r}=${se(d.toString())}`;t.push(i+_)}}}}}else for(const s in n){const u=n[s];if(u!=null&&u!=""&&u.length!=0){const r=`.${s}=${se(u)}`;t.push(i+r)}}continue}else n&&typeof n=="function"&&(n=null);n!=null&&n!=""&&n.length!=0&&t.push(i+"="+se(n))}return t&&t.join("&")}async sign(e){const t="&key="+await this.helloIboot(),i=[];for(const d in e)i.push(d);i.sort((d,_)=>d.toLowerCase().localeCompare(_.toLowerCase()));const n=[];i.forEach(d=>{let _=e[d];typeof _=="object"&&(_=JSON.stringify(_)),n.push(d+"="+_)});const s=n.join("&"),u=tr.md5((s+t).toLocaleUpperCase()),r={params:s,md5:u};return k.debug(r,"API_SIGN"),u}assemblyParameter(e,t){const i=e??{};return i.timestamp=Date.now()+"",i.echostr=Ae(10),i.version=this.version,i.deviceId=this.deviceId,i.webid=this.websiteId,i.apiKey=this.apiKey,t&&t.length>0&&(i.username=t),i}async assemblyHeader({urlParams:e,token:t}){const i={"Res-Type":"json","Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};i[X]=j.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(i.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(i["Web-Id"]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(i["Web-No"]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(i.Authorization=t.token,i.Username=t.username),t.xcsrf&&(i[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));const n=pe(e),s=await this.sign(n);return i.Sign=s,i}async helloIboot(){if(this.helloMethod.length<=0)return this.apiKey;const e=this.getApiUrl(this.helloMethod),t={"Res-Type":"json","Api-Key":this.apiKey};t[X]=j.applicationXwwwFormUrlencoded;const i={url:e,headers:t};k.debug(i,"HELLO");const n=await fetch(e,{method:"GET",headers:t,credentials:"include",cache:"force-cache"});if(n.ok){const s=await n.json();return k.debug(s.data,"HELLO RESULT"),s.data}throw new Error("hello iBoot error!")}getApiUrl(e){return`${this.baseUrl}/${e}`}async csrf(){const e=await this.get({url:"guest/csrf"});if(e.success){const t=e.data;if(t)return t.csrfToken.toString()}}async get({url:e,data:t,token:i,cache:n="default"}){const s=this.assemblyParameter(t),u=this.convertUrlParameter(s),r=await this.assemblyHeader({urlParams:u,token:i}),d=`${this.getApiUrl(e)}?${u.toString()}`,_={url:d,headers:r};k.info(_,"GET");const c=await fetch(d,{method:"GET",headers:r,credentials:"include",cache:n});if(c.ok){const b=Object.fromEntries(c.headers.entries()),R={...await c.json(),headers:b};return k.debug(R,"GET_RESULT"),R}const m={code:c.status,success:!1,msg:c.statusText};return k.error(m),m}async post({url:e,data:t,token:i,cache:n="default"}){const s=t?{...t}:{},u=s.buffer??void 0,r=s.boundary??void 0;u&&delete s.buffer,r&&delete s.boundary;const d=this.assemblyParameter(s),_=this.convertUrlParameter(d),c=await this.assemblyHeader({urlParams:_,token:i});u&&r&&(c[X]=`multipart/form-data; boundary=${r}`);const m=this.getApiUrl(e),b={url:m,headers:c,params:d};k.info(b,"POST");const R=u?`${m}?${_}`:m,y=await fetch(R,{method:"POST",headers:c,body:u||_,credentials:"include",cache:n});if(y.ok){const l=Object.fromEntries(y.headers.entries()),g={...await y.json(),headers:l};return k.debug(g,"POST_RESULT"),g}const O={code:y.status,success:!1,msg:y.statusText};return k.error(O),O}async stream({url:e,data:t,token:i}){t=t?{...t}:{};const n=t.buffer??void 0,s=t.boundary??void 0;n&&delete t.buffer,s&&delete t.boundary;const u=this.assemblyParameter(t),r=this.convertUrlParameter(u),d=await this.assemblyHeader({urlParams:r,token:i});n&&s&&(d[X]=`multipart/form-data; boundary=${s}`),d.Connection="keep-alive",d["X-Accel-Buffering"]="no",d["Cache-Control"]="no-cache";const _=this.getApiUrl(e);try{const c=n?`${_}?${r}`:_,m={url:_,headers:d,params:u};k.info(m,"STREAM");const b=await fetch(c,{method:"POST",headers:d,body:n||r.toString(),credentials:"include"});if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);if(!b.body)throw new Error("No response body");const R=Object.fromEntries(b.headers.entries());return new Response(b.body,{headers:R})}catch(c){throw c}}}A.ACCOUNT_TYPE_MAP=rr,A.CONTENT_TYPE_KEY=X,A.CONTENT_TYPE_MAP=j,A.HTTPRouter=Ir,A.HttpClient=Kt,A.NextJsAdapter=Ar,A.USER_FORM_MAP=nr,A.USER_SEX_MAP=ir,A.USER_TYPE_MAP=Te,A.cleanToken=Yt,A.dateFormat=sr,A.get=Bt,A.getLoginUser=jr,A.getServerHttpCookies=Dr,A.getServerHttpOpts=Xt,A.getToken=Wt,A.iGet=Cr,A.iPost=Lr,A.iPostSuccess=kr,A.isArray=Se,A.logger=k,A.post=ot,A.randomString=Ae,A.setClientRequestHeader=Nr,A.setServerHttpCookies=Mr,A.setServerHttpHeaders=Ur,A.setToken=Vt,A.urlEncode=se,A.urlParamToJson=pe,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
|
|
9
9
|
//# sourceMappingURL=iboot-http-client.umd.js.map
|