function anonymous(exports,module ) { /*! For license information please see captcha.js.LICENSE.txt */ !function(e,t){if("object"===typeof exports&&"object"===typeof module)module.exports=t();else if("function"===typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"===typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={8757:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(2583);const i={h5_click_close:2,mask_click_close:4,back_close:5,app_close:6,feedback_close:7,override_close:998,verify_success_close:-1},o={refresh_frequency:0,verify_failure_frequency:0,submit_btn_frequency:0,rootDivLeft:0,rootDivTop:0,slide_btn_track:[],mouse_track:[],enter_slide_bar_msg:{},enter_verify_dialog_msg:{}},a=(0,r.kQ)()({state:o,reducers:{reset:()=>({...o}),update:(e,t)=>({...e,...t}),refreshIncrease:e=>({...e,refresh_frequency:e.refresh_frequency+1}),verifyFailureIncrease:e=>({...e,verify_failure_frequency:e.verify_failure_frequency+1}),clickSubmitIncrease:e=>({...e,submit_btn_frequency:e.submit_btn_frequency+1}),keepRootDivPos:(e,t)=>({...e,rootDivLeft:t.left,rootDivTop:t.top}),slideTrackIncrease:(e,t)=>({...e,slide_btn_track:[...e.slide_btn_track,{...t,y:Number(t.y.toFixed(3))}]}),setMouseTrack:(e,t)=>({...e,mouse_track:[...t]}),trackIncrease(e,t){const n=[...e.mouse_track];return n.length>=500&&n.shift(),n.push({...t,x:Number(t.x.toFixed(3)),y:Number(t.y.toFixed(3))}),{...e,mouse_track:n}},keepeEnterSlideBarMsg:(e,t)=>({...e,enter_slide_bar_msg:{...t}}),keepEnterVerifyDialogMsg:(e,t)=>({...e,enter_verify_dialog_msg:{...t}})}});t.A=a},7210:function(e,t,n){"use strict";n.d(t,{K1:function(){return y},Uh:function(){return _},F:function(){return S},o9:function(){return w},LW:function(){return E}});const r=new class{constructor(){this.bridgeScheme="bytedance://",this.dispatchMsgPath="dispatch_message/",this.callbackId=1e3,this.callbackMap={},this.eventHookMap={},this.sendMessageQueue=[]}_fetchQueue(){const e=JSON.stringify(this.sendMessageQueue);return this.sendMessageQueue=[],e}_dispatchUrlMsg(e){if("undefined"!==typeof document){const t=document.createElement("iframe");t.style.display="none",document.body.appendChild(t),t.src=e,setTimeout((()=>{document.body.removeChild(t)}),300)}}_handleMessageFromApp(e){const t=e.__params;let n={__err_code:"cb404"};const r=e.__callback_id;return"string"===typeof r&&"function"===typeof this.callbackMap[r]?(n=this.callbackMap[r](t),delete this.callbackMap[r]):"string"===typeof r&&Array.isArray(this.eventHookMap[r])&&this.eventHookMap[r].forEach((e=>{"function"===typeof e&&(n=e(t))})),JSON.stringify(n)}_call(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"call";if(!e||"string"!==typeof e)return;(arguments.length>4&&void 0!==arguments[4]?arguments[4]:0)?t=e:(this.callbackId+=1,t=this.callbackId.toString()),"function"===typeof r&&(this.callbackMap[t]=r);let a={JSSDK:i,func:e,params:n,__msg_type:o,__callback_id:t};try{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.callMethodParams&&"function"==typeof window.webkit.messageHandlers.callMethodParams.postMessage?window.webkit.messageHandlers.callMethodParams.postMessage(a):window.androidJsBridge&&"function"==typeof window.androidJsBridge.callMethodParams?window.androidJsBridge.callMethodParams(JSON.stringify(a)):(this.sendMessageQueue.push(a),this._dispatchUrlMsg(`${this.bridgeScheme}${this.dispatchMsgPath}`))}catch(s){console.error(s)}}_on(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;if(!e||"string"!==typeof e||"function"!==typeof t)return;this.eventHookMap[e]?this.eventHookMap[e].push(t):this.eventHookMap[e]=[t];const r={JSSDK:n,__msg_type:"on",__callback_id:e,func:e};try{window.androidJsBridge&&"function"==typeof window.androidJsBridge.onMethodParams?window.androidJsBridge.onMethodParams(JSON.stringify(r)):window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.callMethodParams&&"function"==typeof window.webkit.messageHandlers.callMethodParams.postMessage?window.webkit.messageHandlers.callMethodParams.postMessage(r):this._call(e,{},null,n,1,"on")}catch(i){console.error(i)}}_off(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;if(e&&"string"===typeof e&&"function"===typeof t&&this.eventHookMap[e]){if(this.eventHookMap[e]=this.eventHookMap[e].filter((e=>e!==t)),this.eventHookMap[e].length>0)return;const i={JSSDK:n,__msg_type:"off",func:e};try{window.androidJsBridge&&"function"==typeof window.androidJsBridge.offMethodParams?window.androidJsBridge.offMethodParams(JSON.stringify(i)):window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.callMethodParams&&"function"==typeof window.webkit.messageHandlers.callMethodParams.postMessage?window.webkit.messageHandlers.callMethodParams.postMessage(i):this._call(e,{},null,n,0,"off")}catch(r){console.error(r)}}}_trigger(e,t){const n=this.eventHookMap[e];let r=!1;if(n)for(let i=0,o=n.length;i{setTimeout((()=>r(new Error(`${t}: network timeout `))),e)}))}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;(0,c.Y)(`${e} request JSBRIDGE args ******:`,t);const o=new Promise(((n,i)=>{h.call(e,t,(t=>{(0,c.Y)(`${e} request JSBRIDGE result:`,t),r&&n(t),1===t.code?n(t.data):i(new Error(`jsb error, error code: ${t.code}`))}))}));return n||i?Promise.race([o,m(i||u.SQ,e)]):o}function y(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise(((n,r)=>{h.on(`${g}.${e}`,(r=>{(0,c.Y)(`listen${e} JSBRIDGE return result:`,r),t?n(r.data):n()}))}))}const b={w:0,h:0},_=f()((e=>{let t=300,n=304;if(e&&(t=Math.floor(e.w),n=Math.floor(e.h)),t!==b.w||n!==b.h)if(b.w=t,b.h=n,"1"===u.Z0){const e=window.devicePixelRatio||2;v(`${g}.dialogSize_V2`,{w:t*e,h:n*e})}else v(`${g}.dialogSize`,{w:t,h:n})}),200);async function w(e,t,n,r){const i={method:e,url:(0,d.aO)(a().defaults.baseURL,t),query:n};return"get"!==e&&(i.data=r),v(`${g}.network.request`,i,!1,!0).then((e=>{if(1!=e.code){const t=new Error(`jsb error, error code: ${e.code}`);throw t.code="JSBERROR",t}return(0,p.p0)(null===e||void 0===e?void 0:e.data,t)}))}async function E(e){return v(`${g}.h5_state_changed`,{challenge_id:e})}async function S(e){s.A.trackEvent({key:"SYSTEM_CLOSE",stage:"AFTER",is_success:1,duration:e.duration}),v(`${g}.verifyResult`,{type:2,result:e.verifyResultType,mode:e.challenge_mode}),v(`${g}.pageEnd`,{log:{data:window.captchaFailEvents||[]}})}},1797:function(e,t,n){"use strict";n.d(t,{Ds:function(){return O},tO:function(){return T},W2:function(){return S},ib:function(){return x},M8:function(){return k}});const r=["click","dblclick","mousedown","mousemove","mouseup"],i={mousemove:1,click:2,dblclick:3,mouseup:4,mousedown:5},o=["keyup","keydown"],a={keyup:1,keydown:2,keypress:3},s=["touchstart","touchend","touchmove","touchcancel"],c={touchstart:1,touchend:2,touchmove:3,touchcancel:4};let u=function(e){return e[e.Unknown=0]="Unknown",e[e.MobileWithConsent=257]="MobileWithConsent",e[e.MobileWithoutConsent=258]="MobileWithoutConsent",e[e.WebLoggedIn=513]="WebLoggedIn",e[e.WebUSNotLoggedIn=514]="WebUSNotLoggedIn",e[e.WebUSNotLoggedInHighRisk=515]="WebUSNotLoggedInHighRisk",e[e.WebNonUSNotLoggedIn=516]="WebNonUSNotLoggedIn",e[e.WebUnder13=517]="WebUnder13",e[e.WebEUNotLoggedIn=518]="WebEUNotLoggedIn",e[e.WebEUNotLoggedInHighRisk=519]="WebEUNotLoggedInHighRisk",e}({}),l=function(e){return e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.NEVER_VISIBLE=1]="NEVER_VISIBLE",e[e.WAS_VISIBLE=2]="WAS_VISIBLE",e[e.VISIBLE=3]="VISIBLE",e}({}),f=function(e){return e[e.ALL_TRUSTED=1]="ALL_TRUSTED",e[e.NOT_ALL_TRUSTED=2]="NOT_ALL_TRUSTED",e}({});class d{constructor(e){this.capacity=void 0,this.storage=void 0,this.size=0,this.head=0,this.tail=0,this.capacity=e,this.storage=Array(e).fill(null),this.size=0,this.head=0,this.tail=0}enqueue(e){let t;return this.size==this.capacity?(t=this.storage[this.head],this.head=(this.head+1)%this.capacity,--this.size):t=null,this.storage[this.tail]=e,this.tail=(this.tail+1)%this.capacity,++this.size,t}dequeue(){if(0==this.size)return null;--this.size;const e=this.storage[this.head];return this.head=(this.head+1)%this.capacity,e}peekHead(){return 0==this.size?null:this.storage[this.head]}peekTail(){return 0==this.size?null:this.storage[(this.tail+this.capacity-1)%this.capacity]}reset(){this.size=0,this.head=0,this.tail=0}toArray(){return 0==this.size?[]:this.head{t(e)};this.eventListeners.push([n,e]),window.addEventListener(n,e)}}}function h(e){return t=>{if(!function(e){return o.includes(e.type)}(t))return;const n={e:t.target instanceof HTMLElement?t.target.tagName:"",t:a[t.type],ts:Date.now()};e(n)}}function g(){return"visible"===document.visibilityState}function m(){return"visibilityState"in document?g()?l.VISIBLE:l.NEVER_VISIBLE:l.UNSUPPORTED}function v(e){let t=null;return n=>{if(!function(e){return s.includes(e.type)}(n))return;const r=[];for(const e of n.changedTouches)r.push({x:Math.floor(e.clientX),y:Math.floor(e.clientY),e:e.target instanceof HTMLElement?e.target.tagName:"",i:e.identifier});const i={t:c[n.type],a:r,ts:Date.now()};((e,t)=>{if(!e)return!0;if(e.t!==c.touchmove||t.t!==c.touchmove)return!0;const n=t.ts-e.ts,r=t.a,i=e.a;for(const o of r){const e=i.find((e=>e.i===o.i));if(!e)return!0;if(Math.max(Math.abs(o.x-e.x),Math.abs(o.y-e.y))>=30)return!0}return n>=300})(t,i)&&(e(i),t=i)}}function y(e){let t=null;return n=>{if(!function(e){return r.includes(e.type)}(n))return;const o={e:n.target instanceof HTMLElement?n.target.tagName:"",t:i[n.type],x:Math.floor(n.clientX),y:Math.floor(n.clientY),ts:Date.now()};var a,s;s=o,(!(a=t)||a.t!==i.mousemove||Math.max(Math.abs(s.x-a.x),Math.abs(s.y-a.y))>=30||s.ts-a.ts>=300)&&(e(o),t=o)}}const b=[...o,...r,...s],_=1e3;const w=new Set([u.WebLoggedIn,u.WebUSNotLoggedInHighRisk,u.WebEUNotLoggedInHighRisk,u.WebNonUSNotLoggedIn,u.MobileWithConsent]);const E=new class{constructor(){this.userMode=u.Unknown,this.pageVisibility=void 0,this.isTrusted=void 0,this.beMouseSessionQueue=void 0,this.beKeyboardSessionQueue=void 0,this.beTouchSessionQueue=void 0,this.beMouseCurrentChallengeQueue=void 0,this.beKeyboardCurrentChallengeQueue=void 0,this.beTouchCurrentChallengeQueue=void 0,this.isEnabled=!1,this.eventGroupListener=new p}configure(e){const{userMode:t,beMouseQueueSessionCapacity:n,beKeyboardQueueSessionCapacity:r,beTouchQueueSessionCapacity:i,beMouseQueueCurrentChallengeCapacity:o,beKeyboardQueueCurrentChallengeCapacity:a,beTouchQueueCurrentChallengeCapacity:s}=e;this.reset(),t&&Object.values(u).includes(t)?this.userMode=t:this.userMode=u.Unknown,this.isEnabled=function(e){return!!e&&w.has(e)}(this.userMode),this.isEnabled&&(this.pageVisibility=m(),this.isTrusted=f.ALL_TRUSTED,this.beMouseSessionQueue=new d(null!==n&&void 0!==n?n:_),this.beKeyboardSessionQueue=new d(null!==r&&void 0!==r?r:_),this.beTouchSessionQueue=new d(null!==i&&void 0!==i?i:_),this.beMouseCurrentChallengeQueue=new d(null!==o&&void 0!==o?o:500),this.beKeyboardCurrentChallengeQueue=new d(null!==a&&void 0!==a?a:500),this.beTouchCurrentChallengeQueue=new d(null!==s&&void 0!==s?s:500))}getSessionData(){return this.isEnabled?{userMode:this.userMode,isTrusted:this.isTrusted,pageVisibility:this.pageVisibility,beMouse:this.beMouseSessionQueue.toArray(),beKeyboard:this.beKeyboardSessionQueue.toArray(),beTouch:this.beTouchSessionQueue.toArray()}:{userMode:this.userMode}}clearSessionData(){this.isEnabled&&(this.beMouseSessionQueue.reset(),this.beKeyboardSessionQueue.reset(),this.beTouchSessionQueue.reset())}getCurrentChallengeData(){return this.isEnabled?{userMode:this.userMode,isTrusted:this.isTrusted,pageVisibility:this.pageVisibility,beMouse:this.beMouseCurrentChallengeQueue.toArray(),beKeyboard:this.beKeyboardCurrentChallengeQueue.toArray(),beTouch:this.beTouchCurrentChallengeQueue.toArray()}:{userMode:this.userMode}}clearCurrentChallengeData(){this.isEnabled&&(this.beMouseCurrentChallengeQueue.reset(),this.beKeyboardCurrentChallengeQueue.reset(),this.beTouchCurrentChallengeQueue.reset())}startTracking(){this.isEnabled&&(this.eventGroupListener.listenTo(o,h((e=>{this.beKeyboardSessionQueue.enqueue(e),this.beKeyboardCurrentChallengeQueue.enqueue(e)}))),this.eventGroupListener.listenTo(r,y((e=>{this.beMouseSessionQueue.enqueue(e),this.beMouseCurrentChallengeQueue.enqueue(e)}))),this.eventGroupListener.listenTo(s,v((e=>{this.beTouchSessionQueue.enqueue(e),this.beTouchCurrentChallengeQueue.enqueue(e)}))),this.eventGroupListener.listenTo(["visibilitychange"],(e=>{var t;this.pageVisibility=(t=this.pageVisibility,g()?l.VISIBLE:t===l.VISIBLE?l.WAS_VISIBLE:t)})),this.eventGroupListener.listenTo(b,(e=>{e.isTrusted||(this.isTrusted=f.NOT_ALL_TRUSTED)})))}stopTracking(){this.eventGroupListener.clear()}reset(){this.stopTracking(),this.clearSessionData(),this.clearCurrentChallengeData()}};function S(e){E.configure(e),E.startTracking()}function k(){return E.getSessionData()}function T(){E.clearSessionData()}function x(){return E.getCurrentChallengeData()}function O(){E.clearCurrentChallengeData()}},1414:function(e,t,n){"use strict";n.d(t,{Fr:function(){return g},Hw:function(){return d},Ie:function(){return v},MF:function(){return s},SQ:function(){return a},UB:function(){return u},Z0:function(){return m},_W:function(){return y},bn:function(){return c},ce:function(){return p},cz:function(){return o},hY:function(){return l},ib:function(){return h},k:function(){return f},ye:function(){return b}});var r,i=n(5330);const o="s_v_web_id",a=5e3,s="2.33.12",c="cdn",u=window.captchaHost||"https://verification16-normal-no1a.tiktokw.eu",l="https://verification-va.tiktokv.com",f={international:"captcha/i18n",get:"captcha/get",verify:"captcha/verify",domains:"captcha/domains",feedback:"captcha/feedback",schedulingDomain:"captcha/region",sendCode:"/notify/sms/web/send_code",validateCode:"/notify/sms/check_code"},d={mya:"https://verification-mya.byteintl.com/",va:"https://verification-va.tiktok.com",sg:"https://verification-sg.tiktok.com",in:"https://verification-i18n.tiktok.com",ie:"https://verification.tiktokw.eu",ttp:"https://verification.tiktokw.us",ttp2:"https://verification-ttp2.tiktokw.us",no1a:"https://verification16-normal-no1a.tiktokw.eu",useastred:"https://verification16-normal-useastred.tiktokw.eu"}||{},p=(0,i.wl)(window.location.search),h="0"===p.os_type||"1"===p.os_type,g=(0,i.RJ)(),m=p.use_dialog_size_v2,v=null===(r=Array.isArray(p.store_region)?p.store_region[0]:p.store_region)||void 0===r?void 0:r.toUpperCase();let y=function(e){return e[e.captcha=1]="captcha",e[e.secondVerify=2]="secondVerify",e}({}),b=function(e){return e.SG="sg",e.VA="va",e.IE="ie",e.TTP="ttp",e.TTP2="ttp2",e.MYA="mya",e.NO1A="no1a",e.NONTT="non-tt",e.USEASTRED="useastred",e}({})},688:function(e,t,n){"use strict";n.d(t,{Y:function(){return r}});const r=function(){0}},1192:function(e,t,n){"use strict";n.d(t,{A:function(){return Ge}});var r=n(1414),i=n(688),o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(){for(var e=[],t=0;t-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),r=n.indexOf(";");t=n.slice(0,r)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),C={sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},A={va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},R={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z21z1ez4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z49z23z21z1cz18z21z22z4ez18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23"},I={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz25z4az23z21",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz24z4az23z21",ie:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4az22z1gz1iz22z1mz1iz25z4az1cz23",ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23"};!function(e){e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.DestoryInstance="destory-instance",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.AbTimeout="ab-timeout",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready",e.sessionRecord="session-record",e.SessionRecordStart="session-record-start",e.SessionRecordPause="session-record-pause",e.SessionRecordEnd="session-record-end",e.SessionRecordReport="session-record-report",e.VisualCollectReady="visual-collect-ready",e.VisualApiReady="visual-api-ready",e.VisualApiUpdate="visual-api-update"}(u||(u={})),function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(l||(l={}));var P,D=u,M=void 0,z=(new Date).getTimezoneOffset(),N=parseInt(""+-z/60,10),L=60*z,B=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var n=new O(t.app_id,t.cookie_domain||"",t.cookie_expire||6048e5).init(),r="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new x(!1,"session"),this.localStorage=new x(!1,"local"),this.channelUrl="tcpy"===t.channel_type||"ttp"===t.channel_type?{WEBID_URL:"/v1/user/webid",TOB_URL:"",REPORT_URL:"/v1/list"}:{WEBID_URL:"/webid",TOB_URL:"/tobid",REPORT_URL:"/list"},t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var i=this.localStorage.getItem(r);i&&1==i?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:M,user_type:M,user_id:M,user_is_auth:M,user_is_login:M,device_id:M,web_id:M,ip_addr_id:M,user_unique_id_type:M},header:{app_id:M,app_name:M,app_install_id:M,install_id:M,app_package:M,app_channel:M,app_version:M,ab_version:M,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:M,traffic_type:M,client_ip:M,device_brand:M,os_api:M,access:M,language:n.language,region:M,app_language:M,app_region:M,creative_id:n.utm.creative_id,ad_id:n.utm.ad_id,campaign_id:n.utm.campaign_id,log_type:M,rnd:M,platform:n.platform,sdk_version:"5.3.0_oversea",sdk_lib:"js",province:M,city:M,timezone:N,tz_offset:L,tz_name:M,sim_region:M,carrier:M,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:n.utm.utm_term,utm_content:n.utm.utm_content,utm_source:n.utm.utm_source,utm_medium:n.utm.utm_medium,utm_campaign:n.utm.utm_campaign,tracer_data:JSON.stringify(n.utm.tracer_data),custom:{}}},this.ab_version="",this.ab_uuid_cache={},this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(n),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(e){var t=this.initConfig.channel_domain;if(t)this.domain=t;else{var n=e||this.initConfig.channel,r=this.initConfig&&this.initConfig.channel_type?"tcpy"===this.initConfig.channel_type?R[n]:I[n]:C[n];r||(console.warn("current channel: "+n+" is not exist, use va instead, please check!!!!"),r=C.sg),this.domain=g(r)}},e.prototype.setDomain=function(e){this.customDomain=!0,this.domain=e},e.prototype.getDomain=function(e){return this.customDomain||e&&this.initDomain(e),this.domain},e.prototype.initABData=function(){var e,t="__tea_sdk_ab_version_"+this.initConfig.app_id;e=this.localStorage.getItem(t),this.setAbCache(e)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.setAbUuidCache=function(e,t){var n=t||this.envInfo.user.user_unique_id;this.ab_uuid_cache[""+n]||(this.ab_uuid_cache[""+n]=[]),-1===this.ab_uuid_cache[""+n].indexOf(e)&&this.ab_uuid_cache[""+n].push(e)},e.prototype.getAbUuidCache=function(e){return this.ab_uuid_cache[""+e]},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.channelUrl.REPORT_URL;break;case"webid":t=this.channelUrl.WEBID_URL;break;case"tobid":t=this.channelUrl.TOB_URL}var n="";return this.initConfig.caller&&(n="?sdk_version=5.3.0_oversea&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+n},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.setAppid=function(e){this.envInfo.header.app_id=e},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){if(void 0!==e[n]&&null!==e[n]||t.delete(n),"traffic_type"===n&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[n]),"evtParams"===n)t.evtParams=o(o({},t.evtParams||{}),e.evtParams||{});else if("_staging_flag"===n)t.evtParams=o(o({},t.evtParams||{}),{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var r="",i="";if(n.indexOf(".")>-1){var a=n.split(".");r=a[0],i=a[1]}r?"user"===r||"header"===r?t.envInfo[r][i]=e[n]:t.envInfo.header.custom[i]=e[n]:Object.hasOwnProperty.call(t.envInfo.user,n)?["user_type","ip_addr_id"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:["user_is_auth","user_is_login"].indexOf(n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n]):Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){console.log("get config stringify error "),this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(e){console.log("setStore error"),this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(e){return this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),console.log("delete error")}},e}(),U=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[Tea instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("%c %s","color: #4D1B00; background-color: #FF7D00;","[Tea instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("%c %s","color: #FFF; background-color: #F53F3F;","[Tea instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),G=function(){function e(){this.spiderBot=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"]}return e.prototype.checkSpider=function(e){if(!e.enable_spider)return!1;var t=window.navigator.userAgent;if(!t)return!0;var n=!1;return this.spiderBot.forEach((function(e){-1!==t.indexOf(e)&&(n=!0)})),n},e}(),j=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(e){console.log("AppLogBridge, error:"+JSON.stringify(e.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: "+e)}catch(e){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(e){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(e){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge\u57cb\u70b9\u4e0a\u62a5",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(e){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){console.error("profileAppend error")}},e}(),H=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new x(!0),this.localStorage=new x(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=t.report_url||this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.collect.on(D.Ready,(function(){n.reportAll(!1)})),this.collect.on(D.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on(D.Event,(function(e){n.event(e)})),this.collect.on(D.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on(D.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),m((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;if(!this.collect.destroy&&!this.collect.sdkStop)try{var n=s(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var r=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),r)}}catch(e){this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.beconEvent=function(e){if(!this.collect.destroy&&!this.collect.sdkStop){var t=s(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))}},e.prototype.reportBecon=function(){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},F=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new x(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(D.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on(D.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(D.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(D.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:V(),user_unique_id:this.configManager.get("user_unique_id")||V()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=b(window.location.href);return!(!t||!t.Web_ID)&&(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),!0)}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch WebID Request",logType:"fetch",level:"info",time:Date.now(),data:n});var r=V();this.collect.requestManager.useRequest({url:t,data:n,success:function(t){var n;t&&0===t.e?(n=t.web_id,e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Success",logType:"fetch",level:"info",time:Date.now(),data:t})):(n=r,e.collect.configManager.set({localWebId:r}),e.collect.emit(D.TokenError),e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Data Error, Use LocalId",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})},fail:function(){e.complete({web_id:e.configManager.get("web_id")||r,user_unique_id:e.configManager.get("user_unique_id")||r}),e.collect.configManager.set({localWebId:r}),e.collect.emit(D.TokenError),e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Network Fail, Use LocalId",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")},timeout:3e5})},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK UserInfo Complete",logType:"info",secType:"USER",level:"info",time:Date.now(),data:{web_id:t,user_unique_id:n},infoType:"sdk"}),this.collect.emit(D.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");(n||t)&&this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(D.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),r=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===r)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(D.TokenChange,"uuid"),this.collect.emit(D.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(D.TokenReset))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(D.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(D.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this;return new Promise((function(t){if("tcpy"!==e.config.channel_type&&"ttp"!==e.config.channel_type){var n={app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")};e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch GetToken Request",logType:"fetch",level:"info",time:Date.now(),data:n,infoType:"sdk"}),e.collect.requestManager.useRequest({url:e.configManager.getUrl("tobid"),data:n,success:function(n){n&&0===n.e?(t(n.tobid),e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Success",logType:"fetch",level:"info",time:Date.now(),data:n,infoType:"sdk"})):(t(""),e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Fail",logType:"fetch",level:"error",time:Date.now(),data:n,infoType:"sdk"}))},fail:function(){t(""),e.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Network Error",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"})},time:3e4,withCredentials:e.enable_ttwebid})}else t("")}))},e}(),K=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},q=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new x(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSessionTimeCheck=t.disable_session_check,this.disableSession||(this.setSessionId(),this.collect.on(D.SessionReset,(function(e){n.resetSessionId(e)})),this.collect.on(D.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:K(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:K(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.disableSessionTimeCheck||(this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(e){var t={sessionId:e||K(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,t)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:K(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),W=function(){function e(e,t){this.collector=e,this.config=t,this.requestType=t.request_type,this.supportBeacon=!(!window.navigator||!window.navigator.sendBeacon),this.errorCode={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005},this.customHeader=t.custom_request_header||{}}return e.prototype.useFetch=function(e){var t=e.url,n=e.data,r=e.method,i=e.success,o=e.fail,a={"Content-Type":"application/json; charset=utf-8"};if(Object.keys(this.customHeader).length)for(var s in this.customHeader)a[s]=this.customHeader[s];window.fetch?fetch(t,{method:r||"POST",headers:a,body:JSON.stringify(n)}).then((function(e){return e.json()})).then((function(e){i&&i(e)})).catch((function(e){o&&o(n,e)})):(this.requestType="xhr",console.log("your brwoser not support fetch, use xhr"),this.useRequest({url:t,data:n,method:r,success:i,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,n=e.data,r=e.success,i=e.fail;"xhr"!==this.requestType?window.navigator.sendBeacon(t,JSON.stringify(n))?r&&r():i&&i(n,this.errorCode.BEACON_FALSE):this.useXhr(e)},e.prototype.useXhr=function(e){var t=this,n=e.url,r=e.data,i=e.method,o=e.success,a=e.fail,s=e.timeout,c=e.withCredentials,u=e.app_key;try{var l=new XMLHttpRequest,f=i||"POST";if(l.open(f,""+n,!0),l.setRequestHeader("Content-Type","application/json; charset=utf-8"),u&&l.setRequestHeader("X-MCS-AppKey",""+u),Object.keys(this.customHeader).length)for(var d in this.customHeader)l.setRequestHeader(d,this.customHeader[d]);c&&(l.withCredentials=!0),s&&(l.timeout=s,l.ontimeout=function(){a&&a(r,t.errorCode.TIMEOUT)}),l.onload=function(){if(o){var e=null;if(l.responseText){try{e=JSON.parse(l.responseText)}catch(t){e={}}o(e,r)}}},l.onerror=function(){l.abort(),a&&a(r,t.errorCode.XHR_ON)},l.send(JSON.stringify(r))}catch(e){}},e.prototype.useRequest=function(e){var t=e.useBeacon,n=e.forceXhr;if("xhr"===this.requestType)this.useXhr(e);else{if(t&&this.supportBeacon)return void this.useBeacon(e);if("fetch"===this.requestType&&!n)return void this.useFetch(e);this.useXhr(e)}},e}(),J=function(){function e(e,t){if(this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,t.enable_debug&&"Microsoft Internet Explorer"!==e.configManager.get("browser")){this.collect=e,this.config=t,this.app_id=t.app_id;var n=e.adapters.storage;this.cacheStorgae=new n(!1),this.loadUrl=t.devtool_url||"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/devtool/debug-web.v2.0.0.js",this.filterEvent=new Set(["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"]),this.load()}}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(e){console.log("devTool load fail, "+e.message)}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach((function(t){var n=t.split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}))}catch(e){}return e},e.prototype.load=function(){try{var e=this.parseUrl();if(e.open_devtool_web&&e.app_id){if(parseInt(e.app_id)!==this.app_id)return}else if(!this.getStorage())return;this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(e){console.log("debug fail, "+e.message)}},e.prototype.getStorage=function(){var e=this.cacheStorgae.getItem("__applog_open_devtool_web");return e&&parseInt(e)===this.app_id},e.prototype.setStorage=function(){this.cacheStorgae.setItem("__applog_open_devtool_web",this.app_id)},e.prototype.loadDevTool=function(){this.loadScript(this.loadUrl)},e.prototype.loadBaseInfo=function(){if(this.log=[],this.event=[],this.info=[{title:"BaseInfo",key:"base",type:1,content:[{name:"app_id",desc:"APPID",value:this.config.app_id},{name:"channel",desc:"CHANNEL",value:this.config.channel},{name:"domain",desc:"Domain",value:this.collect.configManager.getDomain()},{name:"sdk_version",desc:"SDK Version",value:"5.3.0_oversea"},{name:"sdk_type",desc:"SDK Import Type",value:"npm"}]},{title:"UserInfo",key:"user",type:2,content:[{name:"uuid",desc:"UserUniqueId",value:this.collect.configManager.get("user").user_unique_id||""},{name:"web_id",desc:"WEB_ID",value:this.collect.configManager.get("user").web_id||""}]},{title:"CommonInfo",type:2,key:"common",content:[{name:"browser",desc:"Browser",value:this.collect.configManager.get("browser")},{name:"browser_version",desc:"Browser Version",value:this.collect.configManager.get("browser_version")},{name:"platform",desc:"Platform",value:this.collect.configManager.get("platform")},{name:"device_model",desc:"Devide Model",value:this.collect.configManager.get("device_model")},{name:"os_name",desc:"Os Name",value:this.collect.configManager.get("os_name")},{name:"os_version",desc:"Os Version",value:this.collect.configManager.get("os_version")},{name:"resolution",desc:"Screen Resolution",value:this.collect.configManager.get("resolution")},{name:"referrer",desc:"Referrer",value:this.collect.configManager.get("referrer")},{name:"custom",desc:"Custom Info",value:JSON.stringify(this.collect.configManager.get("custom"))}]},{title:"Config Info",key:"config",type:3,content:[{name:"autotrack",desc:"AutoTrackEvent",value:!!this.config.autotrack},{name:"stay",desc:"StayDuration",value:!!this.config.enable_stay_duration}]},{title:"A/B Config Info",key:"ab",type:4,content:[{name:"ab",desc:"A/BTester",value:!!this.config.enable_ab_test}]}],this.config.enable_ab_test){var e=this.getInfo("ab"),t=[{name:"ab",desc:"A/BTester",value:!!this.config.enable_ab_test},{name:"vid",desc:"A/B VID",value:this.collect.configManager.getAbVersion()},{name:"ab_domain",desc:"Domain",value:this.config.ab_channel_domain||g(A[this.config.channel])},{name:"all_values",desc:"A/B ALL Values",value:this.collect.configManager.getAbCache()}];e.content=t,this.setInfo("ab",e)}},e.prototype.getInfo=function(e){var t=null;return this.info.forEach((function(n){n.key===e&&(t=n)})),t},e.prototype.setInfo=function(e,t){var n=!1;this.info.forEach((function(r){r.key===e&&(n=!0,r=t)})),n||this.info.push(t)},e.prototype.getSecondInfo=function(e,t){var n=this.getInfo(e),r=null;return n.content.forEach((function(e){e.name===t&&(r=e)})),r},e.prototype.setSecondInfo=function(e,t,n){var r=this.getInfo(e);r.content.forEach((function(e){e.name===t&&(e.value=n)})),this.setInfo(e,r)},e.prototype.loadHook=function(){var e=this;this.collect.on(l.DEBUGGER_MESSAGE,(function(t){switch(t.type){case l.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",infoType:t.infoType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType?(e.setSecondInfo("ab","vid",e.collect.configManager.getAbVersion()),e.setSecondInfo("ab","all_values",e.collect.configManager.getAbCache())):"USER"===t.secType&&(e.setSecondInfo("user","uuid",e.collect.configManager.get("user").user_unique_id),e.setSecondInfo("user","web_id",e.collect.configManager.get("user").web_id)),void e.updateInfo();case l.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var r=t.data[0],i=r.events;if(!i.length)return;i.forEach((function(n){n.checkShow=!0,n.searchShow=!0,n.focusShow=!0,n.status=t.status,n.type=e.filterEvent.has(n.event)?"sdk":"cus",n.verifyType=t.verifyType?"verify":"no",n.info="","fail"===t.status&&(n.info={message:"code: "+t.code+"\uff0c msg: "+(t.msg||t.failType)})})),e.updateEvent(r)}return}}))},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event,sdk_type:"5.3.0_oversea".includes("tob")?"tob":"inner",appId:e.app_id}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.setSecondInfo("user","sid",t.tobid),e.updateInfo()}))}))},e.prototype.sendData=function(e,t){try{var n={type:e,payload:t};window&&window.postMessage(n,this.devToolOrigin)}catch(e){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e="#debugger-applog-web {\n position: fixed;\n width: 45px;\n height: 45px;\n background-image: url("+g("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1bz1cz24z22z1mz1mz1jz4bz18z1nz1nz1jz1mz1ez4az1nz1lz1e")+");\n bottom: 5%;\n right: 10%;\n cursor: pointer;\n z-index:100;\n background-size: 45px;\n }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.appendChild(document.createTextNode(e)),t.appendChild(n);var r=document.createElement("div");r.innerHTML='
';var i=document.createElement("div");i.innerHTML='
',document.getElementsByTagName("body")[0].appendChild(r),document.getElementsByTagName("body")[0].appendChild(i);var o=document.getElementById("debugger-applog-web");o&&o.addEventListener("click",(function(){window&&window.postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),X={autotrack:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},tracer:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"},retry:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/retry.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/retry.js"},object:"LogRetry"},visual:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/visual.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/visual.js"},object:"LogVisual"}},Q=["ab","autotrack","Stay","store","et","profile","cep","heartbeat","monitor","route","tracer"],Y=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroy=!1,this.sdkReady=!1,this.adapters={},this.loadType="base",this.sdkStop=!1,this.name=e,this.hook=new f,this.remotePlugin=new Map,this.Types=D,this.adapters.storage=x,this.loadType="full"}return e.usePlugin=function(t,n,r){if(n){for(var i=!1,o=0,a=e.plugins.length;o0&&this.changeListener.forEach((function(t){"function"==typeof t&&t(e)}))},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,n,r){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof n)throw new Error("callback must be a function");var i={name:e,defaultValue:t,callback:n,type:P.Var};this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetVar",level:"info",time:Date.now(),data:e,infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(i,e,r):this.callbacks.push(i)},e.prototype.setAbUuid=function(e,t){this.collect.configManager.setAbUuidCache(e,t)},e.prototype.getRealVar=function(e,t,n){var r=e.name,i=e.defaultValue,o=e.callback,a=this.data;if(a){if(d(a[r])){var s=a[r].vid;return"$ab_url"===t?this.mulilinkVersions.includes(s)||this.mulilinkVersions.push(s):this.versions.includes(s)||this.versions.push(s),this.setAbUuid(s,n),this.updateVersions(),this.fechEvent(s,t,i),o(a[r].val),void this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetVar, Exposure Experiment "+r,level:"info",time:Date.now(),data:a[r],infoType:"sdk"})}this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GerVar Default Callback",level:"info",time:Date.now(),data:this.data,infoType:"sdk"}),o(i)}else o(i)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:P.All};this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetAllVars",level:"info",time:Date.now(),infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},e.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetAllVars Callback",level:"info",time:Date.now(),data:this.data,infoType:"sdk"})},e.prototype.fechEvent=function(e,t,n){try{if(this.config.disable_track_event)return;if(!e)return;var r=this.collect.configManager.get(),i=r.header,o=r.user,a=this.getABCache(),s=o[this.ab_user_mode]||o.user_unique_id;if(a&&a.uuid&&a.uuid!==s)return;var c={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?n:window.location.href,data:this.data}),local_time_ms:Date.now()};i.custom=JSON.stringify(i.custom);var u={events:[c],user:o,header:i};this.reportExposure(u,t)}catch(e){this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.reportExposure=function(e,t){var n=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report(t):this.reportTimeout=setTimeout((function(){n.report(t),clearTimeout(n.reportTimeout)}),this.ab_batch_time)},e.prototype.report=function(e){var t=this;this.collect.requestManager.useRequest({url:this.reportUrl,data:this.exposureCache,timeout:2e4,useBeacon:"$ab_url"===e}),this.exposureCache.forEach((function(e){t.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_EVENT,info:"SDK Report Exposure Event Success",time:Date.now(),data:[e],code:200,status:"success",infoType:"sdk"})})),this.exposureCache=[]},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var n=Object.keys(e);n&&n.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.get=function(e){return this.cacheStorgae.getItem(e)},e.prototype.set=function(e,t){this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t),this.collect.event("abtest_cache",{env_uuid:this.collect.configManager.get("user").user_unique_id||"",cache:JSON.stringify(t)})},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},e.prototype.openOverlayer=function(e){var t=this;if(function(){if(!document.getElementById($)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id=$,n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}}(),e)var n=setTimeout((function(){t.closeOverlayer(),clearTimeout(n)}),e)},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById($))&&e.parentElement.removeChild(e)},e.prototype.fetchComplete=function(e,t){var n=this;try{if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var r=[];Object.keys(e).forEach((function(t){var n=e[t].vid;n&&r.push(n)})),this.versions=this.versions.filter((function(e){return r.includes(e)}));var i=e.$ab_url,o=e.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroy)return}else if(i&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return r.includes(e)}));var a=i.val,s=i.vid;a&&s&&this.getVar("$ab_url",a,(function(){n.editMode||(a!==window.location.href?setTimeout((function(){if(!n.collect.destroy){var e=""+a;e=-1===e.indexOf("http")?"https://"+e:e,y(e).host!==location.host?e=e+"&vid="+s:window.history.replaceState("","",e),window.location.href=e}}),100):n.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(e){return n[e.type===P.Var?"getRealVar":"getRealAllVars"](e,"")})),this.callbacks=[]}catch(e){}},e.prototype.fetchAB=function(e){var t=this,n=this.collect.configManager.get(),r={header:o(o(o({aid:this.config.app_id},n.user||{}),n.header||{}),{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch AB Request",level:"info",logType:"fetch",time:Date.now(),data:r,infoType:"sdk"});var i=n.user[this.ab_user_mode]||n.user.user_unique_id;this.collect.requestManager.useRequest({url:this.fetchUrl,data:r,success:function(n){t.fetchStatus="complete",t.refreshFetchStatus="complete";var r=n.data;"success"===n.message?(t.fetchComplete(r,i),e&&e(r)):(t.fetchComplete(null,i),e&&e(null)),t.collect.emit(t.types.AbComplete,r),t.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Fetch AB Request Success",level:"info",logType:"fetch",time:Date.now(),data:r,infoType:"sdk"})},fail:function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,i),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Fetch AB Request Network Error",level:"error",logType:"fetch",time:Date.now(),infoType:"sdk"})},timeout:this.timeout})},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true[\0-\xff]*":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true[\0-\xff]*");var n=new RegExp(t,"g");e=e.replace(n,"")}catch(e){}return e},e}(),ee=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var r=e.Types;e.on(r.SubmitBefore,(function(t){e.requestManager.useBeacon({url:n.url,data:t}),e.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_EVENT,info:"SDK Report ByteIo Verify Request",time:Date.now(),data:t,code:200,status:"success",verifyType:!0})}))}}else console.log("please use correct et_test url")},e}(),te=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.focusState=!0,this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,d(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.focusState=document.hasFocus()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageAlive(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var n=t?this.aliveDTime:Date.now()-this.sessionStartTime;n<0||n>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||t&&"hidden"===document.visibilityState||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.aliveName,o({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:n,is_support_visibility_change:v(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e,mode:this.hard?"hard":"normal",focusState:this.focusState},this.options.params)),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)}),1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),m(n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this,t=function(){e.timerHandler&&(clearInterval(e.timerHandler),e.sendEvent(!1)),e.focusState=!1},n=function(){e.focusState=!0,e.sessionStartTime=Date.now(),e.timerHandler=e.setUpTimer()};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),ne=function(){function e(e,t){var n=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.focusState=!0,this.visibilitychange=function(){"hidden"===document.visibilityState?n.activeEndTime=Date.now():"visible"===document.visibilityState&&(n.activeEndTime&&(n.totalTime+=n.activeEndTime-n.activeStartTime,n.activeTimes+=1),n.activeEndTime=void 0,n.activeStartTime=Date.now())},this.beforeunload=function(){if(n.totalTime+=(n.activeEndTime||Date.now())-n.activeStartTime,n.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:n.totalTime,page_title:document.title||location.pathname}))}catch(e){}n.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),d(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.focusState=document.hasFocus(),this.resetData()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.resetParams=function(e,t,n){this.url_path=e,this.url=n,this.title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageClose(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.resetParams(location.pathname,document.title,location.href)},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.closeName,o({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:v(),mode:this.hard?"hard":"normal",focusState:this.focusState},this.options.params)),this.pageStartTime=Date.now(),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),m(n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this,t=function(){e.focusState=!1},n=function(){e.focusState=!0};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),re=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new te(e,t),this.pageClose=new ne(e,t);var r=this.collect.Types;this.collect.on(r.ResetStay,(function(e){var t=e.url_path,r=e.title,i=e.url;n.resetStayDuration(t,r,i)})),this.collect.on(r.RouteChange,(function(e){e.init||t.disable_route_report||n.resetStayDuration()})),this.collect.on(r.SetStay,(function(e){var t=e.url_path,r=e.title,i=e.url;n.setStayParmas(t,r,i)})),this.enable(this.url_path,this.title,this.url),this.ready(r.Stay),this.collect.emit(r.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var r=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var i in n)r(i)}},e.prototype.enable=function(e,t,n){this.pageAlive.enable(e,t,n),this.pageClose.enable(e,t,n)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.pageAlive.setParams(e,t,n),this.pageClose.setParams(e,t,n),this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Execute resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e.prototype.reset=function(e,t,n){this.disable(),this.enable(e,t,n)},e.prototype.resetStayDuration=function(e,t,n){this.reset(e,t,n),this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"SDK Execute resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e}(),ie=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,r=Date.now()+t;return n=window.setTimeout((function i(){var o=Date.now()-r;e(),r+=t,n=window.setTimeout(i,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var r=this.collect.Types;this.collect.on(r.SessionReset,(function(){n.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),oe=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var r=this.collect.Types;this.collect.on(r.Ready,(function(){n.sdkOnload()})),this.collect.on(r.SubmitError,(function(e){var t=e.type,r=e.eventData,i=e.errorCode;"f_data"===t&&n.sdkError(r,i)}))}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,r=t.user,i=n.app_id,o=n.app_name,a=n.sdk_version,s=r.web_id,c={events:[{event:"onload",params:JSON.stringify({app_id:i,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOC_OVERSEA"}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.collect.requestManager.useRequest({url:e.url,data:[c],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e.prototype.sdkError=function(e,t){var n=this;try{var r=e[0],i=r.user,o=r.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:a.map((function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(i)}),local_time_ms:Date.now()}})),user:{user_unique_id:i.user_unique_id},header:{}};setTimeout((function(){n.collect.requestManager.useRequest({url:n.url,data:[s],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e}();function ae(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}function se(e){for(var t=e;t&&!ae(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function ce(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")||e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}var ue=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},le=function(){function e(e,t,n){var r=this;this.statistics=!1,this.pageView=!1,this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,n=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,n=!0):t=t.parentElement;return n}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var n=e;return"none"!==n.style.display&&(!!ae(n,"container")||!(!function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0}(n)&&!t.svg))})(e.target,r.options)&&r.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){r.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){r.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&r.eventHandel({eventType:"dom",eventName:"beat"},o({beat_type:0},e)),r.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){r.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=n.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e){if(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv){this.collect.on("route-change",(function(e){var n=e.config,r=e.name;t.getPageViewEvent(n,r),t.pageView=!0}));var n=setTimeout((function(){t.pageView||(t.getPageViewEvent(t.getDefaultConfig()),t.pageView=!0,clearTimeout(n))}),2e3)}if(this.config.beat){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var r=0,i=null;window.addEventListener("scroll",(function(){clearTimeout(i),i=setTimeout(o,500),r=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==r&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var a=window.performance&&window.performance.getEntriesByType("paint");a&&a.length?(new PerformanceObserver((function(e){var n=e.getEntries(),r=n[n.length-1],i=r.renderTime||r.loadTime;t.statistics||(t.getPageLoadEvent(i),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(a[0].startTime||0),t.statistics=!0)}),2e3)):this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var n;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(n=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),m((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(n)}))}catch(e){}},e.prototype.getDefaultConfig=function(){return{is_html:1,url:location.href,referrer:document.referrer,page_key:location.href,refer_page_key:document.referrer,page_title:document.title||location.pathname,page_manual_key:"",refer_page_manual_key:"",refer_page_title:"",page_path:location.pathname,page_host:location.host}},e}(),fe={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},de=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function pe(e,t,n,r){var i={},o=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return{left:t.left,top:t.top,element_width:n,element_height:r}}}(t),a=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,r=e.clientY,i=t.left,o=t.top,a=n-i>=0?n-i:0,s=r-o>=0?r-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,o),s=o.element_width,c=o.element_height,u=a.touch_x,l=a.touch_y,f=function(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var n=[],r=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,n=e.parentElement;if(n)for(var r=n.children,i=0;i0)for(var i=t.childNodes,o=0;o0)for(var i=t.childNodes,o=0;o0?i:0)),t.page_start_ms=r.navigationStart}catch(e){console.log("page_statistics event error "+JSON.stringify(e))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("beat event error "+JSON.stringify(e))}return e},e}(),me=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var n=e.eventSend,r=t.event;delete t.event,n&&"becon"===n?this.collect.beconEvent(r,t):this.collect.event(r,t)},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}(),ve={},ye=[];function be(e,t,n,r){var i=e&&e.source||window.opener||window.parent,o=e&&e.origin||r||"*",a={type:t,payload:n};i.postMessage(JSON.stringify(a),o)}function _e(e){if(ye.some((function(e){return"*"===e}))||ye.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var n=t.type,r=t.payload;ve[n]&&ve[n].forEach((function(t){"function"==typeof t&&t(e,r)}))}}var we=!1;function Ee(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id;var n,r,i,a,s=t.channel_domain,c="";if((n=["*"]).length&&n.forEach((function(e){ye.push(e)})),s){var u,l="";try{var f=window.performance.getEntriesByType("resource");if(f&&f.length&&(f.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(l=e.name)})),l&&(u=l.split("/"))&&u.length)){c="https:/";for(var d=2;d=0&&c<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(n.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else n._observeId=this.count,n.visible=!1,this.observeMap.set(this.count,n),this.observe(n),this.count++},e.prototype.exposureRemove=function(e){this.observeMap.has(e._observeId)&&(this.observeMap.delete(e._observeId),this.unobserve(e))},e.prototype.exposureEvent=function(e){if(e.intersectionRatio>=this.Ratio&&e.isIntersecting){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===e.target.visible)return;e.target.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e)}else e.target.visible=!1},e.prototype.observe=function(e){this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance.unobserve(e)},e._observer_instance=null,e._observer_map=new Map,e}(),xe=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new Te(e,t),this._observer=new ke(this._intersection),this.initObserver())}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}(),Oe={hashTag:!1,impr:!1},Ce=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var n=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(n.Autotrack),this.collect.emit(n.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==typeof t?t:{},t=Object.assign(Oe,t),this.destroyed=!1,this.options=t,this.Config=new de(fe,this.options),this.Exposure=new xe(this.config,this.handle.bind(this)),this.Listener=new le(t,this.collect,this.Config),this.EventHandle=new ge(this.config,t),this.Request=new me(this.collect),this.autoTrackStart=!0,this.init(),Ee(this,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this)),"base"===this.collect.loadType&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var n=e.eventName;if("click"===n||"exposure"===n||"change"===n||"submit"===n){var r=this.EventHandle.handleEvent(t,n);null!==r&&this.Request.send({eventType:"custom",eventName:"report_"+n+"_event",extra:{methods:"GET"}},r)}else if("page_view"===n||"page_statistics"===n){var i;i="page_view"===n?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},i)}else if("beat"===n){var o=this.EventHandle.handleBeadtEvent(t),a=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:a},o)}}catch(e){console.log("handel dom event error "+JSON.stringify(e))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}();!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(Se||(Se={}));var Ae={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},Re=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var r=this.collect.Types;e.adapters.fetch,this.collect.on(r.Event,(function(e){p(e)?e.forEach((function(e){n.addCount("log")})):n.addCount("log")})),this.collect.on(r.SubmitError,(function(e){var t=e.type,r=e.eventDate,i=e.errorCode,o=e.response;n.addErrorCount(r,t,i,o)})),this.listener(),this.collect.emit(r.TracerReady)}},e.prototype.addCount=function(e,t,n){void 0===t&&(t="net"),void 0===n&&(n=1);try{this.tracerCache||(this.tracerCache=new Map);var r=void 0;if(this.tracerCache.has(e))(i=this.tracerCache.get(e)).has(t)?(r=i.get(t).params.count,r++,i.set(t,this.processTracer(r,e,t))):(r=n,i.set(t,this.processTracer(n,e,t)));else{var i=new Map;r=n,i.set(t,this.processTracer(n,e,t)),this.tracerCache.set(e,i)}"net"===t&&r>=this.limit[e]&&this.report(!1)}catch(e){console.log(e)}},e.prototype.addErrorCount=function(e,t,n,r){var i=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(r&&r.hasOwnProperty("sc")?this.addCount("log",t,o.length-r.sc):this.addCount("log",t,o.length),this.errorCode[t]=n):o.forEach((function(e){var r="log";for(var o in Ae)if(-1!==Ae[o].indexOf(e.event)){r=o;break}i.addCount(r,t,1),i.errorCode[t]=n})))}}catch(e){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach((function(e){console.log(e),e.forEach((function(e){t.push(e)}))})),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var n=this.collect.eventManager.merge(e);this.collect.requestManager.useRequest({url:this.reportUrl,data:n,useBeacon:t}),this.tracerCache=null}catch(e){}},e.prototype.processTracer=function(e,t,n){try{var r={count:e,state:n,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:"5.3.0_oversea"};"f_net"!==n&&"f_data"!==n||(r.errorCode=this.errorCode[n]);var i=this.collect.processEvent("applog_trace",r);if(i&&i.event)return delete i.is_bav,i}catch(e){console.warn("something error")}},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),m((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),Ie="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,Pe=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,n){if("sdk"===t)if(X.hasOwnProperty(n)){var r=X[n].object,i=""+X[n].src[e.channel];e.exist(n,r,i)}else console.warn("your "+n+" is not exist\uff0cplease check plugin name");else"object"==typeof t&&(t.src?e.exist(n,t.call,t.src):e.process(n,t.instance,"INSTANCE"))}))}catch(e){this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"\u53d1\u751f\u4e86\u5f02\u5e38",level:"error",time:Date.now(),data:e.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,n){var r=this;Ie[t]?(this.process(e,Ie[t]),console.log("already has "+e+" plugin~")):this.loadPlugin(e,n,(function(){r.process(e,Ie[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","\u2013","load plugin:"+e+" success","-")}),(function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","\u2013","load plugin:"+e+" error","-")}))},e.prototype.process=function(e,t,n){try{if(n){var r=new t;r.apply&&r.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(t){this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"\u53d1\u751f\u4e86\u5f02\u5e38",level:"error",time:Date.now(),data:t.message}),console.log("excude "+e+" error, message:"+t.message)}},e.prototype.loadPlugin=function(e,t,n,r){var i=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(n),o.onerror=function(){r(t)},o.onload=function(){i._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(e){this.collect.emit(l.DEBUGGER_MESSAGE,{type:l.DEBUGGER_MESSAGE_SDK,info:"\u53d1\u751f\u4e86\u5f02\u5e38",level:"error",time:Date.now(),data:e.message})}},e}(),De=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var n=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(n.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==typeof this.config.autotrack&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(n){for(var r=[],i=1;i{var n;this.teaInstance.init({app_id:2740,channel:o,channel_type:"ttp"===a||"ttp2"===a?"ttp":(0,Ne.t3)(+e.aid)||!0===t?"tcpy":void 0,channel_domain:null!==(n=e.channelDomain)&&void 0!==n?n:void 0})})).then((()=>{var t,n,i,o,a,s,c,u,l,f,d,p,h;const g={user_unique_id:r.ib?e.did:(0,ze.d0)(),evtParams:e,web_id:r.ib?e.did:(0,ze.d0)(),device_model:null!==(t=e.device_model)&&void 0!==t?t:"not in option",platform:r.ib?"app":r.Fr?"h5":"pc",browser:null!==(n=window.navigator.userAgent)&&void 0!==n?n:"window.navigator.userAgent is not set",region:null!==(i=null===e||void 0===e||null===(o=e.verify_data)||void 0===o?void 0:o.region)&&void 0!==i?i:"not in verify_data",screen_height:null!==(a=window.screen.height)&&void 0!==a?a:-2,screen_width:null!==(s=window.screen.width)&&void 0!==s?s:-2,user_agent:null!==(c=window.navigator.userAgent)&&void 0!==c?c:"window.navigator.userAgent is not set",verify_type:null!==(u=e.type)&&void 0!==u?u:"evtParams type is empty",sdk_version:null!==r.MF&&void 0!==r.MF?r.MF:"SDK version Not found",device_id:r.ib?e.did:(0,ze.d0)(),user_id:r.ib?e.did:(0,ze.d0)(),reportErrorCallback:(e,t)=>{window.captchaFailEvents.push(JSON.stringify(e)+"||"+JSON.stringify(t))}};this.optionParameters={aid:String(e.aid),did:r.ib?e.did:"is_not_native",iid:e.iid,app_version:e.app_version,host_app_id:String(e.aid),h5_sdk_version:r.MF,platform:r.ib?"app":r.Fr?"h5":"pc",os_type:(0,ze.Dj)(),lang:e.lang,region:(null===e||void 0===e||null===(l=e.verify_data)||void 0===l?void 0:l.region)||{NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_WEBSITE_TITLE:"verify captcha"}.REGION_ENV,mode:null!==(f=null===e||void 0===e||null===(d=e.verify_data)||void 0===d?void 0:d.subtype)&&void 0!==f?f:"not set in verify data",business_log_id:null===e||void 0===e||null===(p=e.verify_data)||void 0===p?void 0:p.log_id,detail:null===e||void 0===e||null===(h=e.verify_data)||void 0===h?void 0:h.detail},this.teaInstance.config(g),this.teaInstance.start()})).catch((()=>{(0,i.Y)("TEA init error!"),window.captchaFailEvents.push("TEA init error!||")}))}trackEvent(e){const t={...this.optionParameters,get_log_id:window.logIdMap.get_log_id,verify_log_id:window.logIdMap.verify_log_id,lang:Le.Ay.language,timestamp:Date.now(),product_host:window.location.host,product_path:window.location.pathname,visibility:(0,Ne.Hv)("captcha-verify-container-main-page"),fp:(0,ze.d0)(),verify_id:window.logIdMap.verify_id,os_version:(0,Ne.fA)(),business_log_id:this.optionParameters.business_log_id,detail:this.optionParameters.detail,wid:Ue().get("ttwid"),userRegion:r.Ie,...e};(0,i.Y)("log event ****************","event.key",e.key,"evtPayload",t),this.teaInstance.event("turing_verify_sdk",t)}async batchSendEvents(e){(0,i.Y)("batch log events ****************",e),window.captchaFailEvents=[],e.length>250&&(window.captchaFailEvents=e.splice(250)),e.forEach((e=>{const t=JSON.parse(e);this.teaInstance.event(t.event,t)}))}setParams(e){var t,n,i,o,a,s,c,u,l,f,d,p;this.optionParameters={aid:String(null!==(t=e.aid)&&void 0!==t?t:this.optionParameters.aid),did:null!==(n=e.did)&&void 0!==n?n:this.optionParameters.did,iid:null!==(i=e.iid)&&void 0!==i?i:this.optionParameters.iid,app_version:null!==(o=e.app_version)&&void 0!==o?o:this.optionParameters.app_version,host_app_id:null!==(a=e.host_app_id)&&void 0!==a?a:this.optionParameters.host_app_id,h5_sdk_version:r.MF,platform:r.ib?"app":r.Fr?"h5":"pc",os_type:(0,ze.Dj)(),lang:null!==(s=e.lang)&&void 0!==s?s:this.optionParameters.lang,region:null!==(c=e.region)&&void 0!==c?c:this.optionParameters.region,mode:null!==(u=e.mode)&&void 0!==u?u:this.optionParameters.mode,stage:null!==(l=e.stage)&&void 0!==l?l:this.optionParameters.stage,uid:null!==(f=e.uid)&&void 0!==f?f:this.optionParameters.uid,detail:null!==(d=e.detail)&&void 0!==d?d:this.optionParameters.detail,business_log_id:null!==(p=e.business_log_id)&&void 0!==p?p:this.optionParameters.business_log_id}}}},5444:function(e,t,n){"use strict";n.d(t,{Jt:function(){return b},bE:function(){return _},p0:function(){return E}});var r,i=n(2529),o=n(5169),a=n.n(o),s=n(688),c=n(1414),u=n(5330),l=n(7210),f=n(5174),d=n(6791),p=n.n(d);function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_WEBSITE_TITLE:"verify captcha"}.REGION_ENV;return"unset"==(t=Object.assign((0,u.vA)(window.captchaOptions),t,v({region:n,triggered_region:n},(0,f.r_)()))).subtype&&(t.subtype=""),(0,s.Y)(e,"GET request args\uff1a",t),"1"===c.ce.use_jsb_request?(0,l.o9)("get",e,t):a().get(e,{params:t})}function _(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{params:{}},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_WEBSITE_TITLE:"verify captcha"}.REGION_ENV;e;var o=function(e){return(0,i.v)(48,void 0,arguments,{get 0(){return h},get 23(){return p()},get 24(){return r}})}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return t.params=Object.assign((0,u.vA)(window.captchaOptions),t.params,v({region:n,triggered_region:n},(0,f.r_)())),(0,s.Y)(e,"POST request args\uff1a","data:",o,"config:",t),"1"===c.ce.use_jsb_request?(0,l.o9)("post",e,t.params,o):a().post(e,o,t)}a().defaults.timeout=5e3;var w=function(e){return(0,i.v)(49,void 0,arguments,{get 23(){return p()},get 24(){return r}})};function E(e,t,n){if(null!==n&&void 0!==n&&n["x-tt-logid"]){var i=n["x-tt-logid"];"captcha/get"===t?window.logIdMap.get_log_id=i:"captcha/verify"===t&&(window.logIdMap.verify_log_id=i)}return null!==t&&void 0!==t&&t.includes("captcha/get")&&r.reset(),Promise.resolve(e).then((function(e){if(null==e.edata){var t=200===e.code||"10000"===e.code||void 0!==e.size;return(0,s.Y)(t?"success return args:":"request failed:",e),t?e:Promise.reject(e)}return"string"===typeof(null===e||void 0===e?void 0:e.edata)?w(e.edata):Promise.reject(new Error("Unexpected response format"))})).then((function(e){if("object"!==typeof e)return Promise.reject(new Error("Invalid response format after processing"));var t=200===e.code||"10000"===e.code||void 0!==e.size;return(0,s.Y)(t?"success return args:":"request failed:",e),t?e:Promise.reject(e)}))}a().interceptors.response.use((function(e){return(0,i.v)(54,void 0,arguments,{get 14(){return E}})}),(function(e){return(0,s.Y)("server error:",e),Promise.reject(e)}))},5330:function(e,t,n){"use strict";n.d(t,{$Z:function(){return u},Dj:function(){return l},Gv:function(){return _},Ks:function(){return b},RJ:function(){return y},XP:function(){return v},aO:function(){return h},d0:function(){return d},uO:function(){return p},vA:function(){return f},wl:function(){return s},xh:function(){return c}});var r=n(6042),i=n(3551),o=n.n(i),a=n(1414);function s(e){const t=u(e);return t.channel=t.ch||t.channel,t.app_version=t.vc||t.app_version,t.region=t.region||t.tea_channel,t.verify_data&&delete t.verify_data,t.theme&&delete t.theme,t}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("[object Object]"!==Object.prototype.toString.call(e))throw console.error("Options must be an object"),new Error("Options must be an object");const{aid:t}=e,n="function"===typeof e.initErrorCb?e.initErrorCb:function(e){console.error(e)};if("number"!==typeof t)throw n("The parameter aid is required and of type int"),new Error("The parameter aid is required and of type int")}function u(e){const t=e.indexOf("?"),n=t>-1?e.substring(t+1):"";try{return r.parse(n)}catch(i){return{}}}function l(){const e=window.navigator.userAgent;return/windows|win32/i.test(e)?"windows":e.indexOf("Android")>-1||e.indexOf("Adr")>-1?"Android":/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(e)?"iOS":/macintosh|mac os x/i.test(e)?"mac":"other"}function f(e){const{aid:t,lang:n,app_name:r,ch:i,iid:o,did:s,os_type:c,h5_sdk_version:u,h5_sdk_use_type:l,sdk_version:f,verify_data:p,type:h,mode:g,challenge_code:m,platform:v,os_name:y,webdriver:b,imagexDomain:_}=e,w=Object.assign({lang:n,app_name:r,h5_sdk_version:u,h5_sdk_use_type:l,sdk_version:f,iid:o,did:s,device_id:s,ch:i,aid:t,os_type:c,mode:g,tmp:Date.now(),platform:v,webdriver:b},a.ib?a.ce:{});return"0"!=c&&"1"!=c&&(w.fp=d()),p&&(w.type=p.type,w.detail=p.detail,w.server_sdk_env=p.server_sdk_env),w.imagex_domain=_,w.subtype=h,w.challenge_code=m,w.os_name=y,w.verify_id=window.logIdMap.verify_id,a.ib||e.h5_check_version&&(w.h5_check_version=e.h5_check_version,w.sdk_version=e.h5_check_version),w}function d(){return window.captchaOptions&&window.captchaOptions.fp?window.captchaOptions.fp:o().get(a.cz)||""}function p(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),t=e.length,n=(new Date).getTime().toString(36),r=[];r[8]=r[13]=r[18]=r[23]="_",r[14]="4";for(var i,o=0;o<36;o++)r[o]||(i=0|Math.random()*t,r[o]=e[19==o?3&i|8:i]);return"verify_"+n+"_"+r.join("")}const h=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=t&&n?"/"===t.slice(-1)&&"/"===n[0]?t+n.slice(1):"/"!==t.slice(-1)&&"/"!==n[0]?`${t}/${n}`:`${t}${n}`:n||t,/^(http|https):/.test(e)||(e=`${window.location.protocol}${e}`),e};let g=!1;try{const e=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("test",(()=>{}),e)}catch(w){}function m(e){e.preventDefault()}const v={option:!1,init(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.option=!(!g||e)&&{passive:!1}},disabled(){a.ib||document.addEventListener("touchmove",m,this.option)},allow(){document.removeEventListener("touchmove",m,this.option)}},y=()=>{const e=/android|mobi|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent);if(e)return e;try{const e=document.createElement("canvas").getContext("webgl"),t=e&&e.getExtension("WEBGL_debug_renderer_info"),n=e&&t&&e.getParameter(t.UNMASKED_RENDERER_WEBGL);return/Apple/i.test(n)&&!!("ontouchstart"in window)}catch(t){return!1}},b=()=>{const e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");return t.textContent="\n body.disable-scroll {\n overflow: hidden !important;\n height: 100vh !important;\n }\n ",e.appendChild(t),document.body.classList.add("disable-scroll"),()=>{e.removeChild(t),document.body.classList.remove("disable-scroll")}},_=e=>"[object Object]"===Object.prototype.toString.call(e)},5174:function(e,t,n){"use strict";n.d(t,{$x:function(){return a},ES:function(){return s},Gl:function(){return o},Hv:function(){return m},Ye:function(){return u},bZ:function(){return p},fA:function(){return v},k0:function(){return f},r_:function(){return h},t3:function(){return g},tS:function(){return c},wZ:function(){return l},wc:function(){return b},zK:function(){return d}});var r=n(688);n(1414);let i=function(e){return e[e.TIKTOK_NATIVE=1180]="TIKTOK_NATIVE",e[e.MUSICALLY_NATIVE=1233]="MUSICALLY_NATIVE",e[e.TIKTOK_LOGIN_WEB=1459]="TIKTOK_LOGIN_WEB",e[e.TIKTOK_LITE=1340]="TIKTOK_LITE",e[e.TIKTOK_MUSIC=310024]="TIKTOK_MUSIC",e[e.TIKTOK_MUSIC_2=378748]="TIKTOK_MUSIC_2",e[e.TIKTOK_MUSIC_3=314897]="TIKTOK_MUSIC_3",e[e.TIKTOK_OPEN_PLATFORM=2471]="TIKTOK_OPEN_PLATFORM",e[e.TIKTOK_LIVE_BACKSTAGE=6849]="TIKTOK_LIVE_BACKSTAGE",e[e.TIKTOK_SAFETY_ENFORCEMENT_TOOL=326738]="TIKTOK_SAFETY_ENFORCEMENT_TOOL",e[e.TIKTOK_ADS=1583]="TIKTOK_ADS",e[e.TIKTOK_SELLER_APP=7743]="TIKTOK_SELLER_APP",e[e.TIKTOK_MAGELLAN=4068]="TIKTOK_MAGELLAN",e[e.TIKTOK_MAGELLAN2=6556]="TIKTOK_MAGELLAN2",e[e.TIKTOK_WEB=1988]="TIKTOK_WEB",e[e.TIKTOK_BIZ_CENTER=2239]="TIKTOK_BIZ_CENTER",e[e.LEMON8_WEB=2538]="LEMON8_WEB",e[e.LEMON8_CPM=580075]="LEMON8_CPM",e}({});const o=async e=>{switch(e){case"ttp":case"ttp2":return(await n.e(324).then(n.t.bind(n,655,23))).default;default:return(await n.e(324).then(n.t.bind(n,3535,23))).default}},a=e=>{switch(e){case"in":case"ie":case"no1a":case"useastred":return"https://mon-i18n.tiktokv.com";case"ttp":case"ttp2":return"https://mon16-normal-useast5.tiktokv.us";default:return"https://mon.tiktokv.com"}},s=e=>{switch(e){case"ttp":case"ttp2":return"https://lf16-cdn-tos.tiktokcdn-us.com/obj/static-tx/slardar/fe/sdk-web/plugins";default:return"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/plugins"}},c=(async()=>{switch({NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_WEBSITE_TITLE:"verify captcha"}.REGION_ENV){case"va":return(await n.e(324).then(n.bind(n,2028))).default;case"in":case"ie":return(await n.e(324).then(n.bind(n,5070))).default;case"ttp":case"ttp2":return(await n.e(324).then(n.bind(n,4353))).default;default:return(await n.e(324).then(n.bind(n,5902))).default}})(),u=e=>{switch(e){case"3d":return 99997;case"whirl":return 99996;case"icon":return 99995;case"voice":return 99994;case"hashcash":return 99993;case"hcaptcha":return 89992;case"arkose":return 89991;case"none":return 1e4;case"geetest":return 89993;default:return 99999}},l=e=>["slide","whirl","3d","icon"].includes(e),f=e=>new Promise(((t,n)=>{if(document.querySelector(`script[src="${e}"]`))return void t("Script already loaded");const r=document.createElement("script");r.src=e,r.onload=()=>t("Script loaded successfully"),r.onerror=()=>n(new Error(`Script loading failed: ${e}`)),document.head.appendChild(r)})),d=(e,t)=>{const n=document.createElement("script");return n.id=t,n.type="text/javascript",n.src="https://tx41v.arkoselabs.com/v2/"+e+"/api.js",n.async=!0,n.defer=!0,n.setAttribute("data-callback","setupEnforcement"),document.head.append(n),()=>{document.getElementById(t).remove()}};function p(e){switch(e){case"ar":return"ara";case"az":return"aym";case"bg":return"bug";case"bn":return"bem";case"ca":return"car";case"ceb":case"fil":return"fil";case"cs-CZ":return"ces";case"da-DK":return"dak";case"de":return"deu";case"el-GR":return"ell";case"en":case"ga":case"ha":case"ig":case"sq":case"yo":default:return"eng";case"en-GB":return"eng-gb";case"es":case"es-419":return"spa";case"et":return"est";case"fi-FI":return"fin";case"fr":return"fra";case"gu":return"guj";case"he":case"he-IL":return"haw-he";case"hi":return"him";case"hr":return"hrv";case"hu-HU":return"hun";case"id":return"ind";case"is":case"it":return"isl";case"ja":return"jpn";case"jv":return"jav";case"kk":return"kaw";case"km":return"khm";case"ko":return"kor";case"lt":return"lit";case"lv":return"lat";case"mr":return"mar";case"ms":return"msa";case"my":return"mya";case"nb":case"nb-NO":return"nob";case"nl-NL":return"nld";case"pl":return"pol";case"pt":case"pt-BR":return"pon";case"ro-RO":return"ron";case"ru":return"rus";case"sk":return"slk";case"sl":return"slv";case"sv-SE":return"swe";case"sw":return"swa";case"th":return"tha";case"tr":return"tur";case"uk":return"ukr";case"ur":return"urd";case"uz":case"uz-UZ":return"uzb";case"vi":case"vi-VN":return"vie";case"zh":case"zh-Hans":return"zho";case"zh-Hant":return"zho-tw"}}const h=()=>{try{return{cookie_enabled:navigator.cookieEnabled,screen_width:window.screen.width,screen_height:window.screen.height,browser_language:navigator.language,browser_platform:navigator.platform,browser_name:navigator.appCodeName,browser_version:navigator.appVersion}}catch(e){return(0,r.Y)(`failed to collect shark web ext params: ${e.message}`),{}}},g=e=>Object.values(i).filter((e=>"number"===typeof e)).includes(e),m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;const n=t.getElementById(e);if(!n)return!1;const r=window.getComputedStyle(n);if("none"===r.display||"hidden"===r.visibility||0===parseFloat(r.opacity))return!1;const i=n.getBoundingClientRect();return!(i.bottom<0||i.top>(window.innerHeight||document.documentElement.clientHeight)||i.right<0||i.left>(window.innerWidth||document.documentElement.clientWidth))&&!(t!==document&&"host"in t&&!t.host.isConnected)};function v(){let e="";if("undefined"===typeof window||!window.navigator)return"Unknown";e=window.navigator.userAgent;const t=e.match(/Windows NT ([0-9.]+)|Mac OS X ([0-9_]+)|(?:CPU (?:iPhone )?OS) ([0-9_]+)|Android ([0-9.]+)/i);if(t){if(t[1])return t[1];if(t[2])return t[2].replace(/_/g,".");if(t[3])return t[3].replace(/_/g,".");if(t[4])return t[4]}return"Unknown"}const y=/~([^.]+)\.(\w+)$/;function b(e){let t="unknown",n="unknown";const r=e.match(y);return r&&(t=r[0],n=r[2]),{template:t,format:n}}},2529:function(e,t,n){"use strict";n.d(t,{v:function(){return L}});var r=Uint8Array,i=Uint16Array,o=Int32Array,a=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),c=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u=function(e,t){for(var n=new i(31),r=0;r<31;++r)n[r]=t+=1<>1|(21845&m)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,g[m]=((65280&v)>>8|(255&v)<<8)>>1}var y=function(e,t,n){for(var r=e.length,o=0,a=new i(t);o>u]=l}else for(s=new i(r),o=0;o>15-e[o]);return s},b=new r(288);for(m=0;m<144;++m)b[m]=8;for(m=144;m<256;++m)b[m]=9;for(m=256;m<280;++m)b[m]=7;for(m=280;m<288;++m)b[m]=8;var _=new r(32);for(m=0;m<32;++m)_[m]=5;var w=y(b,9,1),E=y(_,5,1),S=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},k=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},T=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},x=function(e){return(e+7)/8|0},O=function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new r(e.subarray(t,n))},C=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],A=function(e,t,n){var r=new Error(t||C[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,A),!n)throw r;return r},R=function(e,t,n,i){var o=e.length,u=i?i.length:0;if(!o||t.f&&!t.l)return n||new r(0);var l=!n,d=l||2!=t.i,p=t.i;l&&(n=new r(3*o));var g=function(e){var t=n.length;if(e>t){var i=new r(Math.max(2*t,e));i.set(n),n=i}},m=t.f||0,v=t.p||0,b=t.b||0,_=t.l,C=t.d,R=t.m,I=t.n,P=8*o;do{if(!_){m=k(e,v,1);var D=k(e,v+1,3);if(v+=3,!D){var M=e[(K=x(v)+4)-4]|e[K-3]<<8,z=K+M;if(z>o){p&&A(0);break}d&&g(b+M),n.set(e.subarray(K,z),b),t.b=b+=M,t.p=v=8*z,t.f=m;continue}if(1==D)_=w,C=E,R=9,I=5;else if(2==D){var N=k(e,v,31)+257,L=k(e,v+10,15)+4,B=N+k(e,v+5,31)+1;v+=14;for(var U=new r(B),G=new r(19),j=0;j>4)<16)U[j++]=K;else{var W=0,J=0;for(16==K?(J=3+k(e,v,3),v+=2,W=U[j-1]):17==K?(J=3+k(e,v,7),v+=3):18==K&&(J=11+k(e,v,127),v+=7);J--;)U[j++]=W}}var X=U.subarray(0,N),Q=U.subarray(N);R=S(X),I=S(Q),_=y(X,R,1),C=y(Q,I,1)}else A(1);if(v>P){p&&A(0);break}}d&&g(b+131072);for(var Y=(1<>4;if((v+=15&W)>P){p&&A(0);break}if(W||A(2),ee<256)n[b++]=ee;else{if(256==ee){Z=v,_=null;break}var te=ee-254;if(ee>264){var ne=a[j=ee-257];te=k(e,v,(1<>4;re||A(3),v+=15&re;Q=h[ie];if(ie>3){ne=s[ie];Q+=T(e,v)&(1<P){p&&A(0);break}d&&g(b+131072);var oe=b+te;if(b0;)t=t[0],--R;m=t[n],p[++d]=m}}else if(e<33)if(e<30)28===e?(E=p[d--],p[d]=p[d]=E;else if(e<35)if(33===e){var U=p[d--];p[d]=p[d]instanceof U}else{for(R=i[u++],n=i[u++],t=s;R>0;)t=t[0],--R;p[++d]=t,p[++d]=n}else e<36?p[d]=-p[d]:36===e?p[++d]=!1:(m=p[d--],p[d]*=m);else if(e<57)if(e<47)if(e<42)if(e<40)if(38===e)E=p[d--],p[d]=p[d]|E;else{n=i[u++];var G=M[n];m=y(G,o),p[++d]=m,p[++d]=G}else if(40===e){n=i[u++];var j=p[d--];Object.defineProperty(p[d],M[n],{get:j,enumerable:!0,configurable:!0})}else t=i[u++],p[d--]&&(u+=t);else if(e<44)if(42===e)E=p[d--],p[d]=p[d]>E;else{var H=p[d--];m=(U=p[d--])[H]--,p[++d]=m}else if(e<45)E=p[d--],p[d]=p[d]>>>E;else if(45===e){k=i[u++];for(var V=[void 0];k>0;)V[k--]=p[d--];var F=p[d--];A=new(Function.bind.apply(F,V)),p[++d]=A}else E=p[d--],p[d]=p[d]>>E;else if(e<52)if(e<49)47===e?(E=p[d--],p[d]=p[d]!=E):(E=p[d--],p[d]=p[d]==E);else if(e<50)n=i[u++],p[d]=p[d][M[n]];else{if(50===e)return t=i[u++],l=1,void(f=u+t);m=p[d--],p[d]-=m}else if(e<54)if(52===e)t=i[u++],u+=t;else{var K=i[u++];p[d=d-K+1]=p.slice(d,d+K)}else e<55?(t=i[u++],m=p[d--],p[d]===m&&(--d,u+=t)):55===e?p[d]=!p[d]:(m=p[d--],p[d]+=m);else if(e<67)if(e<62)if(e<59)if(57===e){m=p[d--];var q=p[d--];(U=p[d--])[q]=m}else m=p[d],p[++d]=m;else e<60?(U=p[d--],p[d]=p[d]in U):60===e?p[d]=void 0:(m=p[d--],p[d]/=m);else if(e<64)if(62===e){var W=p[d--];m=--(U=p[d--])[W],p[++d]=m}else{for(R=i[u++],n=i[u++],t=s;R>0;)t=t[0],--R;t[n]=p[d--]}else{if(e<65)return l=3,void(f=p[d--]);if(65===e)E=p[d--],p[d]=p[d]===E;else{for(var L in n=i[u++],z=[],U=p[d--])z.push(L);s[n]=[z,U]}}else if(e<72)if(e<69)67===e?p[++d]={}:(E=p[d--],p[d]=p[d]!==E);else if(e<70){var J=p[d--];p[d]=p[d][J]}else 70===e?(n=i[u++],m=p[d--],Object.defineProperty(p[d],M[n],{value:m,writable:!0,configurable:!0,enumerable:!0})):p[d]=+p[d];else if(e<74)if(72===e)p[++d]=void 0;else{n=i[u++];var X=p[d--];Object.defineProperty(p[d],M[n],{set:X,enumerable:!0,configurable:!0})}else if(e<75){var Q=p[d--];m=(U=p[d--])[Q]++,p[++d]=m}else 75===e?--d:(E=p[d--],p[d]=p[d]<=0;--n)if((r=t[n])[0]=0;--n)if((r=t[n])[0]=0;--n){var r;if((r=t[n])[0]=128&&r<192)t=(t<<6)+(63&r);else if(t>=0&&n.push(t),r<128)t=r;else if(r<224)t=31&r;else if(r<240)t=15&r;else{if(!(r<248))break;t=7&r}}return String.fromCodePoint.apply(null,n)}function H(e,t){return(e.charCodeAt(0)^(this+this%10*t)%256)>>>0}},8549:function(e,t,n){"use strict";n.d(t,{F2:function(){return Yt},Ay:function(){return $t}});var r=n(5155),i=n(1752);function o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.init(t,n)}return u(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||g,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function i(){return!e||"string"===typeof e}for(var o="string"!==typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function E(e,t,n){var r=w(e,t,Object);r.obj[r.k]=n}function S(e,t){var n=w(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=S(e,n);return void 0!==r?r:S(t,n)}function T(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"===typeof e[r]||e[r]instanceof String||"string"===typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):T(e[r],t[r],n):e[r]=t[r]);return e}function x(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function C(e){return"string"===typeof e?e.replace(/[&<>"'\/]/g,(function(e){return O[e]})):e}var A="undefined"!==typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,R=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return a(this,t),n=f(this,d(t).call(this)),A&&y.call((0,l.A)(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return h(t,e),u(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!==typeof n&&(o=o.concat(n)),n&&"string"===typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),S(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),E(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!==typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var c=S(this.data,s)||{};r?T(c,n,i):c=o({},c,n),E(this.data,s,c),a.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(y),I={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},P={},D=function(e){function t(e){var n,r,i,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(this,t),n=f(this,d(t).call(this)),A&&y.call((0,l.A)(n)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=e,o=(0,l.A)(n),r.forEach((function(e){i[e]&&(o[e]=i[e])})),n.options=s,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=v.create("translator"),n}return h(t,e),u(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return"string"===typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,i){var a=this;if("object"!==(0,r.A)(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),void 0===e||null===e)return"";Array.isArray(e)||(e=[String(e)]);var s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,c=this.extractFromKey(e[e.length-1],n),u=c.key,l=c.namespaces,f=l[l.length-1],d=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=n.nsSeparator||this.options.nsSeparator;return f+h+u}return u}var g=this.resolve(e,n),m=g&&g.res,v=g&&g.usedKey||u,y=g&&g.exactUsedKey||u,b=Object.prototype.toString.apply(m),_=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject;if(w&&m&&("string"!==typeof m&&"boolean"!==typeof m&&"number"!==typeof m)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(b)<0&&("string"!==typeof _||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,m,n):"key '".concat(u," (").concat(this.language,")' returned an object instead of string.");if(s){var E="[object Array]"===b,S=E?[]:{},k=E?y:v;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var x="".concat(k).concat(s).concat(T);S[T]=this.translate(x,o({},n,{joinArrays:!1,ns:l})),S[T]===x&&(S[T]=m[T])}m=S}}else if(w&&"string"===typeof _&&"[object Array]"===b)(m=m.join(_))&&(m=this.extendTranslation(m,e,n,i));else{var O=!1,C=!1,A=void 0!==n.count&&"string"!==typeof n.count,R=t.hasDefaultValue(n),I=A?this.pluralResolver.getSuffix(d,n.count):"",P=n["defaultValue".concat(I)]||n.defaultValue;!this.isValidLookup(m)&&R&&(O=!0,m=P),this.isValidLookup(m)||(C=!0,m=u);var D=R&&P!==m&&this.options.updateMissing;if(C||O||D){if(this.logger.log(D?"updateKey":"missingKey",d,f,u,D?P:m),s){var M=this.resolve(u,o({},n,{keySeparator:!1}));M&&M.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.")}var z=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var L=0;L1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),u=c.key;n=u;var l=c.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==s.count&&"string"!==typeof s.count,d=void 0!==s.context&&"string"===typeof s.context&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(o=e,!P["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(P["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" 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((function(n){if(!a.isValidLookup(t)){i=n;var o,c,l=u,p=[l];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(p,u,n,e,s);else f&&(o=a.pluralResolver.getSuffix(n,s.count)),f&&d&&p.push(l+o),d&&p.push(l+="".concat(a.options.contextSeparator).concat(s.context)),f&&p.push(l+=o);for(;c=p.pop();)a.isValidLookup(t)||(r=c,t=a.getResource(n,e,c,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}]),t}(y);function M(e){return e.charAt(0).toUpperCase()+e.slice(1)}var z=function(){function e(t){a(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=v.create("languageUtils")}return u(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"===typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=M(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=M(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=M(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),"string"===typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"===typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"===typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),N=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],L={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};var B=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.languageUtils=t,this.options=n,this.logger=v.create("pluralResolver"),this.rules=function(){var e={};return N.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:L[t.fc]}}))})),e}()}return u(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"===typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),U=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.logger=v.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return u(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:C,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?x(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?x(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?x(t.nestingPrefix):t.nestingPrefixEscaped||x("$t("),this.nestingSuffix=t.nestingSuffix?x(t.nestingSuffix):t.nestingSuffixEscaped||x(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var i=k(t,c,e);return s.alwaysFormat?s.format(i,void 0,n):i}var o=e.split(s.formatSeparator),a=o.shift().trim(),u=o.join(s.formatSeparator).trim();return s.format(k(t,c,a),u,n,r)};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){if(void 0===(o=l(i[1].trim())))if("function"===typeof f){var n=f(e,i,r);o="string"===typeof n?n:""}else{if(d){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"===typeof o||s.useRawValueToEscape||(o=_(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o({},a);function c(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,s)).replace(/'/g,'"');try{s=JSON.parse(i),t&&(s=o({},t,s))}catch(a){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),a),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var u=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var f=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=f.shift(),u=f,l=!0}if((r=t(c.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!==typeof r)return r;"string"!==typeof r&&(r=_(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),l&&(r=u.reduce((function(e,t){return i.format(e,t,a.lng,a)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();var G=function(e){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(this,t),i=f(this,d(t).call(this)),A&&y.call((0,l.A)(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=v.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return h(t,e),u(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],a=[],s=[],c=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),o.indexOf(s)<0&&o.push(s),c.indexOf(t)<0&&c.push(t)))})),r||s.push(e)})),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:o,pending:a,toLoadLanguages:s,toLoadNamespaces:c}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var i=w(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}(n.loaded,[i],o),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,c){s&&c&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,a)}),o):a(s,c)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"===typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"===typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(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!!!"):void 0!==n&&null!==n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,o({},a,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(y);function j(e){return"string"===typeof e.ns&&(e.ns=[e.ns]),"string"===typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"===typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function H(){}var V=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(a(this,t),e=f(this,d(t).call(this)),A&&y.call((0,l.A)(e)),e.options=j(n),e.services={},e.logger=v,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),f(e,(0,l.A)(e));setTimeout((function(){e.init(n,r)}),0)}return e}return h(t,e),u(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"===typeof e?new e:e:null}if("function"===typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===(0,r.A)(e[1])&&(t=e[1]),"string"===typeof e[1]&&(t.defaultValue=e[1]),"string"===typeof e[2]&&(t.tDescription=e[2]),"object"===(0,r.A)(e[2])||"object"===(0,r.A)(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,j(t)),this.format=this.options.interpolation.format,n||(n=H),!this.options.isClone){this.modules.logger?v.init(i(this.modules.logger),this.options):v.init(null,this.options);var a=new z(this.options);this.store=new R(this.options.resources,this.options);var s=this.services;s.logger=v,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new B(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new U(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new G(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==c[0]&&(this.options.lng=c[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((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var u=b(),l=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),u}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H,r="string"===typeof e?e:this.language;if("function"===typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(r)o(r);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return o(e)}));this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=b();return e||(e=this.languages),t||(t=this.options.ns),n||(n=H),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(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&&I.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=b();this.emit("languageChanging",e);var i=function(e){var i="string"===typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var a;if("object"!==(0,r.A)(i)){for(var s=arguments.length,c=new Array(s>2?s-2:0),u=2;u1&&void 0!==arguments[1]?arguments[1]:{};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;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!this.services.backendConnector.backend||!(!a(r,e)||i&&!a(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=b();return this.options.ns?("string"===typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=b();"string"===typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";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"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H,i=o({},this.options,n,{isClone:!0}),a=new t(i);return["store","services","language"].forEach((function(t){a[t]=e[t]})),a.services=o({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new D(a.services,a.options),a.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(ge,(function(e,n,r,i,o,a){if(n)t.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(me.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(pe.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(pe,(function(e,n,r,i,o,a){return"*"===r?t.minimumFractionDigits=n.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&a?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var o=i.options[0];"w"===o?t=W(W({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=W(W({},t),ve(o)))}else if(he.test(i.stem))t=W(W({},t),ve(i.stem));else{var a=ye(i.stem);a&&(t=W(W({},t),a));var s=be(i.stem);s&&(t=W(W({},t),s))}}return t}var Ee,Se={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function ke(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(Se[n||""]||Se[r||""]||Se["".concat(r,"-001")]||Se["001"])[0]}var Te=new RegExp("^".concat(ue.source,"*")),xe=new RegExp("".concat(ue.source,"*$"));function Oe(e,t){return{start:e,end:t}}var Ce=!!String.prototype.startsWith,Ae=!!String.fromCodePoint,Re=!!Object.fromEntries,Ie=!!String.prototype.codePointAt,Pe=!!String.prototype.trimStart,De=!!String.prototype.trimEnd,Me=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ze=!0;try{ze="a"===(null===(Ee=Ve("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Ee?void 0:Ee[0])}catch(Zt){ze=!1}var Ne,Le=Ce?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Be=Ae?String.fromCodePoint:function(){for(var e=[],t=0;to;){if((n=e[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},Ue=Re?Object.fromEntries:function(e){for(var t={},n=0,r=e;n=n)){var r,i=e.charCodeAt(t);return i<55296||i>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},je=Pe?function(e){return e.trimStart()}:function(e){return e.replace(Te,"")},He=De?function(e){return e.trimEnd()}:function(e){return e.replace(xe,"")};function Ve(e,t){return new RegExp(e,t)}if(ze){var Fe=Ve("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Ne=function(e,t){var n;return Fe.lastIndex=t,null!==(n=Fe.exec(e)[1])&&void 0!==n?n:""}}else Ne=function(e,t){for(var n=[];;){var r=Ge(e,t);if(void 0===r||We(r)||Je(r))break;n.push(r),t+=r>=65536?2:1}return Be.apply(void 0,n)};var Ke=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(e,n)).err)return o;r.push(o.val)}else{if(125===i&&e>0)break;if(35!==i||"plural"!==t&&"selectordinal"!==t){if(60===i&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(X.UNMATCHED_CLOSING_TAG,Oe(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&qe(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;r.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;r.push(o.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:Q.pound,location:Oe(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Q.literal,value:"<".concat(r,"/>"),location:Oe(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:Q.tag,value:r,children:o,location:Oe(n,this.clonePosition())},err:null}:this.error(X.INVALID_TAG,Oe(a,this.clonePosition())))}return this.error(X.UNCLOSED_TAG,Oe(n,this.clonePosition()))}return this.error(X.INVALID_TAG,Oe(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var i=this.tryParseQuote(t);if(i)r+=i;else{var o=this.tryParseUnquoted(e,t);if(o)r+=o;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=Oe(n,this.clonePosition());return{val:{type:Q.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(qe(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Be.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Be(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(X.EXPECT_ARGUMENT_CLOSING_BRACE,Oe(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(X.EMPTY_ARGUMENT,Oe(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(X.MALFORMED_ARGUMENT,Oe(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(X.EXPECT_ARGUMENT_CLOSING_BRACE,Oe(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Q.argument,value:r,location:Oe(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(X.EXPECT_ARGUMENT_CLOSING_BRACE,Oe(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(X.MALFORMED_ARGUMENT,Oe(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Ne(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Oe(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var i,o=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(X.EXPECT_ARGUMENT_TYPE,Oe(o,s));case"number":case"date":case"time":this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition();if((v=this.parseSimpleArgStyleIfPossible()).err)return v;if(0===(p=He(v.val)).length)return this.error(X.EXPECT_ARGUMENT_STYLE,Oe(this.clonePosition(),this.clonePosition()));c={style:p,styleLocation:Oe(u,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var l=Oe(r,this.clonePosition());if(c&&Le(null===c||void 0===c?void 0:c.style,"::",0)){var f=je(c.style.slice(2));if("number"===a)return(v=this.parseNumberSkeletonFromString(f,c.styleLocation)).err?v:{val:{type:Q.number,value:n,location:l,style:v.val},err:null};if(0===f.length)return this.error(X.EXPECT_DATE_TIME_SKELETON,l);var d=f;this.locale&&(d=function(e,t){for(var n="",r=0;r>1),c=ke(t);for("H"!=c&&"k"!=c||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=c+n}else n+="J"===i?"H":i}return n}(f,this.locale));var p={type:Y.dateTime,pattern:d,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?fe(d):{}};return{val:{type:"date"===a?Q.date:Q.time,value:n,location:l,style:p},err:null}}return{val:{type:"number"===a?Q.number:"date"===a?Q.date:Q.time,value:n,location:l,style:null!==(i=null===c||void 0===c?void 0:c.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var h=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(X.EXPECT_SELECT_ARGUMENT_OPTIONS,Oe(h,W({},h)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),m=0;if("select"!==a&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(X.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Oe(this.clonePosition(),this.clonePosition()));var v;if(this.bumpSpace(),(v=this.tryParseDecimalInteger(X.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,X.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return v;this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=v.val}var y,b=this.tryParsePluralOrSelectOptions(e,a,t,g);if(b.err)return b;if((y=this.tryParseArgumentClose(r)).err)return y;var _=Oe(r,this.clonePosition());return"select"===a?{val:{type:Q.select,value:n,options:Ue(b.val),location:_},err:null}:{val:{type:Q.plural,value:n,options:Ue(b.val),offset:m,pluralType:"plural"===a?"cardinal":"ordinal",location:_},err:null};default:return this.error(X.INVALID_ARGUMENT_TYPE,Oe(o,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(X.EXPECT_ARGUMENT_CLOSING_BRACE,Oe(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(X.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Oe(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(de).filter((function(e){return e.length>0}));n=48&&a<=57))break;i=!0,o=10*o+(a-48),this.bump()}var s=Oe(r,this.clonePosition());return i?Me(o*=n)?{val:o,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Ge(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Le(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&We(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!==n&&void 0!==n?n:null},e}();function qe(e){return e>=97&&e<=122||e>=65&&e<=90}function We(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Je(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Xe(e){e.forEach((function(e){if(delete e.location,re(e)||ie(e))for(var t in e.options)delete e.options[t].location,Xe(e.options[t].value);else ee(e)&&se(e.style)||(te(e)||ne(e))&&ce(e.style)?delete e.style.location:ae(e)&&Xe(e.children)}))}function Qe(e,t){void 0===t&&(t={}),t=W({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Ke(e,t).parse();if(n.err){var r=SyntaxError(X[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null===t||void 0===t?void 0:t.captureLocation)||Xe(n.val),n.val}function Ye(e,t){var n=t&&t.cache?t.cache:ot,r=t&&t.serializer?t.serializer:nt;return(t&&t.strategy?t.strategy:tt)(e,{cache:n,serializer:r})}function $e(e,t,n,r){var i,o=null==(i=r)||"number"===typeof i||"boolean"===typeof i?r:n(r),a=t.get(o);return"undefined"===typeof a&&(a=e.call(this,r),t.set(o,a)),a}function Ze(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return"undefined"===typeof o&&(o=e.apply(this,r),t.set(i,o)),o}function et(e,t,n,r,i){return n.bind(t,e,r,i)}function tt(e,t){return et(e,this,1===e.length?$e:Ze,t.cache.create(),t.serializer)}var nt=function(){return JSON.stringify(arguments)};function rt(){this.cache=Object.create(null)}rt.prototype.get=function(e){return this.cache[e]},rt.prototype.set=function(e,t){this.cache[e]=t};var it,ot={create:function(){return new rt}},at={variadic:function(e,t){return et(e,this,Ze,t.cache.create(),t.serializer)},monadic:function(e,t){return et(e,this,$e,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(it||(it={}));var st,ct=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.originalMessage=r,i}return q(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),ut=function(e){function t(t,n,r,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),it.INVALID_VALUE,i)||this}return q(t,e),t}(ct),lt=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),it.INVALID_VALUE,r)||this}return q(t,e),t}(ct),ft=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),it.MISSING_VALUE,n)||this}return q(t,e),t}(ct);function dt(e){return"function"===typeof e}function pt(e,t,n,r,i,o,a){if(1===e.length&&$(e[0]))return[{type:st.literal,value:e[0].value}];for(var s=[],c=0,u=e;c0?new Intl.Locale(t[0]):new Intl.Locale("string"===typeof e?e:e[0])},e.__parse=Qe,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),yt=vt,bt=function(){return bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1?e.replace(/###/g,"."):e}function i(){return!e||"string"===typeof e}void 0===n&&(n=null);for(var o="string"!==typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),e=e[a]}return i()?{}:{obj:e,k:r(o.shift())}}!function(e){e.keepRaw="keepRaw",e.replaceAnyway="replaceAnyway"}(mt||(mt={}));mt.replaceAnyway;var wt={memoize:!1,memoizeFallback:!1,bindI18n:!1,bindI18nStore:!1,onParseError:mt.replaceAnyway},Et=function(){function e(){this.mem={}}return e.staticInit=function(t){e._i18nextInstance=t},e.prototype.init=function(t,n){var r=this;void 0===t&&(t=e._i18nextInstance);var i={};if((null===t||void 0===t?void 0:t.options)&&(t.options.i18nFormat&&(i=t.options.i18nFormat),i.onParseError=t.options.onParseError,i.missingInterpolationHandler=t.options.missingInterpolationHandler,i.icuConfig=t.options.icuConfig,i.ignoreWarning=!!t.options.ignoreWarning),this.options=Object.assign(wt,n,i),this.formats=this.options.formats,t){var o=this.options,a=o.bindI18n,s=o.bindI18nStore,c=o.memoize;t.IntlMessageFormat=yt,this.IntlMessageFormat=yt,t.ICU=this,c&&(a&&t.on(a,(function(){return r.clearCache()})),s&&t.store.on(s,(function(){return r.clearCache()})))}this.options.localeData&&("[object Array]"===Object.prototype.toString.apply(this.options.localeData)?this.options.localeData.forEach((function(e){return r.addLocaleData(e)})):this.addLocaleData(this.options.localeData))},e.prototype.addLocaleData=function(e){("[object Array]"===Object.prototype.toString.apply(e)?e:[e]).forEach((function(e){e&&e.locale&&yt.__addLocaleData(e)}))},e.prototype.addUserDefinedFormats=function(e){this.formats=this.formats?bt(bt({},this.formats),e):e},e.prototype.checkMissingInterpolation=function(e,t,n,r,i){if(!1===(this.options.icuConfig||{}).strict)return n;for(var o={},a=0,s=e;a-1?(window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t][a].default=e,i=a):i=window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t].push({options:n,default:e})-1}else window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t]=[{options:n,default:e}],i=0;return"[[__starling_"+i+"_"+t+"__]]"}return e}};function xt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ot(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e._waitingToAddResourceBundle);try{for(a.s();!(o=a.n()).done;){var s,c=o.value;(s=e.instance).addResourceBundle.apply(s,At(c))}}catch(r){a.e(r)}finally{a.f()}e._waitingToAddResourceBundle=[]}catch(r){}r||(e._updateLanguages(),t({t:i,err:r})),e.init=!0,n({t:i,err:r})}))}))}},{key:"_updateLanguages",value:function(){this.languages=this.instance?Array.from(new Set([this.instance.language].concat(At(this.instance.languages)))):null}},{key:"getLanguages",value:function(){return this.languages}},{key:"changeLanguage",value:function(e,t){var n=this;this.config.lng=e,this.instance.changeLanguage(e,(function(e,r){e||n._updateLanguages(),t&&t(e,r)}))}},{key:"changeLanguageWithPromise",value:function(e){var t=this;return new Promise((function(n,r){t.config.lng=e,t.instance.changeLanguage(e,(function(e,i){e&&r({err:e,t:i}),t._updateLanguages(),n({err:e,t:i})}))}))}},{key:"getDir",value:function(e){return this.instance.dir(e)}},{key:"t",value:function(e,t,n){var r=Array.isArray(e)?Array.from(e).map((function(){return" "})).join(""):Array(e.length).fill(" "),i=Object.assign({keySeparator:r,nsSeparator:r},t);return"thirdParamFallback"in this.config&&this.config.thirdParamFallback&&(i.thirdParamFallback=!0),this.instance.t(e,n,i)}},{key:"addResourceBundle",value:function(e,t,n,r,i){return this.instance.isInitialized?this.instance.addResourceBundle(e,t,n,r,i):(this._waitingToAddResourceBundle.push([e,t,n,!!r,!!i]),this.instance)}},{key:"cloneInstance",value:function(t,n){var r=this.instance.cloneInstance(t,n),i=new e({copiedI18nextInstance:r});return i.t=this.t.bind(i),i.config=this.config,i.plugins=this.plugins,i.languages=this.languages,i.init=r.isInitialized||Boolean(this.init),i.userLng=this.userLng,r.on("initialized",(function(){i.init=!0})),i}}]),e}(),Vt="Starling_intl:",Ft=function(){for(var e,t="".concat(Vt," [WARNING]"),n=arguments.length,r=new Array(n),i=0;i-1}(e)?e:t.name+"/"+e;n[r]=t.reducers[e]}));var r=function(e,r){return void 0===e&&(e=t.state),r.type in n?n[r.type](e,r.payload,r.meta):e},i=t.baseReducer,o=i?function(e,n){return void 0===e&&(e=t.state),r(i(e,n),n)}:r;e.forEachPlugin("onReducer",(function(n){o=n(o,t.name,e)||o})),e.reduxConfig.reducers[t.name]=o}function E(e){var t=e.reduxConfig.rootReducers,n=function(e){var t=e.combineReducers||h;if(!Object.keys(e.reducers).length)return function(e){return e};return t(e.reducers)}(e.reduxConfig),r=n;return t&&Object.keys(t).length&&(r=function(e,r){var i=t[r.type];return n(i?i(e,r):e,r)}),e.forEachPlugin("onRootReducer",(function(t){r=t(r,e)||r})),r}var S=function(e){},k=function(e,t,n,r){return Object.assign((function(r,i){var o={type:t+"/"+n};return"undefined"!==typeof r&&(o.payload=r),"undefined"!==typeof i&&(o.meta=i),e.dispatch(o)}),{isEffect:r})},T=function(e,t){var n=e.dispatch[t.name];Object.keys(t.reducers).forEach((function(r){t.name,t.reducers,n[r]=k(e,t.name,r,!1)}))},x=function(e,t,n){var r=e.dispatch[n.name],i={};n.effects&&(i="function"===typeof n.effects?n.effects(e.dispatch):n.effects),Object.keys(i).forEach((function(o){n.name,t.effects[n.name+"/"+o]=i[o].bind(r),r[o]=k(e,n.name,o,!0)}))};function O(e){return{models:(t=e.models,Object.keys(t).map((function(e){var n=function(e,t){return b({name:e,reducers:{}},t)}(e,t[e]);return S(n),n}))),reduxConfig:e.redux,forEachPlugin:function(t,n){e.plugins.forEach((function(e){e[t]&&n(e[t])}))},effects:{}};var t}function C(e){var t=O(e);t.reduxConfig.middlewares.push(function(e){return function(t){return function(n){return function(r){return r.type in e.effects?(n(r),e.effects[r.type](r.payload,t.getState(),r.meta)):n(r)}}}}(t)),t.forEachPlugin("createMiddleware",(function(e){t.reduxConfig.middlewares.push(e(t))}));var n,r=_(t),i=b({},r,{name:e.name,addModel:function(e){S(e),w(t,e),A(i,e),R(i,t,e),r.replaceReducer(E(t)),r.dispatch({type:"@@redux/REPLACE"})}});return n=i,e.plugins.forEach((function(e){e.exposed&&Object.keys(e.exposed).forEach((function(t){if(e.exposed){var r=e.exposed[t],i="function"===typeof r;n[t]=i?function(){for(var e=arguments.length,t=new Array(e),i=0;i1024){for(var t=0,n=o.length-a;t=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){s.headers[e]=r.merge(o)})),e.exports=s},4124:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},5204:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7652:function(e,t,n){"use strict";var r=n(4124),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n>32,this.state[14]=o[0],this.state[15]=o[1]):(this.state[13]=o[0],this.state[14]=o[1],this.state[15]=o[2]),this}function a(e){const t=new Uint32Array(16);for(let n=16;n--;)t[n]=e[n];for(let n=0;n<20;n+=2)c(t,0,4,8,12),c(t,1,5,9,13),c(t,2,6,10,14),c(t,3,7,11,15),c(t,0,5,10,15),c(t,1,6,11,12),c(t,2,7,8,13),c(t,3,4,9,14);for(let n=0;n<16;n++)t[n]+=e[n];return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function s(e,t){return e<>>32-t}function c(e,t,n,r,i){e[t]+=e[n],e[i]^=e[t],e[i]=s(e[i],16),e[r]+=e[i],e[n]^=e[r],e[n]=s(e[n],12),e[t]+=e[n],e[i]^=e[t],e[i]=s(e[i],8),e[r]+=e[i],e[n]^=e[r],e[n]=s(e[n],7)}o.prototype.update=function(e,t){r(!this.finalized,"cipher finalized."),r(e.byteLength>=t.byteLength,"output cannot be shorter than input.");let n=t.length,i=this.pos%64;this.pos+=n;let o=0,s=a(this.state);for(;i>0&&n>0;)e[o]=t[o++]^s[i],i=i+1&63,i||this.state[12]++,n--;for(;n>0;){if(s=a(this.state),n<64){for(let r=0;r0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"===typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},57:function(e){"use strict";e.exports=function(e){return e[1]}},3551:function(e,t,n){var r,i;!function(o){if(void 0===(i="function"===typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i),e.exports=o(),!!0){var a=window.Cookies,s=window.Cookies=o();s.noConflict=function(){return window.Cookies=a,s}}}((function(){function e(){for(var e=0,t={};e=t||n<0||m&&e-u>=o}function _(){var e=p();if(b(e))return w(e);s=setTimeout(_,function(e){var n=t-(e-c);return m?d(n,o-(e-u)):n}(e))}function w(e){return clearTimeout(s),s=void 0,v&&r?y(e):(r=i=void 0,a)}function E(){var e=p(),n=b(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(_,t),l?y(e):a}(c);if(m)return clearTimeout(s),s=setTimeout(_,t),y(c)}return void 0===s&&(s=setTimeout(_,t)),a}return t=g(t)||0,h(n)&&(l=!!n.leading,o=(m="maxWait"in n)?f(g(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v),E.cancel=function(){void 0!==s&&clearTimeout(s),c=u=0,r=i=s=void 0},E.flush=function(){return void 0===s?a:w(p())},E}},5873:function(e){e.exports=function e(n,r){if(!n){var i=new t(r);throw Error.captureStackTrace&&Error.captureStackTrace(i,e),i}};class t extends Error{}t.prototype.name="AssertionError"},6308:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var o,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c0&&c>s&&(c=s);for(var u=0;u=0?(l=h.substr(0,g),f=h.substr(g+1)):(l=h,f=""),d=decodeURIComponent(l),p=decodeURIComponent(f),t(o,d)?Array.isArray(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o}},5466:function(e){"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"===typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(n):o+encodeURIComponent(t(e[i]))})).filter(Boolean).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},6042:function(e,t,n){"use strict";t.decode=t.parse=n(5558),t.encode=t.stringify=n(5466)},6994:function(e,t,n){for(var r=n(9451),i="undefined"===typeof window?n.g:window,o=["moz","webkit"],a="AnimationFrame",s=i["request"+a],c=i["cancel"+a]||i["cancelRequest"+a],u=0;!s&&u