iboot-http-client 1.4.6 → 1.4.7

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.
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rr=require("pino"),nr=require("pino-pretty"),or=require("js-md5"),oe=require("crypto-js"),G=require("h3"),ir={GENERAL:0,PHONE:1,EMAIL:2},Ht={TYPE_MGT:0,TYPE_C:1,TYPE_B:2},sr={FROM_WEB:1,FROM_PC:2,FROM_WX_MINI_PRO:3,FROM_WX_PLU:4,FROM_WX_E:5,FROM_APP:6,FROM_DEVICE:7},ar={unknown:0,male:1,female:2},ur=nr({colorize:!0,destination:process.stdout,translateTime:"SYS:yyyy-mm-dd HH:MM:ss",ignore:"pid,hostname",messageFormat:"{msg}",singleLine:!0}),L=rr({name:process.env.APP_NAME??"iBoot",level:process.env.APP_ENV==="production"?"info":"debug",nestedKey:"payload"},ur),Ze=i=>Array.isArray(i)||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Array]",et=i=>{const e=i||32,t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",o=t.length;let r="";for(let s=0;s<e;s++)r+=t.charAt(Math.floor(Math.random()*o));return r},Pe=(i,e)=>{const t={};return i.split("&").forEach(r=>{const s=r.split("=");s[1]&&(!e||e.indexOf(s[0])==-1)&&(t[s[0]]=s[1])}),t},fe=i=>!i||i==""||i.length==0?"":encodeURIComponent(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\'/g,"%27").replace(/\!/g,"%21").replace(/\~/g,"%7E"),cr=(i,e)=>{const t={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};if(/(y+)/.test(e)){const r=new RegExp(/(y+)/).exec(e);let s=0;r&&r.length>0&&(s=r[0].length),e=e.replace(/(y+)/,i.getFullYear()+"").substring(4-s)}for(const o in t){const r="("+o+")",s=new RegExp(r);if(s.test(e)){const c=s.exec(e);let n=0;c&&c.length>0&&(n=c[0].length),e=e.replace(s,n==1?t[o].toString():("00"+t[o]).substring(t[o].toString().length))}}return e};var ve={exports:{}},Ae={},Ie={},Oe={},dt;function lr(){return dt||(dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(t,o,r){if(t){r&&(r=r.toLowerCase());for(const n of t){var s,c;const l=(s=n.domain)==null?void 0:s.split(":",1)[0].toLowerCase();if(o===l||r===n.defaultLocale.toLowerCase()||(c=n.locales)!=null&&c.some(f=>f.toLowerCase()===r))return n}}}})(Oe)),Oe}var xe={},Ne={},ft;function dr(){return ft||(ft=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\/$/,"")||"/"}})(Ne)),Ne}var Ce={},Le={},ht;function ot(){return ht||(ht=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"parsePath",{enumerable:!0,get:function(){return e}});function e(t){const o=t.indexOf("#"),r=t.indexOf("?"),s=r>-1&&(o<0||r<o);return s||o>-1?{pathname:t.substring(0,s?r:o),query:s?t.substring(r,o>-1?o:void 0):"",hash:o>-1?t.slice(o):""}:{pathname:t,query:"",hash:""}}})(Le)),Le}var pt;function Ft(){return pt||(pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathPrefix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,r){if(!o.startsWith("/")||!r)return o;const{pathname:s,query:c,hash:n}=(0,e.parsePath)(o);return""+r+s+c+n}})(Ce)),Ce}var ke={},mt;function fr(){return mt||(mt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathSuffix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,r){if(!o.startsWith("/")||!r)return o;const{pathname:s,query:c,hash:n}=(0,e.parsePath)(o);return""+s+r+c+n}})(ke)),ke}var Ue={},De={},_t;function it(){return _t||(_t=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"pathHasPrefix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,r){if(typeof o!="string")return!1;const{pathname:s}=(0,e.parsePath)(o);return s===r||s.startsWith(r+"/")}})(De)),De}var gt;function hr(){return gt||(gt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addLocale",{enumerable:!0,get:function(){return o}});const e=Ft(),t=it();function o(r,s,c,n){if(!s||s===c)return r;const l=r.toLowerCase();return!n&&((0,t.pathHasPrefix)(l,"/api")||(0,t.pathHasPrefix)(l,"/"+s.toLowerCase()))?r:(0,e.addPathPrefix)(r,"/"+s)}})(Ue)),Ue}var bt;function pr(){return bt||(bt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});const e=dr(),t=Ft(),o=fr(),r=hr();function s(c){let n=(0,r.addLocale)(c.pathname,c.locale,c.buildId?void 0:c.defaultLocale,c.ignorePrefix);return(c.buildId||!c.trailingSlash)&&(n=(0,e.removeTrailingSlash)(n)),c.buildId&&(n=(0,o.addPathSuffix)((0,t.addPathPrefix)(n,"/_next/data/"+c.buildId),c.pathname==="/"?"index.json":".json")),n=(0,t.addPathPrefix)(n,c.basePath),!c.buildId&&c.trailingSlash?n.endsWith("/")?n:(0,o.addPathSuffix)(n,"/"):(0,e.removeTrailingSlash)(n)}})(xe)),xe}var Me={},wt;function mr(){return wt||(wt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getHostname",{enumerable:!0,get:function(){return e}});function e(t,o){let r;if(o?.host&&!Array.isArray(o.host))r=o.host.toString().split(":",1)[0];else if(t.hostname)r=t.hostname;else return;return r.toLowerCase()}})(Me)),Me}var je={},qe={},Et;function _r(){return Et||(Et=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(t,o){let r;const s=t.split("/");return(o||[]).some(c=>s[1]&&s[1].toLowerCase()===c.toLowerCase()?(r=c,s.splice(1,1),t=s.join("/")||"/",!0):!1),{pathname:t,detectedLocale:r}}})(qe)),qe}var He={},vt;function gr(){return vt||(vt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removePathPrefix",{enumerable:!0,get:function(){return t}});const e=it();function t(o,r){if(!(0,e.pathHasPrefix)(o,r))return o;const s=o.slice(r.length);return s.startsWith("/")?s:"/"+s}})(He)),He}var Rt;function br(){return Rt||(Rt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getNextPathnameInfo",{enumerable:!0,get:function(){return r}});const e=_r(),t=gr(),o=it();function r(s,c){var n;const{basePath:l,i18n:f,trailingSlash:u}=(n=c.nextConfig)!=null?n:{},h={pathname:s,trailingSlash:s!=="/"?s.endsWith("/"):u};l&&(0,o.pathHasPrefix)(h.pathname,l)&&(h.pathname=(0,t.removePathPrefix)(h.pathname,l),h.basePath=l);let g=h.pathname;if(h.pathname.startsWith("/_next/data/")&&h.pathname.endsWith(".json")){const P=h.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),I=P[0];h.buildId=I,g=P[1]!=="index"?"/"+P.slice(1).join("/"):"/",c.parseData===!0&&(h.pathname=g)}if(f){let P=c.i18nProvider?c.i18nProvider.analyze(h.pathname):(0,e.normalizeLocalePath)(h.pathname,f.locales);h.locale=P.detectedLocale;var v;h.pathname=(v=P.pathname)!=null?v:h.pathname,!P.detectedLocale&&h.buildId&&(P=c.i18nProvider?c.i18nProvider.analyze(g):(0,e.normalizeLocalePath)(g,f.locales),P.detectedLocale&&(h.locale=P.detectedLocale))}return h}})(je)),je}var Pt;function Bt(){return Pt||(Pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextURL",{enumerable:!0,get:function(){return l}});const e=lr(),t=pr(),o=mr(),r=br(),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(f,u){return new URL(String(f).replace(s,"localhost"),u&&String(u).replace(s,"localhost"))}const n=Symbol("NextURLInternal");class l{constructor(u,h,g){let v,P;typeof h=="object"&&"pathname"in h||typeof h=="string"?(v=h,P=g||{}):P=g||h||{},this[n]={url:c(u,v??P.base),options:P,basePath:""},this.analyze()}analyze(){var u,h,g,v,P;const I=(0,r.getNextPathnameInfo)(this[n].url.pathname,{nextConfig:this[n].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[n].options.i18nProvider}),d=(0,o.getHostname)(this[n].url,this[n].options.headers);this[n].domainLocale=this[n].options.i18nProvider?this[n].options.i18nProvider.detectDomainLocale(d):(0,e.detectDomainLocale)((h=this[n].options.nextConfig)==null||(u=h.i18n)==null?void 0:u.domains,d);const b=((g=this[n].domainLocale)==null?void 0:g.defaultLocale)||((P=this[n].options.nextConfig)==null||(v=P.i18n)==null?void 0:v.defaultLocale);this[n].url.pathname=I.pathname,this[n].defaultLocale=b,this[n].basePath=I.basePath??"",this[n].buildId=I.buildId,this[n].locale=I.locale??b,this[n].trailingSlash=I.trailingSlash}formatPathname(){return(0,t.formatNextPathnameInfo)({basePath:this[n].basePath,buildId:this[n].buildId,defaultLocale:this[n].options.forceLocale?void 0:this[n].defaultLocale,locale:this[n].locale,pathname:this[n].url.pathname,trailingSlash:this[n].trailingSlash})}formatSearch(){return this[n].url.search}get buildId(){return this[n].buildId}set buildId(u){this[n].buildId=u}get locale(){return this[n].locale??""}set locale(u){var h,g;if(!this[n].locale||!(!((g=this[n].options.nextConfig)==null||(h=g.i18n)==null)&&h.locales.includes(u)))throw new TypeError(`The NextURL configuration includes no locale "${u}"`);this[n].locale=u}get defaultLocale(){return this[n].defaultLocale}get domainLocale(){return this[n].domainLocale}get searchParams(){return this[n].url.searchParams}get host(){return this[n].url.host}set host(u){this[n].url.host=u}get hostname(){return this[n].url.hostname}set hostname(u){this[n].url.hostname=u}get port(){return this[n].url.port}set port(u){this[n].url.port=u}get protocol(){return this[n].url.protocol}set protocol(u){this[n].url.protocol=u}get href(){const u=this.formatPathname(),h=this.formatSearch();return`${this.protocol}//${this.host}${u}${h}${this.hash}`}set href(u){this[n].url=c(u),this.analyze()}get origin(){return this[n].url.origin}get pathname(){return this[n].url.pathname}set pathname(u){this[n].url.pathname=u}get hash(){return this[n].url.hash}set hash(u){this[n].url.hash=u}get search(){return this[n].url.search}set search(u){this[n].url.search=u}get password(){return this[n].url.password}set password(u){this[n].url.password=u}get username(){return this[n].url.username}set username(u){this[n].url.username=u}get basePath(){return this[n].basePath}set basePath(u){this[n].basePath=u.startsWith("/")?u:`/${u}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new l(String(this),this[n].options)}}})(Ie)),Ie}var Fe={},Be={},yt;function wr(){return yt||(yt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(be,we){for(var J in we)Object.defineProperty(be,J,{enumerable:!0,get:we[J]})}e(i,{ACTION_SUFFIX:function(){return l},APP_DIR_ALIAS:function(){return j},CACHE_ONE_YEAR:function(){return E},DOT_NEXT_ALIAS:function(){return y},ESLINT_DEFAULT_DIRS:function(){return re},GSP_NO_RETURNED_VALUE:function(){return se},GSSP_COMPONENT_MEMBER_ERROR:function(){return te},GSSP_NO_RETURNED_VALUE:function(){return ae},INSTRUMENTATION_HOOK_FILENAME:function(){return m},MIDDLEWARE_FILENAME:function(){return a},MIDDLEWARE_LOCATION_REGEXP:function(){return R},NEXT_BODY_SUFFIX:function(){return h},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return _},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return P},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return I},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return v},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return p},NEXT_CACHE_TAGS_HEADER:function(){return g},NEXT_CACHE_TAG_MAX_ITEMS:function(){return d},NEXT_CACHE_TAG_MAX_LENGTH:function(){return b},NEXT_DATA_SUFFIX:function(){return f},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return o},NEXT_META_SUFFIX:function(){return u},NEXT_QUERY_PARAM_PREFIX:function(){return t},NON_STANDARD_NODE_ENV:function(){return ue},PAGES_DIR_ALIAS:function(){return w},PRERENDER_REVALIDATE_HEADER:function(){return r},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return s},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return B},ROOT_DIR_ALIAS:function(){return N},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return Z},RSC_ACTION_ENCRYPTION_ALIAS:function(){return Q},RSC_ACTION_PROXY_ALIAS:function(){return q},RSC_ACTION_VALIDATE_ALIAS:function(){return F},RSC_MOD_REF_PROXY_ALIAS:function(){return D},RSC_PREFETCH_SUFFIX:function(){return c},RSC_SUFFIX:function(){return n},SERVER_PROPS_EXPORT_ERROR:function(){return he},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return ie},SERVER_PROPS_SSG_CONFLICT:function(){return Y},SERVER_RUNTIME:function(){return ce},SSG_FALLBACK_EXPORT_ERROR:function(){return me},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return V},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return ee},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return pe},WEBPACK_LAYERS:function(){return _e},WEBPACK_RESOURCE_QUERIES:function(){return ge}});const t="nxtP",o="nxtI",r="x-prerender-revalidate",s="x-prerender-revalidate-if-generated",c=".prefetch.rsc",n=".rsc",l=".action",f=".json",u=".meta",h=".body",g="x-next-cache-tags",v="x-next-cache-soft-tags",P="x-next-revalidated-tags",I="x-next-revalidate-tag-token",d=128,b=256,p=1024,_="_N_T_",E=31536e3,a="middleware",R=`(?:src/)?${a}`,m="instrumentation",w="private-next-pages",y="private-dot-next",N="private-next-root-dir",j="private-next-app-dir",D="private-next-rsc-mod-ref-proxy",F="private-next-rsc-action-validate",q="private-next-rsc-server-reference",Q="private-next-rsc-action-encryption",Z="private-next-rsc-action-client-wrapper",B="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",V="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",ie="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",Y="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",ee="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",he="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",se="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",ae="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",pe="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",te="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",ue='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',me="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",re=["app","pages","components","lib","src"],ce={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},k={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"},_e={...k,GROUP:{serverOnly:[k.reactServerComponents,k.actionBrowser,k.appMetadataRoute,k.appRouteHandler,k.instrument],clientOnly:[k.serverSideRendering,k.appPagesBrowser],nonClientServerTarget:[k.middleware,k.api],app:[k.reactServerComponents,k.actionBrowser,k.appMetadataRoute,k.appRouteHandler,k.serverSideRendering,k.appPagesBrowser,k.shared,k.instrument]}},ge={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}})(Be)),Be}var St;function Gt(){return St||(St=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,f){for(var u in f)Object.defineProperty(l,u,{enumerable:!0,get:f[u]})}e(i,{fromNodeOutgoingHttpHeaders:function(){return o},normalizeNextQueryParam:function(){return n},splitCookiesString:function(){return r},toNodeOutgoingHttpHeaders:function(){return s},validateURL:function(){return c}});const t=wr();function o(l){const f=new Headers;for(let[u,h]of Object.entries(l)){const g=Array.isArray(h)?h:[h];for(let v of g)typeof v>"u"||(typeof v=="number"&&(v=v.toString()),f.append(u,v))}return f}function r(l){var f=[],u=0,h,g,v,P,I;function d(){for(;u<l.length&&/\s/.test(l.charAt(u));)u+=1;return u<l.length}function b(){return g=l.charAt(u),g!=="="&&g!==";"&&g!==","}for(;u<l.length;){for(h=u,I=!1;d();)if(g=l.charAt(u),g===","){for(v=u,u+=1,d(),P=u;u<l.length&&b();)u+=1;u<l.length&&l.charAt(u)==="="?(I=!0,u=P,f.push(l.substring(h,v)),h=u):u=v+1}else u+=1;(!I||u>=l.length)&&f.push(l.substring(h,l.length))}return f}function s(l){const f={},u=[];if(l)for(const[h,g]of l.entries())h.toLowerCase()==="set-cookie"?(u.push(...r(g)),f[h]=u.length===1?u[0]:u):f[h]=g;return f}function c(l){try{return String(new URL(String(l)))}catch(f){throw new Error(`URL is malformed "${String(l)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:f})}}function n(l,f){const u=[t.NEXT_QUERY_PARAM_PREFIX,t.NEXT_INTERCEPTION_MARKER_PREFIX];for(const h of u)if(l!==h&&l.startsWith(h)){const g=l.substring(h.length);f(g)}}})(Fe)),Fe}var Ge={},Tt;function Er(){return Tt||(Tt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(s,c){for(var n in c)Object.defineProperty(s,n,{enumerable:!0,get:c[n]})}e(i,{PageSignatureError:function(){return t},RemovedPageError:function(){return o},RemovedUAError:function(){return r}});class t extends Error{constructor({page:c}){super(`The middleware "${c}" accepts an async API directly with the form:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nr=require("pino"),or=require("pino-pretty"),ir=require("js-md5"),oe=require("crypto-js"),G=require("h3"),sr={GENERAL:0,PHONE:1,EMAIL:2},Ht={TYPE_MGT:0,TYPE_C:1,TYPE_B:2},ar={FROM_WEB:1,FROM_PC:2,FROM_WX_MINI_PRO:3,FROM_WX_PLU:4,FROM_WX_E:5,FROM_APP:6,FROM_DEVICE:7},ur={unknown:0,male:1,female:2},cr=or({colorize:!0,destination:process.stdout,translateTime:"SYS:yyyy-mm-dd HH:MM:ss",ignore:"pid,hostname",messageFormat:"{msg}",singleLine:!0}),L=nr({name:process.env.APP_NAME??"iBoot",level:process.env.APP_ENV==="production"?"info":"debug",nestedKey:"payload"},cr),Ze=i=>Array.isArray(i)||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Array]",et=i=>{const e=i||32,t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",o=t.length;let r="";for(let s=0;s<e;s++)r+=t.charAt(Math.floor(Math.random()*o));return r},Pe=(i,e)=>{const t={};return i.split("&").forEach(r=>{const s=r.split("=");s[1]&&(!e||e.indexOf(s[0])==-1)&&(t[s[0]]=s[1])}),t},fe=i=>!i||i==""||i.length==0?"":encodeURIComponent(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\'/g,"%27").replace(/\!/g,"%21").replace(/\~/g,"%7E"),lr=(i,e)=>{const t={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};if(/(y+)/.test(e)){const r=new RegExp(/(y+)/).exec(e);let s=0;r&&r.length>0&&(s=r[0].length),e=e.replace(/(y+)/,i.getFullYear()+"").substring(4-s)}for(const o in t){const r="("+o+")",s=new RegExp(r);if(s.test(e)){const c=s.exec(e);let n=0;c&&c.length>0&&(n=c[0].length),e=e.replace(s,n==1?t[o].toString():("00"+t[o]).substring(t[o].toString().length))}}return e};var ve={exports:{}},Ae={},Ie={},Oe={},dt;function dr(){return dt||(dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(t,o,r){if(t){r&&(r=r.toLowerCase());for(const n of t){var s,c;const l=(s=n.domain)==null?void 0:s.split(":",1)[0].toLowerCase();if(o===l||r===n.defaultLocale.toLowerCase()||(c=n.locales)!=null&&c.some(f=>f.toLowerCase()===r))return n}}}})(Oe)),Oe}var xe={},Ne={},ft;function fr(){return ft||(ft=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\/$/,"")||"/"}})(Ne)),Ne}var Ce={},Le={},ht;function ot(){return ht||(ht=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"parsePath",{enumerable:!0,get:function(){return e}});function e(t){const o=t.indexOf("#"),r=t.indexOf("?"),s=r>-1&&(o<0||r<o);return s||o>-1?{pathname:t.substring(0,s?r:o),query:s?t.substring(r,o>-1?o:void 0):"",hash:o>-1?t.slice(o):""}:{pathname:t,query:"",hash:""}}})(Le)),Le}var pt;function Ft(){return pt||(pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathPrefix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,r){if(!o.startsWith("/")||!r)return o;const{pathname:s,query:c,hash:n}=(0,e.parsePath)(o);return""+r+s+c+n}})(Ce)),Ce}var ke={},mt;function hr(){return mt||(mt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addPathSuffix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,r){if(!o.startsWith("/")||!r)return o;const{pathname:s,query:c,hash:n}=(0,e.parsePath)(o);return""+s+r+c+n}})(ke)),ke}var Ue={},De={},_t;function it(){return _t||(_t=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"pathHasPrefix",{enumerable:!0,get:function(){return t}});const e=ot();function t(o,r){if(typeof o!="string")return!1;const{pathname:s}=(0,e.parsePath)(o);return s===r||s.startsWith(r+"/")}})(De)),De}var gt;function pr(){return gt||(gt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addLocale",{enumerable:!0,get:function(){return o}});const e=Ft(),t=it();function o(r,s,c,n){if(!s||s===c)return r;const l=r.toLowerCase();return!n&&((0,t.pathHasPrefix)(l,"/api")||(0,t.pathHasPrefix)(l,"/"+s.toLowerCase()))?r:(0,e.addPathPrefix)(r,"/"+s)}})(Ue)),Ue}var bt;function mr(){return bt||(bt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});const e=fr(),t=Ft(),o=hr(),r=pr();function s(c){let n=(0,r.addLocale)(c.pathname,c.locale,c.buildId?void 0:c.defaultLocale,c.ignorePrefix);return(c.buildId||!c.trailingSlash)&&(n=(0,e.removeTrailingSlash)(n)),c.buildId&&(n=(0,o.addPathSuffix)((0,t.addPathPrefix)(n,"/_next/data/"+c.buildId),c.pathname==="/"?"index.json":".json")),n=(0,t.addPathPrefix)(n,c.basePath),!c.buildId&&c.trailingSlash?n.endsWith("/")?n:(0,o.addPathSuffix)(n,"/"):(0,e.removeTrailingSlash)(n)}})(xe)),xe}var Me={},wt;function _r(){return wt||(wt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getHostname",{enumerable:!0,get:function(){return e}});function e(t,o){let r;if(o?.host&&!Array.isArray(o.host))r=o.host.toString().split(":",1)[0];else if(t.hostname)r=t.hostname;else return;return r.toLowerCase()}})(Me)),Me}var je={},qe={},Et;function gr(){return Et||(Et=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(t,o){let r;const s=t.split("/");return(o||[]).some(c=>s[1]&&s[1].toLowerCase()===c.toLowerCase()?(r=c,s.splice(1,1),t=s.join("/")||"/",!0):!1),{pathname:t,detectedLocale:r}}})(qe)),qe}var He={},vt;function br(){return vt||(vt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"removePathPrefix",{enumerable:!0,get:function(){return t}});const e=it();function t(o,r){if(!(0,e.pathHasPrefix)(o,r))return o;const s=o.slice(r.length);return s.startsWith("/")?s:"/"+s}})(He)),He}var Rt;function wr(){return Rt||(Rt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getNextPathnameInfo",{enumerable:!0,get:function(){return r}});const e=gr(),t=br(),o=it();function r(s,c){var n;const{basePath:l,i18n:f,trailingSlash:u}=(n=c.nextConfig)!=null?n:{},h={pathname:s,trailingSlash:s!=="/"?s.endsWith("/"):u};l&&(0,o.pathHasPrefix)(h.pathname,l)&&(h.pathname=(0,t.removePathPrefix)(h.pathname,l),h.basePath=l);let g=h.pathname;if(h.pathname.startsWith("/_next/data/")&&h.pathname.endsWith(".json")){const P=h.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),I=P[0];h.buildId=I,g=P[1]!=="index"?"/"+P.slice(1).join("/"):"/",c.parseData===!0&&(h.pathname=g)}if(f){let P=c.i18nProvider?c.i18nProvider.analyze(h.pathname):(0,e.normalizeLocalePath)(h.pathname,f.locales);h.locale=P.detectedLocale;var v;h.pathname=(v=P.pathname)!=null?v:h.pathname,!P.detectedLocale&&h.buildId&&(P=c.i18nProvider?c.i18nProvider.analyze(g):(0,e.normalizeLocalePath)(g,f.locales),P.detectedLocale&&(h.locale=P.detectedLocale))}return h}})(je)),je}var Pt;function Bt(){return Pt||(Pt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextURL",{enumerable:!0,get:function(){return l}});const e=dr(),t=mr(),o=_r(),r=wr(),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(f,u){return new URL(String(f).replace(s,"localhost"),u&&String(u).replace(s,"localhost"))}const n=Symbol("NextURLInternal");class l{constructor(u,h,g){let v,P;typeof h=="object"&&"pathname"in h||typeof h=="string"?(v=h,P=g||{}):P=g||h||{},this[n]={url:c(u,v??P.base),options:P,basePath:""},this.analyze()}analyze(){var u,h,g,v,P;const I=(0,r.getNextPathnameInfo)(this[n].url.pathname,{nextConfig:this[n].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[n].options.i18nProvider}),d=(0,o.getHostname)(this[n].url,this[n].options.headers);this[n].domainLocale=this[n].options.i18nProvider?this[n].options.i18nProvider.detectDomainLocale(d):(0,e.detectDomainLocale)((h=this[n].options.nextConfig)==null||(u=h.i18n)==null?void 0:u.domains,d);const b=((g=this[n].domainLocale)==null?void 0:g.defaultLocale)||((P=this[n].options.nextConfig)==null||(v=P.i18n)==null?void 0:v.defaultLocale);this[n].url.pathname=I.pathname,this[n].defaultLocale=b,this[n].basePath=I.basePath??"",this[n].buildId=I.buildId,this[n].locale=I.locale??b,this[n].trailingSlash=I.trailingSlash}formatPathname(){return(0,t.formatNextPathnameInfo)({basePath:this[n].basePath,buildId:this[n].buildId,defaultLocale:this[n].options.forceLocale?void 0:this[n].defaultLocale,locale:this[n].locale,pathname:this[n].url.pathname,trailingSlash:this[n].trailingSlash})}formatSearch(){return this[n].url.search}get buildId(){return this[n].buildId}set buildId(u){this[n].buildId=u}get locale(){return this[n].locale??""}set locale(u){var h,g;if(!this[n].locale||!(!((g=this[n].options.nextConfig)==null||(h=g.i18n)==null)&&h.locales.includes(u)))throw new TypeError(`The NextURL configuration includes no locale "${u}"`);this[n].locale=u}get defaultLocale(){return this[n].defaultLocale}get domainLocale(){return this[n].domainLocale}get searchParams(){return this[n].url.searchParams}get host(){return this[n].url.host}set host(u){this[n].url.host=u}get hostname(){return this[n].url.hostname}set hostname(u){this[n].url.hostname=u}get port(){return this[n].url.port}set port(u){this[n].url.port=u}get protocol(){return this[n].url.protocol}set protocol(u){this[n].url.protocol=u}get href(){const u=this.formatPathname(),h=this.formatSearch();return`${this.protocol}//${this.host}${u}${h}${this.hash}`}set href(u){this[n].url=c(u),this.analyze()}get origin(){return this[n].url.origin}get pathname(){return this[n].url.pathname}set pathname(u){this[n].url.pathname=u}get hash(){return this[n].url.hash}set hash(u){this[n].url.hash=u}get search(){return this[n].url.search}set search(u){this[n].url.search=u}get password(){return this[n].url.password}set password(u){this[n].url.password=u}get username(){return this[n].url.username}set username(u){this[n].url.username=u}get basePath(){return this[n].basePath}set basePath(u){this[n].basePath=u.startsWith("/")?u:`/${u}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new l(String(this),this[n].options)}}})(Ie)),Ie}var Fe={},Be={},yt;function Er(){return yt||(yt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(be,we){for(var J in we)Object.defineProperty(be,J,{enumerable:!0,get:we[J]})}e(i,{ACTION_SUFFIX:function(){return l},APP_DIR_ALIAS:function(){return j},CACHE_ONE_YEAR:function(){return E},DOT_NEXT_ALIAS:function(){return y},ESLINT_DEFAULT_DIRS:function(){return re},GSP_NO_RETURNED_VALUE:function(){return se},GSSP_COMPONENT_MEMBER_ERROR:function(){return te},GSSP_NO_RETURNED_VALUE:function(){return ae},INSTRUMENTATION_HOOK_FILENAME:function(){return m},MIDDLEWARE_FILENAME:function(){return a},MIDDLEWARE_LOCATION_REGEXP:function(){return R},NEXT_BODY_SUFFIX:function(){return h},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return _},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return P},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return I},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return v},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return p},NEXT_CACHE_TAGS_HEADER:function(){return g},NEXT_CACHE_TAG_MAX_ITEMS:function(){return d},NEXT_CACHE_TAG_MAX_LENGTH:function(){return b},NEXT_DATA_SUFFIX:function(){return f},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return o},NEXT_META_SUFFIX:function(){return u},NEXT_QUERY_PARAM_PREFIX:function(){return t},NON_STANDARD_NODE_ENV:function(){return ue},PAGES_DIR_ALIAS:function(){return w},PRERENDER_REVALIDATE_HEADER:function(){return r},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return s},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return B},ROOT_DIR_ALIAS:function(){return N},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return Z},RSC_ACTION_ENCRYPTION_ALIAS:function(){return Q},RSC_ACTION_PROXY_ALIAS:function(){return q},RSC_ACTION_VALIDATE_ALIAS:function(){return F},RSC_MOD_REF_PROXY_ALIAS:function(){return D},RSC_PREFETCH_SUFFIX:function(){return c},RSC_SUFFIX:function(){return n},SERVER_PROPS_EXPORT_ERROR:function(){return he},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return ie},SERVER_PROPS_SSG_CONFLICT:function(){return Y},SERVER_RUNTIME:function(){return ce},SSG_FALLBACK_EXPORT_ERROR:function(){return me},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return V},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return ee},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return pe},WEBPACK_LAYERS:function(){return _e},WEBPACK_RESOURCE_QUERIES:function(){return ge}});const t="nxtP",o="nxtI",r="x-prerender-revalidate",s="x-prerender-revalidate-if-generated",c=".prefetch.rsc",n=".rsc",l=".action",f=".json",u=".meta",h=".body",g="x-next-cache-tags",v="x-next-cache-soft-tags",P="x-next-revalidated-tags",I="x-next-revalidate-tag-token",d=128,b=256,p=1024,_="_N_T_",E=31536e3,a="middleware",R=`(?:src/)?${a}`,m="instrumentation",w="private-next-pages",y="private-dot-next",N="private-next-root-dir",j="private-next-app-dir",D="private-next-rsc-mod-ref-proxy",F="private-next-rsc-action-validate",q="private-next-rsc-server-reference",Q="private-next-rsc-action-encryption",Z="private-next-rsc-action-client-wrapper",B="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",V="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",ie="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",Y="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",ee="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",he="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",se="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",ae="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",pe="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",te="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",ue='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',me="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",re=["app","pages","components","lib","src"],ce={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},k={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"},_e={...k,GROUP:{serverOnly:[k.reactServerComponents,k.actionBrowser,k.appMetadataRoute,k.appRouteHandler,k.instrument],clientOnly:[k.serverSideRendering,k.appPagesBrowser],nonClientServerTarget:[k.middleware,k.api],app:[k.reactServerComponents,k.actionBrowser,k.appMetadataRoute,k.appRouteHandler,k.serverSideRendering,k.appPagesBrowser,k.shared,k.instrument]}},ge={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}})(Be)),Be}var Tt;function Gt(){return Tt||(Tt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,f){for(var u in f)Object.defineProperty(l,u,{enumerable:!0,get:f[u]})}e(i,{fromNodeOutgoingHttpHeaders:function(){return o},normalizeNextQueryParam:function(){return n},splitCookiesString:function(){return r},toNodeOutgoingHttpHeaders:function(){return s},validateURL:function(){return c}});const t=Er();function o(l){const f=new Headers;for(let[u,h]of Object.entries(l)){const g=Array.isArray(h)?h:[h];for(let v of g)typeof v>"u"||(typeof v=="number"&&(v=v.toString()),f.append(u,v))}return f}function r(l){var f=[],u=0,h,g,v,P,I;function d(){for(;u<l.length&&/\s/.test(l.charAt(u));)u+=1;return u<l.length}function b(){return g=l.charAt(u),g!=="="&&g!==";"&&g!==","}for(;u<l.length;){for(h=u,I=!1;d();)if(g=l.charAt(u),g===","){for(v=u,u+=1,d(),P=u;u<l.length&&b();)u+=1;u<l.length&&l.charAt(u)==="="?(I=!0,u=P,f.push(l.substring(h,v)),h=u):u=v+1}else u+=1;(!I||u>=l.length)&&f.push(l.substring(h,l.length))}return f}function s(l){const f={},u=[];if(l)for(const[h,g]of l.entries())h.toLowerCase()==="set-cookie"?(u.push(...r(g)),f[h]=u.length===1?u[0]:u):f[h]=g;return f}function c(l){try{return String(new URL(String(l)))}catch(f){throw new Error(`URL is malformed "${String(l)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:f})}}function n(l,f){const u=[t.NEXT_QUERY_PARAM_PREFIX,t.NEXT_INTERCEPTION_MARKER_PREFIX];for(const h of u)if(l!==h&&l.startsWith(h)){const g=l.substring(h.length);f(g)}}})(Fe)),Fe}var Ge={},St;function vr(){return St||(St=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(s,c){for(var n in c)Object.defineProperty(s,n,{enumerable:!0,get:c[n]})}e(i,{PageSignatureError:function(){return t},RemovedPageError:function(){return o},RemovedUAError:function(){return r}});class t extends Error{constructor({page:c}){super(`The middleware "${c}" accepts an async API directly with the form:
2
2
 
3
3
  export function middleware(request, event) {
4
4
  return NextResponse.redirect('/new-location')
5
5
  }
6
6
 
7
7
  Read more: https://nextjs.org/docs/messages/middleware-new-signature
8
- `)}}class o 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 r 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 ")}}})(Ge)),Ge}var Xe={},We,At;function vr(){if(At)return We;At=1;var i=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(a,R)=>{for(var m in R)i(a,m,{get:R[m],enumerable:!0})},s=(a,R,m,w)=>{if(R&&typeof R=="object"||typeof R=="function")for(let y of t(R))!o.call(a,y)&&y!==m&&i(a,y,{get:()=>R[y],enumerable:!(w=e(R,y))||w.enumerable});return a},c=a=>s(i({},"__esModule",{value:!0}),a),n={};r(n,{RequestCookies:()=>b,ResponseCookies:()=>p,parseCookie:()=>f,parseSetCookie:()=>u,stringifyCookie:()=>l}),We=c(n);function l(a){var R;const m=["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((R=a.value)!=null?R:"")}`;return m.length===0?w:`${w}; ${m.join("; ")}`}function f(a){const R=new Map;for(const m of a.split(/; */)){if(!m)continue;const w=m.indexOf("=");if(w===-1){R.set(m,"true");continue}const[y,N]=[m.slice(0,w),m.slice(w+1)];try{R.set(y,decodeURIComponent(N??"true"))}catch{}}return R}function u(a){if(!a)return;const[[R,m],...w]=f(a),{domain:y,expires:N,httponly:j,maxage:D,path:F,samesite:q,secure:Q,partitioned:Z,priority:B}=Object.fromEntries(w.map(([ie,Y])=>[ie.toLowerCase(),Y])),V={name:R,value:decodeURIComponent(m),domain:y,...N&&{expires:new Date(N)},...j&&{httpOnly:!0},...typeof D=="string"&&{maxAge:Number(D)},path:F,...q&&{sameSite:v(q)},...Q&&{secure:!0},...B&&{priority:I(B)},...Z&&{partitioned:!0}};return h(V)}function h(a){const R={};for(const m in a)a[m]&&(R[m]=a[m]);return R}var g=["strict","lax","none"];function v(a){return a=a.toLowerCase(),g.includes(a)?a:void 0}var P=["low","medium","high"];function I(a){return a=a.toLowerCase(),P.includes(a)?a:void 0}function d(a){if(!a)return[];var R=[],m=0,w,y,N,j,D;function F(){for(;m<a.length&&/\s/.test(a.charAt(m));)m+=1;return m<a.length}function q(){return y=a.charAt(m),y!=="="&&y!==";"&&y!==","}for(;m<a.length;){for(w=m,D=!1;F();)if(y=a.charAt(m),y===","){for(N=m,m+=1,F(),j=m;m<a.length&&q();)m+=1;m<a.length&&a.charAt(m)==="="?(D=!0,m=j,R.push(a.substring(w,N)),w=m):m=N+1}else m+=1;(!D||m>=a.length)&&R.push(a.substring(w,a.length))}return R}var b=class{constructor(a){this._parsed=new Map,this._headers=a;const R=a.get("cookie");if(R){const m=f(R);for(const[w,y]of m)this._parsed.set(w,{name:w,value:y})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...a){const R=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(R)}getAll(...a){var R;const m=Array.from(this._parsed);if(!a.length)return m.map(([y,N])=>N);const w=typeof a[0]=="string"?a[0]:(R=a[0])==null?void 0:R.name;return m.filter(([y])=>y===w).map(([y,N])=>N)}has(a){return this._parsed.has(a)}set(...a){const[R,m]=a.length===1?[a[0].name,a[0].value]:a,w=this._parsed;return w.set(R,{name:R,value:m}),this._headers.set("cookie",Array.from(w).map(([y,N])=>l(N)).join("; ")),this}delete(a){const R=this._parsed,m=Array.isArray(a)?a.map(w=>R.delete(w)):R.delete(a);return this._headers.set("cookie",Array.from(R).map(([w,y])=>l(y)).join("; ")),m}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("; ")}},p=class{constructor(a){this._parsed=new Map;var R,m,w;this._headers=a;const y=(w=(m=(R=a.getSetCookie)==null?void 0:R.call(a))!=null?m:a.get("set-cookie"))!=null?w:[],N=Array.isArray(y)?y:d(y);for(const j of N){const D=u(j);D&&this._parsed.set(D.name,D)}}get(...a){const R=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(R)}getAll(...a){var R;const m=Array.from(this._parsed.values());if(!a.length)return m;const w=typeof a[0]=="string"?a[0]:(R=a[0])==null?void 0:R.name;return m.filter(y=>y.name===w)}has(a){return this._parsed.has(a)}set(...a){const[R,m,w]=a.length===1?[a[0].name,a[0].value,a[0]]:a,y=this._parsed;return y.set(R,E({name:R,value:m,...w})),_(y,this._headers),this}delete(...a){const[R,m,w]=typeof a[0]=="string"?[a[0]]:[a[0].name,a[0].path,a[0].domain];return this.set({name:R,path:m,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(l).join("; ")}};function _(a,R){R.delete("set-cookie");for(const[,m]of a){const w=l(m);R.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 We}var It;function tt(){return It||(It=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(o,r){for(var s in r)Object.defineProperty(o,s,{enumerable:!0,get:r[s]})}e(i,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=vr()})(Xe)),Xe}var Ot;function Rr(){return Ot||(Ot=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,f){for(var u in f)Object.defineProperty(l,u,{enumerable:!0,get:f[u]})}e(i,{INTERNALS:function(){return c},NextRequest:function(){return n}});const t=Bt(),o=Gt(),r=Er(),s=tt(),c=Symbol("internal request");class n extends Request{constructor(f,u={}){const h=typeof f!="string"&&"url"in f?f.url:String(f);(0,o.validateURL)(h),f instanceof Request?super(f,u):super(h,u);const g=new t.NextURL(h,{headers:(0,o.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:u.nextConfig});this[c]={cookies:new s.RequestCookies(this.headers),geo:u.geo||{},ip:u.ip,nextUrl:g,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?h:g.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[c].cookies}get geo(){return this[c].geo}get ip(){return this[c].ip}get nextUrl(){return this[c].nextUrl}get page(){throw new r.RemovedPageError}get ua(){throw new r.RemovedUAError}get url(){return this[c].url}}})(Ae)),Ae}var ze={},Ve={},xt;function Pr(){return xt||(xt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(o,r,s){const c=Reflect.get(o,r,s);return typeof c=="function"?c.bind(o):c}static set(o,r,s,c){return Reflect.set(o,r,s,c)}static has(o,r){return Reflect.has(o,r)}static deleteProperty(o,r){return Reflect.deleteProperty(o,r)}}})(Ve)),Ve}var Nt;function yr(){return Nt||(Nt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextResponse",{enumerable:!0,get:function(){return f}});const e=tt(),t=Bt(),o=Gt(),r=Pr(),s=tt(),c=Symbol("internal response"),n=new Set([301,302,303,307,308]);function l(u,h){var g;if(!(u==null||(g=u.request)==null)&&g.headers){if(!(u.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const v=[];for(const[P,I]of u.request.headers)h.set("x-middleware-request-"+P,I),v.push(P);h.set("x-middleware-override-headers",v.join(","))}}class f extends Response{constructor(h,g={}){super(h,g);const v=this.headers,P=new s.ResponseCookies(v),I=new Proxy(P,{get(d,b,p){switch(b){case"delete":case"set":return(..._)=>{const E=Reflect.apply(d[b],d,_),a=new Headers(v);return E instanceof s.ResponseCookies&&v.set("x-middleware-set-cookie",E.getAll().map(R=>(0,e.stringifyCookie)(R)).join(",")),l(g,a),E};default:return r.ReflectAdapter.get(d,b,p)}}});this[c]={cookies:I,url:g.url?new t.NextURL(g.url,{headers:(0,o.toNodeOutgoingHttpHeaders)(v),nextConfig:g.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[c].cookies}static json(h,g){const v=Response.json(h,g);return new f(v.body,v)}static redirect(h,g){const v=typeof g=="number"?g:g?.status??307;if(!n.has(v))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const P=typeof g=="object"?g:{},I=new Headers(P?.headers);return I.set("Location",(0,o.validateURL)(h)),new f(null,{...P,headers:I,status:v})}static rewrite(h,g){const v=new Headers(g?.headers);return v.set("x-middleware-rewrite",(0,o.validateURL)(h)),l(g,v),new f(null,{...g,headers:v})}static next(h){const g=new Headers(h?.headers);return g.set("x-middleware-next","1"),l(h,g),new f(null,{...h,headers:g})}}})(ze)),ze}var Ye={},Ct;function Sr(){return Ct||(Ct=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"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')}})(Ye)),Ye}var Ke={},$e={exports:{}},Lt;function Tr(){return Lt||(Lt=1,(()=>{var i={226:function(r,s){(function(c,n){var l="1.0.35",f="",u="?",h="function",g="undefined",v="object",P="string",I="major",d="model",b="name",p="type",_="vendor",E="version",a="architecture",R="console",m="mobile",w="tablet",y="smarttv",N="wearable",j="embedded",D=350,F="Amazon",q="Apple",Q="ASUS",Z="BlackBerry",B="Browser",V="Chrome",ie="Edge",Y="Firefox",ee="Google",he="Huawei",se="LG",ae="Microsoft",pe="Motorola",te="Opera",ue="Samsung",me="Sharp",re="Sony",ce="Xiaomi",k="Zebra",_e="Facebook",ge="Chromium OS",be="Mac OS",we=function(A,x){var T={};for(var C in A)x[C]&&x[C].length%2===0?T[C]=x[C].concat(A[C]):T[C]=A[C];return T},J=function(A){for(var x={},T=0;T<A.length;T++)x[A[T].toUpperCase()]=A[T];return x},at=function(A,x){return typeof A===P?le(x).indexOf(le(A))!==-1:!1},le=function(A){return A.toLowerCase()},er=function(A){return typeof A===P?A.replace(/[^\d\.]/g,f).split(".")[0]:n},ye=function(A,x){if(typeof A===P)return A=A.replace(/^\s\s*/,f),typeof x===g?A:A.substring(0,D)},de=function(A,x){for(var T=0,C,K,X,O,S,W;T<x.length&&!S;){var Te=x[T],lt=x[T+1];for(C=K=0;C<Te.length&&!S&&Te[C];)if(S=Te[C++].exec(A),S)for(X=0;X<lt.length;X++)W=S[++K],O=lt[X],typeof O===v&&O.length>0?O.length===2?typeof O[1]==h?this[O[0]]=O[1].call(this,W):this[O[0]]=O[1]:O.length===3?typeof O[1]===h&&!(O[1].exec&&O[1].test)?this[O[0]]=W?O[1].call(this,W,O[2]):n:this[O[0]]=W?W.replace(O[1],O[2]):n:O.length===4&&(this[O[0]]=W?O[3].call(this,W.replace(O[1],O[2])):n):this[O]=W||n;T+=2}},Se=function(A,x){for(var T in x)if(typeof x[T]===v&&x[T].length>0){for(var C=0;C<x[T].length;C++)if(at(x[T][C],A))return T===u?n:T}else if(at(x[T],A))return T===u?n:T;return A},tr={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ut={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"},ct={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,E],[/opios[\/ ]+([\w\.]+)/i],[E,[b,te+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[b,te]],[/(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],[b,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[b,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[b,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+B],E],[/\bfocus\/([\w\.]+)/i],[E,[b,Y+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[b,te+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[b,te+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[b,"MIUI "+B]],[/fxios\/([-\w\.]+)/i],[E,[b,Y]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+B]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+B],E],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,_e],E],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[b,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[b,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[b,V+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,V+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[E,Se,tr]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,Y+" 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],[b,E],[/(cobalt)\/([\w\.]+)/i],[b,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[a,"amd64"]],[/(ia32(?=;))/i],[[a,le]],[/((?: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/,f,le]],[/(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,le]]],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],[d,[_,ue],[p,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[_,ue],[p,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[_,q],[p,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[_,q],[p,w]],[/(macintosh);/i],[d,[_,q]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[_,me],[p,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[_,he],[p,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[_,he],[p,m]],[/\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],[[d,/_/g," "],[_,ce],[p,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[_,ce],[p,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[_,"OPPO"],[p,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[_,"Vivo"],[p,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[d,[_,"Realme"],[p,m]],[/\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],[d,[_,pe],[p,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[_,pe],[p,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[_,se],[p,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[_,se],[p,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[_,"Lenovo"],[p,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[_,"Nokia"],[p,m]],[/(pixel c)\b/i],[d,[_,ee],[p,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[_,ee],[p,m]],[/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],[d,[_,re],[p,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[_,re],[p,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[_,"OnePlus"],[p,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[_,F],[p,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[_,F],[p,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,_,[p,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[_,Z],[p,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[_,Q],[p,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[_,Q],[p,m]],[/(nexus 9)/i],[d,[_,"HTC"],[p,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[d,/_/g," "],[p,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[_,"Acer"],[p,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[_,"Meizu"],[p,m]],[/(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],[_,d,[p,m]],[/(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],[_,d,[p,w]],[/(surface duo)/i],[d,[_,ae],[p,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[_,"Fairphone"],[p,m]],[/(u304aa)/i],[d,[_,"AT&T"],[p,m]],[/\bsie-(\w*)/i],[d,[_,"Siemens"],[p,m]],[/\b(rct\w+) b/i],[d,[_,"RCA"],[p,w]],[/\b(venue[\d ]{2,7}) b/i],[d,[_,"Dell"],[p,w]],[/\b(q(?:mv|ta)\w+) b/i],[d,[_,"Verizon"],[p,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[_,"Barnes & Noble"],[p,w]],[/\b(tm\d{3}\w+) b/i],[d,[_,"NuVision"],[p,w]],[/\b(k88) b/i],[d,[_,"ZTE"],[p,w]],[/\b(nx\d{3}j) b/i],[d,[_,"ZTE"],[p,m]],[/\b(gen\d{3}) b.+49h/i],[d,[_,"Swiss"],[p,m]],[/\b(zur\d{3}) b/i],[d,[_,"Swiss"],[p,w]],[/\b((zeki)?tb.*\b) b/i],[d,[_,"Zeki"],[p,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],d,[p,w]],[/\b(ns-?\w{0,9}) b/i],[d,[_,"Insignia"],[p,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[_,"NextBook"],[p,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],d,[p,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],d,[p,m]],[/\b(ph-1) /i],[d,[_,"Essential"],[p,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[_,"Envizen"],[p,w]],[/\b(trio[-\w\. ]+) b/i],[d,[_,"MachSpeed"],[p,w]],[/\btu_(1491) b/i],[d,[_,"Rotor"],[p,w]],[/(shield[\w ]+) b/i],[d,[_,"Nvidia"],[p,w]],[/(sprint) (\w+)/i],[_,d,[p,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[_,ae],[p,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[_,k],[p,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[_,k],[p,m]],[/smart-tv.+(samsung)/i],[_,[p,y]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[_,ue],[p,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,se],[p,y]],[/(apple) ?tv/i],[_,[d,q+" TV"],[p,y]],[/crkey/i],[[d,V+"cast"],[_,ee],[p,y]],[/droid.+aft(\w)( bui|\))/i],[d,[_,F],[p,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[_,me],[p,y]],[/(bravia[\w ]+)( bui|\))/i],[d,[_,re],[p,y]],[/(mitv-\w{5}) bui/i],[d,[_,ce],[p,y]],[/Hbbtv.*(technisat) (.*);/i],[_,d,[p,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,ye],[d,ye],[p,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,d,[p,R]],[/droid.+; (shield) bui/i],[d,[_,"Nvidia"],[p,R]],[/(playstation [345portablevi]+)/i],[d,[_,re],[p,R]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[_,ae],[p,R]],[/((pebble))app/i],[_,d,[p,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[_,q],[p,N]],[/droid.+; (glass) \d/i],[d,[_,ee],[p,N]],[/droid.+; (wt63?0{2,3})\)/i],[d,[_,k],[p,N]],[/(quest( 2| pro)?)/i],[d,[_,_e],[p,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[p,j]],[/(aeobc)\b/i],[d,[_,F],[p,j]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[d,[p,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[p,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,ie+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[b,"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],[b,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[E,Se,ut]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,Se,ut]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,be],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,E],[/\(bb(10);/i],[E,[b,Z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,Y+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[b,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[b,V+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[b,ge],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],[b,E],[/(sunos) ?([\w\.\d]*)/i],[[b,"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],[b,E]]},H=function(A,x){if(typeof A===v&&(x=A,A=n),!(this instanceof H))return new H(A,x).getResult();var T=typeof c!==g&&c.navigator?c.navigator:n,C=A||(T&&T.userAgent?T.userAgent:f),K=T&&T.userAgentData?T.userAgentData:n,X=x?we(ct,x):ct,O=T&&T.userAgent==C;return this.getBrowser=function(){var S={};return S[b]=n,S[E]=n,de.call(S,C,X.browser),S[I]=er(S[E]),O&&T&&T.brave&&typeof T.brave.isBrave==h&&(S[b]="Brave"),S},this.getCPU=function(){var S={};return S[a]=n,de.call(S,C,X.cpu),S},this.getDevice=function(){var S={};return S[_]=n,S[d]=n,S[p]=n,de.call(S,C,X.device),O&&!S[p]&&K&&K.mobile&&(S[p]=m),O&&S[d]=="Macintosh"&&T&&typeof T.standalone!==g&&T.maxTouchPoints&&T.maxTouchPoints>2&&(S[d]="iPad",S[p]=w),S},this.getEngine=function(){var S={};return S[b]=n,S[E]=n,de.call(S,C,X.engine),S},this.getOS=function(){var S={};return S[b]=n,S[E]=n,de.call(S,C,X.os),O&&!S[b]&&K&&K.platform!="Unknown"&&(S[b]=K.platform.replace(/chrome os/i,ge).replace(/macos/i,be)),S},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 C},this.setUA=function(S){return C=typeof S===P&&S.length>D?ye(S,D):S,this},this.setUA(C),this};H.VERSION=l,H.BROWSER=J([b,E,I]),H.CPU=J([a]),H.DEVICE=J([d,_,p,R,m,y,w,N,j]),H.ENGINE=H.OS=J([b,E]),typeof s!==g?(r.exports&&(s=r.exports=H),s.UAParser=H):typeof c!==g&&(c.UAParser=H);var ne=typeof c!==g&&(c.jQuery||c.Zepto);if(ne&&!ne.ua){var Ee=new H;ne.ua=Ee.getResult(),ne.ua.get=function(){return Ee.getUA()},ne.ua.set=function(A){Ee.setUA(A);var x=Ee.getResult();for(var T in x)ne.ua[T]=x[T]}}})(typeof window=="object"?window:this)}},e={};function t(r){var s=e[r];if(s!==void 0)return s.exports;var c=e[r]={exports:{}},n=!0;try{i[r].call(c.exports,c,c.exports,t),n=!1}finally{n&&delete e[r]}return c.exports}typeof t<"u"&&(t.ab="undefined/");var o=t(226);$e.exports=o})()),$e.exports}var kt;function Ut(){return kt||(kt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(n,l){for(var f in l)Object.defineProperty(n,f,{enumerable:!0,get:l[f]})}e(i,{isBot:function(){return r},userAgent:function(){return c},userAgentFromString:function(){return s}});const t=o(Tr());function o(n){return n&&n.__esModule?n:{default:n}}function r(n){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(n)}function s(n){return{...(0,t.default)(n),isBot:n===void 0?!1:r(n)}}function c({headers:n}){return s(n.get("user-agent")||void 0)}})(Ke)),Ke}var Je={},Dt;function Ar(){return Dt||(Dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})(Je)),Je}var Mt;function Ir(){return Mt||(Mt=1,(function(i,e){const t={NextRequest:Rr().NextRequest,NextResponse:yr().NextResponse,ImageResponse:Sr().ImageResponse,userAgentFromString:Ut().userAgentFromString,userAgent:Ut().userAgent,URLPattern:Ar().URLPattern};i.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})(ve,ve.exports)),ve.exports}var Or=Ir();class xr{async parseRequest(e){const t=new URL(e.url),o=e.method,r=e.headers.get(z)??"",s={};e.cookies.getAll().forEach(l=>{s[l.name]=l.value});let c,n;if(o!=="GET"){if(r.includes(M.applicationJson))try{c=await e.json()}catch{L.warn("request body is null!")}else if(r.includes(M.multipartFormData)){const l=e.clone(),f=await e.formData(),u=await l.arrayBuffer();n={formData:f,buffer:u}}else if(r.includes(M.applicationXwwwFormUrlencoded)){const l=await e.text();c=Pe(l,["m"])}}return{url:t,method:o,contentType:r,body:c,requestFormData:n,cookies:s}}createResponse(e){const t=Or.NextResponse.json(e.body);if(Object.entries(e.cookies).forEach(([o,r])=>{typeof r=="object"&&r.value?t.cookies.set(o,r.value,r.options):typeof r=="string"&&t.cookies.set(o,r)}),e.cleanCookies){const o={set(r,s,c){t.cookies.set(r,s,c)},delete(r,s){t.cookies.delete({...s,name:r})}};e.cleanCookies(o)}return t}setCookie(e,t,o,r){e.cookies[t]={value:o,options:r}}}class Nr{async parseRequest(e){const t=G.getRequestURL(e),o=e.method,r=e.headers.get(z)||"",s=G.parseCookies(e);let c,n;if(o!=="GET"){if(r.includes(M.applicationJson))try{c=await G.readBody(e)}catch{L.warn("request body is null!")}else if(r.includes(M.multipartFormData)){const l=await G.readMultipartFormData(e)??[],f=new FormData,u=[];for(const v of l)if(v.type==="file"&&v.data){const P=new File([v.data],v.filename||"unknown",{type:v.type});f.append("file",P),u.push(v.data)}else if(v.name){const P=v.data?v.data.toString():"";f.append(v.name,P)}const h=Buffer.concat(u.map(v=>Buffer.from(v))),g=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);n={formData:f,buffer:g}}else if(r.includes(M.applicationXwwwFormUrlencoded))try{c=await G.readBody(e)}catch{L.warn("request body is null!")}}return{url:t,method:o,contentType:r,body:c,requestFormData:n,cookies:s,context:e}}createResponse(e){const{status:t,headers:o,body:r,cookies:s,cleanCookies:c,context:n}=e,l=n;return G.setResponseStatus(l,t),Object.entries(o).forEach(([f,u])=>{G.setHeader(l,f,u)}),Object.entries(s).forEach(([f,u])=>{typeof u=="object"&&u.value?G.setCookie(l,f,u.value,u.options):typeof u=="string"&&G.setCookie(l,f,u)}),c&&c({set(u,h,g){G.setCookie(l,u,h,g)},delete(u,h){G.deleteCookie(l,u,h)}}),r}setCookie(e,t,o,r){e.cookies[t]={value:o,options:r}}}var rt=(i=>(i[i.login=0]="login",i[i.logout=1]="logout",i))(rt||{});const Qe={login:"login",logout:"logout",unknown:""},z="Content-Type",M={applicationJson:"application/json",multipartFormData:"multipart/form-data",applicationXwwwFormUrlencoded:"application/x-www-form-urlencoded"};class Cr{config;http;adapter;constructor({config:e,adapter:t,storage:o}){this.config=e;let r=Yt(o.headers);(!r.deviceId||r.deviceId.trim().length===0)&&(r=Kt(o.cookies)),this.http=new Zt({...r,userType:e.userType,helloURL:e.helloURL}),this.adapter=t}async handleRequest(e){try{const t=await this.adapter.parseRequest(e),o=await this.processRequest(t);return this.adapter.createResponse(o)}catch(t){L.error({error:t?.toString()||"Internal server error"},"ROUTE ERROR");const o=this.createErrorResponse(500,t?.toString()||"Internal server error");return this.adapter.createResponse(o)}}async processRequest(e){const t=e.url.searchParams,o=t.get("m")??"unknown",s={...Qe,...this.config.APIMAP}[o],c=e.cookies;if(!s||s.length===0)return this.createErrorResponse(404,"API not found",c);let n;if((s.startsWith("admin/")||s.startsWith("api/"))&&(n=$t(c),L.debug(n,"token"),!n||n.username.length===0||n.token.length===0))return this.createErrorResponse(409,"Authentication required",c);L.debug({"content-type":e.contentType},"Content-Type"),L.debug({hostUrl:s,token:n?{...n}:""},"processRequest");const l=e.method;if(l==="GET"){const f=Pe(t.toString(),["m"]),u=await this.http.get({url:s,data:f,token:n});return this.createResponse({url:s,result:u,config:this.config,req:e})}else if(l==="POST"){let f;const u=e.contentType;if(u.includes(M.applicationJson)||u.includes(M.applicationXwwwFormUrlencoded))e.body&&(f={...e.body});else if(u.includes(M.multipartFormData)){const g=u.match(/boundary=([^\s;]+)/);if(!g||!e.requestFormData)return this.createErrorResponse(411,"Missing boundary in form data",c);const v=e.requestFormData.buffer;f={boundary:g[1],buffer:Buffer.from(v)};const I=e.requestFormData.formData;if(I)for(const[d,b]of Object.entries(I))d!=="file"&&(f[d]=b)}else return this.createErrorResponse(410,"Unsupported content type",c);const h=await this.http.post({url:s,data:f,token:n});return this.createResponse({url:s,result:h,config:this.config,req:e})}return this.createErrorResponse(405,"Method not allowed, only supported GET or POST",c)}createResponse({url:e,result:t,config:o,req:r}){const s={};s[z]=M.applicationJson;const c={status:t.success?200:t.code,headers:s,cookies:this.setCookies(r.cookies),body:t,context:r.context};if(t.success){switch(e){case Qe[rt[0]]:const n=t.data;Jt(n,c);break;case Qe[rt[1]]:c.cleanCookies=l=>Qt(l);break}o.onHandlerSuccess&&o.onHandlerSuccess({url:e,data:t.data,req:r,res:c})}return c}createErrorResponse(e,t,o){const r={};return r[z]=M.applicationJson,{status:e,headers:r,cookies:o?this.setCookies(o):{},body:{code:e,success:!1,msg:t}}}setCookies(e){const t={};return Object.entries(e).forEach(([o,r])=>{t[o]={value:r}}),t}}const Lr="zh-CN",Xt="_device_id_key",Wt="_current_website_key",jt="Get request error!",nt="Post request error!",U={IBOOT_DEVICE_ID:"dvid",IBOOT_LANG:"lang",IBOOT_WEBSITE_ID:"wid",IBOOT_WEBSITE_NO:"wno",IBOOT_TOKEN:"token",IBOOT_USER:"user"},$={DEVICE_ID:"Device-Id",LANG:"Lang",WEBSITE_ID:"Website-Id",WEBSITE_NO:"Website-No"},zt=i=>{if(!i.get)throw new Error("The get method of IStorage has not been implemented.");const e=i.get(Xt)??"",t=i.get(Wt),o=t!=null?JSON.parse(t):null,r={};return e.length>0&&(r["Device-Id"]=e),o&&(r.Lang=o.language,o.websiteId&&(r["Website-Id"]=o.websiteId),o.websiteNo&&(r["Website-No"]=o.websiteNo)),r},kr=({deviceId:i,website:e},t)=>{if(!t.set)throw new Error("The set method of IStorage has not been implemented.");t.set(Xt,i),e&&t.set(Wt,JSON.stringify(e))},Ur=i=>`${process.env.BASE_URL||"/api/services"}?m=${i}`,Vt=async(i,e)=>{let t=Ur(i);if(e?.data){const n=new URLSearchParams(e.data);t+=`&${n}`}const o=e&&e.storage&&e.storage.get?zt(e.storage):{},r=e?.headers;if(r)for(const n in r){const l=r[n];l&&(o[n]=l)}L.info({url:t,headers:o},"GET");const s=await fetch(t,{method:"GET",headers:o,cache:e?.useCache?"force-cache":"default"});if(s.ok){const n=Object.fromEntries(s.headers.entries()),l={...await s.json(),headers:n};return L.debug(l,"GET_RESULT"),l}const c={code:s.status,success:!1,msg:s.statusText};return L.error(c),c},st=async(i,e)=>{const t=e?.data??{},o=e?.headers;let r;const s=e&&e.storage&&e.storage.get?zt(e.storage):{},c=new Headers(s);if(t instanceof FormData?r=t:(r=JSON.stringify(t),c.set(z,M.applicationJson)),o)for(let f in o){const u=o[f];u&&c.set(f,u)}L.info({url:i,headers:c},"POST");const n=await fetch(i,{method:"POST",headers:c,body:r});if(n.ok){const f=Object.fromEntries(n.headers.entries()),u={...await n.json(),headers:f};return L.debug(u,"POST_RESULT"),u}const l={code:n.status,success:!1,msg:n.statusText};return L.error(l),l},Dr=async(i,e)=>{const t=await Vt(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??jt);return}throw Error(t.msg??jt)},Mr=async(i,e)=>{const t=await st(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??nt);return}throw Error(t.msg??nt)},jr=async(i,e)=>{const t=await st(i,e);return t.success?(e?.showSuccess&&e.showSuccess(t.msg??"SUCCESS"),!0):(e?.showError&&e.showError(t.msg??nt),!1)},Yt=i=>{if(i.get){const e=i.get($.DEVICE_ID),t=i.get($.LANG),o=i.get($.WEBSITE_ID),r=i.get($.WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),o&&o.length>0&&(s.websiteId=o),r&&r.length>0&&(s.websiteNo=r),s}throw new Error("The get method of IStorage has not been implemented.")},qr=(i,e)=>{if(i.set)e.deviceId&&i.set($.DEVICE_ID,e.deviceId),e.lang&&i.set($.LANG,e.lang),e.websiteId&&i.set($.WEBSITE_ID,e.websiteId),e.websiteNo&&i.set($.WEBSITE_NO,e.websiteNo);else throw new Error("The set method of IStorage has not been implemented.")},Kt=i=>{if(i.get){const e=i.get(U.IBOOT_DEVICE_ID),t=i.get(U.IBOOT_LANG),o=i.get(U.IBOOT_WEBSITE_ID),r=i.get(U.IBOOT_WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),o&&o.length>0&&(s.websiteId=o),r&&r.length>0&&(s.websiteNo=r),s}throw new Error("The get method of ICookies has not been implemented.")},Hr=(i,e)=>{if(i.set)e.deviceId&&i.set(U.IBOOT_DEVICE_ID,e.deviceId),e.lang&&i.set(U.IBOOT_LANG,e.lang),e.websiteId&&i.set(U.IBOOT_WEBSITE_ID,e.websiteId),e.websiteNo&&i.set(U.IBOOT_WEBSITE_NO,e.websiteNo);else throw new Error("The set method of ICookies has not been implemented.")},Fr=i=>{if(i.get){const e=i.get(U.IBOOT_USER);if(e&&e.length>0)return JSON.parse(e)}},$t=i=>{if(i.get){const e=i[U.IBOOT_USER];if(e&&e.length>0){const t=JSON.parse(e),o=t.username,r=t.userType.toString(),s=i[U.IBOOT_TOKEN];if(s)return{username:o,utype:r,token:s}}}},qt=()=>({path:"/",secure:process.env.APP_ENV==="production",httpOnly:!0,sameSite:"strict"}),Re={maxAge:-1,httpOnly:!0,path:"/"},Jt=(i,e)=>{const{id:t,name:o,username:r,nickname:s,headImg:c,token:n,lastLoginTime:l,deviceId:f,userType:u,mustChangePwd:h}=i,g={id:t,name:o,username:r,nickname:s||o,headImg:c,lastLoginTime:l,deviceId:f,userType:u,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:h};e.cookies[U.IBOOT_TOKEN]={value:n,options:qt()},e.cookies[U.IBOOT_USER]={value:JSON.stringify(g),options:qt()}},Qt=i=>{if(!i.set)throw new Error("cookies set function is undefined");if(i.set(U.IBOOT_TOKEN,"",Re),i.set(U.IBOOT_USER,"",Re),!i.delete)throw new Error("cookies delete function is undefined");i.delete(U.IBOOT_TOKEN,Re),i.delete(U.IBOOT_USER,Re)};class Zt{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version="1";lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV==="production"||L.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??Ht.TYPE_MGT,this.deviceId=e.deviceId??et(10),this.lang=e.lang??Lr,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}getDeviceId(){return this.deviceId}encrypt(e){const t=oe.enc.Utf8.parse(this.apiKey);return oe.AES.encrypt(e,t).toString()}decrypt(e){const t=oe.enc.Utf8.parse(this.apiKey);return oe.AES.decrypt(e,t,{mode:oe.mode.ECB}).toString(oe.enc.Utf8)}convertUrlParameter(e){const t=[];for(const o in e){let r=e[o];if(r&&typeof r=="string")r=r.trim();else if(r&&typeof r=="object"){if(Ze(r)){if(r.length===0)continue;for(let s=0;s<r.length;s++){const c=r[s];for(const n in c){const l=c[n]??void 0;if(l){if(typeof l=="object")Ze(l)&&l.forEach((f,u)=>{if(f)for(const h in f){const g=f[h];if(g&&g.toString().length>0){const v=`[${s.toString()}].${n+`[${u.toString()}].${h}`}=${fe(g)}`;t.push(o+v)}}});else if(l.toString().length>0){const f=`[${s.toString()}].${n}=${fe(l.toString())}`;t.push(o+f)}}}}}else for(const s in r){const c=r[s];if(c!=null&&c!=""&&c.length!=0){const n=`.${s}=${fe(c)}`;t.push(o+n)}}continue}else r&&typeof r=="function"&&(r=null);r!=null&&r!=""&&r.length!=0&&t.push(o+"="+fe(r))}return t&&t.join("&")}async sign(e){const t="&key="+await this.helloIboot(),o=[];for(const l in e)o.push(l);o.sort((l,f)=>l.toLowerCase().localeCompare(f.toLowerCase()));const r=[];o.forEach(l=>{let f=e[l];typeof f=="object"&&(f=JSON.stringify(f)),r.push(l+"="+f)});const s=r.join("&"),c=or.md5((s+t).toLocaleUpperCase()),n={params:s,md5:c};return L.debug(n,"API_SIGN"),c}assemblyParameter(e,t){const o=e??{};return o.timestamp=Date.now()+"",o.echostr=et(10),o.version=this.version,o.deviceId=this.deviceId,o.webid=this.websiteId,o.apiKey=this.apiKey,t&&t.length>0&&(o.username=t),o}async assemblyHeader({urlParams:e,token:t}){const o={"Res-Type":"json","Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};o[z]=M.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(o.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(o["Web-Id"]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(o["Web-No"]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(o.Authorization=t.token,o.Username=t.username),t.xcsrf&&(o[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));const r=Pe(e),s=await this.sign(r);return o.Sign=s,o}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[z]=M.applicationXwwwFormUrlencoded;const o={url:e,headers:t};L.debug(o,"HELLO");const r=await fetch(e,{method:"GET",headers:t,credentials:"include",cache:"force-cache"});if(r.ok){const s=await r.json();return L.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:o,cache:r="default"}){const s=this.assemblyParameter(t),c=this.convertUrlParameter(s),n=await this.assemblyHeader({urlParams:c,token:o}),l=`${this.getApiUrl(e)}?${c.toString()}`,f={url:l,headers:n};L.info(f,"GET");const u=await fetch(l,{method:"GET",headers:n,credentials:"include",cache:r});if(u.ok){const g=Object.fromEntries(u.headers.entries()),v={...await u.json(),headers:g};return L.debug(v,"GET_RESULT"),v}const h={code:u.status,success:!1,msg:u.statusText};return L.error(h),h}async post({url:e,data:t,token:o,cache:r="default"}){const s=t?{...t}:{},c=s.buffer??void 0,n=s.boundary??void 0;c&&delete s.buffer,n&&delete s.boundary;const l=this.assemblyParameter(s),f=this.convertUrlParameter(l),u=await this.assemblyHeader({urlParams:f,token:o});c&&n&&(u[z]=`multipart/form-data; boundary=${n}`);const h=this.getApiUrl(e),g={url:h,headers:u,params:l};L.info(g,"POST");const v=c?`${h}?${f}`:h,P=await fetch(v,{method:"POST",headers:u,body:c||f,credentials:"include",cache:r});if(P.ok){const d=Object.fromEntries(P.headers.entries()),b={...await P.json(),headers:d};return L.debug(b,"POST_RESULT"),b}const I={code:P.status,success:!1,msg:P.statusText};return L.error(I),I}async stream({url:e,data:t,token:o}){t=t?{...t}:{};const r=t.buffer??void 0,s=t.boundary??void 0;r&&delete t.buffer,s&&delete t.boundary;const c=this.assemblyParameter(t),n=this.convertUrlParameter(c),l=await this.assemblyHeader({urlParams:n,token:o});r&&s&&(l[z]=`multipart/form-data; boundary=${s}`),l.Connection="keep-alive",l["X-Accel-Buffering"]="no",l["Cache-Control"]="no-cache";const f=this.getApiUrl(e);try{const u=r?`${f}?${n}`:f,h={url:f,headers:l,params:c};L.info(h,"STREAM");const g=await fetch(u,{method:"POST",headers:l,body:r||n.toString(),credentials:"include"});if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);if(!g.body)throw new Error("No response body");const v=Object.fromEntries(g.headers.entries());return new Response(g.body,{headers:v})}catch(u){throw u}}}exports.ACCOUNT_TYPE_MAP=ir;exports.CONTENT_TYPE_KEY=z;exports.CONTENT_TYPE_MAP=M;exports.HTTPRouter=Cr;exports.HttpClient=Zt;exports.NextJsAdapter=xr;exports.NuxtJsAdapter=Nr;exports.USER_FORM_MAP=sr;exports.USER_SEX_MAP=ar;exports.USER_TYPE_MAP=Ht;exports.cleanToken=Qt;exports.dateFormat=cr;exports.get=Vt;exports.getLoginUser=Fr;exports.getServerHttpCookies=Kt;exports.getServerHttpOpts=Yt;exports.getToken=$t;exports.iGet=Dr;exports.iPost=Mr;exports.iPostSuccess=jr;exports.isArray=Ze;exports.logger=L;exports.post=st;exports.randomString=et;exports.setClientRequestHeader=kr;exports.setServerHttpCookies=Hr;exports.setServerHttpHeaders=qr;exports.setToken=Jt;exports.urlEncode=fe;exports.urlParamToJson=Pe;
8
+ `)}}class o 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 r 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 ")}}})(Ge)),Ge}var Xe={},We,At;function Rr(){if(At)return We;At=1;var i=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(a,R)=>{for(var m in R)i(a,m,{get:R[m],enumerable:!0})},s=(a,R,m,w)=>{if(R&&typeof R=="object"||typeof R=="function")for(let y of t(R))!o.call(a,y)&&y!==m&&i(a,y,{get:()=>R[y],enumerable:!(w=e(R,y))||w.enumerable});return a},c=a=>s(i({},"__esModule",{value:!0}),a),n={};r(n,{RequestCookies:()=>b,ResponseCookies:()=>p,parseCookie:()=>f,parseSetCookie:()=>u,stringifyCookie:()=>l}),We=c(n);function l(a){var R;const m=["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((R=a.value)!=null?R:"")}`;return m.length===0?w:`${w}; ${m.join("; ")}`}function f(a){const R=new Map;for(const m of a.split(/; */)){if(!m)continue;const w=m.indexOf("=");if(w===-1){R.set(m,"true");continue}const[y,N]=[m.slice(0,w),m.slice(w+1)];try{R.set(y,decodeURIComponent(N??"true"))}catch{}}return R}function u(a){if(!a)return;const[[R,m],...w]=f(a),{domain:y,expires:N,httponly:j,maxage:D,path:F,samesite:q,secure:Q,partitioned:Z,priority:B}=Object.fromEntries(w.map(([ie,Y])=>[ie.toLowerCase(),Y])),V={name:R,value:decodeURIComponent(m),domain:y,...N&&{expires:new Date(N)},...j&&{httpOnly:!0},...typeof D=="string"&&{maxAge:Number(D)},path:F,...q&&{sameSite:v(q)},...Q&&{secure:!0},...B&&{priority:I(B)},...Z&&{partitioned:!0}};return h(V)}function h(a){const R={};for(const m in a)a[m]&&(R[m]=a[m]);return R}var g=["strict","lax","none"];function v(a){return a=a.toLowerCase(),g.includes(a)?a:void 0}var P=["low","medium","high"];function I(a){return a=a.toLowerCase(),P.includes(a)?a:void 0}function d(a){if(!a)return[];var R=[],m=0,w,y,N,j,D;function F(){for(;m<a.length&&/\s/.test(a.charAt(m));)m+=1;return m<a.length}function q(){return y=a.charAt(m),y!=="="&&y!==";"&&y!==","}for(;m<a.length;){for(w=m,D=!1;F();)if(y=a.charAt(m),y===","){for(N=m,m+=1,F(),j=m;m<a.length&&q();)m+=1;m<a.length&&a.charAt(m)==="="?(D=!0,m=j,R.push(a.substring(w,N)),w=m):m=N+1}else m+=1;(!D||m>=a.length)&&R.push(a.substring(w,a.length))}return R}var b=class{constructor(a){this._parsed=new Map,this._headers=a;const R=a.get("cookie");if(R){const m=f(R);for(const[w,y]of m)this._parsed.set(w,{name:w,value:y})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...a){const R=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(R)}getAll(...a){var R;const m=Array.from(this._parsed);if(!a.length)return m.map(([y,N])=>N);const w=typeof a[0]=="string"?a[0]:(R=a[0])==null?void 0:R.name;return m.filter(([y])=>y===w).map(([y,N])=>N)}has(a){return this._parsed.has(a)}set(...a){const[R,m]=a.length===1?[a[0].name,a[0].value]:a,w=this._parsed;return w.set(R,{name:R,value:m}),this._headers.set("cookie",Array.from(w).map(([y,N])=>l(N)).join("; ")),this}delete(a){const R=this._parsed,m=Array.isArray(a)?a.map(w=>R.delete(w)):R.delete(a);return this._headers.set("cookie",Array.from(R).map(([w,y])=>l(y)).join("; ")),m}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("; ")}},p=class{constructor(a){this._parsed=new Map;var R,m,w;this._headers=a;const y=(w=(m=(R=a.getSetCookie)==null?void 0:R.call(a))!=null?m:a.get("set-cookie"))!=null?w:[],N=Array.isArray(y)?y:d(y);for(const j of N){const D=u(j);D&&this._parsed.set(D.name,D)}}get(...a){const R=typeof a[0]=="string"?a[0]:a[0].name;return this._parsed.get(R)}getAll(...a){var R;const m=Array.from(this._parsed.values());if(!a.length)return m;const w=typeof a[0]=="string"?a[0]:(R=a[0])==null?void 0:R.name;return m.filter(y=>y.name===w)}has(a){return this._parsed.has(a)}set(...a){const[R,m,w]=a.length===1?[a[0].name,a[0].value,a[0]]:a,y=this._parsed;return y.set(R,E({name:R,value:m,...w})),_(y,this._headers),this}delete(...a){const[R,m,w]=typeof a[0]=="string"?[a[0]]:[a[0].name,a[0].path,a[0].domain];return this.set({name:R,path:m,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(l).join("; ")}};function _(a,R){R.delete("set-cookie");for(const[,m]of a){const w=l(m);R.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 We}var It;function tt(){return It||(It=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(o,r){for(var s in r)Object.defineProperty(o,s,{enumerable:!0,get:r[s]})}e(i,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=Rr()})(Xe)),Xe}var Ot;function Pr(){return Ot||(Ot=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,f){for(var u in f)Object.defineProperty(l,u,{enumerable:!0,get:f[u]})}e(i,{INTERNALS:function(){return c},NextRequest:function(){return n}});const t=Bt(),o=Gt(),r=vr(),s=tt(),c=Symbol("internal request");class n extends Request{constructor(f,u={}){const h=typeof f!="string"&&"url"in f?f.url:String(f);(0,o.validateURL)(h),f instanceof Request?super(f,u):super(h,u);const g=new t.NextURL(h,{headers:(0,o.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:u.nextConfig});this[c]={cookies:new s.RequestCookies(this.headers),geo:u.geo||{},ip:u.ip,nextUrl:g,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?h:g.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[c].cookies}get geo(){return this[c].geo}get ip(){return this[c].ip}get nextUrl(){return this[c].nextUrl}get page(){throw new r.RemovedPageError}get ua(){throw new r.RemovedUAError}get url(){return this[c].url}}})(Ae)),Ae}var ze={},Ve={},xt;function yr(){return xt||(xt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(o,r,s){const c=Reflect.get(o,r,s);return typeof c=="function"?c.bind(o):c}static set(o,r,s,c){return Reflect.set(o,r,s,c)}static has(o,r){return Reflect.has(o,r)}static deleteProperty(o,r){return Reflect.deleteProperty(o,r)}}})(Ve)),Ve}var Nt;function Tr(){return Nt||(Nt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NextResponse",{enumerable:!0,get:function(){return f}});const e=tt(),t=Bt(),o=Gt(),r=yr(),s=tt(),c=Symbol("internal response"),n=new Set([301,302,303,307,308]);function l(u,h){var g;if(!(u==null||(g=u.request)==null)&&g.headers){if(!(u.request.headers instanceof Headers))throw new Error("request.headers must be an instance of Headers");const v=[];for(const[P,I]of u.request.headers)h.set("x-middleware-request-"+P,I),v.push(P);h.set("x-middleware-override-headers",v.join(","))}}class f extends Response{constructor(h,g={}){super(h,g);const v=this.headers,P=new s.ResponseCookies(v),I=new Proxy(P,{get(d,b,p){switch(b){case"delete":case"set":return(..._)=>{const E=Reflect.apply(d[b],d,_),a=new Headers(v);return E instanceof s.ResponseCookies&&v.set("x-middleware-set-cookie",E.getAll().map(R=>(0,e.stringifyCookie)(R)).join(",")),l(g,a),E};default:return r.ReflectAdapter.get(d,b,p)}}});this[c]={cookies:I,url:g.url?new t.NextURL(g.url,{headers:(0,o.toNodeOutgoingHttpHeaders)(v),nextConfig:g.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[c].cookies}static json(h,g){const v=Response.json(h,g);return new f(v.body,v)}static redirect(h,g){const v=typeof g=="number"?g:g?.status??307;if(!n.has(v))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');const P=typeof g=="object"?g:{},I=new Headers(P?.headers);return I.set("Location",(0,o.validateURL)(h)),new f(null,{...P,headers:I,status:v})}static rewrite(h,g){const v=new Headers(g?.headers);return v.set("x-middleware-rewrite",(0,o.validateURL)(h)),l(g,v),new f(null,{...g,headers:v})}static next(h){const g=new Headers(h?.headers);return g.set("x-middleware-next","1"),l(h,g),new f(null,{...h,headers:g})}}})(ze)),ze}var Ye={},Ct;function Sr(){return Ct||(Ct=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"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')}})(Ye)),Ye}var Ke={},$e={exports:{}},Lt;function Ar(){return Lt||(Lt=1,(()=>{var i={226:function(r,s){(function(c,n){var l="1.0.35",f="",u="?",h="function",g="undefined",v="object",P="string",I="major",d="model",b="name",p="type",_="vendor",E="version",a="architecture",R="console",m="mobile",w="tablet",y="smarttv",N="wearable",j="embedded",D=350,F="Amazon",q="Apple",Q="ASUS",Z="BlackBerry",B="Browser",V="Chrome",ie="Edge",Y="Firefox",ee="Google",he="Huawei",se="LG",ae="Microsoft",pe="Motorola",te="Opera",ue="Samsung",me="Sharp",re="Sony",ce="Xiaomi",k="Zebra",_e="Facebook",ge="Chromium OS",be="Mac OS",we=function(A,x){var S={};for(var C in A)x[C]&&x[C].length%2===0?S[C]=x[C].concat(A[C]):S[C]=A[C];return S},J=function(A){for(var x={},S=0;S<A.length;S++)x[A[S].toUpperCase()]=A[S];return x},at=function(A,x){return typeof A===P?le(x).indexOf(le(A))!==-1:!1},le=function(A){return A.toLowerCase()},tr=function(A){return typeof A===P?A.replace(/[^\d\.]/g,f).split(".")[0]:n},ye=function(A,x){if(typeof A===P)return A=A.replace(/^\s\s*/,f),typeof x===g?A:A.substring(0,D)},de=function(A,x){for(var S=0,C,K,X,O,T,W;S<x.length&&!T;){var Se=x[S],lt=x[S+1];for(C=K=0;C<Se.length&&!T&&Se[C];)if(T=Se[C++].exec(A),T)for(X=0;X<lt.length;X++)W=T[++K],O=lt[X],typeof O===v&&O.length>0?O.length===2?typeof O[1]==h?this[O[0]]=O[1].call(this,W):this[O[0]]=O[1]:O.length===3?typeof O[1]===h&&!(O[1].exec&&O[1].test)?this[O[0]]=W?O[1].call(this,W,O[2]):n:this[O[0]]=W?W.replace(O[1],O[2]):n:O.length===4&&(this[O[0]]=W?O[3].call(this,W.replace(O[1],O[2])):n):this[O]=W||n;S+=2}},Te=function(A,x){for(var S in x)if(typeof x[S]===v&&x[S].length>0){for(var C=0;C<x[S].length;C++)if(at(x[S][C],A))return S===u?n:S}else if(at(x[S],A))return S===u?n:S;return A},rr={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ut={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"},ct={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[b,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[b,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[b,E],[/opios[\/ ]+([\w\.]+)/i],[E,[b,te+" Mini"]],[/\bopr\/([\w\.]+)/i],[E,[b,te]],[/(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],[b,E],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[b,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[E,[b,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[E,[b,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[b,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[b,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[b,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[b,/(.+)/,"$1 Secure "+B],E],[/\bfocus\/([\w\.]+)/i],[E,[b,Y+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[b,te+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[b,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[b,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[b,te+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[b,"MIUI "+B]],[/fxios\/([-\w\.]+)/i],[E,[b,Y]],[/\bqihu|(qi?ho?o?|360)browser/i],[[b,"360 "+B]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[b,/(.+)/,"$1 "+B],E],[/(comodo_dragon)\/([\w\.]+)/i],[[b,/_/g," "],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[b,E],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[b],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[b,_e],E],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[b,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[b,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[b,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[b,V+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[b,V+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[b,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[b,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[b,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,b],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[b,[E,Te,rr]],[/(webkit|khtml)\/([\w\.]+)/i],[b,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[b,"Netscape"],E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[b,Y+" 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],[b,E],[/(cobalt)\/([\w\.]+)/i],[b,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[a,"amd64"]],[/(ia32(?=;))/i],[[a,le]],[/((?: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/,f,le]],[/(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,le]]],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],[d,[_,ue],[p,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[_,ue],[p,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[_,q],[p,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[_,q],[p,w]],[/(macintosh);/i],[d,[_,q]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[_,me],[p,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[_,he],[p,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[_,he],[p,m]],[/\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],[[d,/_/g," "],[_,ce],[p,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[_,ce],[p,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[_,"OPPO"],[p,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[_,"Vivo"],[p,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[d,[_,"Realme"],[p,m]],[/\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],[d,[_,pe],[p,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[_,pe],[p,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[_,se],[p,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[_,se],[p,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[_,"Lenovo"],[p,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[_,"Nokia"],[p,m]],[/(pixel c)\b/i],[d,[_,ee],[p,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[_,ee],[p,m]],[/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],[d,[_,re],[p,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[_,re],[p,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[_,"OnePlus"],[p,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[_,F],[p,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[_,F],[p,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,_,[p,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[_,Z],[p,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[_,Q],[p,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[_,Q],[p,m]],[/(nexus 9)/i],[d,[_,"HTC"],[p,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[_,[d,/_/g," "],[p,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[_,"Acer"],[p,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[_,"Meizu"],[p,m]],[/(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],[_,d,[p,m]],[/(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],[_,d,[p,w]],[/(surface duo)/i],[d,[_,ae],[p,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[_,"Fairphone"],[p,m]],[/(u304aa)/i],[d,[_,"AT&T"],[p,m]],[/\bsie-(\w*)/i],[d,[_,"Siemens"],[p,m]],[/\b(rct\w+) b/i],[d,[_,"RCA"],[p,w]],[/\b(venue[\d ]{2,7}) b/i],[d,[_,"Dell"],[p,w]],[/\b(q(?:mv|ta)\w+) b/i],[d,[_,"Verizon"],[p,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[_,"Barnes & Noble"],[p,w]],[/\b(tm\d{3}\w+) b/i],[d,[_,"NuVision"],[p,w]],[/\b(k88) b/i],[d,[_,"ZTE"],[p,w]],[/\b(nx\d{3}j) b/i],[d,[_,"ZTE"],[p,m]],[/\b(gen\d{3}) b.+49h/i],[d,[_,"Swiss"],[p,m]],[/\b(zur\d{3}) b/i],[d,[_,"Swiss"],[p,w]],[/\b((zeki)?tb.*\b) b/i],[d,[_,"Zeki"],[p,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[_,"Dragon Touch"],d,[p,w]],[/\b(ns-?\w{0,9}) b/i],[d,[_,"Insignia"],[p,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[_,"NextBook"],[p,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[_,"Voice"],d,[p,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[_,"LvTel"],d,[p,m]],[/\b(ph-1) /i],[d,[_,"Essential"],[p,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[_,"Envizen"],[p,w]],[/\b(trio[-\w\. ]+) b/i],[d,[_,"MachSpeed"],[p,w]],[/\btu_(1491) b/i],[d,[_,"Rotor"],[p,w]],[/(shield[\w ]+) b/i],[d,[_,"Nvidia"],[p,w]],[/(sprint) (\w+)/i],[_,d,[p,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[_,ae],[p,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[_,k],[p,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[_,k],[p,m]],[/smart-tv.+(samsung)/i],[_,[p,y]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[_,ue],[p,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[_,se],[p,y]],[/(apple) ?tv/i],[_,[d,q+" TV"],[p,y]],[/crkey/i],[[d,V+"cast"],[_,ee],[p,y]],[/droid.+aft(\w)( bui|\))/i],[d,[_,F],[p,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[_,me],[p,y]],[/(bravia[\w ]+)( bui|\))/i],[d,[_,re],[p,y]],[/(mitv-\w{5}) bui/i],[d,[_,ce],[p,y]],[/Hbbtv.*(technisat) (.*);/i],[_,d,[p,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[_,ye],[d,ye],[p,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[_,d,[p,R]],[/droid.+; (shield) bui/i],[d,[_,"Nvidia"],[p,R]],[/(playstation [345portablevi]+)/i],[d,[_,re],[p,R]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[_,ae],[p,R]],[/((pebble))app/i],[_,d,[p,N]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[_,q],[p,N]],[/droid.+; (glass) \d/i],[d,[_,ee],[p,N]],[/droid.+; (wt63?0{2,3})\)/i],[d,[_,k],[p,N]],[/(quest( 2| pro)?)/i],[d,[_,_e],[p,N]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[_,[p,j]],[/(aeobc)\b/i],[d,[_,F],[p,j]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[d,[p,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[p,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[_,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[b,ie+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[b,"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],[b,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,b]],os:[[/microsoft (windows) (vista|xp)/i],[b,E],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[b,[E,Te,ut]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,"Windows"],[E,Te,ut]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[b,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[b,be],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,b],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[b,E],[/\(bb(10);/i],[E,[b,Z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[b,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[b,Y+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[b,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[b,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[b,V+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[b,ge],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],[b,E],[/(sunos) ?([\w\.\d]*)/i],[[b,"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],[b,E]]},H=function(A,x){if(typeof A===v&&(x=A,A=n),!(this instanceof H))return new H(A,x).getResult();var S=typeof c!==g&&c.navigator?c.navigator:n,C=A||(S&&S.userAgent?S.userAgent:f),K=S&&S.userAgentData?S.userAgentData:n,X=x?we(ct,x):ct,O=S&&S.userAgent==C;return this.getBrowser=function(){var T={};return T[b]=n,T[E]=n,de.call(T,C,X.browser),T[I]=tr(T[E]),O&&S&&S.brave&&typeof S.brave.isBrave==h&&(T[b]="Brave"),T},this.getCPU=function(){var T={};return T[a]=n,de.call(T,C,X.cpu),T},this.getDevice=function(){var T={};return T[_]=n,T[d]=n,T[p]=n,de.call(T,C,X.device),O&&!T[p]&&K&&K.mobile&&(T[p]=m),O&&T[d]=="Macintosh"&&S&&typeof S.standalone!==g&&S.maxTouchPoints&&S.maxTouchPoints>2&&(T[d]="iPad",T[p]=w),T},this.getEngine=function(){var T={};return T[b]=n,T[E]=n,de.call(T,C,X.engine),T},this.getOS=function(){var T={};return T[b]=n,T[E]=n,de.call(T,C,X.os),O&&!T[b]&&K&&K.platform!="Unknown"&&(T[b]=K.platform.replace(/chrome os/i,ge).replace(/macos/i,be)),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 C},this.setUA=function(T){return C=typeof T===P&&T.length>D?ye(T,D):T,this},this.setUA(C),this};H.VERSION=l,H.BROWSER=J([b,E,I]),H.CPU=J([a]),H.DEVICE=J([d,_,p,R,m,y,w,N,j]),H.ENGINE=H.OS=J([b,E]),typeof s!==g?(r.exports&&(s=r.exports=H),s.UAParser=H):typeof c!==g&&(c.UAParser=H);var ne=typeof c!==g&&(c.jQuery||c.Zepto);if(ne&&!ne.ua){var Ee=new H;ne.ua=Ee.getResult(),ne.ua.get=function(){return Ee.getUA()},ne.ua.set=function(A){Ee.setUA(A);var x=Ee.getResult();for(var S in x)ne.ua[S]=x[S]}}})(typeof window=="object"?window:this)}},e={};function t(r){var s=e[r];if(s!==void 0)return s.exports;var c=e[r]={exports:{}},n=!0;try{i[r].call(c.exports,c,c.exports,t),n=!1}finally{n&&delete e[r]}return c.exports}typeof t<"u"&&(t.ab="undefined/");var o=t(226);$e.exports=o})()),$e.exports}var kt;function Ut(){return kt||(kt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(n,l){for(var f in l)Object.defineProperty(n,f,{enumerable:!0,get:l[f]})}e(i,{isBot:function(){return r},userAgent:function(){return c},userAgentFromString:function(){return s}});const t=o(Ar());function o(n){return n&&n.__esModule?n:{default:n}}function r(n){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(n)}function s(n){return{...(0,t.default)(n),isBot:n===void 0?!1:r(n)}}function c({headers:n}){return s(n.get("user-agent")||void 0)}})(Ke)),Ke}var Je={},Dt;function Ir(){return Dt||(Dt=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})(Je)),Je}var Mt;function Or(){return Mt||(Mt=1,(function(i,e){const t={NextRequest:Pr().NextRequest,NextResponse:Tr().NextResponse,ImageResponse:Sr().ImageResponse,userAgentFromString:Ut().userAgentFromString,userAgent:Ut().userAgent,URLPattern:Ir().URLPattern};i.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})(ve,ve.exports)),ve.exports}var xr=Or();class Nr{async parseRequest(e){const t=new URL(e.url),o=e.method,r=e.headers.get(z)??"",s={};e.cookies.getAll().forEach(l=>{s[l.name]=l.value});let c,n;if(o!=="GET"){if(r.includes(M.applicationJson))try{c=await e.json()}catch{L.warn("request body is null!")}else if(r.includes(M.multipartFormData)){const l=e.clone(),f=await e.formData(),u=await l.arrayBuffer();n={formData:f,buffer:u}}else if(r.includes(M.applicationXwwwFormUrlencoded)){const l=await e.text();c=Pe(l,["m"])}}return{url:t,method:o,contentType:r,body:c,requestFormData:n,cookies:s}}createResponse(e){const t=xr.NextResponse.json(e.body);if(Object.entries(e.cookies).forEach(([o,r])=>{typeof r=="object"&&r.value?t.cookies.set(o,r.value,r.options):typeof r=="string"&&t.cookies.set(o,r)}),e.cleanCookies){const o={set(r,s,c){t.cookies.set(r,s,c)},delete(r,s){t.cookies.delete({...s,name:r})}};e.cleanCookies(o)}return t}setCookie(e,t,o,r){e.cookies[t]={value:o,options:r}}}class Cr{async parseRequest(e){const t=G.getRequestURL(e),o=e.method,r=e.headers.get(z)||"",s=G.parseCookies(e);let c,n;if(o!=="GET"){if(r.includes(M.applicationJson))try{c=await G.readBody(e)}catch{L.warn("request body is null!")}else if(r.includes(M.multipartFormData)){const l=await G.readMultipartFormData(e)??[],f=new FormData,u=[];for(const v of l)if(v.type==="file"&&v.data){const P=new File([v.data],v.filename||"unknown",{type:v.type});f.append("file",P),u.push(v.data)}else if(v.name){const P=v.data?v.data.toString():"";f.append(v.name,P)}const h=Buffer.concat(u.map(v=>Buffer.from(v))),g=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);n={formData:f,buffer:g}}else if(r.includes(M.applicationXwwwFormUrlencoded))try{c=await G.readBody(e)}catch{L.warn("request body is null!")}}return{url:t,method:o,contentType:r,body:c,requestFormData:n,cookies:s,context:e}}createResponse(e){const{status:t,headers:o,body:r,cookies:s,cleanCookies:c,context:n}=e,l=n;return G.setResponseStatus(l,t),Object.entries(o).forEach(([f,u])=>{G.setHeader(l,f,u)}),Object.entries(s).forEach(([f,u])=>{typeof u=="object"&&u.value?G.setCookie(l,f,u.value,u.options):typeof u=="string"&&G.setCookie(l,f,u)}),c&&c({set(u,h,g){G.setCookie(l,u,h,g)},delete(u,h){G.deleteCookie(l,u,h)}}),r}setCookie(e,t,o,r){e.cookies[t]={value:o,options:r}}}var rt=(i=>(i[i.login=0]="login",i[i.logout=1]="logout",i))(rt||{});const Qe={login:"login",logout:"logout",unknown:""},z="Content-Type",M={applicationJson:"application/json",multipartFormData:"multipart/form-data",applicationXwwwFormUrlencoded:"application/x-www-form-urlencoded"};class Lr{config;http;adapter;constructor({config:e,adapter:t,storage:o}){this.config=e;let r=Yt(o.headers);(!r.deviceId||r.deviceId.trim().length===0)&&(r=Kt(o.cookies)),this.http=new er({...r,userType:e.userType,helloURL:e.helloURL}),this.adapter=t}async handleRequest(e){try{const t=await this.adapter.parseRequest(e),o=await this.processRequest(t);return this.adapter.createResponse(o)}catch(t){L.error({error:t?.toString()||"Internal server error"},"ROUTE ERROR");const o=this.createErrorResponse(500,t?.toString()||"Internal server error");return this.adapter.createResponse(o)}}async processRequest(e){const t=e.url.searchParams,o=t.get("m")??"unknown",s={...Qe,...this.config.APIMAP}[o],c=e.cookies;if(Jt(c,this.http.getDeviceId()),!s||s.length===0)return this.createErrorResponse(404,"API not found",c);let n;if((s.startsWith("admin/")||s.startsWith("api/"))&&(n=$t(c),L.debug(n,"token"),!n||n.username.length===0||n.token.length===0))return this.createErrorResponse(409,"Authentication required",c);L.debug({"content-type":e.contentType},"Content-Type"),L.debug({hostUrl:s,token:n?{...n}:""},"processRequest");const l=e.method;if(l==="GET"){const f=Pe(t.toString(),["m"]),u=await this.http.get({url:s,data:f,token:n});return this.createResponse({url:s,result:u,config:this.config,req:e})}else if(l==="POST"){let f;const u=e.contentType;if(u.includes(M.applicationJson)||u.includes(M.applicationXwwwFormUrlencoded))e.body&&(f={...e.body});else if(u.includes(M.multipartFormData)){const g=u.match(/boundary=([^\s;]+)/);if(!g||!e.requestFormData)return this.createErrorResponse(411,"Missing boundary in form data",c);const v=e.requestFormData.buffer;f={boundary:g[1],buffer:Buffer.from(v)};const I=e.requestFormData.formData;if(I)for(const[d,b]of Object.entries(I))d!=="file"&&(f[d]=b)}else return this.createErrorResponse(410,"Unsupported content type",c);const h=await this.http.post({url:s,data:f,token:n});return this.createResponse({url:s,result:h,config:this.config,req:e})}return this.createErrorResponse(405,"Method not allowed, only supported GET or POST",c)}createResponse({url:e,result:t,config:o,req:r}){const s={};s[z]=M.applicationJson;const c={status:t.success?200:t.code,headers:s,cookies:this.setCookies(r.cookies),body:t,context:r.context};if(t.success){switch(e){case Qe[rt[0]]:const n=t.data;Qt(n,c);break;case Qe[rt[1]]:c.cleanCookies=l=>Zt(l);break}o.onHandlerSuccess&&o.onHandlerSuccess({url:e,data:t.data,req:r,res:c})}return c}createErrorResponse(e,t,o){const r={};return r[z]=M.applicationJson,{status:e,headers:r,cookies:o?this.setCookies(o):{},body:{code:e,success:!1,msg:t}}}setCookies(e){const t={};return Object.entries(e).forEach(([o,r])=>{t[o]={value:r}}),t}}const kr="zh-CN",Xt="_device_id_key",Wt="_current_website_key",jt="Get request error!",nt="Post request error!",U={IBOOT_DEVICE_ID:"dvid",IBOOT_LANG:"lang",IBOOT_WEBSITE_ID:"wid",IBOOT_WEBSITE_NO:"wno",IBOOT_TOKEN:"token",IBOOT_USER:"user"},$={DEVICE_ID:"Device-Id",LANG:"Lang",WEBSITE_ID:"Website-Id",WEBSITE_NO:"Website-No"},zt=i=>{if(!i.get)throw new Error("The get method of IStorage has not been implemented.");const e=i.get(Xt)??"",t=i.get(Wt),o=t!=null?JSON.parse(t):null,r={};return e.length>0&&(r["Device-Id"]=e),o&&(r.Lang=o.language,o.websiteId&&(r["Website-Id"]=o.websiteId),o.websiteNo&&(r["Website-No"]=o.websiteNo)),r},Ur=({deviceId:i,website:e},t)=>{if(!t.set)throw new Error("The set method of IStorage has not been implemented.");t.set(Xt,i),e&&t.set(Wt,JSON.stringify(e))},Dr=i=>`${process.env.BASE_URL||"/api/services"}?m=${i}`,Vt=async(i,e)=>{let t=Dr(i);if(e?.data){const n=new URLSearchParams(e.data);t+=`&${n}`}const o=e&&e.storage&&e.storage.get?zt(e.storage):{},r=e?.headers;if(r)for(const n in r){const l=r[n];l&&(o[n]=l)}L.info({url:t,headers:o},"GET");const s=await fetch(t,{method:"GET",headers:o,cache:e?.useCache?"force-cache":"default"});if(s.ok){const n=Object.fromEntries(s.headers.entries()),l={...await s.json(),headers:n};return L.debug(l,"GET_RESULT"),l}const c={code:s.status,success:!1,msg:s.statusText};return L.error(c),c},st=async(i,e)=>{const t=e?.data??{},o=e?.headers;let r;const s=e&&e.storage&&e.storage.get?zt(e.storage):{},c=new Headers(s);if(t instanceof FormData?r=t:(r=JSON.stringify(t),c.set(z,M.applicationJson)),o)for(let f in o){const u=o[f];u&&c.set(f,u)}L.info({url:i,headers:c},"POST");const n=await fetch(i,{method:"POST",headers:c,body:r});if(n.ok){const f=Object.fromEntries(n.headers.entries()),u={...await n.json(),headers:f};return L.debug(u,"POST_RESULT"),u}const l={code:n.status,success:!1,msg:n.statusText};return L.error(l),l},Mr=async(i,e)=>{const t=await Vt(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??jt);return}throw Error(t.msg??jt)},jr=async(i,e)=>{const t=await st(i,e);if(t.success)return t.data;if(e?.showError){e.showError(t.msg??nt);return}throw Error(t.msg??nt)},qr=async(i,e)=>{const t=await st(i,e);return t.success?(e?.showSuccess&&e.showSuccess(t.msg??"SUCCESS"),!0):(e?.showError&&e.showError(t.msg??nt),!1)},Yt=i=>{if(i.get){const e=i.get($.DEVICE_ID),t=i.get($.LANG),o=i.get($.WEBSITE_ID),r=i.get($.WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),o&&o.length>0&&(s.websiteId=o),r&&r.length>0&&(s.websiteNo=r),s}throw new Error("The get method of IStorage has not been implemented.")},Hr=(i,e)=>{if(i.set)e.deviceId&&i.set($.DEVICE_ID,e.deviceId),e.lang&&i.set($.LANG,e.lang),e.websiteId&&i.set($.WEBSITE_ID,e.websiteId),e.websiteNo&&i.set($.WEBSITE_NO,e.websiteNo);else throw new Error("The set method of IStorage has not been implemented.")},Kt=i=>{if(i.get){const e=i.get(U.IBOOT_DEVICE_ID),t=i.get(U.IBOOT_LANG),o=i.get(U.IBOOT_WEBSITE_ID),r=i.get(U.IBOOT_WEBSITE_NO),s={};return e&&e.length>0&&(s.deviceId=e),t&&t.length>0&&(s.lang=t),o&&o.length>0&&(s.websiteId=o),r&&r.length>0&&(s.websiteNo=r),s}throw new Error("The get method of ICookies has not been implemented.")},Fr=(i,e)=>{if(i.set)e.deviceId&&i.set(U.IBOOT_DEVICE_ID,e.deviceId),e.lang&&i.set(U.IBOOT_LANG,e.lang),e.websiteId&&i.set(U.IBOOT_WEBSITE_ID,e.websiteId),e.websiteNo&&i.set(U.IBOOT_WEBSITE_NO,e.websiteNo);else throw new Error("The set method of ICookies has not been implemented.")},Br=i=>{if(i.get){const e=i.get(U.IBOOT_USER);if(e&&e.length>0)return JSON.parse(e)}},$t=i=>{if(i.get){const e=i[U.IBOOT_USER];if(e&&e.length>0){const t=JSON.parse(e),o=t.username,r=t.userType.toString(),s=i[U.IBOOT_TOKEN];if(s)return{username:o,utype:r,token:s}}}},qt=()=>({path:"/",secure:process.env.APP_ENV==="production",httpOnly:!0,sameSite:"strict"}),Re={maxAge:-1,httpOnly:!0,path:"/"},Jt=(i,e)=>{i[U.IBOOT_DEVICE_ID]=e},Qt=(i,e)=>{const{id:t,name:o,username:r,nickname:s,headImg:c,token:n,lastLoginTime:l,deviceId:f,userType:u,mustChangePwd:h}=i,g={id:t,name:o,username:r,nickname:s||o,headImg:c,lastLoginTime:l,deviceId:f,userType:u,accountType:0,needToReview:!1,socketOnline:!1,mustChangePwd:h};e.cookies[U.IBOOT_TOKEN]={value:n,options:qt()},e.cookies[U.IBOOT_USER]={value:JSON.stringify(g),options:qt()}},Zt=i=>{if(!i.set)throw new Error("cookies set function is undefined");if(i.set(U.IBOOT_TOKEN,"",Re),i.set(U.IBOOT_USER,"",Re),!i.delete)throw new Error("cookies delete function is undefined");i.delete(U.IBOOT_TOKEN,Re),i.delete(U.IBOOT_USER,Re)};class er{baseUrl;helloMethod;apiKey;userType;userFrom;deviceId;version="1";lang;websiteId;websiteNo;constructor(e){process.env.APP_ENV==="production"||L.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??Ht.TYPE_MGT,this.deviceId=e.deviceId??et(10),this.lang=e.lang??kr,this.websiteId=e.websiteId,this.websiteNo=e.websiteNo}getDeviceId(){return this.deviceId}encrypt(e){const t=oe.enc.Utf8.parse(this.apiKey);return oe.AES.encrypt(e,t).toString()}decrypt(e){const t=oe.enc.Utf8.parse(this.apiKey);return oe.AES.decrypt(e,t,{mode:oe.mode.ECB}).toString(oe.enc.Utf8)}convertUrlParameter(e){const t=[];for(const o in e){let r=e[o];if(r&&typeof r=="string")r=r.trim();else if(r&&typeof r=="object"){if(Ze(r)){if(r.length===0)continue;for(let s=0;s<r.length;s++){const c=r[s];for(const n in c){const l=c[n]??void 0;if(l){if(typeof l=="object")Ze(l)&&l.forEach((f,u)=>{if(f)for(const h in f){const g=f[h];if(g&&g.toString().length>0){const v=`[${s.toString()}].${n+`[${u.toString()}].${h}`}=${fe(g)}`;t.push(o+v)}}});else if(l.toString().length>0){const f=`[${s.toString()}].${n}=${fe(l.toString())}`;t.push(o+f)}}}}}else for(const s in r){const c=r[s];if(c!=null&&c!=""&&c.length!=0){const n=`.${s}=${fe(c)}`;t.push(o+n)}}continue}else r&&typeof r=="function"&&(r=null);r!=null&&r!=""&&r.length!=0&&t.push(o+"="+fe(r))}return t&&t.join("&")}async sign(e){const t="&key="+await this.helloIboot(),o=[];for(const l in e)o.push(l);o.sort((l,f)=>l.toLowerCase().localeCompare(f.toLowerCase()));const r=[];o.forEach(l=>{let f=e[l];typeof f=="object"&&(f=JSON.stringify(f)),r.push(l+"="+f)});const s=r.join("&"),c=ir.md5((s+t).toLocaleUpperCase()),n={params:s,md5:c};return L.debug(n,"API_SIGN"),c}assemblyParameter(e,t){const o=e??{};return o.timestamp=Date.now()+"",o.echostr=et(10),o.version=this.version,o.deviceId=this.deviceId,o.webid=this.websiteId,o.apiKey=this.apiKey,t&&t.length>0&&(o.username=t),o}async assemblyHeader({urlParams:e,token:t}){const o={"Res-Type":"json","Device-Id":this.deviceId,"User-Type":t?.utype.toString()??this.userType.toString(),"User-From":this.userFrom,"Api-Key":this.apiKey};o[z]=M.applicationXwwwFormUrlencoded,this.lang&&this.lang.length>0&&(o.Lang=this.lang),this.websiteId&&this.websiteId.length>0&&(o["Web-Id"]=this.websiteId),this.websiteNo&&this.websiteNo.length>0&&(o["Web-No"]=this.websiteNo),t&&(t.token&&t.token.length>0&&t.username&&t.username.length>0&&(o.Authorization=t.token,o.Username=t.username),t.xcsrf&&(o[t.xcsrf.csrfHeader]=t.xcsrf.csrfToken));const r=Pe(e),s=await this.sign(r);return o.Sign=s,o}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[z]=M.applicationXwwwFormUrlencoded;const o={url:e,headers:t};L.debug(o,"HELLO");const r=await fetch(e,{method:"GET",headers:t,credentials:"include",cache:"force-cache"});if(r.ok){const s=await r.json();return L.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:o,cache:r="default"}){const s=this.assemblyParameter(t),c=this.convertUrlParameter(s),n=await this.assemblyHeader({urlParams:c,token:o}),l=`${this.getApiUrl(e)}?${c.toString()}`,f={url:l,headers:n};L.info(f,"GET");const u=await fetch(l,{method:"GET",headers:n,credentials:"include",cache:r});if(u.ok){const g=Object.fromEntries(u.headers.entries()),v={...await u.json(),headers:g};return L.debug(v,"GET_RESULT"),v}const h={code:u.status,success:!1,msg:u.statusText};return L.error(h),h}async post({url:e,data:t,token:o,cache:r="default"}){const s=t?{...t}:{},c=s.buffer??void 0,n=s.boundary??void 0;c&&delete s.buffer,n&&delete s.boundary;const l=this.assemblyParameter(s),f=this.convertUrlParameter(l),u=await this.assemblyHeader({urlParams:f,token:o});c&&n&&(u[z]=`multipart/form-data; boundary=${n}`);const h=this.getApiUrl(e),g={url:h,headers:u,params:l};L.info(g,"POST");const v=c?`${h}?${f}`:h,P=await fetch(v,{method:"POST",headers:u,body:c||f,credentials:"include",cache:r});if(P.ok){const d=Object.fromEntries(P.headers.entries()),b={...await P.json(),headers:d};return L.debug(b,"POST_RESULT"),b}const I={code:P.status,success:!1,msg:P.statusText};return L.error(I),I}async stream({url:e,data:t,token:o}){t=t?{...t}:{};const r=t.buffer??void 0,s=t.boundary??void 0;r&&delete t.buffer,s&&delete t.boundary;const c=this.assemblyParameter(t),n=this.convertUrlParameter(c),l=await this.assemblyHeader({urlParams:n,token:o});r&&s&&(l[z]=`multipart/form-data; boundary=${s}`),l.Connection="keep-alive",l["X-Accel-Buffering"]="no",l["Cache-Control"]="no-cache";const f=this.getApiUrl(e);try{const u=r?`${f}?${n}`:f,h={url:f,headers:l,params:c};L.info(h,"STREAM");const g=await fetch(u,{method:"POST",headers:l,body:r||n.toString(),credentials:"include"});if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);if(!g.body)throw new Error("No response body");const v=Object.fromEntries(g.headers.entries());return new Response(g.body,{headers:v})}catch(u){throw u}}}exports.ACCOUNT_TYPE_MAP=sr;exports.CONTENT_TYPE_KEY=z;exports.CONTENT_TYPE_MAP=M;exports.HTTPRouter=Lr;exports.HttpClient=er;exports.NextJsAdapter=Nr;exports.NuxtJsAdapter=Cr;exports.USER_FORM_MAP=ar;exports.USER_SEX_MAP=ur;exports.USER_TYPE_MAP=Ht;exports.cleanToken=Zt;exports.dateFormat=lr;exports.get=Vt;exports.getLoginUser=Br;exports.getServerHttpCookies=Kt;exports.getServerHttpOpts=Yt;exports.getToken=$t;exports.iGet=Mr;exports.iPost=jr;exports.iPostSuccess=qr;exports.isArray=Ze;exports.logger=L;exports.post=st;exports.randomString=et;exports.setClientRequestHeader=Ur;exports.setDeviceIdToCookies=Jt;exports.setServerHttpCookies=Fr;exports.setServerHttpHeaders=Hr;exports.setToken=Qt;exports.urlEncode=fe;exports.urlParamToJson=Pe;
9
9
  //# sourceMappingURL=iboot-http-client.cjs.js.map