/*! * name: @fe/by-vendors * v: 1.0.1_8d0dd62da5b0 * build: 2026-05-26T12:50:15.865Z */ !function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.ByVendors=t():e.ByVendors=t()}("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof global?global:this,(()=>(()=>{var e={752:e=>{function t(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=t,t.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(e){this.ms=e},t.prototype.setMax=function(e){this.max=e},t.prototype.setJitter=function(e){this.jitter=e}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{byComplianceSdk:()=>u,byDeadpoolSdk:()=>b,byDynamicDomain:()=>i,byDynamicSymbol:()=>h,byEnv:()=>r,byFetch:()=>e,byGtm:()=>v,byHelpers:()=>p,byI18nLoader:()=>f,byLanguageDetector:()=>E,byLogger:()=>a,byMetas:()=>t,byRequest:()=>y,byRouteFinder:()=>d,bySensors:()=>m,bySharedSettings:()=>c,byStorage:()=>l,bySymbolList:()=>g,byThemeLoader:()=>w,byUniframeToolkit:()=>s});var e={};n.r(e),n.d(e,{createFetchInstance:()=>k});var t={};n.r(t),n.d(t,{APP_DEEPLINK_PREFIX_EU:()=>ce,APP_DEEPLINK_PREFIX_GLOBAL:()=>ae,APP_DEEPLINK_PREFIX_JPN:()=>he,APP_DEEPLINK_PREFIX_MINI:()=>pe,APP_DEEPLINK_PREFIX_THA:()=>de,APP_DEEPLINK_PREFIX_TUR:()=>ue,APP_DEEPLINK_PREFIX_USA:()=>le,APP_ONELINK:()=>ge,APP_ONELINK_JPN:()=>ve,APP_ONELINK_THA:()=>ye,APP_ONELINK_TUR:()=>fe,APP_ONELINK_USA:()=>me,BRAND_CN:()=>C,BRAND_GEO:()=>D,BRAND_GLOBAL:()=>P,BRAND_HKG:()=>$,BRAND_NAME:()=>L,BRAND_NAME_FIRST_CHAR_UPPER:()=>I,BRAND_NAME_UPPER:()=>R,BRAND_TUR:()=>x,BRAND_TUR_OLD:()=>U,BRAND_USA:()=>_,DOMAIN_ARE:()=>Q,DOMAIN_EU:()=>V,DOMAIN_GEO:()=>ee,DOMAIN_HKG:()=>X,DOMAIN_IDN:()=>Y,DOMAIN_JPN:()=>ne,DOMAIN_KAZ:()=>z,DOMAIN_NLD:()=>Z,DOMAIN_THA:()=>re,DOMAIN_TUR:()=>J,DOMAIN_TUR_OLD:()=>W,DOMAIN_USA:()=>oe,DOMAIN_WWW:()=>te,REPLACE_DOMAIN_WHITE_LIST:()=>be,UA_APP:()=>M,UA_APP_EU:()=>q,UA_APP_IDN:()=>F,UA_APP_JPN:()=>H,UA_APP_THA:()=>B,UA_APP_TUR:()=>j,UA_APP_USA:()=>G,URL_TESTNET:()=>ie,URL_WWW:()=>se,getDomain:()=>K});var r={};n.r(r),n.d(r,{API2_HOST:()=>Ye,COOKIE_DOMAIN:()=>Ze,DEADPOOL_URL_PREFIX:()=>lt,ENV_API2_HOST:()=>Me,ENV_COOKIE_DOMAIN:()=>Ce,ENV_DEADPOOL_URL_PREFIX:()=>at,ENV_HOST:()=>He,ENV_HOSTNAME:()=>Ke,ENV_NODE_ENV:()=>Fe,ENV_ORIGIN_HOST:()=>Ge,ENV_PORT:()=>Ve,ENV_PROTOCOL:()=>Be,ENV_RUNTIME_ENV:()=>$e,ENV_SERVICE_DOMAINS:()=>qe,ENV_WS2_HOST:()=>je,REGULATED_SITE_HOSTS:()=>it,RUNTIME_ENV:()=>We,SERVICE_DOMAINS:()=>et,SITE_ID:()=>it,TG_PLATFORM:()=>wt,WS2_HOST:()=>Qe,getPlatform:()=>St,getRelativeUrl:()=>Lt,getSiteId:()=>ot,getWwwUrlBySiteId:()=>rt,getXUserAgent:()=>Tt,isApp:()=>mt,isAppEu:()=>ht,isAppJpn:()=>ft,isAppTha:()=>gt,isAppTr:()=>dt,isAppUSA:()=>pt,isBrowser:()=>ct,isDev:()=>Pe,isGlobalApp:()=>ut,isLocal:()=>kt,isMobile:()=>vt,isProd:()=>Ie,isProdOrTestnet:()=>Le,isSSL:()=>Ue,isTGMiniApp:()=>bt,isTest:()=>_e,isTestnet:()=>Re,platform:()=>Nt,protocol:()=>xe,repaired_hostname:()=>tt,s3TransformPath:()=>Ot,xUserPlatform:()=>At});var i={};n.r(i),n.d(i,{AFFILIATES_HOST:()=>Wt,API2_HOST:()=>ln,BLOG_HOST:()=>gn,CDN_STATIC:()=>nn,CDN_STATIC_PROD:()=>tn,CHAT_URL:()=>rn,DOMAIN:()=>Qt,DOMAIN_TYPE:()=>Xt,DYNAMIC_ENV:()=>Bt,OPTION_ALL_ENV:()=>hn,OPTION_TEST_GATEWAY_HOST:()=>un,OPTION_TEST_WS_HOST:()=>dn,REPLACE_DOMAIN_WHITE_LIST:()=>be,TOKEN_COOKIE_KEY:()=>en,WS2_HOST:()=>cn,ZENDESK_HOST:()=>pn,api2Prefix:()=>Zt,apiProtocol:()=>sn,cdnStatic:()=>Gt,currentDomain:()=>Ht,getContentDomain:()=>Rt,getHelpLink:()=>vn,helpCenterHost:()=>yn,helpLang:()=>mn,replaceContentDomain:()=>It,ws2Prefix:()=>Yt,ws2Protocol:()=>an,zBaseLink:()=>fn});var s={};n.r(s),n.d(s,{UniRequest:()=>Gn});var a={};n.r(a),n.d(a,{TRACE_AJAX_TYPES:()=>Ao,TRACE_TYPES:()=>No,addEvent:()=>Uo,initModuleEventLog:()=>xo,initRenderComponentEventLog:()=>Do,monitorInstance:()=>Oo});var l={};n.r(l),n.d(l,{addCookie:()=>Ho,getCookie:()=>Ko,sessionStorage:()=>zo,storage:()=>Vo});var c={};n.r(c),n.d(c,{ADA_LOCALE_MAP:()=>Xo,APP_QR_CODE_PATH:()=>Qo,GA_UID_KEY:()=>So,GLOBAL_SITE_KEY:()=>Wo,GLOBAL_THEME_KEY:()=>Jo,GTM_ID:()=>Dr,GTM_ID_LEARN:()=>Cr,GUID_KEY:()=>wo,LANG_KEY:()=>bo,LOGO_PATH:()=>Yo,PLATFORM_SUPPORT_LANGUAGES:()=>yr,PLATFORM_SUPPORT_LANGUAGES_MAP:()=>vr,REG_REF_KEY:()=>Ir,RTL_LANGUAGES:()=>Rr,SITE_DEFAULT_LANGUAGE:()=>wr,SITE_DEFAULT_LANGUAGE_MAP:()=>br,SITE_ID:()=>it,SITE_ID_HOST_MAP:()=>Se,SITE_SUPPORTED_LANGUAGES:()=>Sr,SUPPORTED_LANGUAGES:()=>ir,SUPPORTED_LANGUAGES_ALL_SITES:()=>yr,SUPPORTED_LANGUAGES_ALL_SITES_MAP:()=>vr,SUPPORTED_LANGUAGES_ARE:()=>pr,SUPPORTED_LANGUAGES_EU:()=>ur,SUPPORTED_LANGUAGES_GBR:()=>nr,SUPPORTED_LANGUAGES_GEO:()=>dr,SUPPORTED_LANGUAGES_GLOBAL:()=>rr,SUPPORTED_LANGUAGES_GLOBAL_DISPLAY:()=>tr,SUPPORTED_LANGUAGES_GLOBAL_HIDDEN:()=>or,SUPPORTED_LANGUAGES_HKG:()=>sr,SUPPORTED_LANGUAGES_IDN:()=>hr,SUPPORTED_LANGUAGES_JPN:()=>gr,SUPPORTED_LANGUAGES_KAZ:()=>cr,SUPPORTED_LANGUAGES_NLD:()=>ar,SUPPORTED_LANGUAGES_THA:()=>mr,SUPPORTED_LANGUAGES_TUR:()=>lr,SUPPORTED_LANGUAGES_USA:()=>fr,TDID_V2_KEY:()=>Zo,THEME_KEY:()=>Eo,TRADING_VIEW_LOCALE_MAP:()=>er,domainSiteIdMap:()=>Lr,getAppDeeplinkPrefix:()=>Pr,getAppLanguage:()=>Ar,getFormattedConfigs:()=>yo,getHreflangHtml:()=>vo,getOriginalConfigs:()=>mo,getSiteIdByLanguage:()=>kr,getSiteLanguage:()=>Nr,getSupportLanguage:()=>Or,regulatedSiteHosts:()=>it,rtlLanguagesList:()=>Rr,setSiteLanguage:()=>Tr});var u={};n.r(u),n.d(u,{ByComplianceSDK:()=>$r,regulatedSiteHosts:()=>it});var d={};n.r(d),n.d(d,{getServiceHost:()=>ii,initRoute:()=>si,serviceDomainList:()=>zr});var h={};n.r(h),n.d(h,{FETCH_SYMBOL_OPTION_ACTION:()=>Zs,FETCH_SYMBOL_OPTION_FILTER:()=>Ys,UNDERLYING_TYPE:()=>ta,default:()=>ll});var p={};n.r(p),n.d(p,{clamp:()=>Gl,countDown:()=>nc,crossCombine:()=>Fl,deepClone:()=>Ml,displayThousands:()=>fc,flatMapDepth:()=>Yl,formatCountDown:()=>oc,formatNumber:()=>mc,getMainDomainName:()=>Tc,getQueryParams:()=>wc,getQueryParamsWithSpecialChars:()=>Ec,getUrlObject:()=>Sc,guid:()=>bc,intercept:()=>rc,isFinite:()=>Dl,isFromInternalByMainDomain:()=>Nc,isFunction:()=>$l,isInteger:()=>Cl,isNaN:()=>xl,isNumber:()=>Ul,isObject:()=>Ll,isObjectLike:()=>Ol,isPlainObject:()=>kl,isString:()=>Nl,isSymbol:()=>Rl,isUndefined:()=>Al,loadScript:()=>yc,localDate:()=>ec,localDateTime:()=>Xl,localTime:()=>tc,map:()=>jl,omit:()=>ql,partition:()=>Bl,pick:()=>Hl,reduceNum:()=>ac,tendTo5:()=>lc,toFinite:()=>_l,toInteger:()=>Pl,toNumber:()=>Il,toThousands:()=>ic,transformNum:()=>sc});var g={};n.r(g),n.d(g,{API_KEY_MAP:()=>Pc,default:()=>Ou});var f={};n.r(f),n.d(f,{I18nBackend:()=>bd,I18nLanguageDetector:()=>md,initI18nInstance:()=>Nd});var m={};n.r(m),n.d(m,{fastFetchABTest:()=>_d,getSensorsInstance:()=>kd,login:()=>Pd,track:()=>Ld,trackClick:()=>Rd,trackExposure:()=>Id});var y={};n.r(y),n.d(y,{SUPPORTED_METHOD:()=>qd,request:()=>jd});var v={};n.r(v),n.d(v,{addGtmListener:()=>Gd,pushEvent:()=>Fd});var b={};n.r(b),n.d(b,{DeadpoolCacheSdk:()=>Kd});var w={};n.r(w),n.d(w,{getSite:()=>lh,getTheme:()=>ch,initTheme:()=>sh,reinit:()=>ah,setSite:()=>th,setTheme:()=>rh,toggleTheme:()=>ih});var E={};n.r(E),n.d(E,{detectLanguageAndRedirect:()=>yh,detectSiteLanguage:()=>fh,detectSiteLanguageAndRedirect:()=>mh,getSiteLanguageFromClientLanguage:()=>gh});let S=null;try{S="AbortController"in window}catch(e){S=null}const T="json",N={},A=e=>e>=200&&e<300;class O{constructor(e={},t={}){this.defaultOpts={...N,...e},this.globalTimeout=t.timeout||3e4,this.validateStatus=t.validateStatus||A,this.defaultRespType=t.defaultRespType||T,this.interceptors={response:[],request:[],errorHandler:[],finally:[]}}get(e,t={},n){let o=e;if(t.body){const e=t.body;Object.keys(e).forEach((t=>{const n=`${t}=${e[t]}`;o=o.indexOf("?")>-1?`${o}&${n}`:`${o}?${n}`})),delete t.body}return this.fetch(o,{...t,method:"get"},n)}post(e,t={},n){return this.fetch(e,{...t,method:"post"},n)}delete(e,t={},n){return this.fetch(e,{...t,method:"delete"},n)}put(e,t={},n){return this.fetch(e,{...t,method:"put"},n)}fetch(e,t={},n){const o=n||this.defaultRespType,{timeout:r,...i}=t,s="number"!==typeof r||Number.isNaN(r)?this.globalTimeout:r,a={url:e,...this.defaultOpts,...i,headers:{...this.defaultOpts.headers,...i.headers}},l=this.interceptors.request.reduce(((t,n)=>n(t,e)),a);let c;const u=S?new AbortController:{};l.signal=u.signal;const d=new Promise(((t,n)=>{c=setTimeout((()=>{n({ret_code:9000001,ret_msg:"Request timeout, please re-try!",url:e}),S&&u.abort()}),s)})),h=fetch(e,l);return Promise.race([h,d]).then((e=>(clearTimeout(c),e))).then((e=>this.validateStatus(e.status)?e.ok?new Promise((t=>{e[(e=>{const t=String(e).toLowerCase();return{json:!0,text:!0,formData:!0,blob:!0,arrayBuffer:!0}[t]?t:T})(o)]().then((n=>{t({headers:e.headers,data:n})}))})):{headers:{},data:{}}:Promise.reject({status:e.status,statusText:e.statusText}))).then((({data:t,headers:n})=>this.interceptors.response.reduce(((e,t)=>e.then(t)),Promise.resolve({headers:n,data:t,config:l,url:e})))).catch((t=>(clearTimeout(c),this.interceptors.errorHandler.forEach((n=>n(t,l,e))),Promise.reject(t)))).finally((()=>{this.interceptors.finally.forEach((t=>t(l,e)))}))}}const k=(e={},t={})=>{"undefined"!==typeof window&&"fetch"in window||console&&console.error&&console.error("fetch function doesn't detected in you environment");const n=new O(e,t),o=n.fetch.bind(n);return o.get=n.get.bind(n),o.post=n.post.bind(n),o.put=n.put.bind(n),o.delete=n.delete.bind(n),o.interceptors=n.interceptors,o},L=String.fromCharCode(98,121,98,105,116),R=L.toUpperCase(),I=String.fromCharCode(66,121,98,105,116),_="abfinance",P=`${L}global`,U=`${L}-tr`,x=`${L}tr`,D=`${L}georgia`,C=`${L}-cn`,$=String.fromCharCode(98,121,104,107,98,105,116),M=`${L}_app`,j=`${L}_app_tr`,q=`${L}_app_eu`,F=`${L}_app_idn`,G="bit_app_us",B="bit_app_tha",H="bit_app_jpn",K=e=>`${L}.${e}`,V=K("eu"),z=K("kz"),J=K("tr"),W=`${U}.com`,Z=K("nl"),Y=K("id"),Q=K("ae"),X=`${$}.com`,ee=`${D}.ge`,te=K("com"),ne="moneypartners.co.jp",oe="abfinance.com",re="waanx.com",ie=`https://testnet.${L}.com`,se=`https://www.${L}.com`,ae=`${L}app://`,le="bitusapp://",ce=`${L}-eu://`,ue=`${L}-tr://`,de="waanxapp://",he="bit-jpn://",pe="by-mini://",ge=`https://${L}.onelink.me`,fe=`https://${x}.onelink.me`,me="https://bitappus.onelink.me",ye="https://waanx.onelink.me",ve="https://moneypartners.onelink.me",be=[`${L}.com`,`${P}.com`,"bytick.com",`${L}-global.com`,`${L}.biz`,`${L}.global`,`${L}.org`,`${L}s.org`,`${L}gum.com`,`${L}gum.org`,`${L}s.io`,`${L}.cloud`,`${L}x.global`,X,Z,Q,`${L}.com.hk`,J,W,z,V,`${L}-ge.com`,Y,ee,oe,re,ne,"fullbetacloud.com","bycloud.org"],we=(e,t)=>!e||e===t,Ee=(e,t)=>{if(!Array.isArray(e)||!e.length)return{};const{siteId:n,account:o,regulationCountry:r}=t,i=e.reduce(((e,t)=>{if(null===t||void 0===t||!t.action)return e;let i=t.siteId;const s=t.account,a=t.rc,l=t.logic;"GLOBAL"===i&&(i=R);let c=!1;if(we(i,n)&&("or"===l?we(s,o)||we(a,r):we(s,o)&&we(a,r))&&(c=!0),c){const n=e[t.element];e[t.element]=((null===n||void 0===n?void 0:n.priority)||0)>(t.priority||0)?n:t}return e}),{});return Object.entries(i).reduce(((e,[t,n])=>({...e,[t]:{action:n.action,...n.ext&&{ext:n.ext}}})),{})},Se={HKG:X,TUR:J,TUR_OLD:W,KAZ:z,NLD:Z,GEO:ee,IDN:Y,ARE:Q,EU:V,JPN:ne,USA:oe,THA:re};var Te;let Ne,Ae="",Oe={};const ke=`__${R}_GLOBAL_CONFIG__`;"undefined"!==typeof window&&window.location&&(Ne=window.location.hostname,Ae=window.location.protocol,Oe=window.__GLOBAL_PROXY_CONFIG__||window[ke]||{});const Le=!!Ne&&(/^[^.]+\.[^.]+\.[^.]+$/.test(Ne)||/^[^.]+\.[^.]+\.[^.]+\.(hk|uae|us|uk|jp|fr|de|au|ca|br|in|ru)$/.test(Ne)),Re=Le&&!!Ne&&/^[^.]*testnet[^.]*\./.test(Ne),Ie=Le&&!Re,_e=!Re&&!Ie,Pe=_e,Ue="https:"===Ae,xe=Ae,De=Oe.enableAutoman&&Oe.automan||{},Ce=De.AUTOMAN_COOKIE_DOMAIN,$e=De.AUTOMAN_RUNTIME_ENV,Me=De.AUTOMAN_API2_HOST,je=De.AUTOMAN_WS2_HOST,qe=De.AUTOMAN_SERVICE_DOMAINS,Fe=De.AUTOMAN_NODE_ENV||"production",Ge=De.AUTOMAN_ORIGIN_HOST,Be=De.AUTOMAN_PROTOCOL,He=De.AUTOMAN_HOST,Ke=De.AUTOMAN_HOSTNAME,Ve=De.AUTOMAN_PORT;function ze(e,t,n){return"undefined"!==typeof process&&"MISSING_ENV_VAR"[e]?"MISSING_ENV_VAR"[e]:void 0!==t&&null!==t&&""!==t?t:n}let Je="local";Re?Je="testnet":Ie?Je="prod":_e&&(Je="test");const We=ze("RUNTIME_ENV",$e,Je)||Je,Ze=ze("COOKIE_DOMAIN",Ce),Ye=ze("API2_HOST",Me),Qe=ze("WS2_HOST",je);let Xe="";Re?Xe=`${P}.com`:Ie?Xe="bycbe.com, byapis.com":_e&&(Xe=`${C}.com`);const et=ze("SERVICE_DOMAINS",qe,Xe)||Xe;let tt=Ne;const nt=["cloud","announcements","sandbox","blog","newblog","learn","affiliates","institution"];if(Ne&&nt.some((e=>Ne.includes(e)))){const e=new RegExp(`(?:(?:${nt.join("|")})-testnet|testnet-(?:${nt.join("|")}))`,"g"),t=new RegExp(`^(?:${nt.join("|")})(?=.)`,"g");tt=Ne.replace(e,"testnet").replace(t,"www")}function ot(e){var t,n,o,r,i,s,a,l,c,u,d,h;if("undefined"===typeof window&&!e)return(null===(d=process)||void 0===d||null===(h="MISSING_ENV_VAR")?void 0:h.BUILD_SITE_ID)||R;let p=e||"";return!p&&"undefined"!==typeof window&&window.location&&(p=window.location.hostname||""),null!==(t=p)&&void 0!==t&&t.includes(V)?"EU":null!==(n=p)&&void 0!==n&&n.includes(z)?"KAZ":null!==(o=p)&&void 0!==o&&o.includes(J)||null!==(r=p)&&void 0!==r&&r.includes(W)?"TUR":null!==(i=p)&&void 0!==i&&i.includes(ee)?"GEO":null!==(s=p)&&void 0!==s&&s.includes(Y)?"IDN":/^[^.]+\.[^.]+\.[^.]+\.hk$/.test(p)||/^[^.]+\.[^.]+\.[^.]+\.[^.]+\.hk$/.test(p)||null!==(a=p)&&void 0!==a&&a.includes(X)?"HKG":/^[^.]+\.[^.]+\.ae$/.test(p)||/^[^.]+\.[^.]+\.[^.]+\.ae$/.test(p)?"ARE":/^[^.]+\.[^.]+\.nl$/.test(p)||/^[^.]+\.[^.]+\.[^.]+\.nl$/.test(p)?"NLD":null!==(l=p)&&void 0!==l&&l.includes(ne)?"JPN":null!==(c=p)&&void 0!==c&&c.includes(oe)?"USA":null!==(u=p)&&void 0!==u&&u.includes(re)?"THA":R}const rt=e=>{let t=Se[e];return t||(t=te),`https://www.${t}`},it=ot(),st="USA"===it?"//www.byore-test-1.abfinance.com":`//www.unify-test-1.${L}.com`,at=De.AUTOMAN_DEADPOOL_URL_PREFIX,lt=ze("DEADPOOL_URL_PREFIX",at,st)||st,ct="undefined"!==typeof window,ut=()=>!!ct&&new RegExp(M).test(navigator.userAgent.toLowerCase()),dt=()=>!!ct&&new RegExp(j).test(navigator.userAgent.toLowerCase()),ht=()=>!!ct&&new RegExp(q).test(navigator.userAgent.toLowerCase()),pt=()=>!!ct&&new RegExp(G).test(navigator.userAgent.toLowerCase()),gt=()=>!!ct&&new RegExp(B).test(navigator.userAgent.toLowerCase()),ft=()=>!!ct&&new RegExp(H).test(navigator.userAgent.toLowerCase()),mt=()=>ut()||ht()||gt()||dt()||pt()||ft(),yt=["android","ios"];function vt(e={}){var t,n;let o=null===e||void 0===e?void 0:e.ua;if(o||"undefined"===typeof navigator||(o=navigator.userAgent),"object"===typeof o&&null!==(t=o)&&void 0!==t&&null!==(n=t.headers)&&void 0!==n&&n["user-agent"]&&(o=o.headers["user-agent"]),"string"!==typeof o)return!1;let r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|Telegram-Android/i.test(o)||!!e.tablet&&/android|ipad|playbook|silk/i.test(o);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==o.indexOf("Macintosh")&&-1!==o.indexOf("Safari")&&(r=!0),r}function bt(){var e;return"undefined"!==typeof window&&!(null===(e=window)||void 0===e||!e.TelegramWebviewProxy)}const wt={PC:"pc_tg",IOS:"ios_tg",ANDROID:"android_tg"};function Et(){var e,t,n,o;if("undefined"===typeof window)return null;const r=(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)||"",i=(null===(n=window)||void 0===n||null===(o=n.navigator)||void 0===o?void 0:o.platform)||"";let s=null;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(i)?s="macos":-1!==["iPhone","iPad","iPod"].indexOf(i)?s="ios":-1!==["Win32","Win64","Windows","WinCE"].indexOf(i)?s="windows":/Android/.test(r)?s="android":!s&&/Linux/.test(i)&&(s="linux"),s}const St=e=>{try{if(ct){if(bt()){const e=Et();return e&&yt.includes(e)?"ios"===e?wt.IOS:wt.ANDROID:wt.PC}return null!==e&&void 0!==e?e:vt()?"h5":"pc"}return null!==e&&void 0!==e?e:vt()?"h5":"pc"}catch(t){return null!==e&&void 0!==e?e:vt()?"h5":"pc"}},Tt=()=>{try{if(ct){if(!bt())return;const e=Et()||(vt()?"android":"windows"),t=yt.includes(e)?"phone":"pc";return`company/${L} platform/tg-mini system/${e} device/${t}`}return}catch(e){return}},Nt=St(),At=Tt(),Ot=new Map([["https://fh-static.bycsi.com","/common-static/fhs"],["https://prod-usa-fht-web-0145-wu.s3.ap-southeast-1.amazonaws.com","/common-static/fhs"],["https://d1.abfinance.com","/bycsi-root"],["https://t1.bycsi.com","/bycsi-root"],["https://t1.abfinance.com","/bycsi-root"],["https://s1.bycsi.com","/bycsi-root"],["https://s1.abfinance.com","/bycsi-root"]]),kt="undefined"!==typeof process&&"development"===(null===(Te="MISSING_ENV_VAR")?void 0:Te.NODE_ENV)||"development"===Fe||"development"===$e;function Lt(e,t=!1){try{if(!e)return e;if(e.startsWith("/bycsi-root"))return kt||t?`${lt}${e}`:e;if(/deadpool/.test(e)){let n=e,o=!1,r="";try{const t=new URL(e);n=t.pathname,r=t.origin,o=!0}catch{n=e}return n.includes(`/${L}/deadpool-testnet`)?n=n.replace(`/${L}/deadpool-testnet`,"/bycsi-root/deadpool"):n.includes("/deadpool-test")?n=n.replace("/deadpool-test","/bycsi-root/deadpool"):n.includes(`/${L}/deadpool`)&&(n=n.replace(`/${L}/deadpool`,"/bycsi-root/deadpool")),kt||t?`${lt}${n}`:n}const n=new URL(e);if(!Ot.has(n.origin))return e;let o=e;return o=e.replace(n.origin,Ot.get(n.origin)),(kt||t)&&(o=n.origin.includes("t1.bycsi.com")?`${ie}${o}`:`${se}${o}`),o}catch(n){return(kt||t)&&e.startsWith("/bycsi-root")?`${lt}${e}`:e}}const Rt=e=>{if("undefined"!==typeof window){const{protocol:t}=window.location;let{hostname:n}=window.location;be.some((e=>n.match(new RegExp(`${e}$`))))||(n=`www.${L}.com`),n.endsWith(".nl")&&"blog"===e&&(n=n.replace(/\.nl$/,".com")),n.endsWith(".com.hk")&&["blog","learn"].includes(e)&&(n=n.replace(/\.com\.hk$/,".com"));const o=new RegExp(`\\.${X}\\.com$`),r=`${L}.com`;n.match(o)&&["blog","learn"].includes(e)&&(n=n.replace(o,`.${r}`));const i=n.split(".");if(i.length<=2)return`${t}//${e}.${r}`;let s=i[0];const a="blog"===e?"newblog":e;return s=s.includes("testnet")?`testnet-${a}`:e,i[0]=s,n=i.join("."),`${t}//${n}`}return""},It=e=>{if("undefined"!==typeof window){var t;const n=new URL(e),o=null===(t=n.hostname.match(/learn|blog|announcements/))||void 0===t?void 0:t[0];if(!o)return e;const r=new URL(Rt(o));return n.hostname=r.hostname,n.toString()}return e},_t="undefined"!==typeof xe&&"https:"===xe?"wss:":"ws:";let Pt=!0,Ut="USA"===it?"byore-test-1":"unify-test-1",xt="USA"===it?_:L,Dt="com",Ct="";if("development"!==Fe&&tt){Pt=!1;const e=tt.split(".");3===e.length&&([Ut,xt,Dt]=e),4===e.length&&(Le?([Ut,xt,Dt,Ct]=e,Dt=`${Dt}.${Ct}`):[,Ut,xt,Dt]=e),5===e.length&&([,Ut,xt,Dt,Ct]=e,Dt=`${Dt}.${Ct}`)}const $t=Pt&&("dev-3"===Ut||"test-3"===Ut),Mt=/^(www|m)$/,jt="testnet"===Ut||"m-testnet"===Ut,qt="s1.bycsi.com",Ft=/^(www|m|testnet|m-testnet)$/.test(Ut),Gt=jt?"t1.bycsi.com":qt,Bt=Ut,Ht=`${xt}.${Dt}`;let Kt="api2."+(Mt.test(Ut)?"":`${Ut}.`),Vt="ws2."+(Mt.test(Ut)?"":`${Ut}.`),zt="chat."+(Mt.test(Ut)?"":`${Ut}.`),Jt="affiliates.";jt&&(Kt="api2-testnet.",zt="chat-testnet.",Vt="ws2-testnet.",Jt="affiliates-testnet."),Ft||(Jt=`affiliates.${Ut}.`);const Wt=`https://${Jt}${xt}.${Dt}`,Zt=Kt,Yt=Vt,Qt=xt,Xt=Dt,en=Ce||"b_t_c_k"+(Mt.test(Ut)?"":`_${Ut}`),tn=`https://${qt}`,nn=`https://${Gt}`,on=xe||"https:",rn=`${on}//${zt}${xt}.${Dt}/chat/by-chat-widget.js`,sn=$t?"https:":on,an=$t?"wss:":_t,ln=Me||"/x-api",cn=je||`${an}//${Yt}${xt}.${Dt}`,un=`${on}//infra-gateway.${Ut}.${xt}.${Dt}`,dn=`${an}//www.${Ut}.${xt}.${Dt}`,hn=Mt.test(Ut)?"":`_${Ut}`,pn=`https://help.${xt}.com`,gn=`https://blog.${xt}.com`,fn=`${pn}/hc`,mn={"en-US":"en-us","zh-CN":"zh-cn","zh-TW":"zh-tw","ja-JP":"ja","ko-KR":"ko","ru-RU":"en-us","vi-VN":"en-us"},yn=Ft?"":se,vn=(e,t)=>`${yn}/${e||"en-US"}/help-center/${t}`;let bn=function(e){return e.ALL="all",e.MANUAL="manual",e.TTL="ttl",e}({});class wn{constructor(){this.cache=new Map,this.maxCache=20,this.timer={},this.freezedCacheDeletion={}}get(e){return this.cache.get(e)}set(e,t,n=6e4){if(this.maxCache>0&&this.cache.size>=this.maxCache){const e=[...this.cache.keys()][0];this.cache.delete(e),this.timer[e]&&clearTimeout(this.timer[e])}this.cache.set(e,t),n>0&&(this.timer[e]=setTimeout((()=>{this.allowDeleteCacheEntry(e,bn.TTL)&&(this.cache.delete(e),delete this.timer[e])}),n))}delete(e){return delete this.timer[e],this.cache.delete(e)}clear(){Object.entries(this.timer).forEach((([e])=>{this.allowDeleteCacheEntry(e,bn.MANUAL)&&delete this.timer[e]})),this.cache.forEach(((e,t)=>{this.allowDeleteCacheEntry(t,bn.MANUAL)&&this.cache.delete(t)}))}clearOneCache(e){Object.entries(this.timer).forEach((([t])=>{this.allowDeleteCacheEntry(t,bn.MANUAL)&&e===t&&delete this.timer[t]})),this.cache.forEach(((t,n)=>{this.allowDeleteCacheEntry(n,bn.MANUAL)&&e===n&&this.cache.delete(n)}))}freezeCacheDeletion(e={}){this.freezedCacheDeletion={...this.freezedCacheDeletion,...e}}allowDeleteCacheEntry(e,t){return!Object.entries(this.freezedCacheDeletion).some((([n,o])=>e.includes(n)&&(o===bn.ALL||t===o)))}}class En{constructor(){this.middlewares=[]}use(e){if("function"!==typeof e)throw new TypeError("Middleware is not a function.");this.middlewares.push(e)}execute(e){const t=function(e){if(!Array.isArray(e))throw new TypeError("Middlewares must be an array!");const t=e.length;for(let n=0;nr(i+1))))}catch(e){return Promise.reject(e)}}(0)}}([...this.middlewares]);return t(e)}}class Sn extends Error{constructor(e,t,n="RequestError"){super(e),this.name="RequestError",this.request=t,this.type=n}}class Tn extends Error{constructor(e,t,n,o,r="ResponseError"){super(t||e.statusText),this.name="ResponseError",this.data=n,this.response=e,this.request=o,this.type=r}}function Nn(){let e;return"undefined"!==typeof process&&null!=process.versions&&null!==process.versions.node&&(e="NODE"),"undefined"!==typeof XMLHttpRequest&&(e="BROWSER"),e}class An{resolve=()=>{};reject=()=>{};constructor(e){const t=new Promise(((t,n)=>{this.resolve=t,this.reject=n,e&&e(t,n)}));return t.resolve=this.resolve,t.reject=this.reject,t}}let On=!1,kn=["/v2/private/user/profile"];try{On="AbortController"in window}catch(e){On=!1}async function Ln(e){return Promise.resolve(e)}async function Rn(e){var t;const n=null===e||void 0===e||null===(t=e.interceptors)||void 0===t?void 0:t.instanceRequest;return n&&Array.isArray(n)?async function(e,t){return t.reduce(((t,n)=>t.then(((t={})=>(e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,n(e.req.url,e.req.options,e.operations))))),Promise.resolve()).then(((t={})=>(e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,Promise.resolve(e))))}(e,n):Promise.resolve(e)}async function In(e,t){const n="function"===typeof e.clone?e.clone():e;let o=Promise.resolve(n);return t.interceptors.instanceResponse.forEach((e=>{o=o.then((n=>{const o="BROWSER"===Nn()&&"function"===typeof n.clone?n.clone():n;return e(o,t.req.options,t.operations)}))})),o}function _n(e,t){const{req:{url:n,options:o={}},cache:r,cacheKey:i}=e;e.operations.createRequestError=t=>new Sn(t,e.req);const{useCache:s=!1,timeout:a=3e4,validateStatus:l=e=>e>=200&&e<300,ttl:c=6e4}=o;let u=r.get(i);if(!u||!s){u=new An,s&&r.set(i,u,c);const o=Ln(e).then((e=>Rn(e))).then((async e=>{const o=e.req.options;let c;On&&(c=new AbortController);const d=fetch(n,{...o,signal:c?c.signal:void 0}).catch((t=>{throw u.reject(new Sn((null===t||void 0===t?void 0:t.message)||"Faild to fetch, http network error",null===e||void 0===e?void 0:e.req)),new Sn("http network error",e.req)})),h=function(e,t,n){let o;return{promise:new Promise(((r,i)=>{o=setTimeout((()=>{i(new Sn(`timeout of ${e}ms exceeded`,t,"Timeout")),n()}),e)})),timer:o}}(a,e.req,(()=>{On&&c.abort()}));return Promise.race([d,h.promise]).then((e=>{const t="BROWSER"===Nn()&&"function"===typeof e.clone?e.clone():e;return l(t.status)&&s&&(t.useCache=!0,u.resolve(t)),e})).then((t=>(e.operations.createResponseError=(n,o)=>new Tn(t,n,o,e.req),async function(e,t){const n=t.interceptors.globalResponseMap[t.req.url];if(n&&Array.isArray(n)){const o="BROWSER"===Nn()&&"function"===typeof e.clone?e.clone():e;n.forEach((e=>e(o,t.req.options,t.operations)))}}(t,e),t))).then((t=>In(t,e))).then((n=>(e.res=n,t()))).catch((t=>(null!==kn&&void 0!==kn&&kn.every((t=>{var n;return!(null!==e&&void 0!==e&&null!==(n=e.req)&&void 0!==n&&n.url.includes(t))}))&&r.delete(i),Promise.reject(t)))).finally((()=>{h.timer&&clearTimeout(h.timer)}))}));return o}return Ln(e).then((e=>Rn(e))).then((()=>u)).then((t=>(e.operations.createResponseError=(n,o)=>new Tn(t,n,o,e.req),In(t,e)))).then((n=>(e.res=n,t()))).catch((e=>Promise.reject(e)))}function Pn(e,t){let n;return t().then((()=>{if(!e)return Promise.resolve();const{res:t,req:o={}}=e;if(!t)throw new Tn(void 0,"No response object",null,o,"NoResponseError");n="BROWSER"===Nn()&&"function"===typeof t.clone?t.clone():t,n.useCache=t.useCache||!1;const{options:{responseType:r="json"}={}}=o;if("json"===r)return t.text().then((e=>{try{return JSON.parse(e)}catch(t){return e}}));try{return t[r]()}catch(e){throw new Tn(n,"responseType not support",null,o,"ParseError")}})).then((t=>{const{req:o={}}=e,{options:{cacheType:r,ttl:i,validateStatus:s=e=>e>=200&&e<300}={}}=o;if(n){if(!s(n.status))throw new Tn(n,"http error",t,o,"HttpError");if("persist"===r)try{var a;null===e||void 0===e||null===(a=e.storage)||void 0===a||a.set(e.cacheKey,{data:t},i)}catch(e){}e.finalResult={data:t,response:n}}})).catch((t=>{if(t instanceof Sn||t instanceof Tn)throw t;const{req:n,res:o}=e;throw t.request=t.request||n,t.response=t.response||o,t.type=t.type||t.name,t.data=t.data||void 0,t}))}function Un(e,t){if(!e)return t();const{req:{options:n={},url:o=""}={}}=e,{params:r}=n;return n.method=n.method?n.method.toUpperCase():"GET",n.credentials=n.credentials||"same-origin",r&&(e.req.originUrl=o,e.req.url=Object.entries(r).reduce(((e,[t,n])=>{const o=`${t}=${n}`;return e.indexOf("?")>-1?`${e}&${o}`:`${e}?${o}`}),o)),e.req.options=n,t()}function xn(e,t){if(!e)return t();const{req:{options:n={}}={}}=e,{method:o="get"}=n;if(!["post","put","patch","delete"].includes(o.toLowerCase()))return t();const{requestType:r="json",data:i}=n;if(i){const e=Object.prototype.toString.call(i);"[object Object]"===e||"[object Array]"===e?"json"===r&&(n.headers={Accept:"application/json","Content-Type":"application/json;charset=UTF-8",...n.headers},n.body=JSON.stringify(i)):(n.headers={Accept:"application/json",...n.headers},n.body=i)}return e.req.options=n,t()}const Dn=class{constructor(e={},t={}){this.defaultOpts=e,this.cache=t.cache,this.storage=t.storage,this.interceptors={globalRequestMap:t.requestInterceptors||{},globalResponseMap:t.responseInterceptors||{},instanceRequest:t.instanceRequestInterceptors||[],instanceResponse:t.instanceResponseInterceptors||[]},this.onion=new En,this.onion.use(xn),this.onion.use(Un),this.onion.use(Pn),this.onion.use(_n)}get(e,t={}){return this.fetch(e,{...t,method:"get"})}post(e,t={}){return this.fetch(e,{...t,method:"post"})}delete(e,t={}){return this.fetch(e,{...t,method:"delete"})}put(e,t={}){return this.fetch(e,{...t,method:"put"})}patch(e,t={}){return this.fetch(e,{...t,method:"patch"})}fetch(e,t={}){const n={...this.defaultOpts,...t,headers:{...this.defaultOpts.headers,...t.headers}},{data:o,params:r,method:i,rewriteCacheKey:s}=t,a=s?s(e):e,l=JSON.stringify({url:a,params:r,method:i,data:o}),c={req:{url:e,options:n},res:null,cache:this.cache,storage:this.storage,cacheKey:l,interceptors:this.interceptors,operations:{clearCache:()=>function(e){e.clear&&e.clear()}(this.cache),clearOneCache:()=>this.cache.clearOneCache(l),clearStorage:()=>this.storage.delete(l)}};return new Promise(((e,n)=>{if(null!==t&&void 0!==t&&t.useCache&&"persist"===(null===t||void 0===t?void 0:t.cacheType)&&this.storage.get(l)){const t=this.storage.get(l);e(t)}else this.onion.execute(c).then((()=>e(c.finalResult))).catch((t=>{const{errorHandler:o}=c.req.options;if(o)try{const n=o(t);e(n)}catch(e){n(e)}n(t)}))}))}};class Cn{max_cache_size=4718592;isOverflowSize(){try{let t=0;for(let n=0;nthis.max_cache_size}catch(e){return!1}}get=e=>{if(window.localStorage)try{const t=localStorage.getItem(e)||"{}",{expireAt:n,data:o}=JSON.parse(t);if(!o)return null;return Date.now()<=n?o:(this.delete(e),null)}catch(e){return null}return null};set(e,t,n=6e4){try{if(this.isOverflowSize()||!window.localStorage)return;const o=Date.now();localStorage.setItem(e,JSON.stringify({expireAt:o+n,data:t}))}catch(e){}}delete=e=>{window.localStorage&&localStorage.removeItem(e)}}class $n{constructor(e){this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[],e&&e.rewriteCacheKey&&delete e.rewriteCacheKey,this.fetch=new Dn(e,{cache:$n.cache,storage:$n.storage,requestInterceptors:$n.requestInterceptors,responseInterceptors:$n.responseInterceptors,instanceRequestInterceptors:this.instanceRequestInterceptors,instanceResponseInterceptors:this.instanceResponseInterceptors})}static storage=new Cn;static cache=new wn;static version="2.0.0";static requestInterceptors={};static responseInterceptors={};static getGlobalSharableEntry=()=>{const e=jn($n.version);return Mn().SharedUniRequest[e]};static addGlobalRequestInterceptors(e){Object.entries(e).forEach((([e,t])=>{Array.isArray($n.requestInterceptors[e])||($n.requestInterceptors[e]=[]),t.forEach((t=>$n.requestInterceptors[e].push(t)))}))}static addGlobalResponseInterceptors(e){Object.entries(e).forEach((([e,t])=>{Array.isArray($n.responseInterceptors[e])||($n.responseInterceptors[e]=[]),t.forEach((t=>$n.responseInterceptors[e].push(t)))}))}addInstanceRequestInterceptors(e){e.forEach((e=>this.instanceRequestInterceptors.push(e)))}addInstanceResponseInterceptors(e){e.forEach((e=>this.instanceResponseInterceptors.push(e)))}request(e,t={}){return this.fetch.get(e,t)}get(e,t={}){return this.fetch.get(e,t)}post(e,t={}){return this.fetch.post(e,t)}patch(e,t={}){return this.fetch.patch(e,t)}put(e,t={}){return this.fetch.put(e,t)}delete(e,t={}){return this.fetch.delete(e,t)}freezeCacheDeletion(e={}){this.fetch.cache.freezeCacheDeletion(e)}}function Mn(){return"undefined"!==typeof window?window:n.g}function jn(e){return e.split(".")[0]||"0"}const qn=jn($n.version),Fn=Mn();Fn.SharedUniRequest||(Fn.SharedUniRequest={}),Fn.SharedUniRequest[qn]||(Fn.SharedUniRequest[qn]={cache:new wn,requestInterceptors:{},responseInterceptors:{}}),$n.cache=Fn.SharedUniRequest[qn].cache,$n.requestInterceptors=Fn.SharedUniRequest[qn].requestInterceptors,$n.responseInterceptors=Fn.SharedUniRequest[qn].responseInterceptors;const Gn=$n,Bn=new Gn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"}});Bn.addInstanceResponseInterceptors([async(e,t,n)=>{try{const t=e.clone(),i=await t.json();if(!i)return;const{ret_code:s}=i;var o,r;if([10007,33003,10009].includes(s))null!==(o=e.url)&&void 0!==o&&null!==(r=o.includes)&&void 0!==r&&r.call(o,"/v2/private/user/profile")||n.clearOneCache();return e}catch(e){return e}}]);const Hn=Bn,Kn=Le?ln:"undefined"!==typeof window&&localStorage.getItem("complianceSDKApi2Host")||ln,Vn="REGULATION_RESTRICT_OPERATE",zn=async()=>{try{let t=(()=>{const e=localStorage.getItem(Vn);if(e)try{const{expiredTime:t,restrictOperate:n}=JSON.parse(e);if(Date.now()<=t)return n}catch(e){}return null})();if(null===t){var e;const{data:n}=await(async()=>Hn.get(`${Kn}/compliance/v1/wall/regulation-info`,{useCache:!0}))();t=null===n||void 0===n||null===(e=n.result)||void 0===e?void 0:e.restrictOperate,(e=>{const t=Date.now()+1e4;localStorage.setItem(Vn,JSON.stringify({restrictOperate:e,expiredTime:t}))})(t)}return t?"EEA":""}catch(e){return null}},Jn=`https://www.${P}.com`,Wn=`https://www.${J}`,Zn=`https://www.${V}`,Yn=`https://www.${z}`,Qn=`https://www.${ee}`,Xn=`https://www.${Y}`,eo=`https://www.${oe}`,to=`https://www.${re}`,no=`https://www.${ne}`,oo=[{domain:se,locale:"en",hreflang:"x-default"},{domain:se,locale:"en",hreflang:"en"},{domain:se,locale:"fr-FR",hreflang:"fr"},{domain:se,locale:"es-ES",hreflang:"es-ES"},{domain:se,locale:"es-MX",hreflang:"es-MX"},{domain:se,locale:"es-AR",hreflang:"es-AR"},{domain:se,locale:"pt-BR",hreflang:"pt-BR"},{domain:se,locale:"pt-PT",hreflang:"pt-PT"},{domain:se,locale:"vi-VN",hreflang:"vi-VN"},{domain:se,locale:"ja-JP",hreflang:"ja-JP"},{domain:se,locale:"zh-TW",hreflang:"zh-TW"},{domain:se,locale:"ru-RU",hreflang:"ru-RU"},{domain:se,locale:"uk-UA",hreflang:"uk-UA"},{domain:se,locale:"ar-SA",hreflang:"ar-SA"},{domain:se,locale:"en-GB",hreflang:"en-GB"},{domain:Jn,locale:"zh-MY",hreflang:"zh-MY"},{domain:Jn,locale:"en",hreflang:"en-MY"},{domain:`https://www.${L}-global.com`,locale:"id-ID",hreflang:"id-ID"}],ro=[{domain:Wn,locale:"tr-TUR",hreflang:"tr-TR"},{domain:Wn,locale:"en-TR",hreflang:"en-TR"}],io=[{domain:Yn,locale:"kk-KAZ",hreflang:"kk-KZ"},{domain:Yn,locale:"en-KAZ",hreflang:"en-KZ"},{domain:Yn,locale:"ru-KAZ",hreflang:"ru-KZ"}],so=[{domain:Zn,locale:"de-EU",hreflang:"de"},{domain:Zn,locale:"es-EU",hreflang:"es"},{domain:Zn,locale:"pt-EU",hreflang:"pt"},{domain:Zn,locale:"pl-EU",hreflang:"pl"},{domain:Zn,locale:"ro-EU",hreflang:"ro"},{domain:Zn,locale:"it-EU",hreflang:"it"},{domain:Zn,locale:"fr-EU",hreflang:"fr-FR"},{domain:Zn,locale:"nl-EU",hreflang:"nl"},{domain:Zn,locale:"en-EU",hreflang:"en-DE"},{domain:Zn,locale:"en-EU",hreflang:"en-ES"},{domain:Zn,locale:"en-EU",hreflang:"en-FR"},{domain:Zn,locale:"en-EU",hreflang:"en-IT"},{domain:Zn,locale:"en-EU",hreflang:"en-PL"},{domain:Zn,locale:"en-EU",hreflang:"en-PT"},{domain:Zn,locale:"en-EU",hreflang:"en-RO"},{domain:Zn,locale:"en-EU",hreflang:"en-AT"},{domain:Zn,locale:"en-EU",hreflang:"en-SE"},{domain:Zn,locale:"en-EU",hreflang:"en-FI"},{domain:Zn,locale:"cs-EU",hreflang:"cs"},{domain:Zn,locale:"hu-EU",hreflang:"hu"},{domain:Zn,locale:"lt-EU",hreflang:"lt"},{domain:Zn,locale:"el-EU",hreflang:"el"},{domain:Zn,locale:"en-EU",hreflang:"en-CZ"},{domain:Zn,locale:"en-EU",hreflang:"en-GR"},{domain:Zn,locale:"en-EU",hreflang:"en-LT"},{domain:Zn,locale:"en-EU",hreflang:"en-HU"},{domain:Zn,locale:"fi-EU",hreflang:"fi"},{domain:Zn,locale:"sv-EU",hreflang:"sv"},{domain:Zn,locale:"da-EU",hreflang:"da"},{domain:Zn,locale:"no-EU",hreflang:"no"}],ao=[{domain:Qn,locale:"en-GEO",hreflang:"en-GE"},{domain:Qn,locale:"ru-GEO",hreflang:"ru-GE"},{domain:Qn,locale:"ka-GEO",hreflang:"ka-GE"}],lo=[{domain:Xn,locale:"id-IDN",hreflang:"id-ID"},{domain:Xn,locale:"en-IDN",hreflang:"en-ID"}],co=[{domain:eo,locale:"en-USA",hreflang:"x-default"},{domain:eo,locale:"en-USA",hreflang:"en-US"}],uo=[{domain:to,locale:"en-THA",hreflang:"x-default"},{domain:to,locale:"en-THA",hreflang:"en-TH"},{domain:to,locale:"th-THA",hreflang:"th-TH"}],ho=[{domain:no,locale:"ja-JPN",hreflang:"x-default"},{domain:no,locale:"en-JPN",hreflang:"en-JP"},{domain:no,locale:"ja-JPN",hreflang:"ja-JP"}],po=[R,"EU","KAZ","GEO","TUR"],go={[R]:oo,EU:so,KAZ:io,GEO:ao,IDN:lo,USA:co,TUR:ro,THA:uo,JPN:ho};class fo{static getConfigs(e){return(Array.isArray(e)&&e.length>0?e:po).reduce(((e,t)=>e.concat(go[null===t||void 0===t?void 0:t.toUpperCase()]||[])),[])}static isLocaleSegment(e){return e.match(/^(\/?([a-z]{2,3}-[A-Z]{2,3}|[a-z]{2}))?$/)}static processPath(e){const t=e.split("/").filter(Boolean);let n=-1;t.forEach(((e,t)=>{this.isLocaleSegment(e)&&(n=t)}));const o=e.endsWith("/");return{segments:t,localeIndex:n,hasTrailingSlash:o}}static generateUrl(e,t){const{segments:n,localeIndex:o,hasTrailingSlash:r}=t,i=[...n];return-1!==o?i[o]=e.locale:i.unshift(e.locale),`${e.domain}/${i.join("/")}${r?"/":""}`}static generateHreflangArray(e,t){const n=this.processPath(e),o=n.segments[n.localeIndex]||"en",r=kr(o),i=["USA","THA","JPN"].includes(r)?[r]:t,s=this.getConfigs(i),a=null===s||void 0===s?void 0:s.filter((e=>e.locale===o));let l;if(a.length>0)[l]=a;else{l={domain:`https://www.${Se[r]||te}`,locale:o,hreflang:"en"}}const c=[...n.segments];-1!==n.localeIndex?c[n.localeIndex]=l.locale:c.unshift(l.locale);const u=`${l.domain}/${c.join("/")}${n.hasTrailingSlash?"/":""}`,d=s.map((e=>({href:this.generateUrl(e,n),hreflang:e.hreflang,isCanonical:!1})));return[{href:u,hreflang:"x-default",isCanonical:!0},...d]}static generateHreflangHtml(e){const t=e.find((e=>e.isCanonical)),n=e.filter((e=>!e.isCanonical)).map((({href:e,hreflang:t})=>``));return t?`\n${n.join("\n")}`:n.join("\n")}}const mo=e=>fo.getConfigs(e),yo=(e,t)=>fo.generateHreflangArray(e,t),vo=(e,t)=>fo.generateHreflangHtml(yo(e,t)),bo="LANG_KEY",wo="_by_l_g_d",Eo="THEME_KEY",So="GA_UID_KEY";var To;const No={AJAX:"ajax",ACTION:"action",RESOURCE:"resource",AJAX_REQUEST:"ajax-request",REQUEST_ERROR:"request-error"},Ao={SC:"sc",EC:"ec"};let Oo=null;var ko,Lo,Ro,Io,_o,Po;"undefined"!==typeof window&&null!==(To=window)&&void 0!==To&&To.Monitor&&(Oo=null===(ko=window)||void 0===ko||null===(Lo=ko.Monitor)||void 0===Lo||null===(Ro=Lo.getInstance)||void 0===Ro?void 0:Ro.call(Lo,{appId:324}),null!==(Io=Oo)&&void 0!==Io&&Io.initialized||null===(_o=Oo)||void 0===_o||null===(Po=_o.init)||void 0===Po||Po.call(_o,{name:"BY_GLOBALS",appId:324,traceWhiteList:["api2","x-api"],disableGlobalRequestProxy:!0,disableGlobalResourceProxy:!0}));const Uo=e=>{var t,n;const o={r:"undefined"!==typeof window?window.location.href:"",t:No.ACTION,...e||{}};null===(t=Oo)||void 0===t||null===(n=t.log)||void 0===n||n.call(t,o)},xo=(e="",t="LOCAL_VERSION")=>{Uo({v:t,m:e,t:No.RESOURCE,ext:{m:"init_module"}})},Do=(e="",t="LOCAL_VERSION")=>{Uo({v:t,m:e,t:No.RESOURCE,ext:{m:"init_component"}})},Co=R+"_LANG_KEY",$o=R+"_THEME_KEY",Mo=R+"_GA_UID",jo={[Co]:bo,[$o]:Eo,[Mo]:So},qo=["setItem","getItem","removeItem"];function Fo(e,t,n){if("undefined"!==typeof window)try{var o;Uo({t:No.ACTION,m:"legacy_storage_interceptor",ext:{action:e,legacyKey:t,newKey:n,page:(null===(o=window.location)||void 0===o?void 0:o.href)||""}})}catch(e){}}let Go=null,Bo=!1;if("undefined"!==typeof window&&"undefined"!==typeof localStorage&&window.Storage)try{Go={setItem:window.Storage.prototype.setItem,getItem:window.Storage.prototype.getItem,removeItem:window.Storage.prototype.removeItem}}catch(Hc){console.error("[LocalStorage] Failed to capture native methods:",Hc)}function Ho(e,t,n,o,r){let i=t;-1!==t.indexOf(";")&&(i=escape(t));let s=`${e}=${i}`;if(n&&(s+=`; domain=${n}`),o&&(s+=`; path=${o}`),r>0){const e=new Date;e.setTime(e.getTime()+60*r*1e3),s+=`;expires=${e.toUTCString()}`}"undefined"!==typeof window&&(document.cookie=s)}function Ko(e){if("undefined"!==typeof window){const t=document.cookie.match(`(^|;) ?${e}=([^;]*)(;|$)`);return t?unescape(t[2]):null}return null}"undefined"!==typeof window&&"undefined"!==typeof localStorage&&(Go&&qo.forEach((e=>{try{null!==Go.getItem.call(localStorage,e)&&Go.removeItem.call(localStorage,e)}catch(e){}})),function(){if("undefined"===typeof window||!window.Storage||!Go)return!1;try{const e=window.Storage;if(e.prototype.__lsInterceptorInstalled)return!0;const t=Go.setItem,n=Go.getItem,o=Go.removeItem;return e.prototype.setItem=function(e,n){if(this!==window.localStorage)return t.call(this,e,n);if(Bo)return t.call(this,e,n);if(e in jo){Bo=!0;try{Fo("set",e,jo[e])}finally{Bo=!1}}t.call(this,e,n)},e.prototype.getItem=function(e){if(this!==window.localStorage)return n.call(this,e);if(Bo)return n.call(this,e);if(e in jo){Bo=!0;try{Fo("get",e,jo[e])}finally{Bo=!1}}return n.call(this,e)},e.prototype.removeItem=function(e){if(this!==window.localStorage)return o.call(this,e);o.call(this,e)},e.prototype.__lsInterceptorInstalled=!0,!0}catch(e){return console.error("[LocalStorage] Failed to install interceptor:",e),!1}}()&&function(){if(Go)try{Object.keys(jo).forEach((e=>{null!==Go.getItem.call(localStorage,e)&&Go.removeItem.call(localStorage,e)}))}catch(e){console.error("[LocalStorage] Failed to cleanup legacy keys:",e)}}());const Vo={set:(e,t)=>"undefined"!==typeof window&&window.localStorage?void 0===t?localStorage.removeItem(e):localStorage.setItem(e,t):null,setObject(e,t){return this.set(e,JSON.stringify(t))},get(e){if("undefined"!==typeof window&&window.localStorage)try{return localStorage.getItem(e)}catch(e){return null}return""},getObject(e){try{return JSON.parse(this.get(e))}catch(e){return{}}},remove(e){"undefined"!==typeof window&&window.localStorage&&localStorage.removeItem(e)}},zo={set:(e,t)=>"undefined"!==typeof window&&window.sessionStorage?void 0===t?sessionStorage.removeItem(e):sessionStorage.setItem(e,t):null,setObject(e,t){return this.set(e,JSON.stringify(t))},get(e){if("undefined"!==typeof window&&window.sessionStorage)try{return sessionStorage.getItem(e)}catch(e){return null}return""},getObject(e){try{return JSON.parse(this.get(e))}catch(e){return{}}},remove(e){"undefined"!==typeof window&&window.sessionStorage&&sessionStorage.removeItem(e)}},Jo="GLOBAL_THEME_KEY",Wo="GLOBAL_SITE_KEY",Zo="TDID_V2_KEY",Yo={dark:`${tn}/asset/image/logo-white.svg`,light:`${tn}/asset/image/logo-dark.svg`},Qo=`${tn}/assets/image/d-${Qt}.png`,Xo={"en-US":"en",en:"en","zh-MY":"zh","ja-JP":"ja","ko-KR":"ko","ru-RU":"ru","vi-VN":"vi","zh-TW":"zh-tw","zh-HK":"zh-tw","en-HK":"en","es-ES":"es","pt-BR":"pt","fr-FR":"fr","id-ID":"id","uk-UA":"uk","kk-KZ":"kk","ar-SA":"ar","pt-PT":"pt","es-MX":"es","es-AR":"es","es-419":"es"},er={"ro-RO":"ro","en-US":"en",en:"en","zh-MY":"zh","ja-JP":"ja","ko-KR":"ko","ru-RU":"ru","vi-VN":"vi","zh-TW":"zh_TW","zh-HK":"zh_TW","es-ES":"es","tr-TR":"tr","pt-BR":"pt","fr-FR":"fr","id-ID":"id_ID","uk-UA":"en","kk-KZ":"en","ar-SA":"ar","hi-IN":"en","pt-PT":"pt","es-MX":"es","es-AR":"es","es-419":"es"},tr=[{label:"English",lang:"EN",value:"en"},{label:"Bahasa Indonesia",lang:"ID",value:"id-ID"},{label:"Español (Internacional)",lang:"ES",value:"es-ES"},{label:"Español (México)",lang:"ES",value:"es-MX"},{label:"Español (Argentina)",lang:"ES",value:"es-AR"},{label:"қазақша",lang:"KK",value:"kk-KZ"},{label:"Français",lang:"FR",value:"fr-FR"},{label:"Português (Brasil)",lang:"BR",value:"pt-BR"},{label:"Português (Internacional)",lang:"PT",value:"pt-PT"},{label:"Русский",lang:"RU",value:"ru-RU"},{label:"Tiếng Việt",lang:"VI",value:"vi-VN"},{label:"Українська",lang:"UK",value:"uk-UA"},{label:"العربيه",lang:"AR",value:"ar-SA"},{label:"日本語",lang:"JA",value:"ja-JP"},{label:"简体中文 (马来西亚)",lang:"ZH",value:"zh-MY"},{label:"繁體中文",lang:"ZH",value:"zh-TW"}],nr=[{label:"English (Great Britain)",lang:"EN",value:"en-GB"}],or=[{label:"Polski",lang:"PL",value:"pl-PL"},{label:"Românǎ",lang:"RO",value:"ro-RO"}],rr=[...tr,...nr,...or];let ir=tr;const sr=[{label:"繁體中文 (香港)",lang:"ZH",value:"zh-HK"},{label:"English(Hong Kong)",lang:"EN",value:"en-HK"}],ar=[{label:"Dutch",lang:"NL",value:"nl-NL"},{label:"English (Netherlands)",lang:"EN",value:"en-NL"}],lr=[{label:"Türkçe",lang:"TR",value:"tr-TUR"},{label:"English (Türkiye)",lang:"EN",value:"en-TR"}],cr=[{label:"Русский (Казахстан)",lang:"RU",value:"ru-KAZ"},{label:"Қазақша (Қазақстан)",lang:"KK",value:"kk-KAZ"},{label:"English (Kazakhstan)",lang:"EN",value:"en-KAZ"}],ur=[{label:"English",lang:"EN",value:"en-EU"},{label:"Čeština",lang:"CS",value:"cs-EU"},{label:"Dansk",lang:"DA",value:"da-EU"},{label:"Deutsch",lang:"DE",value:"de-EU"},{label:"Español",lang:"ES",value:"es-EU"},{label:"Ελληνικά",lang:"EL",value:"el-EU"},{label:"Français",lang:"FR",value:"fr-EU"},{label:"Italiano",lang:"IT",value:"it-EU"},{label:"Lietuvių",lang:"LT",value:"lt-EU"},{label:"Magyar",lang:"HU",value:"hu-EU"},{label:"Nederlands",lang:"NL",value:"nl-EU"},{label:"Norsk",lang:"NO",value:"no-EU"},{label:"Polski",lang:"PL",value:"pl-EU"},{label:"Português",lang:"PT",value:"pt-EU"},{label:"Română",lang:"RO",value:"ro-EU"},{label:"Suomi",lang:"FI",value:"fi-EU"},{label:"Svenska",lang:"SV",value:"sv-EU"}],dr=[{label:"ქართული (საქართველო)",lang:"KA",value:"ka-GEO"},{label:"Русский (Грузия)",lang:"RU",value:"ru-GEO"},{label:"English (Georgia)",lang:"EN",value:"en-GEO"}],hr=[{label:"Bahasa Indonesia",lang:"ID",value:"id-IDN"},{label:"English (Indonesia)",lang:"EN",value:"en-IDN"}],pr=[{label:"English (UAE)",lang:"EN",value:"en-ARE"},{label:"العربيه",lang:"AR",value:"ar-ARE"}],gr=[{label:"日本語",lang:"JA",value:"ja-JPN"},{label:"English (Japan)",lang:"EN",value:"en-JPN"}],fr=[{label:"English",lang:"EN",value:"en-USA"}],mr=[{label:"Thai",lang:"TH",value:"th-THA"},{label:"English",lang:"EN",value:"en-THA"}],yr=[...rr,...sr,...lr,...cr,...ar,...ur,...dr,...hr,...pr,...fr,...mr,...gr],vr={[R]:rr,HKG:sr,TUR:lr,KAZ:cr,NLD:ar,EU:ur,GEO:dr,IDN:hr,ARE:pr,USA:fr,THA:mr,JPN:gr},br={[R]:"en",HKG:"zh-HK",TUR:"tr-TUR",KAZ:"kk-KAZ",NLD:"nl-NL",EU:"en-EU",GEO:"en-GEO",IDN:"id-IDN",ARE:"en-ARE",USA:"en-USA",THA:"th-THA",JPN:"ja-JPN"};let wr="en";wr=br[it]||"en";let Er=vr[it];it===R&&(Er=tr),Er&&(ir=Er);const Sr=vr[it];const Tr=e=>{"undefined"!==typeof window&&Vo.set(bo,e)},Nr=()=>{var e,t;if("undefined"===typeof window)return wr;let n=Vo.get(bo)||(null===(e=navigator)||void 0===e?void 0:e.language);["ko-KR","zh-CN"].includes(n)&&(n="en");const o=(Sr||[]).find((e=>e.value===n));return n=null!==(t=null===o||void 0===o?void 0:o.value)&&void 0!==t?t:wr,n},Ar=()=>{if("undefined"===typeof window)return null;const e=Ko(Ie?"b_l_a_k":"b_l_a_k_testnet");return e&&""!==e.trim()?e:null},Or=e=>ir.find((t=>e===t.value))?e:wr,kr=e=>((e,t)=>{const n=Object.entries(t).find((([t,n])=>n.some((t=>t.value===e))));return n?n[0]:R})(e,vr),Lr=[{hostname:[Se.NLD],siteId:"NLD"},{hostname:[Se.ARE],siteId:"ARE"},{hostname:[Se.HKG],siteId:"HKG"},{hostname:[Se.TUR_OLD,Se.TUR],siteId:"TUR"},{hostname:[Se.KAZ],siteId:"KAZ"},{hostname:[Se.EU],siteId:"EU"},{hostname:[Se.GEO],siteId:"GEO"},{hostname:[Se.IDN],siteId:"IDN"},{hostname:[Se.JPN],siteId:"JPN"},{hostname:[Se.USA],siteId:"USA"},{hostname:[Se.THA],siteId:"THA"}],Rr=["ar-SA","ar-ARE"],Ir=`REG_REF_${We}`,_r={[R]:ae,USA:le,EU:ce,TUR:ue,THA:de,JPN:he},Pr=e=>_r[e||it]||ae,Ur={[R]:"GTM-PMHBL76",USA:"GTM-TT967TJN"},xr={[R]:"GTM-NN3QBWC",USA:"GTM-TT967TJN"},Dr=Ur[it]||Ur[R],Cr=xr[it]||xr[R];class $r{constructor(e){this.version="__COMPLIANCE_SDK_VERSION__",this.initialConfig=Ee(e,{siteId:it}),this.latestConfig={},this.subscribers=[],this.profileReady=!1,this.regulationReady=!1,this.needAccount=!1,this.filtersParams={account:"",regulationCountry:""},this.regulatedSiteHosts=it,this.config=e,this.parseConfig=Ee,"undefined"!==typeof window&&zn().then((e=>{this.setRegulationCountry(e)}))}setAccount(e){const t=String(e);t&&(this.filtersParams.account=t,this.profileReady=!0,this.updateLatestConfig())}setRegulationCountry(e){this.filtersParams.regulationCountry=e||"",this.regulationReady=!0,this.updateLatestConfig((e=>{this.initialConfig=e}))}setNeedAccount(e){this.needAccount=e}updateLatestConfig(e){const t=this.latestConfig,n=this.parseConfig(this.config,{siteId:this.regulatedSiteHosts,...this.filtersParams});((e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.entries(t).every((([t,n])=>e[t]&&e[t].action===n.action&&e[t].ext===n.ext)))(t,n)||(this.latestConfig=n,null===e||void 0===e||e(n),this.publish())}subscribe(e){return"function"===typeof e&&(this.needAccount&&!this.profileReady||!this.regulationReady||e(this.latestConfig),this.subscribers.push(e)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.subscribers=this.subscribers.filter((t=>t!==e))}publish(){this.subscribers.forEach((e=>e(this.latestConfig)))}injectConfig(e){this.config=e,this.updateLatestConfig()}}"undefined"!==typeof window&&(window.RegulatedSiteHosts=it,window.ByComplianceConfig=$r,window.PlatformSupportedLanguage=Sr);const Mr="undefined"!==typeof window?new Gn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"},timeout:1e4}):{};"undefined"!==typeof window&&Mr.freezeCacheDeletion({"/brief-symbol-list":"manual"});let jr={domain:"",weight:0};function qr(e={}){const t=Object.keys(e).reduce(((t,n)=>({...t,[n]:e[n].reduce(((e,t)=>({factor:e.factor-.03,weight:e.weight+t*e.factor})),{factor:.1,weight:0}).weight})),{}),n=Object.keys(t).reduce(((e,n)=>e.domain?e.weight>t[n]?{domain:n,weight:t[n]}:e:{domain:n,weight:t[n]}),{domain:"",weight:0});if("undefined"!==typeof window&&window&&window.$_router_info&&n.domain,!jr.domain)return jr=n,n;if(jr.domain&&jr.domain!==n.domain){if(jr.weight-n.weight>5)return jr=n,n;const e=t[jr.domain];return e-n.weight>25||e-jr.weight>30?(jr=n,n):jr}return jr.weight>n.weight&&(jr=n),jr}const Fr=k(),Gr=e=>{const t=e.filter((({domain:e})=>"auto"!==e)).map((e=>((e,t)=>{const n=performance.now();return Fr.get(`${e}/t1`).then((()=>{const e=performance.now();return{domain:t,span:e-n}})).catch((()=>({domain:t,span:15e3})))})(e.api2,e.domain)));return Promise.all(t)},Br="by_route_record",Hr=zo.getObject(Br)||{},Kr=e=>[`${sn}//${Re?Zt.replace("-","-1-"):Zt.replace(".","-1.")}${e.trim()}`,`${sn}//${Re?Zt.replace("-","-2-"):Zt.replace(".","-2.")}${e.trim()}`],Vr=e=>[`${an}//${Re?Yt.replace("-","-1-"):Yt.replace(".","-1.")}${e.trim()}`,`${an}//${Re?Yt.replace("-","-2-"):Yt.replace(".","-2.")}${e.trim()}`],zr=[{domain:Ht,api2:ln,ws2:cn},{domain:`${Ht}@1`,api2:Kr(Ht)[0],ws2:Vr(Ht)[0]},{domain:`${Ht}@2`,api2:Kr(Ht)[1],ws2:Vr(Ht)[1]},{domain:"auto"}],Jr={API2_HOST:ln,WS2_HOST:cn};let Wr=ln,Zr=cn;const Yr=e=>{const t=zr.findIndex((({domain:t})=>t===e)),n=t>-1,o=zr[0];return{idx:n?t:0,item:n?zr[t]:o}},Qr=[];let Xr="";const ei=e=>{if(Xr&&Xr===e)return;Xr=e;const{item:t}=Yr(e);t.api2&&(Wr=t.api2),t.ws2&&(Zr=t.ws2),Qr.forEach((e=>e(t)))};let ti=!1;const ni=()=>{setInterval((()=>{var e;ti||document&&document.hidden||(ti=!0,(e=zr,Gr(e).then(((e=[])=>e.every((({span:e})=>-1===e))?"":(e.forEach((({domain:e,span:t})=>{const n=Hr[e];Hr[e]=n?[].concat(t,n).slice(0,3):[t,...new Array(2).fill(100)]})),zo.setObject(Br,Hr),qr(Hr).domain)))).then(ei).finally((()=>{ti=!1})))}),3e4)},oi="route_chosen_v2",ri=Vo.get(oi);"auto"===ri?(ei(0===Object.keys(Hr).length?Ht:qr(Hr).domain),ni()):ri&&!ri.includes(Ht)?(Vo.remove(oi),ei(null)):ei(ri),Object.defineProperties(Jr,{API2_HOST:{get:()=>"/x-api"},WS2_HOST:{get:()=>Zr}});const ii=()=>({API2_HOST:"/x-api",WS2_HOST:Zr}),si=ri?Yr(ri):{idx:3,item:zr[3]}; /*! * decimal.js v10.5.0 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2025 Michael Mclaughlin * MIT Licence */ var ai,li,ci=9e15,ui=1e9,di="0123456789abcdef",hi="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",pi="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",gi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ci,maxE:ci,crypto:!1},fi=!0,mi="[DecimalError] ",yi=mi+"Invalid argument: ",vi=mi+"Precision limit exceeded",bi=mi+"crypto unavailable",wi="[object Decimal]",Ei=Math.floor,Si=Math.pow,Ti=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ni=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ai=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Oi=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ki=1e7,Li=hi.length-1,Ri=pi.length-1,Ii={toStringTag:wi};function _i(e){var t,n,o,r=e.length-1,i="",s=e[0];if(r>0){for(i+=s,t=1;tn)throw Error(yi+e)}function Ui(e,t,n,o){var r,i,s,a;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=7,r=0):(r=Math.ceil((t+1)/7),t%=7),i=Si(10,7-t),a=e[r]%i|0,null==o?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==i||n>3&&a+1==i/2)&&(e[r+1]/i/100|0)==Si(10,t-2)-1||(a==i/2||0==a)&&0==(e[r+1]/i/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(o||n<4)&&9999==a||!o&&n>3&&4999==a):s=((o||n<4)&&a+1==i||!o&&n>3&&a+1==i/2)&&(e[r+1]/i/1e3|0)==Si(10,t-3)-1,s}function xi(e,t,n){for(var o,r,i=[0],s=0,a=e.length;sn-1&&(void 0===i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/n|0,i[o]%=n)}return i.reverse()}Ii.absoluteValue=Ii.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Ci(e)},Ii.ceil=function(){return Ci(new this.constructor(this),this.e+1,2)},Ii.clampedTo=Ii.clamp=function(e,t){var n=this,o=n.constructor;if(e=new o(e),t=new o(t),!e.s||!t.s)return new o(NaN);if(e.gt(t))throw Error(yi+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new o(n)},Ii.comparedTo=Ii.cmp=function(e){var t,n,o,r,i=this,s=i.d,a=(e=new i.constructor(e)).d,l=i.s,c=e.s;if(!s||!a)return l&&c?l!==c?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-c:0;if(l!==c)return l;if(i.e!==e.e)return i.e>e.e^l<0?1:-1;for(t=0,n=(o=s.length)<(r=a.length)?o:r;ta[t]^l<0?1:-1;return o===r?0:o>r^l<0?1:-1},Ii.cosine=Ii.cos=function(){var e,t,n=this,o=n.constructor;return n.d?n.d[0]?(e=o.precision,t=o.rounding,o.precision=e+Math.max(n.e,n.sd())+7,o.rounding=1,n=function(e,t){var n,o,r;if(t.isZero())return t;o=t.d.length,o<32?r=(1/Qi(4,n=Math.ceil(o/3))).toString():(n=16,r="2.3283064365386962890625e-10");e.precision+=n,t=Yi(e,1,t.times(r),new e(1));for(var i=n;i--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}(o,Xi(o,n)),o.precision=e,o.rounding=t,Ci(2==li||3==li?n.neg():n,e,t,!0)):new o(1):new o(NaN)},Ii.cubeRoot=Ii.cbrt=function(){var e,t,n,o,r,i,s,a,l,c,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(fi=!1,(i=u.s*Si(u.s*u,1/3))&&Math.abs(i)!=1/0?o=new d(i.toString()):(n=_i(u.d),(i=((e=u.e)-n.length+1)%3)&&(n+=1==i||-2==i?"0":"00"),i=Si(n,1/3),e=Ei((e+1)/3)-(e%3==(e<0?-1:2)),(o=new d(n=i==1/0?"5e"+e:(n=i.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),s=(e=d.precision)+3;;)if(c=(l=(a=o).times(a).times(a)).plus(u),o=Di(c.plus(u).times(a),c.plus(l),s+2,1),_i(a.d).slice(0,s)===(n=_i(o.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Ci(o,e+1,1),t=!o.times(o).times(o).eq(u));break}if(!r&&(Ci(a,e+1,0),a.times(a).times(a).eq(u))){o=a;break}s+=4,r=1}return fi=!0,Ci(o,e,d.rounding,t)},Ii.decimalPlaces=Ii.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-Ei(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},Ii.dividedBy=Ii.div=function(e){return Di(this,new this.constructor(e))},Ii.dividedToIntegerBy=Ii.divToInt=function(e){var t=this.constructor;return Ci(Di(this,new t(e),0,1,1),t.precision,t.rounding)},Ii.equals=Ii.eq=function(e){return 0===this.cmp(e)},Ii.floor=function(){return Ci(new this.constructor(this),this.e+1,3)},Ii.greaterThan=Ii.gt=function(e){return this.cmp(e)>0},Ii.greaterThanOrEqualTo=Ii.gte=function(e){var t=this.cmp(e);return 1==t||0===t},Ii.hyperbolicCosine=Ii.cosh=function(){var e,t,n,o,r,i=this,s=i.constructor,a=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return a;n=s.precision,o=s.rounding,s.precision=n+Math.max(i.e,i.sd())+4,s.rounding=1,(r=i.d.length)<32?t=(1/Qi(4,e=Math.ceil(r/3))).toString():(e=16,t="2.3283064365386962890625e-10"),i=Yi(s,1,i.times(t),new s(1),!0);for(var l,c=e,u=new s(8);c--;)l=i.times(i),i=a.minus(l.times(u.minus(l.times(u))));return Ci(i,s.precision=n,s.rounding=o,!0)},Ii.hyperbolicSine=Ii.sinh=function(){var e,t,n,o,r=this,i=r.constructor;if(!r.isFinite()||r.isZero())return new i(r);if(t=i.precision,n=i.rounding,i.precision=t+Math.max(r.e,r.sd())+4,i.rounding=1,(o=r.d.length)<3)r=Yi(i,2,r,r,!0);else{e=(e=1.4*Math.sqrt(o))>16?16:0|e,r=Yi(i,2,r=r.times(1/Qi(5,e)),r,!0);for(var s,a=new i(5),l=new i(16),c=new i(20);e--;)s=r.times(r),r=r.times(a.plus(s.times(l.times(s).plus(c))))}return i.precision=t,i.rounding=n,Ci(r,t,n,!0)},Ii.hyperbolicTangent=Ii.tanh=function(){var e,t,n=this,o=n.constructor;return n.isFinite()?n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+7,o.rounding=1,Di(n.sinh(),n.cosh(),o.precision=e,o.rounding=t)):new o(n.s)},Ii.inverseCosine=Ii.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),o=t.precision,r=t.rounding;return-1!==n?0===n?e.isNeg()?qi(t,o,r):new t(0):new t(NaN):e.isZero()?qi(t,o+4,r).times(.5):(t.precision=o+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=o,t.rounding=r,e.times(2))},Ii.inverseHyperbolicCosine=Ii.acosh=function(){var e,t,n=this,o=n.constructor;return n.lte(1)?new o(n.eq(1)?0:NaN):n.isFinite()?(e=o.precision,t=o.rounding,o.precision=e+Math.max(Math.abs(n.e),n.sd())+4,o.rounding=1,fi=!1,n=n.times(n).minus(1).sqrt().plus(n),fi=!0,o.precision=e,o.rounding=t,n.ln()):new o(n)},Ii.inverseHyperbolicSine=Ii.asinh=function(){var e,t,n=this,o=n.constructor;return!n.isFinite()||n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,o.rounding=1,fi=!1,n=n.times(n).plus(1).sqrt().plus(n),fi=!0,o.precision=e,o.rounding=t,n.ln())},Ii.inverseHyperbolicTangent=Ii.atanh=function(){var e,t,n,o,r=this,i=r.constructor;return r.isFinite()?r.e>=0?new i(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=i.precision,t=i.rounding,o=r.sd(),Math.max(o,e)<2*-r.e-1?Ci(new i(r),e,t,!0):(i.precision=n=o-r.e,r=Di(r.plus(1),new i(1).minus(r),n+e,1),i.precision=e+4,i.rounding=1,r=r.ln(),i.precision=e,i.rounding=t,r.times(.5))):new i(NaN)},Ii.inverseSine=Ii.asin=function(){var e,t,n,o,r=this,i=r.constructor;return r.isZero()?new i(r):(t=r.abs().cmp(1),n=i.precision,o=i.rounding,-1!==t?0===t?((e=qi(i,n+4,o).times(.5)).s=r.s,e):new i(NaN):(i.precision=n+6,i.rounding=1,r=r.div(new i(1).minus(r.times(r)).sqrt().plus(1)).atan(),i.precision=n,i.rounding=o,r.times(2)))},Ii.inverseTangent=Ii.atan=function(){var e,t,n,o,r,i,s,a,l,c=this,u=c.constructor,d=u.precision,h=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&d+4<=Ri)return(s=qi(u,d+4,h).times(.25)).s=c.s,s}else{if(!c.s)return new u(NaN);if(d+4<=Ri)return(s=qi(u,d+4,h).times(.5)).s=c.s,s}for(u.precision=a=d+10,u.rounding=1,e=n=Math.min(28,a/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(fi=!1,t=Math.ceil(a/7),o=1,l=c.times(c),s=new u(c),r=c;-1!==e;)if(r=r.times(l),i=s.minus(r.div(o+=2)),r=r.times(l),void 0!==(s=i.plus(r.div(o+=2))).d[t])for(e=t;s.d[e]===i.d[e]&&e--;);return n&&(s=s.times(2<this.d.length-2},Ii.isNaN=function(){return!this.s},Ii.isNegative=Ii.isNeg=function(){return this.s<0},Ii.isPositive=Ii.isPos=function(){return this.s>0},Ii.isZero=function(){return!!this.d&&0===this.d[0]},Ii.lessThan=Ii.lt=function(e){return this.cmp(e)<0},Ii.lessThanOrEqualTo=Ii.lte=function(e){return this.cmp(e)<1},Ii.logarithm=Ii.log=function(e){var t,n,o,r,i,s,a,l,c=this,u=c.constructor,d=u.precision,h=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)i=!0;else{for(r=n[0];r%10===0;)r/=10;i=1!==r}if(fi=!1,s=zi(c,a=d+5),o=t?ji(u,a+10):zi(e,a),Ui((l=Di(s,o,a,1)).d,r=d,h))do{if(s=zi(c,a+=10),o=t?ji(u,a+10):zi(e,a),l=Di(s,o,a,1),!i){+_i(l.d).slice(r+1,r+15)+1==1e14&&(l=Ci(l,d+1,0));break}}while(Ui(l.d,r+=10,h));return fi=!0,Ci(l,d,h)},Ii.minus=Ii.sub=function(e){var t,n,o,r,i,s,a,l,c,u,d,h,p=this,g=p.constructor;if(e=new g(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new g(e.d||p.s!==e.s?p:NaN):e=new g(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,h=e.d,a=g.precision,l=g.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!c[0])return new g(3===l?-0:0);e=new g(p)}return fi?Ci(e,a,l):e}if(n=Ei(e.e/7),u=Ei(p.e/7),c=c.slice(),i=u-n){for((d=i<0)?(t=c,i=-i,s=h.length):(t=h,n=u,s=c.length),i>(o=Math.max(Math.ceil(a/7),s)+2)&&(i=o,t.length=1),t.reverse(),o=i;o--;)t.push(0);t.reverse()}else{for((d=(o=c.length)<(s=h.length))&&(s=o),o=0;o0;--o)c[s++]=0;for(o=h.length;o>i;){if(c[--o](s=(i=Math.ceil(a/7))>s?i+1:s+1)&&(r=s,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for((s=c.length)-(r=u.length)<0&&(r=s,n=u,u=c,c=n),t=0;r;)t=(c[--r]=c[r]+u[r]+t)/ki|0,c[r]%=ki;for(t&&(c.unshift(t),++o),s=c.length;0==c[--s];)c.pop();return e.d=c,e.e=Mi(c,o),fi?Ci(e,a,l):e},Ii.precision=Ii.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(yi+e);return n.d?(t=Fi(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},Ii.round=function(){var e=this,t=e.constructor;return Ci(new t(e),e.e+1,t.rounding)},Ii.sine=Ii.sin=function(){var e,t,n=this,o=n.constructor;return n.isFinite()?n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+Math.max(n.e,n.sd())+7,o.rounding=1,n=function(e,t){var n,o=t.d.length;if(o<3)return t.isZero()?t:Yi(e,2,t,t);n=(n=1.4*Math.sqrt(o))>16?16:0|n,t=t.times(1/Qi(5,n)),t=Yi(e,2,t,t);for(var r,i=new e(5),s=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(i.plus(r.times(s.times(r).minus(a))));return t}(o,Xi(o,n)),o.precision=e,o.rounding=t,Ci(li>2?n.neg():n,e,t,!0)):new o(NaN)},Ii.squareRoot=Ii.sqrt=function(){var e,t,n,o,r,i,s=this,a=s.d,l=s.e,c=s.s,u=s.constructor;if(1!==c||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(fi=!1,0==(c=Math.sqrt(+s))||c==1/0?(((t=_i(a)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=Ei((l+1)/2)-(l<0||l%2),o=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):o=new u(c.toString()),n=(l=u.precision)+3;;)if(o=(i=o).plus(Di(s,i,n+2,1)).times(.5),_i(i.d).slice(0,n)===(t=_i(o.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Ci(o,l+1,1),e=!o.times(o).eq(s));break}if(!r&&(Ci(i,l+1,0),i.times(i).eq(s))){o=i;break}n+=4,r=1}return fi=!0,Ci(o,l,u.rounding,e)},Ii.tangent=Ii.tan=function(){var e,t,n=this,o=n.constructor;return n.isFinite()?n.isZero()?new o(n):(e=o.precision,t=o.rounding,o.precision=e+10,o.rounding=1,(n=n.sin()).s=1,n=Di(n,new o(1).minus(n.times(n)).sqrt(),e+10,0),o.precision=e,o.rounding=t,Ci(2==li||4==li?n.neg():n,e,t,!0)):new o(NaN)},Ii.times=Ii.mul=function(e){var t,n,o,r,i,s,a,l,c,u=this,d=u.constructor,h=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!h||!h[0]||!p||!p[0])return new d(!e.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:h&&p?0*e.s:e.s/0);for(n=Ei(u.e/7)+Ei(e.e/7),(l=h.length)<(c=p.length)&&(i=h,h=p,p=i,s=l,l=c,c=s),i=[],o=s=l+c;o--;)i.push(0);for(o=c;--o>=0;){for(t=0,r=l+o;r>o;)a=i[r]+p[o]*h[r-o-1]+t,i[r--]=a%ki|0,t=a/ki|0;i[r]=(i[r]+t)%ki|0}for(;!i[--s];)i.pop();return t?++n:i.shift(),e.d=i,e.e=Mi(i,n),fi?Ci(e,d.precision,d.rounding):e},Ii.toBinary=function(e,t){return es(this,2,e,t)},Ii.toDecimalPlaces=Ii.toDP=function(e,t){var n=this,o=n.constructor;return n=new o(n),void 0===e?n:(Pi(e,0,ui),void 0===t?t=o.rounding:Pi(t,0,8),Ci(n,e+n.e+1,t))},Ii.toExponential=function(e,t){var n,o=this,r=o.constructor;return void 0===e?n=$i(o,!0):(Pi(e,0,ui),void 0===t?t=r.rounding:Pi(t,0,8),n=$i(o=Ci(new r(o),e+1,t),!0,e+1)),o.isNeg()&&!o.isZero()?"-"+n:n},Ii.toFixed=function(e,t){var n,o,r=this,i=r.constructor;return void 0===e?n=$i(r):(Pi(e,0,ui),void 0===t?t=i.rounding:Pi(t,0,8),n=$i(o=Ci(new i(r),e+r.e+1,t),!1,e+o.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},Ii.toFraction=function(e){var t,n,o,r,i,s,a,l,c,u,d,h,p=this,g=p.d,f=p.constructor;if(!g)return new f(p);if(c=n=new f(1),o=l=new f(0),s=(i=(t=new f(o)).e=Fi(g)-p.e-1)%7,t.d[0]=Si(10,s<0?7+s:s),null==e)e=i>0?t:c;else{if(!(a=new f(e)).isInt()||a.lt(c))throw Error(yi+a);e=a.gt(t)?i>0?t:c:a}for(fi=!1,a=new f(_i(g)),u=f.precision,f.precision=i=7*g.length*2;d=Di(a,t,0,1,1),1!=(r=n.plus(d.times(o))).cmp(e);)n=o,o=r,r=c,c=l.plus(d.times(r)),l=r,r=t,t=a.minus(d.times(r)),a=r;return r=Di(e.minus(n),o,0,1,1),l=l.plus(r.times(c)),n=n.plus(r.times(o)),l.s=c.s=p.s,h=Di(c,o,i,1).minus(p).abs().cmp(Di(l,n,i,1).minus(p).abs())<1?[c,o]:[l,n],f.precision=u,fi=!0,h},Ii.toHexadecimal=Ii.toHex=function(e,t){return es(this,16,e,t)},Ii.toNearest=function(e,t){var n=this,o=n.constructor;if(n=new o(n),null==e){if(!n.d)return n;e=new o(1),t=o.rounding}else{if(e=new o(e),void 0===t?t=o.rounding:Pi(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(fi=!1,n=Di(n,e,0,t,1).times(e),fi=!0,Ci(n)):(e.s=n.s,n=e),n},Ii.toNumber=function(){return+this},Ii.toOctal=function(e,t){return es(this,8,e,t)},Ii.toPower=Ii.pow=function(e){var t,n,o,r,i,s,a=this,l=a.constructor,c=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Si(+a,c));if((a=new l(a)).eq(1))return a;if(o=l.precision,i=l.rounding,e.eq(1))return Ci(a,o,i);if((t=Ei(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return r=Bi(l,a,n,o),e.s<0?new l(1).div(r):Ci(r,o,i);if((s=a.s)<0){if(tl.maxE+1||t0?s/0:0):(fi=!1,l.rounding=a.s=1,n=Math.min(12,(t+"").length),(r=Vi(e.times(zi(a,o+n)),o)).d&&Ui((r=Ci(r,o+5,1)).d,o,i)&&(t=o+10,+_i((r=Ci(Vi(e.times(zi(a,t+n)),t),t+5,1)).d).slice(o+1,o+15)+1==1e14&&(r=Ci(r,o+1,0))),r.s=s,fi=!0,l.rounding=i,Ci(r,o,i))},Ii.toPrecision=function(e,t){var n,o=this,r=o.constructor;return void 0===e?n=$i(o,o.e<=r.toExpNeg||o.e>=r.toExpPos):(Pi(e,1,ui),void 0===t?t=r.rounding:Pi(t,0,8),n=$i(o=Ci(new r(o),e,t),e<=o.e||o.e<=r.toExpNeg,e)),o.isNeg()&&!o.isZero()?"-"+n:n},Ii.toSignificantDigits=Ii.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(Pi(e,1,ui),void 0===t?t=n.rounding:Pi(t,0,8)),Ci(new n(this),e,t)},Ii.toString=function(){var e=this,t=e.constructor,n=$i(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},Ii.truncated=Ii.trunc=function(){return Ci(new this.constructor(this),this.e+1,1)},Ii.valueOf=Ii.toJSON=function(){var e=this,t=e.constructor,n=$i(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var Di=function(){function e(e,t,n){var o,r=0,i=e.length;for(e=e.slice();i--;)o=e[i]*t+r,e[i]=o%n|0,r=o/n|0;return r&&e.unshift(r),e}function t(e,t,n,o){var r,i;if(n!=o)i=n>o?1:-1;else for(r=i=0;rt[r]?1:-1;break}return i}function n(e,t,n,o){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(o,r,i,s,a,l){var c,u,d,h,p,g,f,m,y,v,b,w,E,S,T,N,A,O,k,L,R=o.constructor,I=o.s==r.s?1:-1,_=o.d,P=r.d;if(!_||!_[0]||!P||!P[0])return new R(o.s&&r.s&&(_?!P||_[0]!=P[0]:P)?_&&0==_[0]||!P?0*I:I/0:NaN);for(l?(p=1,u=o.e-r.e):(l=ki,p=7,u=Ei(o.e/p)-Ei(r.e/p)),k=P.length,A=_.length,v=(y=new R(I)).d=[],d=0;P[d]==(_[d]||0);d++);if(P[d]>(_[d]||0)&&u--,null==i?(S=i=R.precision,s=R.rounding):S=a?i+(o.e-r.e)+1:i,S<0)v.push(1),g=!0;else{if(S=S/p+2|0,d=0,1==k){for(h=0,P=P[0],S++;(d1&&(P=e(P,h,l),_=e(_,h,l),k=P.length,A=_.length),N=k,w=(b=_.slice(0,k)).length;w=l/2&&++O;do{h=0,(c=t(P,b,k,w))<0?(E=b[0],k!=w&&(E=E*l+(b[1]||0)),(h=E/O|0)>1?(h>=l&&(h=l-1),1==(c=t(f=e(P,h,l),b,m=f.length,w=b.length))&&(h--,n(f,k=10;h/=10)d++;y.e=d+u*p-1,Ci(y,a?i+y.e+1:i,s,g)}return y}}();function Ci(e,t,n,o){var r,i,s,a,l,c,u,d,h,p=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(r=1,a=d[0];a>=10;a/=10)r++;if((i=t-r)<0)i+=7,s=t,l=(u=d[h=0])/Si(10,r-s-1)%10|0;else if((h=Math.ceil((i+1)/7))>=(a=d.length)){if(!o)break e;for(;a++<=h;)d.push(0);u=l=0,r=1,s=(i%=7)-7+1}else{for(u=a=d[h],r=1;a>=10;a/=10)r++;l=(s=(i%=7)-7+r)<0?0:u/Si(10,r-s-1)%10|0}if(o=o||t<0||void 0!==d[h+1]||(s<0?u:u%Si(10,r-s-1)),c=n<4?(l||o)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||o||6==n&&(i>0?s>0?u/Si(10,r-s):0:d[h-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=Si(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=h,a=1,h--):(d.length=h+1,a=Si(10,7-i),d[h]=s>0?(u/Si(10,r-s)%Si(10,s)|0)*a:0),c)for(;;){if(0==h){for(i=1,s=d[0];s>=10;s/=10)i++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;i!=a&&(e.e++,d[0]==ki&&(d[0]=1));break}if(d[h]+=a,d[h]!=ki)break;d[h--]=0,a=1}for(i=d.length;0===d[--i];)d.pop()}return fi&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+Gi(o):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):r<0?(i="0."+Gi(-r-1)+i,n&&(o=n-s)>0&&(i+=Gi(o))):r>=s?(i+=Gi(r+1-s),n&&(o=n-r-1)>0&&(i=i+"."+Gi(o))):((o=r+1)0&&(r+1===s&&(i+="."),i+=Gi(o))),i}function Mi(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function ji(e,t,n){if(t>Li)throw fi=!0,n&&(e.precision=n),Error(vi);return Ci(new e(hi),t,1,!0)}function qi(e,t,n){if(t>Ri)throw Error(vi);return Ci(new e(pi),t,n,!0)}function Fi(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Gi(e){for(var t="";e--;)t+="0";return t}function Bi(e,t,n,o){var r,i=new e(1),s=Math.ceil(o/7+4);for(fi=!1;;){if(n%2&&ts((i=i.times(t)).d,s)&&(r=!0),0===(n=Ei(n/2))){n=i.d.length-1,r&&0===i.d[n]&&++i.d[n];break}ts((t=t.times(t)).d,s)}return fi=!0,i}function Hi(e){return 1&e.d[e.d.length-1]}function Ki(e,t,n){for(var o,r,i=new e(t[0]),s=0;++s17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(fi=!1,l=g):l=t,a=new h(.03125);e.e>-2;)e=e.times(a),d+=5;for(l+=o=Math.log(Si(2,d))/Math.LN10*2+5|0,n=i=s=new h(1),h.precision=l;;){if(i=Ci(i.times(e),l,1),n=n.times(++u),_i((a=s.plus(Di(i,n,l,1))).d).slice(0,l)===_i(s.d).slice(0,l)){for(r=d;r--;)s=Ci(s.times(s),l,1);if(null!=t)return h.precision=g,s;if(!(c<3&&Ui(s.d,l-o,p,c)))return Ci(s,h.precision=g,p,fi=!0);h.precision=l+=10,n=i=a=new h(1),u=0,c++}s=a}}function zi(e,t){var n,o,r,i,s,a,l,c,u,d,h,p=1,g=e,f=g.d,m=g.constructor,y=m.rounding,v=m.precision;if(g.s<0||!f||!f[0]||!g.e&&1==f[0]&&1==f.length)return new m(f&&!f[0]?-1/0:1!=g.s?NaN:f?0:g);if(null==t?(fi=!1,u=v):u=t,m.precision=u+=10,o=(n=_i(f)).charAt(0),!(Math.abs(i=g.e)<15e14))return c=ji(m,u+2,v).times(i+""),g=zi(new m(o+"."+n.slice(1)),u-10).plus(c),m.precision=v,null==t?Ci(g,v,y,fi=!0):g;for(;o<7&&1!=o||1==o&&n.charAt(1)>3;)o=(n=_i((g=g.times(e)).d)).charAt(0),p++;for(i=g.e,o>1?(g=new m("0."+n),i++):g=new m(o+"."+n.slice(1)),d=g,l=s=g=Di(g.minus(1),g.plus(1),u,1),h=Ci(g.times(g),u,1),r=3;;){if(s=Ci(s.times(h),u,1),_i((c=l.plus(Di(s,new m(r),u,1))).d).slice(0,u)===_i(l.d).slice(0,u)){if(l=l.times(2),0!==i&&(l=l.plus(ji(m,u+2,v).times(i+""))),l=Di(l,new m(p),u,1),null!=t)return m.precision=v,l;if(!Ui(l.d,u-10,y,a))return Ci(l,m.precision=v,y,fi=!0);m.precision=u+=10,c=s=g=Di(d.minus(1),d.plus(1),u,1),h=Ci(g.times(g),u,1),r=a=1}l=c,r+=2}}function Ji(e){return String(e.s*e.s/0)}function Wi(e,t){var n,o,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(o=t.search(/e/i))>0?(n<0&&(n=o),n+=+t.slice(o+1),t=t.substring(0,o)):n<0&&(n=t.length),o=0;48===t.charCodeAt(o);o++);for(r=t.length;48===t.charCodeAt(r-1);--r);if(t=t.slice(o,r)){if(r-=o,e.e=n=n-o-1,e.d=[],o=(n+1)%7,n<0&&(o+=7),oe.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Oi.test(t))return Wi(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ni.test(t))n=16,t=t.toLowerCase();else if(Ti.test(t))n=2;else{if(!Ai.test(t))throw Error(yi+t);n=8}for((i=t.search(/p/i))>0?(l=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),s=(i=t.indexOf("."))>=0,o=e.constructor,s&&(i=(a=(t=t.replace(".","")).length)-i,r=Bi(o,new o(n),i,2*i)),i=u=(c=xi(t,n,ki)).length-1;0===c[i];--i)c.pop();return i<0?new o(0*e.s):(e.e=Mi(c,u),e.d=c,fi=!1,s&&(e=Di(e,r,4*a)),l&&(e=e.times(Math.abs(l)<54?Si(2,l):Gs.pow(2,l))),fi=!0,e)}function Yi(e,t,n,o,r){var i,s,a,l,c=e.precision,u=Math.ceil(c/7);for(fi=!1,l=n.times(n),a=new e(o);;){if(s=Di(a.times(l),new e(t++*t++),c,1),a=r?o.plus(s):o.minus(s),o=Di(s.times(l),new e(t++*t++),c,1),void 0!==(s=a.plus(o)).d[u]){for(i=u;s.d[i]===a.d[i]&&i--;);if(-1==i)break}i=a,a=o,o=s,s=i}return fi=!0,s.d.length=u+1,s}function Qi(e,t){for(var n=e;--t;)n*=e;return n}function Xi(e,t){var n,o=t.s<0,r=qi(e,e.precision,1),i=r.times(.5);if((t=t.abs()).lte(i))return li=o?4:1,t;if((n=t.divToInt(r)).isZero())li=o?3:2;else{if((t=t.minus(n.times(r))).lte(i))return li=Hi(n)?o?2:3:o?4:1,t;li=Hi(n)?o?1:4:o?3:2}return t.minus(r).abs()}function es(e,t,n,o){var r,i,s,a,l,c,u,d,h,p=e.constructor,g=void 0!==n;if(g?(Pi(n,1,ui),void 0===o?o=p.rounding:Pi(o,0,8)):(n=p.precision,o=p.rounding),e.isFinite()){for(g?(r=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):r=t,(s=(u=$i(e)).indexOf("."))>=0&&(u=u.replace(".",""),(h=new p(1)).e=u.length-s,h.d=xi($i(h),10,r),h.e=h.d.length),i=l=(d=xi(u,10,r)).length;0==d[--l];)d.pop();if(d[0]){if(s<0?i--:((e=new p(e)).d=d,e.e=i,d=(e=Di(e,h,n,o,0,r)).d,i=e.e,c=ai),s=d[n],a=r/2,c=c||void 0!==d[n+1],c=o<4?(void 0!==s||c)&&(0===o||o===(e.s<0?3:2)):s>a||s===a&&(4===o||c||6===o&&1&d[n-1]||o===(e.s<0?8:7)),d.length=n,c)for(;++d[--n]>r-1;)d[n]=0,n||(++i,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,u="";s1)if(16==t||8==t){for(s=16==t?4:3,--l;l%s;l++)u+="0";for(l=(d=xi(u,r,t)).length;!d[l-1];--l);for(s=1,u="1.";sl)for(i-=l;i--;)u+="0";else it)return e.length=t,!0}function ns(e){return new this(e).abs()}function os(e){return new this(e).acos()}function rs(e){return new this(e).acosh()}function is(e,t){return new this(e).plus(t)}function ss(e){return new this(e).asin()}function as(e){return new this(e).asinh()}function ls(e){return new this(e).atan()}function cs(e){return new this(e).atanh()}function us(e,t){e=new this(e),t=new this(t);var n,o=this.precision,r=this.rounding,i=o+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?qi(this,o,r):new this(0)).s=e.s:!e.d||t.isZero()?(n=qi(this,i,1).times(.5)).s=e.s:t.s<0?(this.precision=i,this.rounding=1,n=this.atan(Di(e,t,i,1)),t=qi(this,i,1),this.precision=o,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Di(e,t,i,1)):(n=qi(this,i,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function ds(e){return new this(e).cbrt()}function hs(e){return Ci(e=new this(e),e.e+1,2)}function ps(e,t,n){return new this(e).clamp(t,n)}function gs(e){if(!e||"object"!==typeof e)throw Error(mi+"Object expected");var t,n,o,r=!0===e.defaults,i=["precision",1,ui,"rounding",0,8,"toExpNeg",-ci,0,"toExpPos",0,ci,"maxE",0,ci,"minE",-ci,0,"modulo",0,9];for(t=0;t=i[t+1]&&o<=i[t+2]))throw Error(yi+n+": "+o);this[n]=o}if(n="crypto",r&&(this[n]=gi[n]),void 0!==(o=e[n])){if(!0!==o&&!1!==o&&0!==o&&1!==o)throw Error(yi+n+": "+o);if(o){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(bi);this[n]=!0}else this[n]=!1}return this}function fs(e){return new this(e).cos()}function ms(e){return new this(e).cosh()}function ys(e,t){return new this(e).div(t)}function vs(e){return new this(e).exp()}function bs(e){return Ci(e=new this(e),e.e+1,3)}function ws(){var e,t,n=new this(0);for(fi=!1,e=0;e=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:a[i++]=r%1e7;else{if(!crypto.randomBytes)throw Error(bi);for(t=crypto.randomBytes(o*=4);i=214e7?crypto.randomBytes(4).copy(t,i):(a.push(r%1e7),i+=4);i=o/4}else for(;i=10;r/=10)o++;o<7&&(n-=7-o)}return s.e=n,s.d=a,s}function Ps(e){return Ci(e=new this(e),e.e+1,this.rounding)}function Us(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function xs(e){return new this(e).sin()}function Ds(e){return new this(e).sinh()}function Cs(e){return new this(e).sqrt()}function $s(e,t){return new this(e).sub(t)}function Ms(){var e=0,t=arguments,n=new this(t[e]);for(fi=!1;n.s&&++ei.maxE?(r.e=NaN,r.d=null):e.e=10;n/=10)t++;return void(fi?t>i.maxE?(r.e=NaN,r.d=null):tNumber.isNaN(Number(e))?0:Number(e),ia=(e,t)=>new Bs(e).mul(t).toNumber(),sa=[10,50,200],aa=({ratios:e="1,2,4,10",tickSize:t,priceScale:n})=>Number(t)&&e&&e.split?e.split(",").map((e=>{const o=ia(Number(t),Number(e));let r={priceScale:n};return 1===Number(e)&&(r={...r,isDefault:!0}),{label:o,ratio:Number(e),value:o,meta:r}})):[],la=e=>{let t=[];return Number(e)?(sa.forEach((n=>{const o=ia(Number(e),Number(n));t=[...t,{label:`+${o}`,value:o},{label:`-${o}`,value:-o}]})),t):t},ca=(e,t)=>e&&0!==ra(e)?ra(e):ra(t),ua=()=>{if("undefined"===typeof window)return"";try{var e;let t=Ko(en);return null!==(e=window)&&void 0!==e&&e.tracing&&window.tracing.addEvent({t:"dynamic-symbol-get-cookie",m:t}),t&&"null"!==t.toLowerCase()&&"undefined"!==t.toLowerCase()||(t=""),t}catch(e){return""}},da=e=>{const t={prod:"s1.bycsi.com",testnet:"t1.bycsi.com"};if(Ie&&e&&e.indexOf(t.testnet)>-1)return e;if(!e)return"";const n=Object.values(t).find((t=>-1!==e.indexOf(t)));if(!n)return e;const o=n.length,r=e.indexOf(n);return`/bycsi-root${e.substr(r+o)}`},ha=(...e)=>{var t,n,o;return null===(t=window)||void 0===t||null===(n=t.tracing)||void 0===n||null===(o=n.addEvent)||void 0===o?void 0:o.call(n,...e)},pa=e=>e?(Object.entries(e).forEach((([t,n])=>{oa[t]&&Array.isArray(n)&&(e[t]=n.map((e=>(e=>e?Object.entries(e).reduce(((e,[t,n])=>(e[ea[t]||t]=n,e)),{}):{})(e))))})),e):e,ga={InversePerpetual:[],LinearPerpetual:[],InverseFutures:[],UsdcPerpetual:[],UsdcFutures:[],allTags:""};let fa=null,ma=null;async function ya(){if(fa)return fa;if(ma)return ma;const e="EU"===it?"symbols-eu.json":"symbols-default.json";return ma=(async()=>{try{const t=await fetch(`/static/by-vendors/fallback/${e}`);if(!t.ok)throw new Error(`Failed to load fallback symbols: ${t.status}`);const n=await t.json();return fa=n,n}catch(e){return console.warn("[by-vendors] Failed to load fallback JSON, using minimal structure:",e),fa=ga,ga}finally{ma=null}})(),ma}const va=ga;const ba=10011501,wa=10011502,Ea=10011503,Sa=10011504,Ta=10011505,Na=10011506,Aa=10011507,Oa=10011508,ka=(e,t)=>t.some((t=>e instanceof t));let La,Ra;const Ia=new WeakMap,_a=new WeakMap,Pa=new WeakMap;let Ua={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return Ia.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return $a(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function xa(e){Ua=e(Ua)}function Da(e){return(Ra||(Ra=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Ma(this),t),$a(this.request)}:function(...t){return $a(e.apply(Ma(this),t))}}function Ca(e){return"function"===typeof e?Da(e):(e instanceof IDBTransaction&&function(e){if(Ia.has(e))return;const t=new Promise(((t,n)=>{const o=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),o()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)}));Ia.set(e,t)}(e),ka(e,La||(La=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Ua):e)}function $a(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const o=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t($a(e.result)),o()},i=()=>{n(e.error),o()};e.addEventListener("success",r),e.addEventListener("error",i)}));return Pa.set(t,e),t}(e);if(_a.has(e))return _a.get(e);const t=Ca(e);return t!==e&&(_a.set(e,t),Pa.set(t,e)),t}const Ma=e=>Pa.get(e);const ja=["get","getKey","getAll","getAllKeys","count"],qa=["put","add","delete","clear"],Fa=new Map;function Ga(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(Fa.get(t))return Fa.get(t);const n=t.replace(/FromIndex$/,""),o=t!==n,r=qa.includes(n);if(!(n in(o?IDBIndex:IDBObjectStore).prototype)||!r&&!ja.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,r?"readwrite":"readonly");let s=i.store;return o&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),r&&i.done]))[0]};return Fa.set(t,i),i}xa((e=>({...e,get:(t,n,o)=>Ga(t,n)||e.get(t,n,o),has:(t,n)=>!!Ga(t,n)||e.has(t,n)})));const Ba=["continue","continuePrimaryKey","advance"],Ha={},Ka=new WeakMap,Va=new WeakMap,za={get(e,t){if(!Ba.includes(t))return e[t];let n=Ha[t];return n||(n=Ha[t]=function(...e){Ka.set(this,Va.get(this)[t](...e))}),n}};async function*Ja(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const n=new Proxy(t,za);for(Va.set(n,t),Pa.set(n,Ma(t));t;)yield n,t=await(Ka.get(n)||t.continue()),Ka.delete(n)}function Wa(e,t){return t===Symbol.asyncIterator&&ka(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&ka(e,[IDBIndex,IDBObjectStore])}xa((e=>({...e,get:(t,n,o)=>Wa(t,n)?Ja:e.get(t,n,o),has:(t,n)=>Wa(t,n)||e.has(t,n)})));const Za=()=>{"undefined"!==typeof window&&Vs.forEach((e=>{try{localStorage.removeItem(e)}catch{}}))},Ya=async e=>{if("undefined"===typeof window||!window.indexedDB)throw new Error("IndexedDB not supported");try{return await function(e,t,{blocked:n,upgrade:o,blocking:r,terminated:i}={}){const s=indexedDB.open(e,t),a=$a(s);return o&&s.addEventListener("upgradeneeded",(e=>{o($a(s.result),e.oldVersion,e.newVersion,$a(s.transaction),e)})),n&&s.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{i&&e.addEventListener("close",(()=>i())),r&&e.addEventListener("versionchange",(e=>r(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}(e,1,{upgrade(e,t){if(t<1){(async e=>{try{let t=null;if(t=localStorage.getItem(Ks),!t)try{const e=localStorage.getItem(Hs);if(e){const n=JSON.parse(e);t=JSON.stringify(null===n||void 0===n?void 0:n.dynamicSymbol)}}catch(e){}if(!t)return;const n=JSON.parse(t);try{await e.put({key:Ks,value:n}),localStorage.removeItem(Ks),Za()}catch(e){console.warn("Migration failed, IndexedDB write failed:",e)}}catch(e){console.warn("Migration error:",e.message)}})(e.createObjectStore(Ws,{keyPath:"key"}))}}})}catch(e){throw ha({t:"action",c:Oa,m:null===e||void 0===e?void 0:e.message}),e}},Qa=async(e,t)=>{try{try{const n=await Ya(Js);await n.put(Ws,{key:e,value:t})}catch(e){}return!0}catch(e){return!1}},Xa=async e=>{try{try{const t=await Ya(Js),n=await t.get(Ws,e);if(null!=(null===n||void 0===n?void 0:n.value))return n.value}catch(e){}try{const t=await Ya(zs),n=await t.get(Ws,e);return null!=(null===n||void 0===n?void 0:n.value)?(Qa(e,n.value),n.value):null}catch(e){return null}}catch(e){return null}},el=async()=>{if("undefined"===typeof window)return null;try{const e=await Xa(Ks);if(e)return e}catch(e){}let e=null;try{e=JSON.parse(localStorage.getItem(Ks))}catch(e){ha({t:"action",c:ba,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}if(!e)try{const n=localStorage.getItem(Hs);var t;if(n)e=null===(t=JSON.parse(n))||void 0===t?void 0:t.dynamicSymbol,ha({t:"action",c:wa,m:"use v4 data"})}catch(e){ha({t:"action",c:Ea,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}return e},tl=()=>!!window&&(mt()||pt()),nl=async({http:e,url:t,token:n,useCache:o}={http:null,url:"",token:"",useCache:!1})=>{var r;const i=await e.get(`${t}${n?`&token=${n.substr(-8)}`:""}`,{headers:tl()&&{UserToken:n},useCache:o}),{result:s,ret_code:a}=(null===i||void 0===i?void 0:i.data)||{};if(s&&0===a)return(async e=>{var t,n;if("undefined"!==typeof window&&(null!==e&&void 0!==e&&null!==(t=e.LinearPerpetual)&&void 0!==t&&t.length||null!==e&&void 0!==e&&null!==(n=e.UsdcPerpetual)&&void 0!==n&&n.length)){try{return void await Qa(Ks,e)}catch(e){}try{Za(),localStorage.setItem(Ks,JSON.stringify(e))}catch(e){ha({t:"action",c:Sa,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}}})(s),null!==s&&void 0!==s&&null!==(r=s.LinearPerpetual)&&void 0!==r&&r.length?null===i||void 0===i?void 0:i.data:void 0},ol=async({fetchOptions:e={}}={})=>{const{fetchSuccessCallback:t,resolveData:n,...o}=e;let r;try{r=await el()}catch(e){}const i=nl(o);return i.then((e=>{null!==e&&void 0!==e&&e.result&&(null===t||void 0===t||t(n(e.result)))})),r?(i.catch((e=>{var t;ha({t:"action",c:Ta,m:null===e||void 0===e?void 0:e.message,cm:null===e||void 0===e||null===(t=e.request)||void 0===t?void 0:t.url})})),r={result:r}):r=await i,r},rl=async({fetchOptions:e})=>{let t;try{t=await nl(e)}catch(e){var n;if(!t)ha({t:"action",c:Na,m:null===e||void 0===e?void 0:e.message,cm:null===e||void 0===e||null===(n=e.request)||void 0===n?void 0:n.url}),t=await el()}return t},il={symbol:"",symbolName:"",coin:"",baseCoin:"",contractStatus:"Closed",contractType:"",maxPrice:0,minPrice:0,maxQty:0,minQty:0,balanceFraction:4,upnlFraction:4,priceScale:4,tickSize:0,tickSizeFraction:0,priceStep:0,priceFraction:0,lotStep:0,lotSize:0,lotFraction:0,obDepthMergeTimes:"1,2,4,10",indexSort:0,initMargin:0,maintainMargin:0,imIncrements:0,rLBases:0,rLIncrements:0,section:[],symbolDepths:[],priceInputLabels:[],quarter:"UnKnown",symbolTags:"",startTradingTime:0,settleTime:0,avatarUrl:{},isPopular:!1,valueScale:0,feeRateTagId:0,displayName:"",mark:[],underlyingType:0,agreement:0},sl=e=>{const{symbolName:t,symbolAlias:n,baseCurrency:o,quoteCurrency:r,contractStatus:i,contractType:s,maxPrice:a,minPrice:l,minQty:c,maxNewOrderQty:u,maxNewMarketOrderQty:d,walletBalanceFraction:h,upnlFraction:p,priceScale:g,tickSize:f,tickSizeFraction:m,lotFraction:y,lotSize:v,priceFraction:b,obDepthMergeTimes:w,indexSort:E,baseInitialMarginRateE4:S,stepInitialMarginRateE4:T,baseMaintenanceMarginRateE4:N,stepMaintenanceMarginRateE4:A,baseMaxOrdPzValue:O,stepMaxOrdPzValue:k,section:L,quarter:R,symbolTags:I,startTradingTimeE3:_,settleTimeE3:P,isPopular:U,darkIcon:x,lightIcon:D,maxLeverageE2:C,minLeverageE2:$,maxDesignatedMarginE8:M,minDesignatedMarginE8:j,riskMaxLeverageE2:q,riskMinLeverageE2:F,supportCopyTrade:G,symbol:B,symbolDisplay:H,symbolStatus:K,valueScale:V,symbolLabelIcon:z,expectStartTradingTime:J,expectCurrentTimestamp:W,expectDisplay:Z,expectUrl:Y,minNotionalValue:Q,isPreListing:X,preListingInfo:ee,feeRateTagId:te,utaSupportOnly:ne,displayName:oe,maxPostOnlyOrderSize:re,mark:ie,underlyingType:se,agreement:ae}=e,le=(ce=o)?{dark:`/bycsi-root/assets/image/coins/dark/${null===ce||void 0===ce?void 0:ce.toLowerCase()}.svg`,light:`/bycsi-root/assets/image/coins/light/${null===ce||void 0===ce?void 0:ce.toLowerCase()}.svg`}:{dark:"/bycsi-root/assets/image/coins/default-dark.png",light:"/bycsi-root/assets/image/coins/default-light.png"};var ce;return{symbol:t,symbolName:n,coin:o,baseCoin:r,contractStatus:i,contractType:s,maxPrice:ra(a),minPrice:ra(l),maxQty:ra(u),minQty:ra(c),maxMarketQty:ca(d,u),balanceFraction:ra(h),upnlFraction:ra(p),priceScale:g,tickSize:ra(f),tickSizeFraction:m,priceStep:Number(f)*Number(`1e${m||0}`),priceFraction:b,lotStep:Number(v)*Number(`1e${y||0}`),lotSize:ra(v),lotFraction:y,obDepthMergeTimes:w,indexSort:E,initMargin:ra(S)/100,maintainMargin:ra(N)/100,imIncrements:ra(T)/100,mmIncrements:ra(A)/100,rLBases:ra(O),rLIncrements:ra(k),section:L,symbolDepths:aa({ratios:w,tickSize:f,priceScale:b}),priceInputLabels:la(f),quarter:R,symbolTags:I,startTradingTime:ra(_),settleTime:ra(P),avatarUrl:{dark:da(x)||(null===le||void 0===le?void 0:le.dark),light:da(D)||(null===le||void 0===le?void 0:le.light)},isPopular:U,supportCopyTrade:G,copyTradeMaxLvg:ra(C)/100,copyTradeMinLvg:ra($)/100,copyTradeMaxDesignMargin:ra(M)/1e8,copyTradeMinDesignMargin:ra(j)/1e8,copyTradeRiskMaxLvg:ra(q)/100,copyTradeRiskMinLvg:ra(F)/100,symbolId:B,symbolDisplay:H,symbolStatus:K,valueScale:V,symbolLabelIcon:z,expectStartTradingTime:J,expectCurrentTimestamp:W,expectDisplay:Z,expectUrl:Y,minNotionalValue:Q,isPreListing:X,preListingInfo:ee,feeRateTagId:te,utaSupportOnly:ne,displayName:oe||n,maxPostOnlyOrderSize:ra(re),mark:ie,underlyingType:se,agreement:ra(ae)}};class al{constructor(e){if(al.instance||(al.instance=this),e){const t={...e};this.options=t}return al.instance}#e={};#t=e=>{this.symbolStatus=na[e]||na.REJECTED};#n=e=>{const t={},n={},o={};return Object.entries(e).forEach((([e,r])=>{oa[e]?(t[e]=[],n[e]=[],r.forEach((o=>{const r=sl(o);t[e].push(r),r.symbolDisplay!==Xs&&n[e].push(r)}))):o[e]=r})),{allList:t,tradingList:n,others:o}};#o=e=>{const t={},n={};return Object.entries(e).reduce(((e,[,t])=>[...e,...Array.isArray(t)?t:[]]),[]).forEach((e=>{t[e.symbol]=e,e.symbolDisplay!==Xs&&(n[e.symbol]=e)})),{totalSymbolConfig:t,tradingSymbolConfig:n}};#r=(e={})=>{const t=pa(e);this.originData=t;const{allList:n,tradingList:o,others:r}=this.#n(t);this.totalSymbolList=n,this.allSymbolList=o;const{totalSymbolConfig:i,tradingSymbolConfig:s}=this.#o(this.totalSymbolList)||{totalSymbolConfig:il,tradingSymbolConfig:il};return this.totalSymbolConfig=i,this.allSymbolConfig=s,{symbolStatus:this.symbolStatus,totalSymbolConfig:this.totalSymbolConfig,totalSymbolList:this.totalSymbolList,allSymbolConfig:this.allSymbolConfig,allSymbolList:this.allSymbolList,originData:t,others:r}};version=8;symbolStatus="";allSymbolConfig={};allSymbolList={};totalSymbolConfig={};totalSymbolList={};originData={};#i=(e,t,n,o)=>new Promise((r=>{(t===Zs.NETWORK_FIRST?rl:ol)({fetchOptions:{http:Mr,url:e,token:ua(),useCache:n,fetchSuccessCallback:o,resolveData:this.#r}}).then((async({result:e}={})=>{if(e)this.#t(na.RESOLVED),r(this.#r(e));else{this.#t(na.REJECTED);const e=await el();let t=e;if(!e)try{t=await ya(),ha({t:"action",c:Aa,m:"then: use async fallback data"})}catch(e){t=va,ha({t:"action",c:Aa,m:"then: use minimal fallback"})}r(this.#r(t))}})).catch((async e=>{this.#t(na.REJECTED);const t=await el();let n=t;if(!t)try{n=await ya(),ha({t:"action",c:Aa,m:"catch: use async fallback data"})}catch(e){n=va,ha({t:"action",c:Aa,m:"catch: use minimal fallback"})}r(this.#r(n))}))}));#s=e=>{let t=Me||ii().API2_HOST,n=Qs;if(null!==e&&void 0!==e&&e.length){const[o,r]=e;"string"===typeof o?(t=o,n={...n,...r}):n={...n,...o}}const{action:o,filter:r,useCache:i,fetchSuccessCallback:s}=n;return{api2Host:t,action:o,filter:r,useCache:i,fetchSuccessCallback:s}};fetchSymbolList=async(...e)=>{this.#t(na.PENDING);const{api2Host:t,action:n,filter:o,useCache:r,fetchSuccessCallback:i}=this.#s(e),s=await(async()=>{if("undefined"===typeof window)return null;try{const e=await Xa(Ks);if(e)return e}catch(e){}let e=null;try{e=JSON.parse(localStorage.getItem(Ks))}catch(e){ha({t:"action",c:ba,m:null===e||void 0===e?void 0:e.message,st:null===e||void 0===e?void 0:e.stack})}return e})(),a=`${t}/contract/v5/product/brief-symbol-list?${(e=>Object.entries(e).reduce(((e,[t,n])=>n?`${e}${t}=${n}&`:e),"").slice(0,-1))({filter:o,version:null===s||void 0===s?void 0:s.version})}`;return this.#i(a,n,r,i)};fetchSymbol=async(e,t,n={})=>{const{api2Host:o}=this.#s([]),r=`${o}/contract/v5/product/dynamic-symbol-item?symbol=${e}`;try{const o=await Mr.get(r,{headers:tl()&&{UserToken:ua()},...n}).catch((()=>({}))),{result:i}=(null===o||void 0===o?void 0:o.data)||{};if(i.item){const n=this.originData[t],o=n.findIndex((t=>sl(t).symbol===e));return n.splice(o,1,i.item),this.#r(this.originData)}return{}}catch(e){return{}}};static getInstance(e){return this.instance||(this.instance=new al(e)),this.instance}}const ll=al,cl=Object.prototype,ul=n.g&&n.g.Object===Object&&n.g||function(){return this}()||("undefined"!==typeof globalThis?globalThis:void 0),dl=(null===ul||void 0===ul?void 0:ul.isFinite)||Number.isFinite,hl=1/0,pl=Symbol?Symbol.toStringTag:void 0,gl=Symbol?Symbol.isConcatSpreadable:void 0,fl=cl.toString,ml=cl.propertyIsEnumerable,yl=cl.hasOwnProperty,vl=/^\s+|\s+$/g,bl=/^[-+]0x[0-9a-f]+$/i,wl=/^0b[01]+$/i,El=/^0o[0-7]+$/i,Sl=parseInt,Tl=cl.toString,Nl=e=>"string"===typeof e,Al=e=>void 0===e,Ol=e=>!!e&&"object"==typeof e,kl=e=>!!e&&"object"===typeof e&&e.constructor===Object,Ll=e=>{var t=typeof e;return!!e&&("object"==t||"function"==t)},Rl=e=>"symbol"==typeof e||Ol(e)&&"[object Symbol]"==Tl.call(e),Il=e=>{if("number"==typeof e)return e;if(Rl(e))return NaN;if(Ll(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ll(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(vl,"");var n=wl.test(e);return n||El.test(e)?Sl(e.slice(2),n?2:8):bl.test(e)?NaN:+e},_l=e=>e?(e=Il(e))===hl||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0,Pl=e=>{var t=_l(e),n=t%1;return t===t?n?t-n:t:0},Ul=e=>"number"==typeof e||Ol(e)&&"[object Number]"==Tl.call(e),xl=e=>Ul(e)&&e!=+e,Dl=e=>"number"==typeof e&&dl(e),Cl=e=>"number"==typeof e&&e==Pl(e),$l=e=>{var t=Ll(e)?Tl.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t},Ml=e=>{if(null===e)return null;const t=Object.assign({},e);return Object.keys(t).forEach((n=>t[n]="object"===typeof e[n]?Ml(e[n]):e[n])),Array.isArray(e)&&e.length?(t.length=e.length)&&Array.from(t):Array.isArray(e)?Array.from(e):t},jl=(e,t)=>Array.isArray(e)?e.map(t):kl(e)?Object.keys(e).map((n=>t(e[n],n))):[],ql=(e,t)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>(t[n]=e[n],t)),{}),Fl=(e,t)=>e.reduce(((e,n)=>[...e,...t.map((e=>[n,e]))]),[]),Gl=(e,t,n)=>(t=(t=+t)===t?t:0,n=(n=+n)===n?n:0,(e=+e)===e&&(e=(e=e<=n?e:n)>=t?e:t),e),Bl=(e,t)=>e.reduce(((e,n,o,r)=>(e[t(n,o,r)?0:1].push(n),e)),[[],[]]),Hl=(e,t)=>t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{});function Kl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":pl&&pl in Object(e)?function(e){var t=yl.call(e,pl),n=e[pl];try{e[pl]=void 0;var o=!0}catch(e){}var r=fl.call(e);return o&&(t?e[pl]=n:delete e[pl]),r}(e):Tl.call(e)}function Vl(e){return Ol(e)&&"[object Arguments]"==Kl(e)}var zl=Vl(function(){return arguments}())?Vl:function(e){return Ol(e)&&yl.call(e,"callee")&&!ml.call(e,"callee")};const Jl=e=>Array.isArray(e)||zl(e)||!!(gl&&e&&e[gl]);function Wl(e,t){for(var n=-1,o=t.length,r=e.length;++n0&&n(a)?t>1?Zl(a,t-1,n,o,r):Wl(r,a):o||(r[r.length]=a)}return r}const Yl=(e,t,n)=>(n=void 0===n?1:Pl(n),Zl(jl(e,t),n,Jl,!1,[]));function Ql(e){const t=e.getFullYear(),n=e.getMonth()+1,o=e.getDate(),r=e.getHours(),i=e.getMinutes(),s=e.getSeconds(),a={year:Number.isNaN(t)?"--":t,month:Number.isNaN(n)?"--":n,day:Number.isNaN(o)?"--":o,hours:Number.isNaN(r)?"--":r,minutes:Number.isNaN(i)?"--":i,seconds:Number.isNaN(s)?"--":s};return Object.keys(a).forEach((e=>{a[e]<10&&(a[e]=`0${a[e]}`)})),a}function Xl(e){if(!e)return e;const t=Ql("object"===typeof e?e:new Date(e));return`${t.year}-${t.month}-${t.day} ${t.hours}:${t.minutes}:${t.seconds}`}function ec(e){if(!e)return e;const t=Ql("object"===typeof e?e:new Date(e));return`${t.year}-${t.month}-${t.day}`}function tc(e){if(!e)return e;const t=Ql("object"===typeof e?e:new Date(e));return`${t.hours}:${t.minutes}:${t.seconds}`}function nc(e,t){if(!e)return e;const n="object"===typeof e?e:new Date(e),{hours:o,minutes:r,seconds:i}=function(e,t=0){const n=(e-(new Date).getTime())/1e3,o=Math.floor(n/3600/24),r=Math.floor((n-24*o*3600)/3600),i=Math.floor((n-24*o*3600-3600*r)/60),s={days:o,hours:r+t,minutes:i,seconds:Math.floor(n-24*o*3600-3600*r-60*i)};return Object.keys(s).forEach((e=>{s[e]<10&&(s[e]=`0${s[e]}`)})),s}(n,t);return`${o}:${r}:${i}`}function oc(e){const t=Math.floor(e/3600/24),n=Math.floor((e-24*t*3600)/3600),o=Math.floor((e-24*t*3600-3600*n)/60),r={hours:n,minutes:o,seconds:Math.floor(e-24*t*3600-3600*n-60*o)};return Object.keys(r).forEach((e=>{r[e]<10&&(r[e]=`0${r[e]}`)})),e>86400?Math.ceil(e/3600/24):`${r.hours}:${r.minutes}:${r.seconds}`}const rc=(e,t=8)=>{let n=Number(e);!xl(n)&&Dl(n)||(n=0);let o=Number(t);xl(o)&&(o=8);let r="";if(Cl(n))if(o>0){r=`${n}.`;for(let e=0;e=0||r.indexOf("E-")>=0)&&(r=n.toFixed(o+1));const e=r.split("."),t=e[0];if(0===o)return`${t}`;const i=e[1];if(i.length{const n=rc(e,t);let o="(\\d)(?=(\\d{3})+\\.)";return-1===n.indexOf(".")&&(o="(\\d)(?=(\\d{3})+$)"),n.replace(new RegExp(o,"g"),"$1,")},sc=(e,t,n="div")=>{if(!Ul(1*e)||!Ul(1*t))return null;return new Bs(1*e)[n](new Bs(1*t)).toNumber()},ac=(e,t="en-US",n=!0)=>{if(!Ul(1*e)||xl(1*e))return null;const o=new Intl.NumberFormat(t,{notation:"compact"}).format(1*e);return n?null===o||void 0===o?void 0:o.toLocaleLowerCase():o},lc=(e,t=1)=>{const n=10**(t-1);return Math.floor(Number(e)*n*2)/2/n},cc=["id-ID","nl-NL","nl-EU","pt-PT","pt-EU","pt-BR","es-ES","es-EU","es-MX","es-AR","vi-VN","ro-RO","ro-EU","de-DE","de","de-EU","it-IT","it-EU","it","tr-TR","tr-TUR","id-IDN"],uc=["ru-RU","uk-UA","pl-PL","pl-EU","fr-FR","fr","fr-EU","kk-KZ","kk-KAZ","ka-GEO","ru-GEO"];let dc;const hc=e=>cc.includes(e)?"TYPE1":uc.includes(e)?"TYPE2":"DEFAULT",pc=(e,t)=>{let n="en";["TYPE1"].includes(t)?n="id-ID":["TYPE2"].includes(t)&&(n="ru-RU");try{dc=new Intl.NumberFormat(n,{minimumFractionDigits:0,maximumFractionDigits:0})}catch(e){console.warn("Invalid locale, falling back to en"),dc=new Intl.NumberFormat("en")}return["TYPE2"].includes(t)&&e>=1e3&&e<1e4?e:dc.format(e)},gc=(e,t)=>{if(""===t||null===t||void 0===t||Number.isNaN(t)||+t<0)return null===e||void 0===e?void 0:e.toString();const n=t?+t:0;let o=e.toString();const r=o.indexOf(".");return-1!==r?(o=o.slice(0,r+1+n),n<=0?o.split(".")[0]:o):o},fc=(e,t,n="en")=>{var o;if(0===e)return"0";if(!e||Number.isNaN(+e))return e;const r=hc(n),i=["TYPE1","TYPE2"].includes(r)?",":".",s=(null===(o=gc(e,t))||void 0===o?void 0:o.replace(/\./g,i)).split(i);return s[0]=pc(s[0],r),s.join(i)},mc=(e,t,n="en")=>{var o,r;if(0===e)return"0";if(!e||Number.isNaN(+e))return e;const i=t||(0===t?0:4),s=hc(n),a=null===(o=Number(e))||void 0===o?void 0:o.toFixed(i),l=["TYPE1","TYPE2"].includes(s)?",":".",c=(null===(r=gc(a,i))||void 0===r?void 0:r.replace(/\./g,l)).split(l);return c[0]=pc(c[0],s),c.join(l)};const yc=({url:e,async:t,name:n,...o})=>new Promise((r=>{(function(e){const t=Array.from(document.getElementsByTagName("script"));let n=!1;for(let o=0,r=t.length;o{r({name:n})}}));function vc(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function bc(){return`${vc()}${vc()}-${vc()}-${vc()}-${vc()}-${vc()}${vc()}${vc()}`}const wc=e=>{const{search:t}=e;return t?t.slice(1).split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return{...e,[n]:decodeURIComponent(o)}}),{}):{}},Ec=e=>{const[,t]=e.href.split("?");return t?t.split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return{...e,[n]:decodeURIComponent(o)}}),{}):{}},Sc=e=>{let t;if(!e)return t;try{t=new URL(e)}catch(e){console.warn(e)}return t},Tc=(e="")=>{const t=e.split(".");return t.slice(-(t.length-1)).join(".")},Nc=(e="",t="")=>Tc(e)===Tc(t);let Ac="prod";Ie?Ac="prod":Re?Ac="testnet":_e&&(Ac="test");const Oc="SPOT_SYMBOLS_DATA_COMMON",kc="SPOT_SYMBOLS_DATA",Lc="/spot/api/basic/symbol_list_all",Rc="/spot/api/basic/symbol_list_v2",Ic="/spot/api/basic/symbol_list_v3",_c=`/common-static/fhs/global-search/algolia/downgrade/algolia-downgrade-${Ac}.json`,Pc={si:"symbolId",sn:"symbolName",bti:"baseTokenId",btn:"baseTokenName",qti:"quoteTokenId",qtn:"quoteTokenName",bp:"basePrecision",qp:"quotePrecision",miq:"minTradeQuantity",mia:"minTradeAmount",mip:"minPricePrecision",dm:"digitMerge",ss:"showStatus",l:"label",ap:"allowPlan",maq:"maxTradeQuantity",mmq:"maxMarketTradeQty",maa:"maxTradeAmount",nv:"noticeVisible",st:"symbolType",lul:"ltUnderlying",ld:"ltDirection",t:"tags",tfn:"tokenFullName",iu:"iconUrl",ot:"onlineTime",m:"mark",qtr:"quoteTokenLeverageRatio",btr:"baseTokenLeverageRatio",le:"loanEnabled",bb:"isBanBuy",bs:"isBanSell",idu:"iconDayUrl",ts:"tradeStatus",zft:"zeroFeeType",lpp:"limitOrderPriceLimitPercentage",mpp:"marketOrderPriceLimitPercentage",v:"volume",obs:"orderBookShow"},Uc="undefined"!==typeof window,xc=(e,t)=>{var n,o,r;return Uc?null===(n=window)||void 0===n||null===(o=n.Monitor)||void 0===o||null===(r=o.log)||void 0===r?void 0:r.call(o,{t:e,...t}):null},Dc=e=>{if(null===e||void 0===e||!e.length)return[];const t=Object.entries(Pc);return e.map((e=>t.reduce(((t,[n,o])=>(n&&(t[o]=e[n]),t)),{})))},Cc=(e,t=!1)=>null!==e&&void 0!==e&&e.length?t?Dc(e):e.map((e=>(e.quoteTokenSymbols&&(e.quoteTokenSymbols=Dc(e.quoteTokenSymbols)),e))):[],$c=e=>e.reduce(((e,t)=>{var n;if(null!==t&&void 0!==t&&null!==(n=t.quoteTokenSymbols)&&void 0!==n&&n.length){const n=t.quoteTokenSymbols.map((e=>({...e,tokenType:t.tokenType})));e.push(...n)}return e}),[]),Mc=(e=[],t)=>e.reduce(((e,n)=>{var o;return e[null!==(o=n[t])&&void 0!==o?o:n.symbolId]=n,e}),{}),jc=e=>{const t=$c(e);return Mc(t)},qc=(e,t,n)=>{!0===e?Object.assign(t,n):Object.keys(n).forEach((e=>{e in t||(t[e]=n[e])}))},Fc=(e=[],t=[],{key:n="si",tokenId:o,isFromCdn:r}={})=>{if(null===t||void 0===t||!t.length)return e;const i=Mc(e,n);return t.forEach((t=>{if(r&&!t.isFromCdn&&(t.isFromCdn=!0),!o||t.quoteTokenId===o){var s;const o=i[null!==(s=t[n])&&void 0!==s?s:t.symbolId];o?Object.assign(o,t):e.push(t)}})),e},Gc=(e=[],t=[],n,{key:o="si",isNeedReplace:r,isFromCdn:i,tokenId:s}={})=>{if(!0===i)Fc(e,t,{key:o,tokenId:s,isFromCdn:i});else{const i=Mc(t,o);for(let t=0;tMe||ii().API2_HOST,Hc=e=>{let t=500,n="Request failed. Please try again later.";try{if(null!==e&&void 0!==e&&e.response){var o;const r=e.response,i=r.data||{};t=i.ext_code||(null===r||void 0===r||null===(o=r.request)||void 0===o?void 0:o.status)||(null===r||void 0===r?void 0:r.status)||t,n=i.ret_msg||i.error||n}}catch(e){}return{success:!1,code:t,message:n,result:null}};const Kc=e=>{const t=(null===e||void 0===e?void 0:e.data)||e;return function(e){if(e&&(void 0===e.ret_code&&(e.ret_code=e.retCode),void 0===e.ret_msg))try{e.ret_msg=decodeURIComponent(e.retMsg)}catch{e.ret_msg=e.retMsg}}(t),n=t,"[object Object]"!==Object.prototype.toString.call(n)?(e=>{let t=500,n="Request failed. Please try again later.";try{if(null!==e&&void 0!==e&&e.response){var o;const r=e.response,i=r.data||{};t=i.ext_code||(null===r||void 0===r||null===(o=r.request)||void 0===o?void 0:o.status)||(null===r||void 0===r?void 0:r.status)||t,n=i.ret_msg||i.error||n}}catch(e){}return{success:!1,code:t,message:n,result:null}})("Invalid response data"):(t.success=0===t.ret_code,t.code=t.ret_code,t.message=t.ret_msg||0===t.ret_code?t.ret_msg:"Access error, please try again later",t.result=Object.prototype.hasOwnProperty.call(t,"result")?t.result:null,t);var n},Vc=(e,t=null)=>{try{return JSON.parse(e)}catch(e){return t}};function zc(e,{ignoreNull:t=!1}={}){return!t||null!==e&&void 0!==e?Array.isArray(e)?e:[e]:[]}function Jc(e){if("string"!==typeof e||-1===e.indexOf("."))return 0;const t=e.split(".");return t[1]?t[1].length:0}function Wc(){if("undefined"!==typeof window&&"undefined"!==typeof window.location){const{origin:e}=window.location;return"development"===Fe?Ge||"":e}if(He||Ke){const e=He||Ke;if(e)return`${Be||"http"}://${e}:${Ve||80}`}return null}const Zc=e=>{const t=[],n=[],o=[],r={},i=[],s=[],a={},l=()=>({symbols:o,symbolMap:Mc(o),quoteTags:r,totalCurrencys:t,quoteCurrencys:n,allFiatCurrency:i,fiatCurrency:s,qouteTokenInfo:a});try{return zc(e,{ignoreNull:!0}).forEach((e=>{e.quoteTokenSymbols=zc(e.quoteTokenSymbols,{ignoreNull:!0}),e.quoteTags=zc(e.quoteTags,{ignoreNull:!0}),a[e.tokenId]=((e,t)=>{if("object"!==typeof e||null===e)return e;const n=new Set(t),o=e=>{if("object"!==typeof e||null===e)return e;if(Array.isArray(e))return e.map(o);const t={};return Object.keys(e).forEach((r=>{n.has(r)||(t[r]=o(e[r]))})),t};return o(e)})(e,["quoteTokenSymbols","quoteTags"]),"REAL_MONEY"!==e.tokenType||i.includes(e.tokenName)||i.push(e.tokenName),e.quoteTokenSymbols.forEach((r=>{r.tags=zc(r.tags,{ignoreNull:!0}),r.baseTokenName=r.baseTokenName.toUpperCase(),r.quoteTokenName=r.quoteTokenName.toUpperCase(),t.find((t=>t.value===e.tokenName))||t.push({value:e.tokenName,iconType:e.zeroFeeType||0}),"REAL_MONEY"===e.tokenType||n.find((t=>t.value===e.tokenName))||n.push({value:e.tokenName,iconType:e.zeroFeeType||0}),"REAL_MONEY"===e.tokenType&&(s.find((t=>t.value===e.tokenName))||s.push({value:e.tokenName,iconType:r.zeroFeeType||0}),r.isFiat=!0),o.push({...r,quantityPrecision:Jc(r.basePrecision),pricePrecision:Jc(r.minPricePrecision),amountPrecision:Jc(r.quotePrecision)})})),e.quoteTags.forEach((t=>{e.quoteTokenSymbols.some((e=>{var n;return!(!e.tags.includes(t)||null!==(n=r[e.quoteTokenName])&&void 0!==n&&n.includes(t))&&(r[e.quoteTokenName]?r[e.quoteTokenName].push(t):r[e.quoteTokenName]=[t],!0)}))}))})),l()}catch(e){return l()}},Yc=e=>({all:e,symbols:$c(e),symbolsMap:jc(e),handleSymbols:Zc}),Qc="symbol_list_error",Xc="symbol_list_storage_error",eu="symbol_list_execution_error",tu=11511503,nu=11511504,ou=11511505,ru=11511506,iu=11511507,su=11511508,au=11511509,lu=11511510,cu=11511511,uu=11511512,du=11511513,hu=11511514,pu=11511515,gu=11511516,fu=11511517,mu=new Gn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"},timeout:8e3});mu.freezeCacheDeletion({"/symbol_list_all":bn.MANUAL,"/symbol_list_v2":bn.MANUAL,"/symbol_list_v3":bn.MANUAL}),mu.addInstanceRequestInterceptors([(e,t)=>(t.requestTime=Date.now(),{url:e,options:t})]),mu.addInstanceResponseInterceptors([async(e,t,n)=>{try{const t=e.clone();return await t.json()?e:Promise.reject(n.createResponseError("Non Response!",void 0))}catch(e){return Promise.reject(e)}}]);const yu=mu,vu=async e=>{xc(Qc,{c:lu,m:"fallback to v2"});try{localStorage.removeItem(Oc)}catch(e){xc(Xc,{c:pu,m:"delete localStorage error"})}let t={};try{t=await yu.get(`${Bc()}${Rc}`,e),t=Kc(t)}catch(e){xc(Qc,{c:cu,m:e.message||"fallback to v2 request error"}),t=Kc(e)}return Promise.resolve(t)},bu=(e,t,{setIsMergeError:n,isNeedReplace:o,isFromCdn:r,key:i}={})=>{if(!Array.isArray(e)||!Array.isArray(t))return[];let s=!1;for(let a=0;a{null===n||void 0===n||n(),s=!0}),{isNeedReplace:o,isFromCdn:r,key:i,tokenId:l.tokenId}),s)break}return e},wu=Symbol.for("sharedSpotSymbolsData"),Eu=(()=>{if(!Uc)return{};try{const e=window.top||window;return e.location.href,e}catch{return window}})();Uc&&!Eu[wu]&&(Eu[wu]={symbolsPromise:null,retryInProgress:!1,cacheSymbolsData:null,cacheSymbolsDataCdn:null,getSymbolsRetryTimes:0,BACKOFF_ID:"GET_SYMBOLS"});const Su=Eu[wu]||{},Tu={quoteTokenResult:[{tokenId:"USDT",tokenName:"USDT",tokenFullName:null,quoteTokenSymbols:[{symbolId:"BTCUSDT",symbolName:"BTCUSDT",baseTokenId:"BTC",baseTokenName:"BTC",quoteTokenId:"USDT",quoteTokenName:"USDT",basePrecision:"0.000001",quotePrecision:"0.00000001",minTradeQuantity:"0.000048",minTradeAmount:"1",minPricePrecision:"0.01",digitMerge:"100,10,1,0.1,0.01",showStatus:!0,label:null,allowPlan:!0,maxTradeQuantity:"71.73956243",maxTradeAmount:"4000000",noticeVisible:!1,symbolType:"CHAIN_TOKEN",ltUnderlying:"",ltDirection:"",tags:["BTC Ecosystem","PoW","Margin Trading"],tokenFullName:"Bitcoin",iconUrl:"/bycsi-root/app/assets/token/62942131f968981af06a885a79f864ba.svg",onlineTime:0,mark:[],quoteTokenLeverageRatio:"10",baseTokenLeverageRatio:"10",loanEnabled:!0,isBanBuy:!1,isBanSell:!1,iconDayUrl:"/bycsi-root/app/assets/token/d9c8c35b4223b50d9773d7d5294d019f.svg",tradeStatus:3,zeroFeeType:0,limitOrderPriceLimitPercentage:3,marketOrderPriceLimitPercentage:3,volume:"64933718986.350261940000000000"},{symbolId:"ETHUSDT",symbolName:"ETHUSDT",baseTokenId:"ETH",baseTokenName:"ETH",quoteTokenId:"USDT",quoteTokenName:"USDT",basePrecision:"0.00001",quotePrecision:"0.0000001",minTradeQuantity:"0.00062",minTradeAmount:"1",minPricePrecision:"0.01",digitMerge:"100,10,1,0.1,0.01",showStatus:!0,label:null,allowPlan:!0,maxTradeQuantity:"1878.2340843",maxTradeAmount:"4000000",noticeVisible:!1,symbolType:"CHAIN_TOKEN",ltUnderlying:"",ltDirection:"",tags:["ETH Ecosystem","Margin Trading"],tokenFullName:"Ethereum",iconUrl:"/bycsi-root/app/assets/token/35a48e2a91411dcdb00c7fdd443676a9.svg",onlineTime:0,mark:[],quoteTokenLeverageRatio:"10",baseTokenLeverageRatio:"10",loanEnabled:!0,isBanBuy:!1,isBanSell:!1,iconDayUrl:"/bycsi-root/app/assets/token/8f413d7ed51fa4bc3d206d6abf41f4dc.svg",tradeStatus:3,zeroFeeType:0,limitOrderPriceLimitPercentage:3,marketOrderPriceLimitPercentage:3,volume:"19455704679.052111300000000000"}],quoteTags:["0 Fees","Adventure Zone","SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","AI","Modular-BCs","DePIN","LSD","DeFi","GameFi","Inscriptions","Meme","PoW","Stablecoin","Innovation Zone","ETP (Leveraged Tokens)","Margin Trading","Launchpool","Launchpad"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"USDC",tokenName:"USDC",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["0 Fees","SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","AI","Modular-BCs","DePIN","DeFi","GameFi","Meme","PoW","Margin Trading","Launchpool","Launchpad"],tokenType:"CHAIN_TOKEN",zeroFeeType:1},{tokenId:"USDE",tokenName:"USDE",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"EUR",tokenName:"EUR",tokenFullName:null,quoteTags:["SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","Meme"],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"BRL",tokenName:"BRL",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"PLN",tokenName:"PLN",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"TRY",tokenName:"TRY",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"REAL_MONEY",zeroFeeType:0},{tokenId:"BTC",tokenName:"BTC",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["0 Fees","SOL Ecosystem","ETH Ecosystem","BTC Ecosystem","DeFi","GameFi","PoW","Margin Trading"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"USTC",tokenName:"USTC",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["ETH Ecosystem","BTC Ecosystem"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"ETH",tokenName:"ETH",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["ETH Ecosystem","LSD","DeFi"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"DAI",tokenName:"DAI",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["ETH Ecosystem","BTC Ecosystem"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"BRZ",tokenName:"BRZ",tokenFullName:null,quoteTokenSymbols:[],quoteTags:["BTC Ecosystem"],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"SPOTTEST1",tokenName:"SPOTTEST1",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"",zeroFeeType:0},{tokenId:"SPOTTEST3",tokenName:"SPOTTEST",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"",zeroFeeType:0},{tokenId:"SPOTTEST2",tokenName:"SPOTTEST2",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"CHAIN_TOKEN",zeroFeeType:0},{tokenId:"BIT",tokenName:"BIT",tokenFullName:null,quoteTokenSymbols:[],quoteTags:[],tokenType:"CHAIN_TOKEN",zeroFeeType:0}],version:""};n(752);const Nu={},Au=e=>{Nu[e]&&(clearTimeout(Nu[e].$timer),delete Nu[e])},Ou=async(e=(()=>"undefined"!==typeof localStorage&&localStorage.getItem("LANG_KEY")||"en")(),{useCache:t=!0,isRequestCdn:n=!1}={})=>Uc?(Su.symbolsPromise||(Su.symbolsPromise=new Promise((o=>{const r=async(i=!1)=>{try{try{localStorage.removeItem("spotSymbolData")}catch(e){xc(Xc,{c:pu,m:"delete localStorage error"})}if(Su.cacheSymbolsData=Vc(localStorage.getItem(kc)),Su.cacheSymbolsDataCdn=Vc(localStorage.getItem(Oc)),i){var s;Au(Su.BACKOFF_ID);let e=!1,t=[];if(!0===n){let n={};n=await(async()=>{let e={};try{var t,n,o,r;e=await yu.get(`${Wc()}${_c}`);const i=(null===(t=e)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.defaultTradeRecommended)||void 0===o||null===(r=o.spots)||void 0===r?void 0:r.length)>0;e=Kc({result:i?e.data:null,ret_code:i?0:500,ret_msg:i?"success":"error"})}catch(t){xc(Qc,{c:du,m:t.message||"request cdn json symbols error"}),e=Kc(t)}return Promise.resolve(e)})();const{success:o,result:r}=n;var a,l;if(o)e=!(null===r||void 0===r||!r.switch),t=null!==(a=null===r||void 0===r||null===(l=r.defaultTradeRecommended)||void 0===l?void 0:l.spots)&&void 0!==a?a:[];xc(Qc,{c:uu,m:"use cdn json symbols data",s:e})}if(null!==(s=Su.cacheSymbolsData)&&void 0!==s&&s.quoteTokenResult){if(e){xc(Qc,{c:gu,m:"use cdn json symbols and localStorage data",s:e}),bu(Su.cacheSymbolsData.quoteTokenResult,Cc(t,!0),{isFromCdn:!0});try{localStorage.setItem(kc,JSON.stringify(Su.cacheSymbolsData))}catch(e){xc(Xc,{c:hu,m:e.message||"set localStorage error"})}}else xc(Qc,{c:tu,m:"use localStorage data"});o(Yc(Su.cacheSymbolsData.quoteTokenResult))}else e?(xc(Qc,{c:fu,m:"use cdn json symbols and hard code data",s:e}),bu(Tu.quoteTokenResult,Cc(t,!0),{isFromCdn:!0})):xc(Qc,{c:nu,m:"use hard code data"}),o(Yc(Tu.quoteTokenResult))}else{var c,u,d,h,p,g;let n="",i="",s={};null!==(c=Su.cacheSymbolsData)&&void 0!==c&&null!==(u=c.quoteTokenResult)&&void 0!==u&&u.length&&null!==(d=Su.cacheSymbolsData)&&void 0!==d&&d.version&&(i=Su.cacheSymbolsData.version),null!==(h=Su.cacheSymbolsDataCdn)&&void 0!==h&&null!==(p=h.quoteTokenSymbols)&&void 0!==p&&p.length&&null!==(g=Su.cacheSymbolsDataCdn)&&void 0!==g&&g.lastModifiedTime&&(n=Su.cacheSymbolsDataCdn.lastModifiedTime);let a={headers:{lang:e,"Accept-Language":e},useCache:t,rewriteCacheKey:t=>`${t}&${e}`},l={...a};n&&(l={...l,params:{last_modified_at:n}}),i&&(a={...a,params:{version:i}});try{let e=!1;const t=()=>{e=!0},n=await Promise.all([yu.get(`${Bc()}${Lc}`,l),yu.get(`${Bc()}${Ic}`,a)]),o=Kc(n[0]),r=Kc(n[1]);if(o.success){var f;null!==(f=Su.cacheSymbolsDataCdn)&&void 0!==f&&f.quoteTokenSymbols&&(o.result.quoteTokenSymbols=Fc(Su.cacheSymbolsDataCdn.quoteTokenSymbols,o.result.quoteTokenSymbols));try{localStorage.setItem(Oc,JSON.stringify(o.result))}catch(e){xc(Xc,{c:hu,m:e.message||"set localStorage error"})}}o.success&&r.success&&(bu(r.result.quoteTokenResult,o.result.quoteTokenSymbols,{setIsMergeError:t}),e||(s=r)),!e&&o.success&&r.success||(e?xc(Qc,{c:iu,m:"merge symbols error"}):o.success?r.success||xc(Qc,{c:au,m:"symbol_v3 request error"}):xc(Qc,{c:su,m:"symbol_all request error"}),s=await vu(a))}catch(e){xc(Qc,{c:ru,m:e.message||"all/v3 request error"}),s=await vu(a)}const{success:m,result:y}=s;if(!m||!y)return void r(!0);y.quoteTokenResult?y.quoteTokenResult=Cc(y.quoteTokenResult):y.quoteTokenResult=Su.cacheSymbolsData.quoteTokenResult,Au(Su.BACKOFF_ID);try{localStorage.setItem(kc,JSON.stringify(y))}catch(e){xc(Xc,{c:hu,m:e.message||"set localStorage error"})}o(Yc(y.quoteTokenResult))}}catch(e){xc(eu,{c:ou,m:e.message||"code execution error"}),Su.retryInProgress=!1,r(!0)}};r()})).finally((()=>{Su.retryInProgress=!1,Su.symbolsPromise=null}))),Su.symbolsPromise):Promise.resolve(Yc([])),ku=e=>"string"===typeof e,Lu=()=>{let e,t;const n=new Promise(((n,o)=>{e=n,t=o}));return n.resolve=e,n.reject=t,n},Ru=e=>null==e?"":""+e,Iu=/###/g,_u=e=>e&&e.indexOf("###")>-1?e.replace(Iu,"."):e,Pu=e=>!e||ku(e),Uu=(e,t,n)=>{const o=ku(t)?t.split("."):t;let r=0;for(;r{const{obj:o,k:r}=Uu(e,t,Object);if(void 0!==o||1===t.length)return void(o[r]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=Uu(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Uu(e,s,Object),a?.obj&&"undefined"!==typeof a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Du=(e,t)=>{const{obj:n,k:o}=Uu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,o))return n[o]},Cu=(e,t,n)=>{for(const o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?ku(e[o])||e[o]instanceof String||ku(t[o])||t[o]instanceof String?n&&(e[o]=t[o]):Cu(e[o],t[o],n):e[o]=t[o]);return e},$u=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Mu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ju=e=>ku(e)?e.replace(/[&<>"'\/]/g,(e=>Mu[e])):e;const qu=[" ",",","?","!",";"],Fu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Gu=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const o=t.split(n);let r=e;for(let e=0;e-1&&se?.replace("_","-"),Hu={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Ku{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Hu,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,o){return o&&!this.debug?null:(ku(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ku(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ku(this.logger,e)}}var Vu=new Ku;class zu{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((([e,n])=>{for(let o=0;o{for(let r=0;r-1&&this.options.ns.splice(t,1)}getResource(e,t,n,o={}){const r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):ku(n)&&r?s.push(...n.split(r)):s.push(n)));const a=Du(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&ku(n)?Gu(this.data?.[e]?.[t],n,r):a}addResource(e,t,n,o,r={silent:!1}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),o=t,t=s[1]),this.addNamespaces(t),xu(this.data,s,o),r.silent||this.emit("added",e,t,n,o)}addResources(e,t,n,o={silent:!1}){for(const o in n)(ku(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});o.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,o,r,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),o=n,n=t,t=s[1]),this.addNamespaces(t);let a=Du(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?Cu(a,n,r):a={...a,...n},xu(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var Wu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,o,r){return e.forEach((e=>{t=this.processors[e]?.process(t,n,o,r)??t})),t}};const Zu={},Yu=e=>!ku(e)&&"boolean"!==typeof e&&"number"!==typeof e;class Qu extends zu{constructor(e,t={}){super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Vu.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const o=this.resolve(e,n);return void 0!==o?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";const o=qu.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===o.length)return!0;const r=Fu.getRegExp(`(${o.map((e=>"?"===e?"\\?":e)).join("|")})`);let i=!r.test(e);if(!i){const t=e.indexOf(n);t>0&&!r.test(e.substring(0,t))&&(i=!0)}return i})(e,n,o);if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:ku(r)?[r]:r};const i=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(i[0])>-1)&&(r=i.shift()),e=i.join(o)}return{key:e,namespaces:ku(r)?[r]:r}}translate(e,t,n){let o="object"===typeof t?{...t}:t;if("object"!==typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"===typeof options&&(o={...o}),o||(o={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],o),l=a[a.length-1];let c=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=o.lng||this.language,d=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?r?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:`${l}${c}${s}`:r?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:s;const h=this.resolve(e,o);let p=h?.res;const g=h?.usedKey||s,f=h?.exactUsedKey||s,m=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!ku(o.count),b=Qu.hasDefaultValue(o),w=v?this.pluralResolver.getSuffix(u,o.count,o):"",E=o.ordinal&&v?this.pluralResolver.getSuffix(u,o.count,{ordinal:!1}):"",S=v&&!o.ordinal&&0===o.count,T=S&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${w}`]||o[`defaultValue${E}`]||o.defaultValue;let N=p;y&&!p&&b&&(N=T);const A=Yu(N),O=Object.prototype.toString.apply(N);if(!(y&&N&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(O)<0)||ku(m)&&Array.isArray(N))if(y&&ku(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,o,n));else{let t=!1,r=!1;!this.isValidLookup(p)&&b&&(t=!0,p=T),this.isValidLookup(p)||(r=!0,p=s);const a=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:p,d=b&&T!==p&&this.options.updateMissing;if(r||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,s,d?T:p),i){const e=this.resolve(s,{...o,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n{const r=b&&n!==p?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,d,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,d,o),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach((e=>{const t=this.pluralResolver.getSuffixes(e,o);S&&o[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach((t=>{n([e],s+t,o[`defaultValue${t}`]||T)}))})):n(e,s,T))}p=this.extendTranslation(p,e,o,h,n),r&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${l}${c}${s}`),(r||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?p:void 0,o))}else{if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,N,{...o,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return r?(h.res=e,h.usedParams=this.getUsedParamsDetails(o),h):e}if(i){const e=Array.isArray(N),t=e?[]:{},n=e?f:g;for(const e in N)if(Object.prototype.hasOwnProperty.call(N,e)){const r=`${n}${i}${e}`;t[e]=b&&!p?this.translate(r,{...o,defaultValue:Yu(T)?T[e]:void 0,joinArrays:!1,ns:a}):this.translate(r,{...o,joinArrays:!1,ns:a}),t[e]===r&&(t[e]=N[e])}p=t}}return r?(h.res=p,h.usedParams=this.getUsedParamsDetails(o),h):p}extendTranslation(e,t,n,o,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=ku(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let a=n.replace&&!ku(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||o.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,((...e)=>r?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null)),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=ku(i)?[i]:i;return null!=e&&s?.length&&!1!==n.applyPostProcessor&&(e=Wu.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,o,r,i,s;return ku(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;o=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!ku(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(ku(t.context)||"number"===typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach((e=>{this.isValidLookup(n)||(s=e,Zu[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(s)||(Zu[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((o=>{if(this.isValidLookup(n))return;i=o;const s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,o,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(o,t.count,t));const n=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(s.push(l+e),t.ordinal&&0===e.indexOf(r)&&s.push(l+e.replace(r,this.options.pluralSeparator)),d&&s.push(l+n)),h){const o=`${l}${this.options.contextSeparator}${t.context}`;s.push(o),u&&(s.push(o+e),t.ordinal&&0===e.indexOf(r)&&s.push(o+e.replace(r,this.options.pluralSeparator)),d&&s.push(o+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(r=a,n=this.getResource(o,e,a,t))})))}))})),{res:n,usedKey:o,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!ku(e.replace);let o=n?e.replace:e;if(n&&"undefined"!==typeof e.count&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const e of t)delete o[e]}return o}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class Xu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Vu.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Bu(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Bu(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(ku(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find((e=>e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:e.indexOf("-")>0&&o.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),ku(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],r=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return ku(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):ku(e)&&r(this.formatLanguageCode(e)),n.forEach((e=>{o.indexOf(e)<0&&r(this.formatLanguageCode(e))})),o}}const ed={zero:0,one:1,two:2,few:3,many:4,other:5},td={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class nd{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Vu.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Bu("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:o});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let i;try{i=new Intl.PluralRules(n,{type:o})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),td;if(!e.match(/-|_/))return td;const o=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(o,t)}return this.pluralRulesCache[r]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>ed[e]-ed[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t,n={}){const o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const od=(e,t,n,o=".",r=!0)=>{let i=((e,t,n)=>{const o=Du(e,n);return void 0!==o?o:Du(t,n)})(e,t,n);return!i&&r&&ku(n)&&(i=Gu(e,n,o),void 0===i&&(i=Gu(t,n,o))),i},rd=e=>e.replace(/\$/g,"$$$$");class id{constructor(e={}){this.logger=Vu.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:o,prefix:r,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:ju,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==o&&o,this.prefix=r?$u(r):i||"{{",this.suffix=s?$u(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?$u(d):h||$u("$t("),this.nestingSuffix=p?$u(p):g||$u(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,o){let r,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const r=od(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,n,{...o,...t,interpolationkey:e}):r}const r=e.split(this.formatSeparator),i=r.shift().trim(),s=r.join(this.formatSeparator).trim();return this.format(od(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...o,...t,interpolationkey:i})};this.resetRegExp();const c=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==o?.interpolation?.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>rd(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?rd(this.escape(e)):rd(e)}].forEach((t=>{for(s=0;r=t.regex.exec(e);){const n=r[1].trim();if(i=l(n),void 0===i)if("function"===typeof c){const t=c(e,r,o);i=ku(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))i="";else{if(u){i=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else ku(i)||this.useRawValueToEscape||(i=Ru(i));const a=t.safeValue(i);if(e=e.replace(r[0],a),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}})),e}nest(e,t,n={}){let o,r,i;const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const o=e.split(new RegExp(`${n}[ ]*{`));let r=`{${o[1]}`;e=o[0],r=this.interpolate(r,i);const s=r.match(/'/g),a=r.match(/"/g);((s?.length??0)%2===0&&!a||a.length%2!==0)&&(r=r.replace(/'/g,'"'));try{i=JSON.parse(r),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${r}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let a=[];i={...n},i=i.replace&&!ku(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){const e=o[1].split(this.formatSeparator).map((e=>e.trim()));o[1]=e.shift(),a=e,l=!0}if(r=t(s.call(this,o[1].trim(),i),i),r&&o[0]===e&&!ku(r))return r;ku(r)||(r=Ru(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),l&&(r=a.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()})),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const sd=e=>{const t={};return(n,o,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const s=o+JSON.stringify(i);let a=t[s];return a||(a=e(Bu(o),r),t[s]=a),a(n)}},ad=e=>(t,n,o)=>e(Bu(n),o)(t);class ld{constructor(e={}){this.logger=Vu.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sd:ad;this.formats={number:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:n(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:n(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:n(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:n(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sd(t)}format(e,t,n,o={}){const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find((e=>e.indexOf(")")>-1))){const e=r.findIndex((e=>e.indexOf(")")>-1));r[0]=[r[0],...r.splice(1,e)].join(this.formatSeparator)}const i=r.reduce(((e,t)=>{const{formatName:r,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const r=o[1].substring(0,o[1].length-1);"currency"===t&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):"relativetime"===t&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach((e=>{if(e){const[t,...o]=e.split(":"),r=o.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=r),"false"===r&&(n[i]=!1),"true"===r&&(n[i]=!0),isNaN(r)||(n[i]=parseInt(r,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[r]){let t=e;try{const s=o?.formatParams?.[o.interpolationkey]||{},a=s.locale||s.lng||o.locale||o.lng||n;t=this.formats[r](e,a,{...i,...o,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e}),e);return i}}class cd extends zu{constructor(e,t,n,o={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=Vu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,o.backend,o)}queueLoad(e,t,n,o){const r={},i={},s={},a={};return e.forEach((e=>{let o=!0;t.forEach((t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,o=!1,void 0===i[s]&&(i[s]=!0),void 0===r[s]&&(r[s]=!0),void 0===a[t]&&(a[t]=!0)))})),o||(s[e]=!0)})),(Object.keys(r).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const o=e.split("|"),r=o[0],i=o[1];t&&this.emit("failedLoading",r,i,t),!t&&n&&this.store.addResourceBundle(r,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:o,k:r}=Uu(e,t,Object);o[r]=o[r]||[],o[r].push(n)})(n.loaded,[r],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n,o=0,r=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:r,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&o{this.read.call(this,e,t,n,o+1,2*r,i)}),r):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"===typeof n.then?n.then((e=>s(null,e))).catch(s):s(null,n)}catch(e){s(e)}}prepareLoading(e,t,n={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();ku(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ku(t)&&(t=[t]);const r=this.queueLoad(e,t,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${t}loading namespace ${r} for language ${o} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${r} for language ${o}`,i),this.loaded(e,n,i)}))}saveMissing(e,t,n,o,r,i={},s=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(void 0!==n&&null!==n&&""!==n){if(this.backend?.create){const a={...i,isUpdate:r},l=this.backend.create.bind(this.backend);if(l.length<6)try{let r;r=5===l.length?l(e,t,n,o,a):l(e,t,n,o),r&&"function"===typeof r.then?r.then((e=>s(null,e))).catch(s):s(null,r)}catch(e){s(e)}else l(e,t,n,o,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const ud=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"===typeof e[1]&&(t=e[1]),ku(e[1])&&(t.defaultValue=e[1]),ku(e[2])&&(t.tDescription=e[2]),"object"===typeof e[2]||"object"===typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),dd=e=>(ku(e.ns)&&(e.ns=[e.ns]),ku(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ku(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"===typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),hd=()=>{};class pd extends zu{constructor(e={},t){var n;if(super(),this.options=dd(e),this.services={},this.logger=Vu,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"===typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(e={},t){this.isInitializing=!0,"function"===typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(ku(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ud();this.options={...n,...this.options,...dd(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const o=e=>e?"function"===typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Vu.init(o(this.modules.logger),this.options):Vu.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ld;const t=new Xu(this.options);this.store=new Ju(this.options.resources,this.options);const r=this.services;r.logger=Vu,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new nd(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(r.formatter=o(e),r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new id(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new cd(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new Qu(this.services,this.options),this.translator.on("*",((e,...t)=>{this.emit(e,...t)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,t||(t=hd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=(...t)=>this.store[e](...t)}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=(...t)=>(this.store[e](...t),this)}));const r=Lu(),i=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),r}loadResources(e,t=hd){let n=t;const o=ku(e)?e:this.language;if("function"===typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===o?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(o)t(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>t(e)))}this.options.preload?.forEach?.((e=>t(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)}))}else n(null)}reloadResources(e,t,n){const o=Lu();return"function"===typeof e&&(n=e,e=void 0),"function"===typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=hd),this.services.backendConnector.reload(e,t,(e=>{o.resolve(),n(e)})),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Wu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Lu();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,i)=>{i?this.isLanguageChangingTo===e&&(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve(((...e)=>this.t(...e))),t&&t(r,((...e)=>this.t(...e)))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=ku(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(ku(t)?[t]:t);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,(e=>{r(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const o=(e,t,...r)=>{let i;i="object"!==typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(r)):{...t},i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const s=this.options.keySeparator||".";let a;return a=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${s}${e}`)):i.keyPrefix?`${i.keyPrefix}${s}${e}`:e,this.t(a,i)};return ku(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||o&&!i(r,e)))}loadNamespaces(e,t){const n=Lu();return this.options.ns?(ku(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Lu();ku(e)&&(e=[e]);const o=this.options.preload||[],r=e.filter((e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return r.length?(this.options.preload=o.concat(r),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new Xu(ud());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new pd(e,t)}cloneInstance(e={},t=hd){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},r=new pd(o);void 0===e.debug&&void 0===e.prefix||(r.logger=r.logger.clone(e));if(["store","services","language"].forEach((e=>{r[e]=this[e]})),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce(((n,o)=>(n[o]={...e[t][o]},n)),e[t]),e)),{});r.store=new Ju(e,o),r.services.resourceStore=r.store}return r.translator=new Qu(r.services,o),r.translator.on("*",((e,...t)=>{r.emit(e,...t)})),r.init(o,t),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const gd=pd.createInstance();gd.createInstance=pd.createInstance;gd.createInstance,gd.dir,gd.init,gd.loadResources,gd.reloadResources,gd.use,gd.changeLanguage,gd.getFixedT,gd.t,gd.exists,gd.setDefaultNamespace,gd.hasLoadedNamespace,gd.loadNamespaces,gd.loadLanguages;class fd{constructor(e,t={},n={}){this.init(e,t)}init(e,t){const n=(()=>{const e=ot(),t=vr[e],n=t?t.map((e=>e.value)):[];return{defaultLanguage:wr,cacheKey:"i18nextLng",supportLangs:n}})();this.options={...n,...t}}detect(){if("undefined"===typeof window)return this.options.defaultLanguage;const{cacheKey:e,supportLangs:t=[],defaultLanguage:n}=this.options,{searchParams:o}=new URL(window.location.href),r=o.get("lang")||Vo.get(e)||navigator.language,i=t.indexOf(r)>-1?r:n;var s;["announcements","learn","blog"].some((e=>window.location.hostname.includes(e)))||(null===(s=document.querySelector("html"))||void 0===s||s.setAttribute("lang",i));return Vo.set(e,i),i}}fd.type="languageDetector",fd.prototype.cacheUserLanguage=()=>{};const md=fd,yd={projectId:"",loadPath:"/locales/{{lng}}/{{ns}}.json",version:"latest",requestOptions:{}};class vd{constructor(e,t={},n={}){this.init(e,t)}init(e,t){this.services=e,this.options={...yd,...t},this.fetch=t.fetch}getResourceUrl(e,t,n){return this.services.interpolator.interpolate(n,{lng:e,ns:t,projectId:this.options.projectId})}read(e,t,n){const o=this.getResourceUrl(e,t,this.options.loadPath);this.fetch(o,this.options.requestOptions).then((e=>{n(null,e)})).catch((r=>{if(console.error(`Load ${o} resource failed!`,r),"TypeError: Failed to fetch"===r.toString())if(this.options.fallbackPath||o.startsWith("/common-static/fhs")){const r=this.options.fallbackPath?this.getResourceUrl(e,t,this.options.fallbackPath):o.replace("/common-static/fhs","/fht-frontend/common-static/frontend-web");this.fetch(r,this.options.requestOptions).then((e=>{n(null,e)})).catch((e=>{console.error(`Load fallback ${r} resource failed!`,e),n(null,{})}))}else n(null,{});else n(null,{})}))}}vd.type="backend";const bd=vd,wd=kt?"https://fh-static.bycsi.com":"/common-static/fhs";const Ed=function(){let e;return _e&&(e="/test-{{lng}}.json?v=1"),Re&&(e="/testnet-{{lng}}.json?v=1"),Ie&&(e="/{{lng}}.json?v=1"),`${wd}/i18n-upload/low-cache/project/release/{{ns}}${e}`}(),Sd=k({});Sd.interceptors.response.push((e=>Promise.resolve(e.data)));const Td=vr[it].map((e=>e.value)),Nd=({projectId:e,ns:t,defaultNS:n,defaultLang:o,keySeparator:r=!1,injectUsePlugins:i=[]})=>(gd.isInitialized||(gd.use(bd).use(md),i.length&&i.forEach((e=>{gd.use(e)})),gd.init({detection:{cacheKey:bo,supportLangs:Td},backend:{loadPath:Ed,projectId:e,fetch:Sd},fallbackLng:!1,load:"currentOnly",ns:t,defaultNS:n,keySeparator:r,interpolation:{escapeValue:!1}})),gd);let Ad;const Od=async(e=30)=>new Promise((t=>{window.sensorsDataAnalytic201505&&t(window.sensorsDataAnalytic201505),setTimeout((()=>{e>0?Od(e-1).then(t):t(null)}),100)})),kd=async()=>Ad||(Ad=await Od(),Ad||{}),Ld=(e,t)=>{kd().then((n=>{var o;null===n||void 0===n||null===(o=n.track)||void 0===o||o.call(n,e,t||{})}))},Rd=(e,t)=>{kd().then((n=>{var o;null===n||void 0===n||null===(o=n.click)||void 0===o||o.call(n,{page_name:e,...t||{}})}))},Id=(e,t)=>{kd().then((n=>{var o;null===n||void 0===n||null===(o=n.exposure)||void 0===o||o.call(n,{page_name:e,...t||{}})}))},_d=(e={})=>kd().then((()=>{var t,n,o,r;return((null===(t=window)||void 0===t||null===(n=t.sensors)||void 0===n?void 0:n.fastFetchABTest)||(null===(o=window)||void 0===o||null===(r=o.skynet)||void 0===r?void 0:r.fastFetchABTest))(e)})),Pd=(...e)=>{kd().then((t=>{var n;null===t||void 0===t||null===(n=t.login)||void 0===n||n.call(t,...e)}))},Ud=e=>{const{host:t}=window.location,n=-1!==t.indexOf("localhost")?"localhost":t.replace(/^www|m|testnet/,"");Ho(en,e,n,"/",10080)},{getTraceparent:xd,getHeaders:Dd,successHooks:Cd,errorHooks:$d}=(null===Oo||void 0===Oo?void 0:Oo.request)||{},Md=({startTime:e,retCode:t,status:n,retMsg:o,reqUrl:r,c:i,t:s,m:a,p:l,ext:c})=>{const u={m:a,c:i,t:s||No.AJAX,d:performance.now()-e,p:l?`pc-uniframe-${l}`:"pc-uniframe",r:2===r.split(ln).length?r.split(ln)[1]:r,rt:window?window.location.href:"",ext:{code:t,hc:n,msg:o,env:Fe,href:window?window.location.href:"",...c}};Uo(u)},jd=new Gn({credentials:"include",headers:(()=>{const e=St("pc"),t=Tt(),n={Accept:"application/json","Content-Type":"application/json",platform:"pc"};return t&&(e&&(n.platform=e),t&&(n["X-User-Agent"]=t)),n})(),async errorHandler(e){var t,n,o,r,i,s,a,l;const c=null===(t=e.request.options.context)||void 0===t?void 0:t.from,u=null===(n=e.response)||void 0===n||null===(o=n.clone)||void 0===o?void 0:o.call(n),d=await(null===u||void 0===u?void 0:u.json()),h=null!==(r=null===d||void 0===d?void 0:d.ret_code)&&void 0!==r?r:null===d||void 0===d?void 0:d.retCode;var p,g;[10007,33003,10009].includes(h)||Md({startTime:Date.now(),c:87001,t:No.REQUEST_ERROR,m:null===e||void 0===e?void 0:e.message,reqUrl:null===e||void 0===e||null===(p=e.request)||void 0===p?void 0:p.url,status:null===e||void 0===e||null===(g=e.response)||void 0===g?void 0:g.status,ext:{from:c}});const f=(null===e||void 0===e||null===(i=e.request)||void 0===i?void 0:i.options)||{},m=Date.now();return null===$d||void 0===$d||$d({type:1,traceparent:null===f||void 0===f?void 0:f._trace,url:null===e||void 0===e||null===(s=e.request)||void 0===s?void 0:s.url,fetchError:{err:e,input:null===e||void 0===e||null===(a=e.request)||void 0===a?void 0:a.url,init:f},startTime:f._startTime,endTime:m,code:h,status:null===e||void 0===e||null===(l=e.response)||void 0===l?void 0:l.status}),Promise.reject(e)}});jd.addInstanceRequestInterceptors([(e,t)=>{var n,o;t._startTime=null===Date||void 0===Date?void 0:Date.now();const r=null===e||void 0===e?void 0:e.split("?"),i=null===r||void 0===r?void 0:r[1];if(mt()){const e=Ko(en);e&&(t.headers.UserToken=e)}const s=null===xd||void 0===xd?void 0:xd(e),a=(null===Dd||void 0===Dd?void 0:Dd(e,s))||{};return t.headers={...(null===t||void 0===t?void 0:t.headers)||{},...a},t._trace=s,Md({startTime:t._startTime,t:No.AJAX_REQUEST,m:null!==i&&void 0!==i?i:t.body,reqUrl:e,c:null===(n=t.event)||void 0===n?void 0:n.c,p:null===(o=t.event)||void 0===o?void 0:o.p}),{url:e,options:t}}]),jd.addInstanceResponseInterceptors([async(e,t,n)=>{try{var o;const l=e.clone(),c=await l.json(),{url:u}=e;var r;if(-1!==u.indexOf("/private/user/profile"))window.GA_UID=null===c||void 0===c||null===(r=c.result)||void 0===r?void 0:r.id;if(!c){var i;const o=null===n||void 0===n||null===(i=n.createResponseError)||void 0===i?void 0:i.call(n,"Non Response!",void 0);return null===$d||void 0===$d||$d({type:1,traceparent:null===t||void 0===t?void 0:t._trace,url:null===e||void 0===e?void 0:e.url,fetchError:{err:o,input:null===e||void 0===e?void 0:e.url,init:t},startTime:t._startTime,endTime:g,code:(null===c||void 0===c?void 0:c.ret_code)||(null===c||void 0===c?void 0:c.retCode),status:null===e||void 0===e?void 0:e.status,msg:null===o||void 0===o?void 0:o.message,message:null===o||void 0===o?void 0:o.message}),Promise.reject(n.createResponseError("Non Response!",void 0))}if(mt()){const e=null===c||void 0===c?void 0:c.token;"undefined"!==typeof e&&null!==e&&Ud(e)}const d=null!==(o=null===c||void 0===c?void 0:c.ret_code)&&void 0!==o?o:null===c||void 0===c?void 0:c.retCode,h=null===c||void 0===c?void 0:c.ret_msg,{event:p={}}=t;Md({startTime:t._startTime,retCode:d,retMsg:h,status:l.status,reqUrl:e.url,c:p.c,m:p.scSave?JSON.stringify(null===c||void 0===c?void 0:c.result):"",p:p.p,t:No.AJAX});const g=Date.now();if(null===Cd||void 0===Cd||Cd({type:1,traceparent:t._trace,url:null===e||void 0===e?void 0:e.url,fetchResponse:{res:e,input:null===e||void 0===e?void 0:e.url,init:t},startTime:t._startTime,endTime:g}),0===d)return e;var s,a;return[10007,33003,10009].includes(d)?(mt()&&Ud(""),null!==e&&void 0!==e&&null!==(s=e.url)&&void 0!==s&&null!==(a=s.includes)&&void 0!==a&&a.call(s,"/v2/private/user/profile")||n.clearOneCache(),Promise.reject(n.createResponseError("user no permission",c))):Promise.reject(n.createResponseError("bad business ret_code",c))}catch(e){return Promise.reject(e)}}]);const qd=["get","post","patch","put","delete"];window.dataLayer=window.dataLayer||[];const Fd=(e,t,n)=>{window.dataLayer.push({event:"GAEvent",eventAction:e,eventCategory:t,eventLabel:n})},Gd=()=>{document.addEventListener("click",(function(e){const{buried:t}=e.target.dataset;if(!t)return;const n=t.split(",");Fd(...n)}),!0)},Bd=new Gn({credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json",platform:"pc"}});const Hd=new class{max_cache_size=4718592;constructor(){this.timer={}}isOverflowSize(){try{let t=0;for(let n=0;nthis.max_cache_size}catch(e){return!1}}get=(e,t=!1)=>{if(window.localStorage)try{const n=localStorage.getItem(e)||"{}",{expireAt:o,deleteAt:r,data:i}=JSON.parse(n);if(!i)return null;const s=Date.now();return t&&s<=r||!t&&s<=o?i:(s>r&&this.delete(e),null)}catch(e){return null}return null};set(e,t,n=6e4){try{if(this.isOverflowSize()||!window.localStorage)return;const o=Date.now();localStorage.setItem(e,JSON.stringify({expireAt:o+n,deleteAt:o+36e5,data:t}))}catch(e){}}delete=e=>{try{window.localStorage&&localStorage.removeItem(e)}catch(e){}}};class Kd{_defaultOptions={useCache:!0};_defaultTtl=6e4;_configUrl=`${ln}/v3/config/web`;_bannerUrl=`${ln}/v3/config/banner`;constructor(e){null!==e&&void 0!==e&&e.ttl&&(this._defaultTtl=null===e||void 0===e?void 0:e.ttl)}genBannerUrl(e){return`dpsdk_banner_${JSON.stringify(e)}`}getConfigUrl(e){return`dpsdk_config_${JSON.stringify(e)}`}validateStatus(e){return e>=500&&e<600}async fetchBanner(e){if(!e||!e.data)return Promise.reject("deadpool banner api,data 参数缺失!");const{data:t,ttl:n}=e,o=n||this._defaultTtl,r=this.genBannerUrl(e.data);try{if(Hd.get(r))return Hd.get(r);const e=await Bd.post(this._bannerUrl,{...this._defaultOptions,ttl:o,data:t});return 10006===e.data.ret_code&&Hd.get(r,!0)?Hd.get(r,!0):(0===e.data.ret_code&&Hd.set(r,{data:e.data},o),e)}catch(e){var i;if(e&&null!==e&&void 0!==e&&e.response&&this.validateStatus(null===e||void 0===e||null===(i=e.response)||void 0===i?void 0:i.status)){var s;const t=null===(s=e.response)||void 0===s?void 0:s.status;if(t&&t>=500&&t<600){return Hd.get(r,!0)}}return Promise.reject(e)}}async fetchConfig(e){if(!e||!e.data)return Promise.reject("deadpool config api,data 参数缺失!");const{data:t,ttl:n}=e,o=this.getConfigUrl(e.data),r=n||this._defaultTtl;try{var i,s;if(Hd.get(o))return Hd.get(o);const e=await Bd.post(this._configUrl,{...this._defaultOptions,ttl:this._defaultTtl,data:t});if(10006===(null===e||void 0===e||null===(i=e.data)||void 0===i?void 0:i.ret_code)&&Hd.get(o,!0))return Hd.get(o,!0);var a,l,c;if(0===(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.ret_code))e.data.countryCode=null===e||void 0===e||null===(a=e.response)||void 0===a||null===(l=a.headers)||void 0===l||null===(c=l.get)||void 0===c?void 0:c.call(l,"X-Country-Code"),Hd.set(o,{data:e.data},r);return e}catch(e){var u;if(e&&null!==e&&void 0!==e&&e.response&&this.validateStatus(null===e||void 0===e||null===(u=e.response)||void 0===u?void 0:u.status)){var d;const t=null===(d=e.response)||void 0===d?void 0:d.status;if(t&&t>=500&&t<600){return Hd.get(o,!0)}}return Promise.reject(e)}}async apiWithStorageWrappered(e){let t=null;const{payload:n,requestFn:o,storageKey:r,ttl:i}=e||{};if(!o||!r)return Promise.reject("wrapper storage 调用参数异常,缺少 requestFn、storageKey,请检查!");if(Hd.get(r))return Hd.get(r);try{const e=i||this._defaultTtl,s=await o({payload:n,storageKey:r});if(t=s,0===t.ret_code&&Hd.set(r,s,e),10006===t.ret_code&&Hd.get(r,!0)){return Hd.get(r,!0)}return t}catch(e){var s;if(e&&null!==e&&void 0!==e&&e.response&&this.validateStatus(null===e||void 0===e||null===(s=e.response)||void 0===s?void 0:s.status)){return Hd.get(r,!0)}return Promise.reject(e)}}}const Vd="data-theme",zd="data-site";let Jd=!1;const Wd={usa:/(^|\.)abfinance\.com$/i,tha:/(^|\.)waanx\.com$/i,jpn:/(^|\.)moneypartners\.co\.jp$/i};function Zd(e){return["global","usa","tha","jpn"].includes(e)}function Yd(e){return null!==e&&void 0!==e&&["light","dark"].includes(e)}function Qd(e){for(const n in Wd){var t;if(null!==(t=Wd[n])&&void 0!==t&&t.test(e))return n}return""}function Xd(e){var t;if(null!==e&&void 0!==e&&e.site&&Zd(null===e||void 0===e||null===(t=e.site)||void 0===t?void 0:t.toLowerCase()))return e.site;if("undefined"!==typeof location){const e=new URLSearchParams(location.search).get("site");if(e&&Zd(e))return e}else if(null!==e&&void 0!==e&&e.pageUrl)try{const t=new URL(e.pageUrl).searchParams.get("site");if(t&&Zd(t))return t}catch(e){console.error("detectSite error",e)}if("undefined"!==typeof document){const e=document.documentElement.getAttribute("data-site");if(e&&Zd(e))return e}if("undefined"!==typeof location){const e=location.hostname;if(Zd(Qd(e)))return Qd(e)}else if(null!==e&&void 0!==e&&e.pageUrl)try{const t=new URL(e.pageUrl).hostname;if(Zd(Qd(t)))return Qd(t)}catch(e){console.error("detectSite hostname error",e)}return"global"}function eh(e){if(null!==e&&void 0!==e&&e.theme&&Yd(e.theme))return e.theme;if("undefined"!==typeof location){const e=new URLSearchParams(location.search).get("theme");if(Yd(e))return e}else if(null!==e&&void 0!==e&&e.pageUrl)try{const t=new URL(e.pageUrl).searchParams.get("theme");if(Yd(t))return t}catch(e){console.error("detectTheme error",e)}if("undefined"!==typeof document){const e=document.documentElement.getAttribute(Vd);if(Yd(e))return e}return"light"}function th(e){"undefined"!==typeof document&&(Zd(e)?(document.documentElement.removeAttribute(zd),document.documentElement.setAttribute(zd,e),"undefined"!==typeof localStorage&&localStorage.setItem(Wo,e)):console.error("setSite error, not allowed site",e))}function nh(){if("undefined"===typeof location)return!1;const e=new URLSearchParams(location.search).get("theme");return null!==e&&Yd(e)}function oh(e){"undefined"!==typeof document&&(e&&Yd(e)?(document.documentElement.removeAttribute(Vd),document.documentElement.setAttribute(Vd,e)):console.error("setTheme error, not allowed theme",e))}function rh(e){"undefined"!==typeof document&&(nh()?console.warn("Theme is locked by URL parameter, cannot change theme"):oh(e))}function ih(){if("undefined"===typeof document)return;if(nh())return void console.warn("Theme is locked by URL parameter, cannot toggle theme");rh("light"===(document.documentElement.getAttribute(Vd)||"light")?"dark":"light")}function sh(e){"undefined"!==typeof window?function(e){var t;if("undefined"===typeof document)return;Jd=null!==(t=null===e||void 0===e?void 0:e.enableThemeSwitch)&&void 0!==t&&t;const n=Xd(e),o=eh(e);th(n),oh(o)}(e):e&&function(e){if("undefined"!==typeof document){var t;Jd=null!==(t=null===e||void 0===e?void 0:e.enableThemeSwitch)&&void 0!==t&&t;const n=Xd(e),o=eh(e);document.documentElement.setAttribute(zd,n),document.documentElement.setAttribute(Vd,o)}}(e)}function ah(e){var t;if("undefined"===typeof document)return;Jd=null!==(t=null===e||void 0===e?void 0:e.enableThemeSwitch)&&void 0!==t&&t;const n=Xd(e),o=eh(e);th(n),oh(o)}function lh(){if("undefined"===typeof document)return"global";const e=document.documentElement.getAttribute(zd);return e&&Zd(e)?e:"global"}function ch(){if("undefined"===typeof document)return"light";const e=document.documentElement.getAttribute(Vd);return Yd(e)?e:"light"}const uh=JSON.parse('{"en":{"EU":"en-EU","TUR":"en-TR","KAZ":"en-KAZ","GEO":"en-GEO","HKG":"en-HK","ARE":"en-ARE","IDN":"en-IDN","USA":"en-USA"},"en-US":{"GLOBAL":"en","EU":"en-EU","TUR":"en-TR","KAZ":"en-KAZ","GEO":"en-GEO","HKG":"en-HK","ARE":"en-ARE","IDN":"en-IDN","USA":"en-USA"},"en-GB":{"GLOBAL":"en","EU":"en-EU"},"es-ES":{"EU":"es-EU"},"es":{"GLOBAL":"es-ES","EU":"es-EU"},"es-MX":{},"es-AR":{},"pt-BR":{},"pt-PT":{"EU":"pt-EU"},"vi":{"GLOBAL":"vi-VN"},"vi-VN":{},"ja":{"GLOBAL":"ja-JP"},"ja-JP":{},"id":{"GLOBAL":"id-ID","IDN":"id-IDN"},"id-ID":{"IDN":"id-IDN"},"uk":{"GLOBAL":"uk-UA"},"uk-UA":{},"ru":{"GLOBAL":"ru-RU","KAZ":"ru-KAZ","GEO":"ru-GEO"},"ru-RU":{"KAZ":"ru-KAZ","GEO":"ru-GEO"},"ar":{"GLOBAL":"ar-SA","ARE":"ar-ARE"},"ar-SA":{},"kk":{"GLOBAL":"kk-KZ","KAZ":"kk-KAZ"},"kk-KZ":{"GLOBAL":"kk-KZ","KAZ":"kk-KAZ"},"zh-TW":{"HKG":"zh-HK"},"zh-CN":{"GLOBAL":"zh-MY"},"zh-HK":{"GLOBAL":"zh-TW"},"it":{"EU":"it-EU"},"it-IT":{"EU":"it-EU"},"nl":{"EU":"nl-EU"},"nl-NL":{"EU":"nl-EU"},"ro":{"EU":"ro-EU"},"ro-RO":{"EU":"ro-EU"},"cs":{"EU":"cs-EU"},"cs-CZ":{"EU":"cs-EU"},"el":{"EU":"el-EU"},"el-GR":{"EU":"el-EU"},"fr":{"GLOBAL":"fr-FR","EU":"fr-EU"},"fr-FR":{"GLOBAL":"fr-FR","EU":"fr-EU"},"lt":{"EU":"lt-EU"},"lt-LT":{"EU":"lt-EU"},"hu":{"EU":"hu-EU"},"hu-HU":{"EU":"hu-EU"},"de":{"EU":"de-EU"},"de-DE":{"EU":"de-EU"},"da":{"EU":"da-EU"},"da-DK":{"EU":"da-EU"},"no":{"EU":"no-EU"},"no-NO":{"EU":"no-EU"},"pl":{"EU":"pl-EU"},"pl-PL":{"EU":"pl-EU"},"pt":{"EU":"pt-EU"},"tr":{"TUR":"tr-TUR"},"tr-TR":{"TUR":"tr-TUR"},"ka":{"GEO":"ka-GEO"},"ka-GE":{"GEO":"ka-GEO"},"zh":{"HKG":"zh-HK"},"ar-AE":{"ARE":"ar-ARE"}}'),dh=new Set(or.map((e=>e.value)));function hh(e,t){var n,o,r;if(!e)throw new Error("[isValidLanguage]language param is required");if(!t)throw new Error("[isValidLanguage]siteId param is required");return Boolean(null!==(n=null===(o=vr[t])||void 0===o||null===(r=o.find)||void 0===r?void 0:r.call(o,(t=>t.value.toLowerCase()===e.toLowerCase())))&&void 0!==n&&n)}function ph(e){var t,n,o;const r=null===(t=new URL(e||window.location.href).pathname.split("/"))||void 0===t||null===(n=t.filter)||void 0===n||null===(o=n.call(t,Boolean))||void 0===o?void 0:o[0];if(r&&/^[a-z]{2,3}(-[a-z]{2,3}|-[A-Z]{2,3})?$/.test(r))return r}function gh(e,t){const n=uh[e],o=t===R,r=o?"GLOBAL":t;if(n&&o&&n.GBR)return n.GBR;const i=null===n||void 0===n?void 0:n[r];return!i||o&&dh.has(i)?void 0:i}function fh(e,t){if("undefined"===typeof window)return;const n=e=>"function"===typeof t?t(e,it):Array.isArray(t)?t.some((t=>t.toLowerCase()===e.toLowerCase())):hh(e,it);if(mt()){const e=Ar(),o=window.localStorage.getItem(bo);if(e&&n(e))return o&&o!==e&&Uo({t:"LANGUAGE_DETECT_APP_CONFLICT",ext:{appLanguage:e,localStorageLanguage:o,selected:"app",site:it,hasLanguageValidator:Boolean(t),languageValidatorType:Array.isArray(t)?"array":"function"===typeof t?"function":"default"}}),e}const o=window.localStorage.getItem(bo);if(o&&n(o))return o;const r=e||window.navigator.languages;if(Array.isArray(r)&&r.length>0)for(const e of r){const t=gh(e,it);if(t&&n(t))return t;if(n(e))return e}return function(e){var t,n;if(!e)throw new Error("[getSiteFallbackLanguage]siteId param is required");return null===(t=vr[e])||void 0===t||null===(n=t[0])||void 0===n?void 0:n.value}(it)}function mh(e,t,n,o){yh({url:e,languages:t,fallbackFunction:n,languageValidator:o,addReferrer:!1})}function yh(e){var t,n;if("undefined"===typeof window)return;const{url:o,languages:r,fallbackFunction:i,languageValidator:s,addReferrer:a=!1}=e||{},l=ph(o),c=!!l&&hh(l,it);if(c)return;const u=fh(r,s);if(Uo({t:"LANGUAGE_DETECT_REDIRECT",ext:{url:o,locationUrl:window.location.href,languages:r,navigatorLanguages:window.navigator.languages,site:it,siteLanguages:null===(t=vr[it])||void 0===t||null===(n=t.map)||void 0===n?void 0:n.call(t,(e=>e.value)),languageInUrl:c?l:void 0,languageDetected:u,languageDetectedValid:Boolean(u),addReferrer:a}}),!u){if(i)i();else{const e=new URL(window.location.href);e.pathname="/",window.location.replace(e.toString())}return}let d=function(e,t){if(!e)throw new Error("[addLanguageToUrl]url param is required");if(!t)throw new Error("[addLanguageToUrl]language param is required");const n=ph(e);if(n&&hh(n,it))return e.replace(`/${n}`,`/${t}`);const o=new URL(e);return o.pathname=`/${t}${o.pathname}`,o.toString()}(o||window.location.href,u);a&&document.referrer&&(d=function(e,t,n){if(!e||!t||!n)return e;try{const o=new URL(e);return o.searchParams.has(t)?o.searchParams.set(t,n):o.searchParams.append(t,n),o.toString()}catch(n){return Uo({t:"LANGUAGE_DETECT_ADD_QUERY_PARAM_ERROR",ext:{url:e,key:t,error:n instanceof Error?n.message:String(n)}}),e}}(d,"referrer",document.referrer)),window.location.replace(d)}})(),o})()));