PageSourceSearch

https://canan8181.com/assets/EcShopRedirectScreen-PSc1zjKA.js

js canan8181.com collected 2026-10-06 20:05:54 UTC 2,938 bytes, 1 lines download raw bytes

1import{r as s,j as b,R as j}from"./vendor-react-CYOoHjOf.js";import{j as g}from"./vendor-redux-BXotTMQH.js";import{i as v,Y as F,a as M,b as $,h as H,n as B,eP as W,o as V,j as E,eQ as Y,ea as T,bh as q,a3 as J,a1 as O,a2 as Q,eR as Z,e9 as z,br as h,dJ as x,eS as K,eT as X,E as ee,v as te}from"./index-NXCSpy0w.js";import"./vendor-lodash-Cp5T_Ztg.js";import"./vendor-axios-BLlBCaos.js";import"./vendor-mui-A_M4pNO3.js";import"./vendor-auth-DXBuXNeD.js";import"./vendor-motion-CwbUqb9k.js";var I=(t=>(t.REGISTRATION="1",t.BILLING_PLAN="2",t.RENTAL="3",t))(I||{});const ne=()=>{const t=v(),{loginWithRedirect:p}=s.useContext(F),_=M(e=>e.app.appPath),{signed:L}=$(),o=H(),d=new URLSearchParams(B().search),f=window.location.href,r=d.get("return_to"),m=d.get("shop_btn_type"),u=d.get("login")==="true",l=d.get("movie_contents_id"),a=sessionStorage.getItem(W)||void 0,i=V(),[G,R]=s.useState(!1),P=s.useRef(!1),c=s.useMemo(()=>{const e=new URL(f),n=new URLSearchParams(e.search);return n.has("shop_btn_type")&&n.delete("shop_btn_type"),`${e.origin}${_||""}${E.EC_SHOP_REDIRECT}?${n.toString()}`},[_,f]),A=s.useCallback(e=>{const n=new URL(e).origin,S=r&&new URL(decodeURIComponent(r)).origin;return!!(S&&S!==n)},[r]),C=s.useCallback(e=>{t(Y({fanclubSiteId:i,returnTo:e})).then(g).then(n=>{n.loginUrl?window.location.href=n.loginUrl:R(!0)}).catch(()=>{R(!0)})},[t,i]),U=s.useCallback(()=>{l?t(q(l)).then(g).then(e=>{const n=e.fanclubSite.id.toString()!==i,S=!!(e.releasedAt&&J(O(e.releasedAt))||e.closedAt&&Q(O(e.closedAt))),D=e.type===Z.VIDEO;if(n||S){o.push(D?T.VIDEO:z.LIST);return}t(h({returnTo:c,tabId:a})),o.push(D?`${x.VIDEO_PAGE.replace(/:contentCode/,l)}?isOpenDialog=true`:`${x.LIVE_PAGE.replace(/:contentCode/,l)}?isOpenDialog=true`)}).catch(()=>{o.push(T.VIDEO)}):o.push(T.VIDEO)},[l,t,c,i,o,a]),w=s.useCallback(async()=>t(K({fanclubSiteId:i})).then(g).then(e=>e).catch(()=>null),[t,i]),k=s.useCallback(async e=>{const n=await w();if(n?.fanclubSite?.fanclubMember?.mailAddress&&n?.fanclubSite?.fanclubMember?.mailChecked){switch(m){case I.BILLING_PLAN:t(h({returnTo:c,tabId:a})),o.push(E.SIGN_UP_PAYMENT);break;case I.RENTAL:U();break;default:C(r||e);break}return}u?(t(h({returnTo:c,tabId:a})),o.push(E.MAIL_REGISTER,{from:E.EC_SHOP_REDIRECT})):window.location.href=e},[U,C,t,c,w,o,u,r,m,a]),y=s.useCallback(async()=>t(X(V())).then(g).then(e=>e).catch(()=>null),[t]),N=s.useCallback(async()=>{const e=await y();if(!e||A(e)){R(!0);return}if(!L){if(r)if(u){const n=m===I.REGISTRATION;t(h({returnTo:n?c:f,tabId:a,isRegister:n})),p(n?{screen_hint:"signup",prompt:"login"}:{prompt:"login"})}else window.location.href=r;else u?(t(h({returnTo:e,tabId:a})),p({prompt:"login"})):window.location.href=e;return}k(e)},[A,f,t,c,y,u,p,k,r,m,L,a]);return s.useEffect(()=>{P.current||(N(),P.current=!0)},[N]),b.jsx(j.Fragment,{children:G?b.jsx(ee,{notFound:!0}):b.jsx(te,{isFullScreen:!0})},"ecShopRedirect")},he=s.memo(ne);export{he as default};

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.