PageSourceSearch

https://frontia.ai/assets/referral-CnqjpEiJ.js

js frontia.ai collected 2026-10-05 13:39:21 UTC 7,392 bytes, 1 lines download raw bytes

1import{u,r as h,m as v,a as A,q as j,g as k,l as b,b as S,j as e,T as a,A as w,aO as T,h as g,k as y,P as E,ah as F,d as L,aP as N}from"./index-D6pw7iZG.js";import{H as _}from"./home-tab-provider-BAAXXqoI.js";import{T as $}from"./view-logger-C6TfJ0tQ.js";import{P as z}from"./page-content-layout-D_B_6JzJ.js";import{H as O}from"./home-footer-CSQxnbD0.js";import"./home-D9ns4-uT.js";import"./home-header-DtSHFo19.js";import"./sidebar-D1T0KqQk.js";import"./utils-DgWKjmuI.js";import"./use-mobile-Bfe-Wtiq.js";import"./index-DPLoAoRC.js";import"./index-CO-plZdz.js";import"./login-content-coE77sO1.js";import"./help-center-B2OjYITx.js";import"./use-language-9b-6xjdU.js";import"./config-BRGPd1tW.js";/* empty css                    */import"./popover-U2TKMbve.js";import"./use-daily-mission-badge-D5_W4asn.js";import"./use-market-CgZ8c3Zu.js";import"./autumn-harvest-queries-D2_W5ood.js";import"./detail-page-header-BAzL3CLy.js";import"./mobile-header-C3GauBix.js";function P(n,t){const{t:r}=u(),i=h.useRef(!1),[s,c]=h.useState(!1),o=()=>{const{currentUser:d}=k.getState();return d?.id===n&&d.marketCode==="KR"},l=v({queryKey:[...j.getV1ReferralsMeOptions().queryKey,n,t],queryFn:async({signal:d})=>{const{data:p}=await A.getV1ReferralsMe({signal:d,throwOnError:!0});return p},enabled:o(),retry:!1,staleTime:0,gcTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0,refetchOnReconnect:!0}),m=v({...j.getV1ReferralsRewardsOptions(),enabled:o(),retry:!1,staleTime:0,refetchOnMount:"always"});return{me:l,rewards:m,copyCode:async()=>{if(!(!l.data?.code||l.error||i.current||!o())){i.current=!0,c(!0);try{await navigator.clipboard.writeText(l.data.code)}catch{o()&&b.error(r`초대 코드 복사에 실패했어요`);return}finally{i.current=!1,c(!1)}o()&&(b.success(r`초대 코드를 복사했어요`),S.trackEvents("click_copy_referral_code",void 0))}},isCopying:s,retry:()=>{o()&&(l.isError&&l.refetch(),m.isError&&m.refetch())}}}function M({rewards:n}){const{t,i18n:r}=u(),i=n.inviterRewardAmount.toLocaleString(r.language),s=n.inviteeRewardAmount.toLocaleString(r.language),c=[n.inviterRewardAmount===n.inviteeRewardAmount?t`초대받은 친구가 신규 가입 시 추천인 코드를 입력하면, 추천인과 피추천인 모두에게 스타 ${i}개가 지급됩니다.`:t`초대받은 친구가 신규 가입 시 추천인 코드를 입력하면, 추천인에게 스타 ${i}개, 피추천인에게 스타 ${s}개가 지급됩니다.`,t`다계정 사용 시 제재를 받을 수 있습니다.`,t`비정상인 방법으로 이벤트에 참여한 경우, 혜택이 지급되지 않으며 수령한 혜택도 회수될 수 있습니다.`,t`본 기능은 당사 사정에 따라 사전 고지 없이 변경되거나 종료될 수 있습니다.`];return e.jsxs("div",{className:"flex flex-col gap-2 px-3 py-3 md:px-5",children:[e.jsx(a,{variant:"body1-2",color:"text-ui-tertiary",children:t`이용안내`}),e.jsx("ul",{className:"list-disc pl-[18px]",children:c.map(o=>e.jsx(a,{as:"li",variant:"body3-3",color:"text-ui-tertiary",children:o},o))})]})}const R="https://common-assets.frontia.ai/Product/InfoGraphic/Referral.webp";function q({userId:n,language:t}){const{t:r,i18n:i}=u(),{me:s,rewards:c,copyCode:o,isCopying:l,retry:m}=P(n,t),x=s.error??c.error;if(x||!s.data||!c.data)return e.jsx("div",{role:x?"alert":"status",className:"flex min-h-64 flex-col items-center justify-center gap-3 p-5",children:x?e.jsxs(e.Fragment,{children:[e.jsx(a,{variant:"body2-3",color:"text-ui-secondary",children:x.message}),e.jsx(w,{title:r`다시 시도`,size:"s",variant:"surface",loading:s.isFetching||c.isFetching,onClick:m})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{size:24}),e.jsx(a,{variant:"body2-3",color:"text-ui-secondary",children:r`불러오는 중...`})]})});const{inviterRewardAmount:f,inviteeRewardAmount:d}=c.data,p=f.toLocaleString(i.language),C=d.toLocaleString(i.language);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 md:px-5",children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl p-5 text-center",children:[e.jsx("img",{src:R,alt:"",className:"size-[100px] object-contain"}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(a,{variant:"subtitle-2",color:"text-ui-primary",children:f===d?r`친구도 나도 무료 스타 ${p}개!`:r`친구는 무료 스타 ${C}개, 나는 ${p}개!`}),e.jsx(a,{variant:"body2-3",color:"text-ui-secondary",children:r`프론티아 소개하고 무제한으로 스타 받아가자!`})]})]}),e.jsxs("div",{className:g("flex flex-col items-start justify-center gap-2.5 rounded-lg p-3 md:items-center md:px-4 md:py-5",y("brand-primary-opacity")),children:[e.jsx(a,{variant:"subtitle-3",color:"text-ui-secondary",children:r`내 초대 코드`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[e.jsx(a,{variant:"title2-2",className:"text-[32px]! leading-[1.2]!",color:"text-ui-primary",children:s.data.code}),e.jsx(w,{title:r`코드 복사`,variant:"brand_primary",size:"s",loading:l,disabled:!s.data.code,onClick:()=>{o()}})]}),e.jsx(a,{variant:"body3-3",color:"text-ui-secondary",className:"w-full text-left break-keep md:text-center",children:r`초대코드는 프론티아 앱 다운로드 후 회원가입 시 입력할 수 있어요`})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 md:gap-3",children:[e.jsxs("div",{className:g("flex min-w-0 flex-col gap-2.5 rounded-lg p-3 md:px-4 md:py-5",y("surface-primary")),children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-1.5",children:[e.jsx("img",{src:R,alt:"",className:"size-4 shrink-0 object-contain md:size-6"}),e.jsx(a,{variant:"body2-3","variant:md":"subtitle-3",color:"text-ui-secondary",children:r`초대한 친구`})]}),e.jsx(a,{variant:"title2-2",color:"text-ui-primary",className:"break-all md:text-[32px]! md:leading-[1.2]!",children:r`${s.data.invitedCount.toLocaleStr
1ing(i.language)}명`})]}),e.jsxs("div",{className:g("flex min-w-0 flex-col gap-2.5 rounded-lg p-3 md:px-4 md:py-5",y("surface-primary")),children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-1.5",children:[e.jsx(E,{name:"bi-credit",alt:"",className:"size-4 shrink-0 md:size-6"}),e.jsx(a,{variant:"body2-3","variant:md":"subtitle-3",color:"text-ui-secondary",children:r`받은 스타`})]}),e.jsx(a,{variant:"title2-2",color:"text-ui-primary",className:"break-all md:text-[32px]! md:leading-[1.2]!",children:s.data.totalEarnedAmount.toLocaleString(i.language)})]})]})]}),e.jsx(M,{rewards:c.data})]})}function I(){const{t:n}=u(),t=k(s=>s.currentUser),r=F({from:"/_authenticated/referral"}),i=L();return t?t.marketCode!=="KR"?e.jsx(N,{to:"/payment",search:{tab:"free",source:r.source},replace:!0}):e.jsx("div",{className:"bg-base",children:e.jsx(_,{children:e.jsx($,{name:"view_referral_screen",children:e.jsxs(z,{onMobileBack:()=>{i({to:"/payment",search:{tab:"free",source:r.source}})},contentClassName:"max-w-[1120px] flex-none min-h-0 py-0 md:py-5",footer:e.jsx("div",{className:"w-full",children:e.jsx(O,{variant:"episode-detail",showBanner:!0})}),children:[e.jsx("div",{className:"px-3 py-3 md:px-5",children:e.jsx(a,{as:"h1",variant:"title2-2","variant:md":"title1-2",color:"text-ui-primary",children:n`친구 초대`})}),e.jsx(q,{userId:t.id,language:t.language},`${t.id}:${t.language}`)]})},t.id)})}):e.jsx(N,{to:"/login",replace:!0})}const de=I;export{de as component};

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.