(()=>{var e={2511:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp("("+t+")|([^%]+?)","gi"),o=new RegExp("("+t+")+","gi");function r(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),o=e.slice(t);return Array.prototype.concat.call([],r(n),r(o))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n)||[],o=1;o{"use strict";e.exports=function(e,t){for(var n={},o=O(e),r=Array.isArray(t),i=0;i{e.exports=function(){}},2807:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},1759:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},4474:(e,t,n)=>{"use strict";const o=n(1759),r=n(2511),i=n(2807),s=n(2659),a=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?o(e):encodeURIComponent(e):e}function u(e,t){return t.decode?r(e):e}function p(e){return Array.isArray(e)?e.sort():"object"==typeof e?p(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function g(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function v(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,o)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===o[e]&&(o[e]={}),o[e][t[1]]=n):o[e]=n};case"bracket":return(e,n,o)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==o[e]?o[e]=[].concat(o[e],n):o[e]=[n]:o[e]=n};case"colon-list-separator":return(e,n,o)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==o[e]?o[e]=[].concat(o[e],n):o[e]=[n]:o[e]=n};case"comma":case"separator":return(t,n,o)=>{const r="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!r&&u(n,e).includes(e.arrayFormatSeparator);n=i?u(n,e):n;const s=r||i?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);o[t]=s};case"bracket-separator":return(t,n,o)=>{const r=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!r)return void(o[t]=n?u(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==o[t]?o[t]=[].concat(o[t],i):o[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),o=Object.create(null);if("string"!=typeof e)return o;if(!(e=e.trim().replace(/^[?#&]/,"")))return o;for(const r of e.split("&")){if(""===r)continue;let[e,s]=i(t.decode?r.replace(/\+/g," "):r,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:u(s,t),n(u(e,t),s,o)}for(const e of Object.keys(o)){const n=o[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=m(n[e],t);else o[e]=m(n,t)}return!1===t.sort?o:(!0===t.sort?Object.keys(o).sort():Object.keys(o).sort(t.sort)).reduce(((e,t)=>{const n=o[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=p(n):e[t]=n,e}),Object.create(null))}t.extract=g,t.parse=v,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],o=function(e){switch(e.arrayFormat){case"index":return t=>(n,o)=>{const r=n.length;return void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:null===o?[...n,[l(t,e),"[",r,"]"].join("")]:[...n,[l(t,e),"[",l(r,e),"]=",l(o,e)].join("")]};case"bracket":return t=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:null===o?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(o,e)].join("")];case"colon-list-separator":return t=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:null===o?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(o,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(o,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?o:(r=null===r?"":r,0===o.length?[[l(n,e),t,l(r,e)].join("")]:[[o,l(r,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:null===o?[...n,l(t,e)]:[...n,[l(t,e),"=",l(o,e)].join("")]}}(t),r={};for(const t of Object.keys(e))n(t)||(r[t]=e[t]);const i=Object.keys(r);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const r=e[n];return void 0===r?"":null===r?l(n,t):Array.isArray(r)?0===r.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":r.reduce(o(n),[]).join("&"):l(n,t)+"="+l(r,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,o]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:v(g(e),t)},t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:u(o,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);const o=d(e.url).split("?")[0]||"",r=t.extract(e.url),i=t.parse(r,{sort:!1}),s=Object.assign(i,e.query);let c=t.stringify(s,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[a]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${o}${c}${u}`},t.pick=(e,n,o)=>{o=Object.assign({parseFragmentIdentifier:!0,[a]:!1},o);const{url:r,query:i,fragmentIdentifier:c}=t.parseUrl(e,o);return t.stringifyUrl({url:r,query:s(i,n),fragmentIdentifier:c},o)},t.exclude=(e,n,o)=>{const r=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,r,o)}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}(()=>{"use strict";const e=new Map,t="WEBAPP_APP_CONTEXT";var o,r=n(4474);!function(e){e.WebApp="Webapp",e.Analytics="MT_Analytics",e.Reflow="MT_Reflow",e.Login="WebApp_Login",e.POI="poi_web",e.RechargeReferral="Webapp_recharge_referral",e.KickUserFrontier="kick_user_frontier"}(o||(o={}));const i=(e="")=>"zh-Hans"===e?e:e.split("-")[0].replace("zh","zh-Hant")||e||"en";n(7432);const s="$PREFETCH_CACHE",a="__$UNIVERSAL_DATA$__",c="__UNIVERSAL_DATA_FOR_REHYDRATION__",l="__DEFAULT_SCOPE__";function u(e,t){var n,o,r,i;if(!window[a]){let e={};try{e=JSON.parse(null!==(o=null===(n=document.getElementById(c))||void 0===n?void 0:n.textContent)&&void 0!==o?o:"{}")}catch(e){console.error("error while parsing rehydration data")}window[a]=e}return null!==(i=null===(r=window[a][null!=t?t:l])||void 0===r?void 0:r[e])&&void 0!==i?i:null}function p(){const e=u("webapp.app-context");return Promise.resolve(e)}function d(){const e=u("webapp.biz-context");return Promise.resolve(e)}function g(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r1e3?"unknown":h.test(e)?"android":y.test(e)?"linux":v.test(e)?"ios":f.test(e)?"mac":_.test(e)?"windows":"unknown"}function w(e){return function(e){return!(e.length>1e3)&&v.test(e)}(e)||function(e){return h.test(e)}(e)}const x={kind:"m",captcha:"",imApi:"https://im-api-va.tiktok.com",imFrontier:"wss://im-ws-va.tiktok.com/ws/v2",mTApi:"https://m.tiktok.com",rootApi:"https://www.tiktok.com",secSDK:"",slardar:"mon.tiktokv.com",starling:"https://starling-va.tiktokv.com",tea:"https://mcs-va.tiktokv.com",teaChannel:"va",teaChannelType:"tcpy",libraWebSDK:"https://libraweb-va.tiktok.com",webcastApi:"https://webcast.tiktok.com",webcastRootApi:"https://webcast.tiktok.com",tcc:"https://sf-tcc-config.tiktokcdn.com/obj/tcc-config-web-maliva/",locationApi:"https://location-va.tiktokv.com"};let E=null;const k=(()=>{var e,t;if(E)return E;try{const n=JSON.parse(null!==(t=null===(e=document.querySelector("#api-domains"))||void 0===e?void 0:e.innerHTML)&&void 0!==t?t:"");return n?(E=n,n):x}catch(e){return x}})();var O,A;!function(e){e[e.Default=0]="Default",e[e.Simple=1]="Simple",e[e.None=2]="None"}(O||(O={})),function(e){e[e.None=0]="None",e[e.AWEME=1]="AWEME",e[e.FixedWww=2]="FixedWww",e[e.AutoMOrT=3]="AutoMOrT",e[e.Webcast=4]="Webcast",e[e.AutoWebcastMOrT=5]="AutoWebcastMOrT",e[e.AWEMEV1=6]="AWEMEV1",e[e.CommentTest=8]="CommentTest",e[e.WebcastT=9]="WebcastT",e[e.Now=10]="Now"}(A||(A={}));const T=(e,t)=>{try{return sessionStorage.getItem(e)||t}catch(e){return console.warn("sessionStorage get failed"),t}};function C(e,t=""){var n;try{return null!==(n=localStorage.getItem(e))&&void 0!==n?n:t}catch(e){return t}}const S=()=>{};function P(e,t=""){var n;try{return null!==(n=sessionStorage.getItem(e))&&void 0!==n?n:t}catch(e){return t}}var L;!function(e){e[e.Unknown=0]="Unknown",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"}(L||(L={}));const I="content-type",j="webapp-session-referer",U="device_id";class F{constructor(e){this.isPageVisible=!0,this.isFocus=!0,this.handleAppContext=e=>m(this,void 0,void 0,(function*(){return this.appContext||(this.appContext=yield this.options.getAppContextAsync()),e})),this.handleBizContext=e=>m(this,void 0,void 0,(function*(){this.bizContext||e.ignoreBizContext||(this.bizContext=yield this.options.getBizContextAsync());const{ignoreBizContext:t}=e;return g(e,["ignoreBizContext"])})),this.handleQuery=e=>m(this,void 0,void 0,(function*(){var t,n,o,r,i,s,a,c;const l=this.getRiskParams(null!==(t=e.riskParamsType)&&void 0!==t?t:0),u={},p=null===(n=this.bizContext)||void 0===n?void 0:n.canUseQuery,{type:d}=null!==(r=null===(o=this.appContext)||void 0===o?void 0:o.env)&&void 0!==r?r:{type:""},g=null===(i=this.appContext)||void 0===i?void 0:i.odinId,m="ppe"===d||"boe"===d,v=null!==(a=new URLSearchParams(null===(s=window.location)||void 0===s?void 0:s.search).get(U))&&void 0!==a?a:void 0;(p||m)&&v&&(u[U]=v);const h={WebIdLastTime:null===(c=this.appContext)||void 0===c?void 0:c.webIdCreatedTime};g&&(h.odinId=g);const y=function(){var e,t;try{const n=JSON.parse(null!==(t=null===(e=window.document.getElementById("__SCHEDULE_INFO__"))||void 0===e?void 0:e.textContent)&&void 0!==t?t:"{}");if(n.to)return n}catch(e){console.warn(e)}return{from:"",to:"",dispatchParams:{}}}(),f=y.to?y.dispatchParams:{},_=yield this.options.getExtraParams(e);return e.query=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l),e.query),_),f),u),h),e})),this.handleURL=e=>{var t;let{url:n}=e;const o=null!==(t=e.query)&&void 0!==t?t:{};return n.startsWith("http:")||n.startsWith("https:")||(n=`${function(e=0){var t,n,o,r,i,s,a,c;switch(e){case 9:{let e="https://webcast.tiktok.com";return"us"===k.kind&&(e="https://webcast.us.tiktok.com"),e}case 2:return null!==(t=k.rootApi)&&void 0!==t?t:"https://www.tiktok.com";case 3:return null!==(n=k.mTApi)&&void 0!==n?n:"";case 6:return null!==(o=k.rootApi)&&void 0!==o?o:"";case 4:return null!==(i=null!==(r=(()=>{var e,t,n;try{const o=document.getElementById("__REGION__DATA__INJECTED__");return null===(n=null===(t=JSON.parse(null!==(e=null==o?void 0:o.textContent)&&void 0!==e?e:"{}").__DATA__)||void 0===t?void 0:t.region_data_domains)||void 0===n?void 0:n.WEBAPP_WEBCAST_API}catch(e){return}})())&&void 0!==r?r:k.webcastRootApi)&&void 0!==i?i:"https://webcast.tiktok.com";case 5:return null!==(s=k.webcastApi)&&void 0!==s?s:"";case 0:return null!==(a=k.rootApi)&&void 0!==a?a:"";case 8:return null!==(c=k.rootApi)&&void 0!==c?c:"";case 10:return"https://now.tiktok.com";default:return""}}(e.baseUrlType)}${n}`),n=(0,r.stringifyUrl)({url:n,query:o}),e.url=n,e},this.options=e,"undefined"!=typeof window&&(function(e=S,t=S){let n,o;function r(){n&&document[n]?e():t()}"hidden"in document?(n="hidden",o="visibilitychange"):"msHidden"in document?(n="msHidden",o="msvisibilitychange"):"webkitHidden"in document&&(n="webkitHidden",o="webkitvisibilitychange"),"addEventListener"in document&&n&&o&&(document.addEventListener(o,r,!1),document.removeEventListener.bind(document,o,r,!1))}(this.handleVisibilityChange.bind(this,!1),this.handleVisibilityChange.bind(this,!0)),this.bindFocusChange())}init(e){return m(this,void 0,void 0,(function*(){const t=yield this.options.getAppContextAsync(e);this.appContext=t}))}get(e,t){return this.runFetch(e,Object.assign(Object.assign({},t),{method:"GET"}))}post(e,t={}){var{omitContentType:n=!1}=t,o=g(t,["omitContentType"]);const r=new Headers(o.headers);return r.get(I)||n||r.set(I,"application/x-www-form-urlencoded"),o.body||(o.body=""),o.headers=r,this.runFetch(e,Object.assign(Object.assign({},o),{method:"POST"}))}delete(e,t={}){var{omitContentType:n=!1}=t,o=g(t,["omitContentType"]);return this.runFetch(e,Object.assign(Object.assign({},o),{method:"DELETE"}))}getRiskParams(e){if(!this.appContext)return{};if(2===e)return{};if(P(j)||function(e,t){try{sessionStorage.setItem(e,t)}catch(e){}}(j,document.referrer),1===e)return Object.assign({},{cookie_enabled:navigator.cookieEnabled,screen_width:screen.width,screen_height:screen.height,browser_language:navigator.language,browser_platform:navigator.platform,browser_name:navigator.appCodeName,browser_version:navigator.appVersion,browser_online:navigator.onLine,timezone_name:Intl.DateTimeFormat().resolvedOptions().timeZone});const t={};"ageVerify"===P("enter_method")&&(t.security_verification_aid="1459");const n=navigator.userAgent;return Object.assign(Object.assign({},((e,t,n)=>{var o,r,i;const s=document.cookie.match(/s_v_web_id=(\w+)/);try{const a="v1"===(null===(i=null===(r=null===(o=e.abTestVersion)||void 0===o?void 0:o.parameters)||void 0===r?void 0:r.webapp_odin_id_fe_reverse)||void 0===i?void 0:i.vid),c=!!(e||{}).user,l=Object.assign(Object.assign({aid:"1988",app_name:"tiktok_web",channel:"tiktok_web",device_platform:(e||{}).isMobile?"web_mobile":"web_pc",device_id:(e||{}).wid,region:(e||{}).region,priority_region:((e||{}).user||{}).region||"",os:(e||{}).os,referer:document.referrer,root_referer:T("webapp-session-referer"),cookie_enabled:navigator.cookieEnabled,screen_width:screen.width,screen_height:screen.height,browser_language:navigator.language,browser_platform:navigator.platform,browser_name:navigator.appCodeName,browser_version:navigator.appVersion,browser_online:navigator.onLine,verifyFp:(s||"")[1],app_language:(e||{}).language,webcast_language:(e||{}).language,tz_name:Intl.DateTimeFormat().resolvedOptions().timeZone,is_page_visible:t,focus_state:n,is_fullscreen:window.matchMedia("(display-mode: fullscreen)").matches,history_len:window.history.length},a?{}:{user_is_login:c}),{data_collection_enabled:c||"1"===C("guest-mode-flag","0")});return"ageVerify"===T("enter_method")&&(l.security_verification_aid="1459"),l}catch(e){}return{}})(Object.assign(Object.assign({},this.appContext),{isMobile:w(n),os:b(n)}),this.isPageVisible,this.isFocus)),t)}responseHandler(e){return Promise.resolve(e)}runFetch(e,t){var n,o,r,{credentials:i="include"}=t,s=g(t,["credentials"]);return m(this,void 0,void 0,(function*(){let t=Object.assign({url:e,credentials:i},s);t=yield Promise.all([this.options.beforeHandleQuery(t),this.handleAppContext(t),this.handleBizContext(t)]).then((([,,e])=>this.handleQuery(e))).then((e=>this.handleURL(e)));const{url:a}=t,c=g(t,["url"]),l=new Set(["query","riskParamsType","baseUrlType","requireSecSdk"]),u=Object.keys(c).reduce(((e,t)=>(l.has(t)||(e[t]=c[t]),e)),{});u.credentials=i,null===(o=(n=this.options).beforeFetch)||void 0===o||o.call(n,a,null!==(r=s.method)&&void 0!==r?r:"GET");const p=yield this.fetchData(a,u);return this.responseHandler({response:p,url:p.url,config:u})}))}fetchData(e,t){return m(this,void 0,void 0,(function*(){let n;try{n=yield window.fetch.call(null,e,t)}catch(e){return Promise.reject(e)}return n}))}handleVisibilityChange(e){this.isPageVisible=e}bindFocusChange(){const e=()=>{this.isFocus=!0},t=()=>{this.isFocus=!1};return window.addEventListener("focus",e),window.addEventListener("blur",t),()=>{window.removeEventListener("focus",e),window.removeEventListener("blur",t)}}getOptions(){return this.options}}const N=[{text:"pc_web_explorePage_all",name:"All",type:120},{text:"pc_web_explorePage_topics_singing_dancing",name:"Singing & Dancing",type:119},{text:"pc_web_explorePage_topics_comedy",name:"Comedy",type:104},{text:"pc_web_explorePage_topics_sports",name:"Sports",type:112},{text:"pc_web_explorePage_topics_anime_comics",name:"Anime & Comics",type:100},{text:"pc_web_explorePage_topics_relationship",name:"Relationship",type:107},{text:"pc_web_explorePage_topics_shows",name:"Shows",type:101},{text:"pc_web_explorePage_topics_lipsync",name:"Lipsync",type:110},{text:"pc_web_explorePage_topics_daily_life",name:"Daily Life",type:105},{text:"pc_web_explorePage_topics_beauty_care",name:"Beauty Care",type:102},{text:"pc_web_explorePage_topics_games",name:"Games",type:103},{text:"pc_web_explorePage_topics_society",name:"Society",type:114},{text:"pc_web_explorePage_topics_outfit",name:"Outfit",type:109},{text:"pc_web_explorePage_topics_cars",name:"Cars",type:115},{text:"pc_web_explorePage_topics_food",name:"Food",type:111},{text:"pc_web_explorePage_topics_animals",name:"Animals",type:113},{text:"pc_web_explorePage_topics_family",name:"Family",type:106},{text:"pc_web_explorePage_topics_drama",name:"Drama",type:108},{text:"pc_web_explorePage_topics_fitness_health",name:"Fitness & Health",type:117},{text:"pc_web_explorePage_topics_education",name:"Education",type:116},{text:"pc_web_explorePage_topics_technology",name:"Technology",type:118}];var R;!function(e){e.NORMAL="0",e.NEW="1",e.HOT="2",e.RECOM="3",e.EXCLUSIVE="4",e.LOCAL="5",e.BURST="6",e.BOIL="7",e.WENDA_CLUE="8",e.LONG_VIDEO="9",e.LIVE="10",e.UPDATE="15",e.BUBBLE_WORDS="16",e.SAV="17",e.MUSIC="18",e.SEARCH_AGAIN="19",e.COUPON="20"}(R||(R={}));const W=["AT","BE","BG","HR","CY","CZ","DE","DK","EE","EL","FI","FR","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","NO","IS","LI"];var B,D,H;W.concat(["GB","CH"]),function(e){e.DEFAULT="DEFAULT",e.SG="ALL_SG",e.VA="MALI_VA",e.TTP="TTP",e.BOE="BOE"}(B||(B={})),function(e){e.DEFAULT="DEFAULT",e.BOE="BOE",e.US_BOE="US_BOE",e.SG="ALL_SG",e.VA="MALI_VA",e.TTP="TTP",e.EU_TTP="EU_TTP",e.US_TTP="US_TTP",e.US_TTP2="US_TTP2"}(D||(D={})),function(e){e.DarkTheme="dark",e.LightTheme="light"}(H||(H={})),W.concat(["CH","US","GB"]);var V=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))};function M(e){var t;return V(this,void 0,void 0,(function*(){try{const n=e.clone();(null!==(t=(yield yield n.json()).itemList)&&void 0!==t?t:[]).slice(0,3).forEach((e=>{var t,n;const o=null===(n=null===(t=null==e?void 0:e.video)||void 0===t?void 0:t.zoomCover)||void 0===n?void 0:n[720];if(o){const e=new Image;e.fetchPriority="high",e.src=o}}))}catch(e){console.error("prefetch image",e)}}))}!function(){var n,o,r,a,c,l,u,g,m;V(this,void 0,void 0,(function*(){const[v,h]=yield Promise.all([p(),d()]);if(!v||!h)return;const y=new URLSearchParams(location.search);if("v2"!==(null===(r=null===(o=null===(n=null==v?void 0:v.abTestVersion)||void 0===n?void 0:n.parameters)||void 0===o?void 0:o.foryou_prefetch)||void 0===r?void 0:r.vid)&&"v2"!==y.get("foryou_prefetch"))return;const f=new F({getExtraParams:()=>Promise.resolve({}),beforeHandleQuery:e=>e,getAppContextAsync:p,getBizContextAsync:d});(n=>{e.get(t)&&console.warn("AppContext will be overwritten"),e.set(t,n)})(v);const{language:_,abTestVersion:b}=null!=v?v:{},{config:w}=null!=h?h:{},x=null!==(l=null===(c=null===(a=null==b?void 0:b.parameters)||void 0===a?void 0:a.webapp_explore_remove_category)||void 0===c?void 0:c.vid)&&void 0!==l?l:"v0";let E="v0"!==x?10:void 0;"v3"===x&&(E=1);const{exploreCategoryList:k}=null!=w?w:{},O=null!==(m=null===(g=null===(u=null==b?void 0:b.parameters)||void 0===u?void 0:u.explore_category_ranking)||void 0===g?void 0:g.vid)&&void 0!==m?m:"v0";let A=N;(null==k?void 0:k[O])&&(A=null==k?void 0:k[O]);const T=A.slice(0,E).map((e=>Object.assign(Object.assign({},e),{type:Number(e.type)}))),C=()=>V(this,void 0,void 0,(function*(){var e;return f.get("/api/explore/item_list/",{query:{language:i(_),aid:1988,count:16,clientABVersions:null==b?void 0:b.versionName,categoryType:null===(e=T[0])||void 0===e?void 0:e.type},baseUrlType:2})})),S=C().then((e=>{var t,n;return M(e.response),{options:f.getOptions(),response:null!==(t=e.response)&&void 0!==t?t:{},url:null!==(n=e.url)&&void 0!==n?n:"",retryFn:()=>C().then((({response:e})=>(M(e),e)))}}));!function(e,t){var n;const o=null!==(n=window[s])&&void 0!==n?n:{};window[s]=o,!o[e]&&(o[e]={used:!1,request:t},console.debug("set global cache",o))}("exploreItemList",S)}))}()})()})();