PageSourceSearch

https://tinrec.com/_next/static/chunks/3646-1b1b23311eae21ea.js

js tinrec.com collected 2026-10-04 07:01:29 UTC 21,251 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3646],{64227:function(e,t,n){n.d(t,{jD:function(){return l},rU:function(){return s},tv:function(){return u}});var o=n(71585),i=n(38546),r=n(50142);let a=(0,o.Z)({locales:r.k1,defaultLocale:r.al,localePrefix:"as-needed",localeDetection:!1,localeCookie:{maxAge:31536e3,sameSite:"lax",path:"/",partitioned:!0}}),{Link:s,redirect:c,usePathname:l,useRouter:u}=(0,i.Z)(a)},96226:function(e,t,n){n.d(t,{P$:function(){return clearAdminImpersonationSession},i6:function(){return restoreAdminImpersonationSession},lS:function(){return beginAdminImpersonation},xZ:function(){return getAdminImpersonationSession}});var o=n(42181),i=n(230);let r="tinrec.admin_impersonation.session.v1";function getAdminImpersonationSession(){try{let e=window.localStorage.getItem(r);if(!e)return null;let t=JSON.parse(e);if(!t.adminToken||!t.adminUserId||!t.targetUserId)return null;return{adminToken:t.adminToken,adminUserId:t.adminUserId,targetUserId:t.targetUserId}}catch(e){return null}}function setLoginToken(e){(0,o.d8)("jwt_token",e,{expires:30,path:"/",secure:"https:"===window.location.protocol,sameSite:"Lax"})}function beginAdminImpersonation(e,t,n){let a=(0,o.ej)("jwt_token");return!!a&&!!e&&!!t&&!!n&&(window.localStorage.setItem(r,JSON.stringify({adminToken:a,adminUserId:e,targetUserId:n})),(0,i.Pz)(t,n),setLoginToken(t),!0)}function restoreAdminImpersonationSession(){let e=getAdminImpersonationSession();if(!e)return!1;try{return window.localStorage.removeItem("".concat(i.Bm,".").concat(e.targetUserId)),(0,i.Pz)(e.adminToken,e.adminUserId),setLoginToken(e.adminToken),window.localStorage.setItem("userId",e.adminUserId),window.localStorage.removeItem(r),!0}catch(e){return!1}}function clearAdminImpersonationSession(){window.localStorage.removeItem(r)}},34991:function(e,t,n){n.d(t,{_R:function(){return publishCrossTabSessionEvent},kJ:function(){return listenCrossTabSessionEvents}});let o="tinrec.cross_tab_session_context.v1",i="tinrec.cross_tab_session_context.event.v1",r="tinrec.tab_id.v1",a="";function createTabId(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))}function getCrossTabSessionTabId(){try{let e=window.sessionStorage.getItem(r);if(e)return e;let t=createTabId();return window.sessionStorage.setItem(r,t),t}catch(e){return a||(a=createTabId()),a}}function isWorkspaceScope(e){return!!e&&"object"==typeof e&&("personal"===e.type||"team"===e.type&&"string"==typeof e.teamId&&e.teamId.length>0)}function isCrossTabSessionEvent(e){return!!e&&"object"==typeof e&&!("string"!=typeof e.sourceTabId||"number"!=typeof e.createdAt||Date.now()-e.createdAt>3e5)&&("logout"===e.type||("account_changed"===e.type?"string"==typeof e.userId&&e.userId.length>0:"workspace_changed"===e.type&&isWorkspaceScope(e.scope)))}function publishCrossTabSessionEvent(e){let t={...e,sourceTabId:getCrossTabSessionTabId(),createdAt:Date.now()};if("undefined"!=typeof BroadcastChannel)try{let e=new BroadcastChannel(o);e.postMessage(t),e.close()}catch(e){}try{window.localStorage.setItem(i,JSON.stringify(t)),window.localStorage.removeItem(i)}catch(e){}}function listenCrossTabSessionEvents(e){let t=getCrossTabSessionTabId(),n=null,r="",emitIfExternal=n=>{if(!isCrossTabSessionEvent(n)||n.sourceTabId===t)return;let o="".concat(n.sourceTabId,":").concat(n.createdAt,":").concat(n.type);o!==r&&(r=o,e(n))};if("undefined"!=typeof BroadcastChannel)try{(n=new BroadcastChannel(o)).onmessage=e=>{emitIfExternal(e.data)}}catch(e){n=null}let handleStorage=e=>{if(e.key===i&&e.newValue)try{emitIfExternal(JSON.parse(e.newValue))}catch(e){}};return window.addEventListener("storage",handleStorage),()=>{null==n||n.close(),window.removeEventListener("storage",handleStorage)}}},59624:function(e,t,n){n.d(t,{Oe:function(){return clearLastWorkspaceScope},YY:function(){return o},bi:function(){return serializeLastWorkspaceScope},oI:function(){return parseLastWorkspaceScope}});let o="tinrec.workspace.last_scope.v1";
1function serializeLastWorkspaceScope(e){return JSON.stringify(e)}function parseLastWorkspaceScope(e){if(!e)return null;try{let t=JSON.parse(e);if(!t.userId||"number"!=typeof t.updatedAt||!t.scope||"personal"!==t.scope.type&&"team"!==t.scope.type||"team"===t.scope.type&&!t.scope.teamId)return null;return t}catch(e){return null}}function clearLastWorkspaceScope(){window.localStorage.removeItem(o),document.cookie="".concat(o,"=; Max-Age=0; path=/; SameSite=Lax")}},81064:function(e,t,n){n.d(t,{Tg:function(){return clearLoginWorkspaceSelectionPending},_H:function(){return markLoginWorkspaceSelectionPending},iB:function(){return dispatchWorkspaceSelectionPrompt},ot:function(){return readLoginWorkspaceSelectionPending},qD:function(){return i}});let o="tinrec.workspace.login_selection.v1",i="tinrec:workspace-selection-prompt";function readLoginWorkspaceSelectionPending(){try{let e=window.localStorage.getItem(o);if(!e)return null;let t=JSON.parse(e);if("number"!=typeof t.loginAt||t.userId&&"string"!=typeof t.userId||t.reason&&"default"!==t.reason&&"teamPurchase"!==t.reason||Date.now()-t.loginAt>36e5)return null;return{userId:t.userId,reason:t.reason,loginAt:t.loginAt}}catch(e){return null}}function markLoginWorkspaceSelectionPending(e,t){var n;let i=readLoginWorkspaceSelectionPending(),r={...e?{userId:e}:{},reason:null!==(n=null!=t?t:null==i?void 0:i.reason)&&void 0!==n?n:"default",loginAt:Date.now()};window.localStorage.setItem(o,JSON.stringify(r))}function dispatchWorkspaceSelectionPrompt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";window.dispatchEvent(new CustomEvent(i,{detail:{reason:e}}))}function clearLoginWorkspaceSelectionPending(){window.localStorage.removeItem(o)}},230:function(e,t,n){n.d(t,{Bm:function(){return i},HE:function(){return persistTeamToken},PF:function(){return persistPersonalTokenBeforeTeamSwitch},Pz:function(){return persistPersonalToken},XR:function(){return restorePersonalToken},Xp:function(){return getStoredPersonalToken},gi:function(){return getPersonalTokenForWorkspaceApi},ob:function(){return clearWorkspaceTokens}});var o=n(42181);let i="tinrec.workspace.personal_token";function getPersonalTokenStorageKey(e){return e?"".concat(i,".").concat(e):i}function setAuthTokenCookie(e,t){e&&(0,o.d8)("jwt_token",e,{expires:null!=t?t:30,path:"/",secure:"https:"===window.location.protocol,sameSite:"Lax"})}function getStoredPersonalToken(e){let t=e?window.localStorage.getItem(getPersonalTokenStorageKey(e)):null;return t||window.localStorage.getItem(i)||void 0}function persistPersonalToken(e,t){e&&(window.localStorage.setItem(i,e),t&&window.localStorage.setItem(getPersonalTokenStorageKey(t),e))}function persistPersonalTokenBeforeTeamSwitch(e){getStoredPersonalToken(e)||persistPersonalToken((0,o.ej)("jwt_token"),e)}function getPersonalTokenForWorkspaceApi(e){return getStoredPersonalToken(e)||(0,o.ej)("jwt_token")||void 0}function restorePersonalToken(e){let t=getStoredPersonalToken(e);t&&setAuthTokenCookie(t)}function persistTeamToken(e,t){let n=t?new Date(t):30;setAuthTokenCookie(e,n instanceof Date&&Number.isNaN(n.getTime())?30:n)}function clearWorkspaceTokens(){window.localStorage.removeItem(i);for(let e=window.localStorage.length-1;e>=0;e-=1){let t=window.localStorage.key(e);(null==t?void 0:t.startsWith("".concat(i,".")))&&window.localStorage.removeItem(t)}}},79213:function(e,t,n){n.d(t,{Cb:function(){return loginWithGoogle},Ez:function(){return updateUserInfoApi},M3:function(){return generateAdminImpersonationTokenApi},My:function(){return loginWithPhone},O8:function(){return sendEmailCode},R9:function(){return getSubscriptionInfoApi},Sl:function(){return tokenLoginApi},Wq:function(){return getPublicInfoApi},ZM:function(){return renewTokenApi},bL:function(){return sendPhoneCode},fZ:function(){return loginWithEmail},p8:function(){return getUserInfoApi},y7:function(){return getOAuthAuthURL}});var o=n(35324),i=n(25978);let tokenLoginApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/auth/token/login"),{method:"POST",headers:(0,i.wU)(),body:JSON.stringify(e)});return t.json()},renewTokenApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/renew-token"),{method:"POST",headers:(0,i.wU)({token:null==e?void 0:e.token})});return t.json()},generateAdminImpersonationTokenApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/admin/impersonation-token"),{method:"POST",headers:(0,i.wU)(),body:JSON.stringify(e)});return t.json()},sendPhoneCode=async(e,t)=>{let n=await fetch("".concat((0,o.qQ)("api"),"/auth/phone/send"),{method:"POST",headers:(0,i.wU)({locale:"zh-CN"}),body:JSON.stringify({area_code:e,phone:t})});return n.json()},loginWithPhone=async(e,t,n)=>{let r=await fetch("".concat((0,o.qQ)("api"),"/auth/phone/login"),{method:"POST",headers:(0,i.wU)({locale:"zh-CN"}),body:JSON.stringify({area_code:e,phone:t,code:n})});return r.json()},sendEmailCode=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/auth/email/send"),{method:"POST",headers:(0,i.wU)(),body:JSON.stringify({email:e})});return t.json()},loginWithEmail=async(e,t,n)=>{let r={email:e,code:t};n&&(r.invite_id=n);let a=await fetch("".concat((0,o.qQ)("api"),"/auth/email/verify"),{method:"POST",headers:(0,i.wU)(),body:JSON.stringify(r)});return a.json()},loginWithGoogle=async(e,t)=>{let n={id_token:e};t&&(n.invite_id=t);let r=await fetch("".concat((0,o.qQ)("api"),"/auth/google/token"),{method:"POST",headers:(0,i.wU)(),body:JSON.stringify(n)});return r.json()},getOAuthAuthURL=async(e,t)=>{var n;let r=new URLSearchParams({provider:e});t&&r.append("invite_id",t),(null===(n=window.TinrecDesktop)||void 0===n?void 0:n.app)&&r.set("client","desktop");let a=await fetch("".concat((0,o.qQ)("api"),"/auth/oauth/login?").concat(r),{headers:(0,i.wU)()});return a.json()},getUserInfoApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/userinfo"),{method:"GET",headers:(0,i.wU)({token:null==e?void 0:e.token})});return t.json()},updateUserInfoApi=async(e,t)=>{let n=await fetch("".concat((0,o.qQ)("api"),"/user/info"),{method:"PUT",headers:(0,i.wU)({token:null==t?void 0:t.token}),body:JSON.stringify(e)});return n.json()},getPublicInfoApi=async()=>{let e=await fetch("".concat((0,o.qQ)("api"),"/public/info"),{method:"GET",headers:(0,i.wU)()});return e.json()},getSubscriptionInfoApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/subscription/entitlement-status"),{method:"GET",headers:(0,i.wU)({token:null==e?void 0:e.token})});return t.json()}},90130:function(e,t,n){n.d(t,{$2:function(){return getLineQrUrlApi},DA:function(){return submitUserProfileApi},Ie:function(){return getFirstRestrictedPointApi},S1:function(){return getUserProfileConfigApi},U1:function(){return getNicknameByUserIdApi},mZ:function(){return getSpecialOfferInfoApi}});var o=n(35324),i=n(25978);let getUserProfileConfigApi=async()=>{let e=await fetch("".concat((0,o.qQ)("api"),"/profile/options"),{method:"GET",headers:(0,i.wU)()});return e.json()},submitUserProfileApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/profile/submit"),{method:"POST",headers:(0,i.wU)(),body:JSON.stringify(e)});return t.json()},getNicknameByUserIdApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/user/nickname/").concat(encodeURIComponent(e)),{method:"GET",headers:(0,i.wU)()});return t.json()},getLineQrUrlApi=async e=>{let t=await fetch("".concat((0,o.qQ)("api"),"/line/qr-url?type=").concat(e),{method:"GET",headers:(0,i.wU)()});return t.json()},getSpecialOfferInfoApi=async(e,t)=>{let n=await fetch("".concat((0,o.qQ)("api"),"/coupon/issue-once"),{method:"POST",headers:(0,i.wU)({token:null==t?void 0:t.token}),body:JSON.stringify({receive:e})});return n.json()},getFirstRestrictedPointApi=async()=>
1{let e=await fetch("".concat((0,o.qQ)("api"),"/user/first-restricted-point"),{method:"GET",headers:(0,i.wU)()});return e.json()}},38116:function(e,t,n){n.d(t,{userStore:function(){return I}});var o=n(42181),i=n(24256),r=n(79213),a=n(25978),s=n(90130),c=n(230),l=n(96226),u=n(81064),d=n(34991),f=n(59624);function decodeBase64Url(e){if("function"!=typeof atob)return"";let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"="),o=atob(n),i=Uint8Array.from(o,e=>e.charCodeAt(0));return new TextDecoder().decode(i)}function decodeJwtPayload(e){if(!e)return null;let[,t]=e.split(".");if(!t)return null;try{return JSON.parse(decodeBase64Url(t))}catch(e){return null}}function getJwtExpiresAtMs(e){var t;let n=null===(t=decodeJwtPayload(e))||void 0===t?void 0:t.exp;return"number"==typeof n&&Number.isFinite(n)?1e3*n:null}function shouldRenewLoginToken(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=getJwtExpiresAtMs(e);return!!n&&n-t<=2592e5}function getLoginTokenRenewDelayMs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=getJwtExpiresAtMs(e);return n?Math.max(0,n-2592e5-t):432e5}let h="jwt_token",p=null,g=null,w=!1,m=0;function isTeamToken(e){var t;return(null===(t=decodeJwtPayload(e))||void 0===t?void 0:t.token_type)==="team"}function getPersonalTokenForRenewal(){let e=(0,o.ej)(h);if(e&&!isTeamToken(e))return{token:e,syncCookie:!0};let t=(0,c.Xp)();return t&&!isTeamToken(t)?{token:t,syncCookie:!1}:null}function getCookieExpires(e){let t=getJwtExpiresAtMs(e);return t?new Date(t):30}function persistRenewedPersonalToken(e,t){let n=decodeJwtPayload(e);(null==n?void 0:n.token_type)!=="team"&&((0,c.Pz)(e,null==n?void 0:n.user_id),t&&(0,o.d8)(h,e,{expires:getCookieExpires(e),path:"/",secure:"https:"===window.location.protocol,sameSite:"Lax"}))}function scheduleLoginTokenRenewal(e){g&&(window.clearTimeout(g),g=null);let t=getPersonalTokenForRenewal();if(!t)return;let n=Math.min("number"==typeof e?e:getLoginTokenRenewDelayMs(t.token),2147e6),o=m;g=window.setTimeout(async()=>{let e=await renewLoginTokenIfNeeded();o===m&&scheduleLoginTokenRenewal(e?void 0:3e5)},n)}async function handleAuthActivity(){let e=m;await renewLoginTokenIfNeeded(),e===m&&scheduleLoginTokenRenewal()}function handleVisibilityChange(){"visible"===document.visibilityState&&handleAuthActivity()}function handleWindowFocus(){handleAuthActivity()}function registerActivityListeners(){w||(w=!0,window.addEventListener("focus",handleWindowFocus),document.addEventListener("visibilitychange",handleVisibilityChange))}async function renewLoginTokenIfNeeded(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=getPersonalTokenForRenewal();if(!t)return null;if(!e.force&&!shouldRenewLoginToken(t.token))return t.token;if(p)return p;let n=m,o=(async()=>{try{var e;let o=await (0,r.ZM)({token:t.token});if(n!==m)return null;let i=200===o.code?null===(e=o.data)||void 0===e?void 0:e.token:"";if(!i)return null;return persistRenewedPersonalToken(i,t.syncCookie),i}catch(e){return console.warn("续签登录 token 失败:",e),null}finally{n===m&&(p=null)}})();return p=o,o}function startLoginTokenAutoRenew(){let e=m;registerActivityListeners(),renewLoginTokenIfNeeded().finally(()=>{e===m&&scheduleLoginTokenRenewal()})}function stopLoginTokenAutoRenew(){m+=1,p=null,g&&(window.clearTimeout(g),g=null),w&&(window.removeEventListener("focus",handleWindowFocus),document.removeEventListener("visibilitychange",handleVisibilityChange),w=!1)}let k="tinrec.default_hot_word_lexicon_id.v1";let UserStore=class UserStore{setNpsStatus(e){this.userInfo&&(this.userInfo={...this.userInfo,nps_status:e})}setContentRatingStatus(e){this.userInfo&&(this.userInfo={...this.userInfo,has_content_rating:e})}setUserInfo(e){this.userInfo=e}setIsAuthenticated(e){this.isAuthenticated=e}setIsLoading(e){this.isLoading=e}requestWorkspaceSelectionPrompt(e){var t;this.workspaceSelectionPromptReason=null!==(t=null==e?void 0:e.reason)&&void 0!==t?t:"default",this.workspaceSelectionPromptNonce+=1,(0,u.iB)(this.workspaceSelectionPromptReason)}clearWorkspaceSelectionPrompt(){this.workspaceSelectionPromptNonce=0,this.workspaceSelectionPromptReason="default"}requestCreateTeamPrompt(e){var t;this.createTeamPromptReason=null!==(t=null==e?void 0:e.reason)&&void 0!==t?t:"default",this.createTeamPromptNonce+=1}clearCreateTeamPrompt(){this.createTeamPromptNonce=0,this.createTeamPromptReason="default"}getLocalUserId(){return localStorage.getItem("userId")||""}readDefaultHotWordLexiconCache(){try{let e=localStorage.getItem(k);if(!e)return null;let t=JSON.parse(e);if(!t.userId||"number"!=typeof t.lexiconId)return null;return{userId:t.userId,lexiconId:t.lexiconId}}catch(e){return null}}writeDefaultHotWordLexiconCache(e,t){e&&localStorage.setItem(k,JSON.stringify({userId:e,lexiconId:t}))}clearDefaultHotWordLexiconCache(){this.defaultHotWordLexiconId=0,this.hasDefaultHotWordLexiconCache=!1,localStorage.removeItem(k)}restoreDefaultHotWordLexiconIdFromCache(){let e=this.readDefaultHotWordLexiconCache(),t=this.getLocalUserId();e&&t&&e.userId===t&&(this.defaultHotWordLexiconId=e.lexiconId,this.hasDefaultHotWordLexiconCache=!0)}setDefaultHotWordLexiconId(e,t){var n;this.defaultHotWordLexiconId=e,this.hasDefaultHotWordLexiconCache=!0;
1let o=t||(null===(n=this.userInfo)||void 0===n?void 0:n.user_id)||this.getLocalUserId();this.writeDefaultHotWordLexiconCache(o,e)}async getUserInfo(){let e=this.authEpoch;try{(0,i.z)(()=>{this.setIsLoading(!0)});let t=(0,c.gi)(),n=await (0,r.p8)({token:t});if(e!==this.authEpoch)return;(0,i.z)(()=>{200===n.code?(this.setUserInfo(n.data),this.setIsAuthenticated(!0),this.setIsLoading(!1),localStorage.setItem("userId",n.data.user_id||""),(0,c.Pz)(t||(0,o.ej)("jwt_token"),n.data.user_id||""),this.setDefaultHotWordLexiconId(n.data.default_hot_word_lexicon_id||0,n.data.user_id||"")):(this.setIsAuthenticated(!1),this.setIsLoading(!1),this.logout())})}catch(t){if(e!==this.authEpoch)return;console.error("取得使用者資訊失敗:",t),(0,i.z)(()=>{this.setIsAuthenticated(!1),this.setIsLoading(!1)})}}async getPublicInfo(){let e=await (0,r.Wq)();(0,i.z)(()=>{200===e.code?this.publicInfo=e.data:this.publicInfo=null})}async getSpecialOfferInfo(e){if(!e){let e=Date.now();if(this.specialOfferInfo&&e-this.lastSpecialOfferFetchedAt<1e4)return{code:200,message:"ok",data:this.specialOfferInfo};if(this.specialOfferRequestPromise)return this.specialOfferRequestPromise}let t=(async()=>{var t;let n=await (0,s.mZ)(e,{token:(0,c.gi)((null===(t=this.userInfo)||void 0===t?void 0:t.user_id)||this.getLocalUserId()||void 0)});return(0,i.z)(()=>{200!==n.code||(this.specialOfferInfo=n.data,e||(this.lastSpecialOfferFetchedAt=Date.now()))}),n})();if(!e){this.specialOfferRequestPromise=t;try{return await t}finally{this.specialOfferRequestPromise=null}}return t}async getSubscriptionInfo(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Date.now();if(!e&&t-this.lastSubscriptionFetchedAt<8e3)return;if(this.subscriptionRequestPromise)return this.subscriptionRequestPromise;let n=(async()=>{var e;let t=await (0,r.R9)({token:(0,c.gi)((null===(e=this.userInfo)||void 0===e?void 0:e.user_id)||this.getLocalUserId()||void 0)});(0,i.z)(()=>{200===t.code?(this.equityInfo=t.data,this.lastSubscriptionFetchedAt=Date.now(),"free"===t.data.membership_level&&this.getSpecialOfferInfo(!1)):this.equityInfo=null})})();this.subscriptionRequestPromise=n;try{await n}finally{this.subscriptionRequestPromise=null}}
1async init(){let e=(0,o.ej)("jwt_token");if(e){let e=this.authEpoch;if((0,i.z)(()=>{this.setIsLoading(!0)}),await renewLoginTokenIfNeeded(),e!==this.authEpoch)return;startLoginTokenAutoRenew(),this.getUserInfo(),this.getSubscriptionInfo()}}async login(e){this.authEpoch+=1;let t=this.authEpoch,n=this.getLocalUserId();try{var r;if(stopLoginTokenAutoRenew(),(0,i.z)(()=>{this.clearDefaultHotWordLexiconCache()}),(0,o.d8)("jwt_token",e.token,{expires:30,path:"/",secure:"https:"===window.location.protocol,sameSite:"Lax"}),(0,c.Pz)(e.token),startLoginTokenAutoRenew(),(0,u._H)(void 0),(0,i.z)(()=>{this.requestWorkspaceSelectionPrompt()}),await this.getUserInfo(),t!==this.authEpoch)return;let a=(null===(r=this.userInfo)||void 0===r?void 0:r.user_id)||"";n&&a&&n!==a&&(0,d._R)({type:"account_changed",userId:a,previousUserId:n}),await this.getSubscriptionInfo()}catch(e){throw(0,u.Tg)(),console.error("儲存使用者資訊失敗:",e),e}}logout(){var e;this.authEpoch+=1;let t=(null===(e=this.userInfo)||void 0===e?void 0:e.user_id)||this.getLocalUserId();(0,d._R)({type:"logout",userId:t}),this.userInfo=null,this.isAuthenticated=!1,this.isLoading=!1,this.clearDefaultHotWordLexiconCache(),stopLoginTokenAutoRenew(),(0,o.nJ)("jwt_token",{path:"/"}),(0,u.Tg)(),(0,l.P$)(),(0,f.Oe)(),(0,c.ob)(),localStorage.removeItem("userId"),window.location.href=(0,a.Tr)((0,a.P)()?"/home":"/")}constructor(){this.userInfo=null,this.defaultHotWordLexiconId=0,this.hasDefaultHotWordLexiconCache=!1,this.isAuthenticated=!1,this.isLoading=!1,this.publicInfo=null,this.equityInfo=null,this.specialOfferInfo=null,this.workspaceSelectionPromptNonce=0,this.workspaceSelectionPromptReason="default",this.createTeamPromptNonce=0,this.createTeamPromptReason="default",this.subscriptionRequestPromise=null,this.specialOfferRequestPromise=null,this.lastSubscriptionFetchedAt=0,this.lastSpecialOfferFetchedAt=0,this.authEpoch=0,(0,i.ky)(this),this.restoreDefaultHotWordLexiconIdFromCache()}};let I=new UserStore}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.