1import{bs as p,cS as j,bA as i,bU as l,bt as e,bw as c,bN as q,cT as A,cU as B,cV as F,cW as R,cX as M,bJ as y,al as v,cB as $,bG as z}from"./main-CLu-0Z1D.js";import{u as D}from"./useMutation-BU7vroKe.js";import{s as U}from"./store_purchasefailed1-BkvhBjCN.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new s.Error().stack;n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="fca3a9c9-bfda-42f3-a03b-30a6e6f5eb5b",s._sentryDebugIdIdentifier="sentry-dbid-fca3a9c9-bfda-42f3-a03b-30a6e6f5eb5b")}catch{}})();const W=()=>"1,800å以ä¸ã®ä¼è©±åã®ãã¤ã¤ã¨ç¹å
¸ãã²ãã",G=()=>"Subscribe to get Diamonds for 1,800+ chats and more rewards",Y=()=>"è¨é±ä»¥ç²å¾ 1,800+ 次å°è©±çé½ç³åé¡å¤çåµ",J=()=>"1,800í ì´ìì ëí를 ìí ë¤ì´ì몬ëì ì¶ê° ë³´ìì ë°ì¼ì¸ì",K=(s={},n={})=>{const r=n.locale??p();return r==="ja"?W():r==="en"?G():r==="zh_TW"?Y():J()},Q=()=>"ãã¤ã¤ãè³¼å
¥",V=()=>"Buy Diamonds",X=()=>"購買é½ç³",H=()=>"ë¤ì´ì몬ë 구매",Z=(s={},n={})=>{const r=n.locale??p();return r==="ja"?Q():r==="en"?V():r==="zh_TW"?X():H()},ee=()=>"1åéå®ï¼",se=()=>"One-time only!",te=()=>"éå®ä¸æ¬¡ï¼",re=()=>"1í íì !",ne=(s={},n={})=>{const r=n.locale??p();return r==="ja"?ee():r==="en"?se():r==="zh_TW"?te():re()},ae=()=>"ååéå®2åï¼",oe=()=>"First-time double bonus!",ie=()=>"馿¬¡éå®éåï¼",le=()=>"첫 구매 2ë°° ë³´ëì¤!",ce=(s={},n={})=>{const r=n.locale??p();return r==="ja"?ae():r==="en"?oe():r==="zh_TW"?ie():le()};function o({className:s}){return e.jsx("div",{className:`animate-pulse bg-gray-200 rounded-2xl ${s??""}`})}function de(){const{queryClient:s}=j.useRouteContext(),{data:n,isLoading:r}=i(l.user.me.subscription.queryOptions({}),s);return r?e.jsx(o,{className:"w-full h-[4.5rem]"}):n?null:e.jsxs(c,{to:"/account/subscribe",className:"group block w-full rounded-2xl bg-primary/10 transition-colors relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/5 transition-colors rounded-2xl pointer-events-none"}),e.jsxs("div",{className:"flex items-center px-5 py-3.5 gap-3 relative",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx("span",{className:"font-bold text-lg",style:{color:"#e81
1a89"},children:"MoguPass"}),e.jsx("img",{src:"/mogupass-mascot.webp",alt:"",className:"w-5 h-5"})]}),e.jsx("p",{className:"text-sm text-gray-700 leading-snug",children:K()})]}),e.jsx(y,{className:"w-5 h-5 text-gray-500 flex-shrink-0"})]})]})}function ue(){const{queryClient:s}=j.useRouteContext(),[n,r]=v.useState(null),[m,x]=v.useState(null),{data:k,isLoading:I}=i(l.store.prices.products.list.queryOptions({input:{query:{platform:"STRIPE"}}}),s),{data:P,isLoading:L}=i(l.store.items.list.queryOptions({input:{}}),s),g=D({mutationFn:async t=>{const a=await $.store.webPurchase.initiate({body:{platform:"STRIPE",type:"ONE_TIME",productId:t}});if(!a.url)throw new Error("No checkout URL returned");return a.url},onSuccess:t=>{window.location.href=t},onError:()=>{x(U()),r(null)}},s),{data:_}=i(l.inventory.list.queryOptions({}),s),T=_?.find(t=>t.entityId===me)?.usableBalance??0,S=_?.find(t=>t.entityId===xe)?.usableBalance??0;if(I||L)return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx(o,{className:"w-28 h-6 rounded-lg"}),e.jsx(o,{className:"w-32 h-6 rounded-lg"})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:Array.from({length:8}).map((t,a)=>e.jsx(o,{className:"h-28"},a))})]});const O=(P??[]).map(t=>{const a=(k??[]).find(h=>h.sku===t.sku.stripeProductId),d=t.rewardItems[0],u=d?.baseAmount??0,f=t.isFirstTime?d?.firstTimeBonusAmount:d?.subsequentBonusAmount;return{item:t,price:a,baseAmount:u,bonusAmount:f}});return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800",children:Z()}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("img",{src:"/store/okome_paid.png",alt:"",className:"w-5 h-5"}),e.jsx("span",{className:"text-sm font-medium text-gray-700",children:T.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("img",{src:"/store/okome_free.png",alt:"",className:"w-5 h-5"}),e.jsx("span",{className:"text-sm font-medium text-gray-700",children:S.toLocaleString()})]})]})]}),m&&e.jsx("p",{className:"text-sm text-red-500 mb-3",children:m}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:O.map(({item:t,price:a,baseAmount:d,bonusAmount:u})=>{const f=n===t.sku.stripeProductId&&g.isPending,h=g.isPending&&n!==t.sku.stripeProductId,E=a?a.price.currency.toLowerCase()==="jpy"?`Â¥${a.price.unitAmount.toLocaleString()}`:`${a.price.currency.toUpperCase()}$${(a.price.unitAmount/100).toFixed(2)}`:`Â¥${t.jpyPriceForAnalytics.toLocaleString()}`,N=t.predicate==="first_time_only",w=u!=null&&u>0,b=N||t.isFirstTime&&w;return e.jsx("div",{className:`relative ${h?"opacity-30":""} transition-opacity`,children:e.jsxs("button",{type:"button",onClick:()=>{x(null),r(t.sku.stripeProductId),z(C=>C.purchaseStoreAttempted({$productId:t.sku.stripeProductId,is_first_time:!!t.isFirstTime})),g.mutate(t.sku.stripeProductId)},disabled:g.isPending,className:`group relative block w-full text-left rounded-xl overflow-hidden cursor-pointer disabled:cursor-default ${b?"border-2 border-primary":""}`,style:b?{background:"#fee5f5"}:void 0,children:[e.jsxs("div",{className:"bg-white h-28 p-3 pb-2.5 flex flex-col group-hover:bg-gray-50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("img",{src:"/store/okome_paid.png",alt:"",className:"w-6 h-6 flex-shrink-0"}),e.jsx("span",{className:"font-semibold text-xl text-gray-900 leading-tight ml-auto",children:d.toLocaleString()})]}),w&&e.jsxs("p",{className:"font-bold text-lg leading-tight text-right",style:{color:"#e81
1a89"},children:["+",u.toLocaleString()]}),e.jsx("p",{className:"text-base text-gray-700 mt-auto",children:E})]}),b&&e.jsx("div",{className:"px-3 py-1.5 text-center",children:e.jsx("span",{className:"text-sm font-bold",style:{color:"#e81a89"},children:N?ne():ce()})}),f&&e.jsx("div",{className:"absolute inset-0 bg-gray-500/50 flex items-center justify-center",children:e.jsx("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin"})})]})},t.id)})})]})}const me="ecoentity_currency_onigiri",xe="ecoentity_currency_okome";function ge({isActive:s,isLoading:n}){return n?e.jsx(o,{className:"w-24 h-7 rounded-full"}):s?e.jsxs(c,{to:"/account/subscribe",className:"inline-flex items-center gap-1.5 bg-primary rounded-full pl-3.5 pr-2 h-7 w-fit hover:opacity-90 transition-opacity",children:[e.jsx("span",{className:"text-xs text-white leading-none",children:"MoguPass"}),e.jsx(y,{className:"w-3.5 h-3.5 text-white opacity-70"})]}):e.jsxs(c,{to:"/account/subscribe",className:"inline-flex items-center gap-1.5 bg-gray-200 border border-gray-400 rounded-full pl-3.5 pr-2 h-7 w-fit hover:bg-gray-300 transition-colors",children:[e.jsx("span",{className:"text-xs text-gray-500 leading-none",children:"MoguPass"}),e.jsx(y,{className:"w-3.5 h-3.5 text-gray-400"})]})}function be(){const{queryClient:s}=j.useRouteContext(),{data:n}=i(l.user.me.get.queryOptions({}),s),{data:r,isLoading:m}=i(l.user.me.subscription.queryOptions({}),s),x=()=>{M(),s.clear(),window.location.href="/"};return e.jsx("div",{className:"min-h-screen bg-gray-50 px-6 py-8",children:e.jsxs("div",{className:"max-w-lg md:max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs(c,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-700 transition-colors",children:[e.jsx(q,{className:"w-4 h-4"}),A()]}),e.jsx("button",{onClick:x,className:"inline-flex items-center gap-1.5 text-sm text-gray-400 hover:text-gray-600 transition-colors cursor-pointer",children:e.jsx(B,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"flex items-center gap-4 mb-8",children:n?e.jsxs(e.Fragment,{children:[n.avatarUrl?e.jsx("img",{src:n.avatarUrl,alt:"",className:"w-20 h-20 rounded-full"}):e.jsx("div",{className:"w-20 h-20 rounded-full bg-gray-200"}),e.jsxs("div",{className:"min-w-0 flex flex-col gap-2",children:[e.jsx("p",{className:"font-bold text-xl text-gray-900 truncate",children:n.displayName}),e.jsx(ge,{isActive:!!r,isLoading:m})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{className:"w-20 h-20 rounded-full"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(o,{className:"w-32 h-7 rounded-lg"}),e.jsx(o,{className:"w-24 h-8 rounded-full"})]})]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(de,{}),e.jsx(ue,{})]}),e.jsxs("div",{className:"flex items-center justify-center gap-4 pt-8 pb-2",children:[e.jsx(c,{to:"/terms",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-400 hover:text-gray-600 transition-colors",children:F()}),e.jsx("span",{className:"text-xs text-gray-300",children:"·"}),e.jsx(c,{to:"/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-400 hover:text-gray-600 transition-colors",children:R()})]})]})})}export{be 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.