var G=Object.defineProperty;var S=(s,e,t)=>e in s?G(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>S(s,typeof e!="symbol"?e+"":e,t);import{J as y,K as f}from"./C-p8iwFB.js";var i=(s=>(s.Json="application/json",s.FormData="multipart/form-data",s.UrlEncoded="application/x-www-form-urlencoded",s.Text="text/plain",s))(i||{});class q{constructor(e={}){a(this,"baseUrl","");a(this,"securityData",null);a(this,"securityWorker");a(this,"abortControllers",new Map);a(this,"customFetch",(...e)=>fetch(...e));a(this,"baseApiParams",{credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"});a(this,"setSecurityData",e=>{this.securityData=e});a(this,"contentFormatters",{"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce((t,o)=>{const r=e[o];return t.append(o,r instanceof Blob?r:typeof r=="object"&&r!==null?JSON.stringify(r):`${r}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)});a(this,"createAbortSignal",e=>{if(this.abortControllers.has(e)){const o=this.abortControllers.get(e);return o?o.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal});a(this,"abortRequest",e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))});a(this,"request",async({body:e,secure:t,path:o,type:r,query:m,format:P,baseUrl:$,cancelToken:l,...w})=>{const A=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},u=this.mergeRequestParams(w,A),d=m&&this.toQueryString(m),j=this.contentFormatters[r||"application/json"],c=P||u.format;return this.customFetch(`${$||this.baseUrl||""}${o}${d?`?${d}`:""}`,{...u,headers:{...u.headers||{},...r&&r!=="multipart/form-data"?{"Content-Type":r}:{}},signal:l?this.createAbortSignal(l):u.signal,body:typeof e>"u"||e===null?null:j(e)}).then(async h=>{const n=h;n.data=null,n.error=null;const b=c?await h[c]().then(p=>(n.ok?n.data=p:n.error=p,n)).catch(p=>(n.error=p,n)):n;if(l&&this.abortControllers.delete(l),!h.ok)throw b;return b})});Object.assign(this,e)}encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}}const C=()=>{const{baseUrl:s}=y(f.API_HUB_API);return new g({baseUrl:`${s}`,baseApiParams:{headers:{"Content-Type":"application/json"}}}).api.apiHub},E=()=>{const{baseUrl:s}=y(f.WORDPRESS_PREVIEW_API);return new g({baseUrl:`${s}`}).api.wordpressPreview};class g extends q{constructor(){super(...arguments);a(this,"api",{apiHub:{blog:{GetAll:(t,o,r={})=>this.request({path:`/apiHub/blog/${t}`,method:"GET",type:i.Json,format:"json",query:o,...r}),GetBySlug:(t,o,r={})=>this.request({path:`/apiHub/blog/${t}/${o}`,method:"GET",type:i.Json,format:"json",...r})},blogCategory:{GetAll:(t,o={})=>this.request({path:`/apiHub/blog-category/${t}`,method:"GET",type:i.Json,format:"json",...o}),GetBySlug:(t,o,r={})=>this.request({path:`/apiHub/blog-category/${t}/${o}`,method:"GET",type:i.Json,format:"json",...r})},blogRoutes:{GetAll:(t,o={})=>this.request({path:`/apiHub/blog-routes/${t}`,method:"GET",type:i.Json,format:"json",...o})},career:{GetAll:(t,o,r={})=>this.request({path:`/apiHub/career/${t}`,method:"GET",type:i.Json,format:"json",query:o,...r}),GetById:(t,o,r={})=>this.request({path:`/apiHub/career/${t}/${o}`,method:"GET",type:i.Json,format:"json",...r})},globalNumbers:{GetAll:(t={})=>this.request({path:"/apiHub/global-numbers",method:"GET",type:i.Json,format:"json",...t})},mobile:{GetLinkStatus:(t,o={})=>this.request({path:"/apiHub/mobile/link-status",method:"POST",type:i.Json,format:"json",body:{link:t},...o})},pf2024:{GetGameList:(t,o={})=>this.request({path:`/apiHub/pf2024/${t}`,method:"GET",type:i.Json,format:"json",...o}),SetGame:(t,o,r={})=>this.request({path:`/apiHub/pf2024/${o}`,method:"POST",type:i.Json,format:"json",body:{token:t},...r})}},wordpressPreview:{GetDynamicBySlug:(t,o,r={})=>this.request({path:`/wordpressPreview/${t}/${o}`,method:"GET",type:i.Json,format:"json",...r})}})}}export{i as C,q as H,C as a,E as w}; //# sourceMappingURL=CeX-HMq3.js.map