PageSourceSearch

https://goooods.com/_next/static/chunks/pages/buyer/me/checkout-e7d36c9ca34d3c8e.js

js goooods.com collected 2026-10-03 23:48:36 UTC 103,483 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4237],{1741:(e,t,s)=>{"use strict";s.d(t,{Ae:()=>l,C2:()=>x,Fs:()=>v,Lr:()=>d,T1:()=>u,_C:()=>p,ae:()=>C,do:()=>h,lO:()=>I,ns:()=>r,pj:()=>y,qE:()=>g,tH:()=>o,uo:()=>c,xs:()=>n});var a=s(76204),i=s(75597);let n="58fe2893-c313-405d-aa98-880a74281228",r=5e3,l=5e9,d=3e3,c=3e9,o="4748d4da-70af-47e5-a9f2-78e477e5ad1c",u="913bc9c7-7337-4601-a485-ca50bcb92f16",m=[o],p="437b06bd-fe99-4cd0-932e-3d87cfe3d7e9";function x(e,t){return e.validUntilMs-t.validUntilMs}function h(e){return Math.round(e.reduce((e,t)=>e+t.couponPriceE6,0)/1e6)}function g(e){return C({validUntilMs:Math.min(...e.map(e=>e.validUntilMs))})}function C(e){let t=new Date,s=e.validUntilMs,i=s-t.getTime();if(i<0)return;let n=(0,a.m)(new Date(s),t);return n>=1?{unit:"day",value:n}:{unit:"hour",value:Math.floor(i/36e5)}}function y(e){return m.includes(e)}function I(e,t,s){let a=t=>{var s,a,i;return null!=(i=null==(a=e.find(e=>e.id===t))||null==(s=a.availableBrandIds)?void 0:s[0])?i:null},i=a(s);return null!==i&&t.some(e=>e!==s&&a(e)===i)}function v(e,t){let s={},a=[];for(let l of t){let t=e.find(e=>e.id===l);if(t&&(null==t?void 0:t.buyerCouponType.buyerCouponAccountingMode)===i.MR6.SELLER_FUNDED){var n,r;let e=null==(n=t.availableBrandIds)?void 0:n[0];if(null!=e){let t=s[e];void 0!==t?null==(r=t.buyerCouponId)||r.push(l):s[e]={brandId:e,buyerCouponId:[l]}}}else a.push(l)}return{brandOrderBuyerCouponId:Object.values(s),aggregatedOrderBuyerCouponId:a}}},4315:(e,t,s)=>{"use strict";s.d(t,{M:()=>i});var a=s(14232);function i(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[t,s]=(0,a.useState)(e),i=(0,a.useRef)(e);return{isLoading:t,isLoadingRef:i,setIsLoading:e=>{s(e),i.current=e}}}},7340:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/buyer/me/checkout",function(){return s(31064)}])},15762:(e,t,s)=>{"use strict";s.d(t,{K:()=>d});var a=s(37876),i=s(39955),n=s(75597),r=s(99895);let l=n.dp4.WEBP;function d(e){let{bucket:t,objectKey:s,defaultUrl:n,resizeWidth:d,resizeHeight:c,resizingType:o,format:u,children:m,...p}=e,{getResizedImageUrlForBucketObject:x}=(0,r.i)(),h=x({bucket:t,objectKey:s,defaultUrl:n},d,c,o,u||l);return(0,a.jsx)(i.a,{bgImage:h,...p,children:m})}},19031:(e,t,s)=>{"use strict";s.d(t,{Cm:()=>a,HM:()=>c,SE:()=>j,Vk:()=>I,Y_:()=>f,e7:()=>m,gz:()=>u,iW:()=>i,lx:()=>l,oS:()=>d,or:()=>x,q5:()=>o,qb:()=>y,ug:()=>g,xh:()=>v,y:()=>C});let a="f219dd82-ba1e-4558-b157-e2c8b574cb19",i="a0041944-bd50-4243-9183-499146be507a",n="bb52b821-1f92-4a60-b9e9-33f87db6ce2f",r=["f4679e74-f9a6-456e-8fc6-7ac173eff5e0","9b667bdf-7bee-42ea-aa5f-930e8629e53c","d1936ac0-0f50-4a84-a2da-b8266439644d"];function l(e){return e.filter(e=>0===(e.parentCategoryIds||[]).length).sort((e,t)=>e.displayOrder-t.displayOrder)}function d(e){let t=[];return e.forEach(e=>{0===(e.parentCategoryIds||[]).length&&t.push(e)}),t.sort((e,t)=>e.displayOrder-t.displayOrder)}function c(e,t){return e.filter(e=>{var s,a;let i=null==(s=e.parentCategoryIds)?void 0:s.findIndex(e=>e===t);return void 0!==i&&i>=0&&i+1===(null==(a=e.parentCategoryIds)?void 0:a.length)}).sort((e,t)=>e.displayOrder-t.displayOrder)}function o(e,t){let s=[];return e.forEach(e=>{null!==e.parentCategoryIds&&e.parentCategoryIds.length>0&&e.parentCategoryIds[e.parentCategoryIds.length-1]===t&&s.push(e)}),s.sort((e,t)=>e.displayOrder-t.displayOrder)}function u(e,t){let s=e.flatMap(e=>e.parentCategoryIds||[]);return e.filter(e=>(e.parentCategoryIds||[]).includes(t)&&!s.includes(e.id)).sort((e,t)=>e.displayOrder-t.displayOrder)}function m(e,t){let s=e.flatMap(e=>e.parentCategoryIds||[]);return e.filter(e=>(e.parentCategoryIds||[]).includes(t)&&!s.includes(e.id))}let p=new Map([a,i,"7609650f-adeb-46d2-9f7c-636e039ccfae","070f8966-9be0-4819-98cc-25807c597399","dec5b16b-8d5d-43ae-9db4-3d3167897385","d64b4abe-3434-4daf-97db-221b04a97529","e7592aea-2921-4d03-be77-87233fcb83e2","e2070713-bbe0-4b35-aa78-8a9e64dc2fcf","c04338d6-f4af-4ec7-8ec7-602da30e92f1","60d0fc7e-5990-4356-9abc-762dec511380"].map((e,t)=>[e,t]));function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;return[...e].sort((e,s)=>{let a=t.get(e.id),i=t.get(s.id);return void 0!==a||void 0!==i?(null!=a?a:Number.MAX_SAFE_INTEGER)-(null!=i?i:Number.MAX_SAFE_INTEGER):e.displayOrder!==s.displayOrder?e.displayOrder-s.displayOrder:e.name.localeCompare(s.name)})}function h(e,t){var s;return(null==(s=t.find(t=>t.depth===e))?void 0:s.categories)||[]}function g(e){return h(1,e)}function C(e){return h(2,e)}function y(e,t){return 0===o(e,t).length}function I(e){var t;return!!e&&"a9f26610-5129-4bbb-8f23-f5c2c287b4b3"!==e.id&&(e.id===n||!!(null==(t=e.parentCategoryIds)?void 0:t.includes(n)))}function v(e){var t;return!!e&&(r.includes(e.id)||!!(null==(t=e.parentCategoryIds)?void 0:t.some(e=>r.includes(e))))}function f(e){return I(e.category)||I(e.categorySecondary)}function j(e,t){let s=C(t).find(t=>
1t.id===e.id);if(s){var a;let i=null==(a=s.parentCategoryIds)?void 0:a[s.parentCategoryIds.length-1],n=g(t).find(e=>e.id===i);if(n)return{category:e,categoryPath:[n,s]}}let i=g(t).find(t=>t.id===e.id);return i?{category:e,categoryPath:[i]}:null}},27398:(e,t,s)=>{"use strict";function a(e){if(e)return Array.isArray(e)?e:[e]}function i(e){if(e)return Array.isArray(e)?e[0]:e}s.d(t,{eA:()=>r,k7:()=>a,q3:()=>i,rL:()=>n});let n=e=>{if(e)return Array.isArray(e)?Number(e[0]):Number(e)},r=e=>e?{exists:!0,v:e}:{exists:!1,v:""}},31064:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>e1,default:()=>e2});var a=s(37876),i=s(89099),n=s(14232),r=s(86317),l=s(14685),d=s(86287),c=s(67487),o=s(24836),u=s(41418),m=s(23396),p=s(12418),x=s(7996),h=s(57234),g=s(15962),C=s(52329),y=s(19031),I=s(28714),v=s(26087),f=s(52101),j=s(99087),N=s(57503),A=s(75597),b=s(55569);let E=e=>{var t,s;return[...(null!=(t=null==e?void 0:e.brandOrderBuyerCouponId)?t:[]).flatMap(e=>{var t;return null!=(t=e.buyerCouponId)?t:[]}),...null!=(s=null==e?void 0:e.aggregatedOrderBuyerCouponId)?s:[]]},D=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),_=e=>{var t,s;let a=(null!=(t=null==e?void 0:e.brandOrderBuyerCouponId)?t:[]).flatMap(e=>{var t;return null!=(t=e.buyerCouponId)?t:[]}),i=null!=(s=null==e?void 0:e.aggregatedOrderBuyerCouponId)?s:[];return a.length>0?{couponMode:"BRAND_SPECIFIC",usingCouponIds:a}:i.length>0?{couponMode:"CART_WIDE",usingCouponIds:i}:{couponMode:"NONE",usingCouponIds:[]}},L=e=>"".concat(e.couponMode,":").concat([...e.usingCouponIds].sort().join(",")),P=e=>{var t;let s=e&&"INVALID"!==e.paymentMethodType?e.paymentMethodType:A.ymB.INVALID;(null==e?void 0:e.creditType)==="EMAIL_INVOICE_DISABLED"&&(0,b.TM)(s)&&(s="INVALID");let a=(null==e||null==(t=e.primaryIdDependingOnPaymentMethodType)?void 0:t.exists)&&(0,b.Ze)(s)?e.primaryIdDependingOnPaymentMethodType.v:null;return(0,b.Ze)(s)&&(!(null==e?void 0:e.creditCards)||e.creditCards.every(e=>e.id!==a))&&(s=(null==e?void 0:e.creditType)!=="EMAIL_INVOICE_DISABLED"?"EMAIL_INVOICE":"INVALID",a=null),{paymentMethodType:s,creditCardId:a}};var T=s(42818),R=s(9118),S=s(34379);let O=e=>{let{t}=(0,h.yi)(),s=(0,i.useRouter)();return(0,a.jsx)(N.QJ5,{size:"small",title:t("注文には事業者プロフィールが必要です"),footerLeftButton:(0,a.jsx)(S.$,{gds:!0,variant:"outline",onClick:e.onClose,children:t("キャンセル")}),footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:()=>{s.push((0,g.JF4)(g.PuI))},children:t("設定する")}),isOpen:e.isOpen,onClose:e.onClose,children:(0,a.jsx)("div",{className:"px-4 py-6",children:(0,a.jsxs)(T.H,{children:["グッズでのご注文は、取引が成立する前にセラーがその注文を受領するかどうかの判断をします。",(0,a.jsx)("br",{}),(0,a.jsx)("br",{}),"店舗についての情報や販売方法を詳細に記入し、ブランドが商品の利用方法を具体的にイメージできるようにしましょう。"]})})})};function k(e){var t,s;return!((null==(s=e.firstReviewApprovedMs)?void 0:s.exists)&&e.firstReviewApprovedMs.v<17485308e5)&&(0,R.Mh)(e.profile.storeCategory,e.profile.storeReadiness,(null==(t=e.profile.salesPlan)?void 0:t.v)||null,e.profile.buyerSalesPlanGeneration)}let B=e=>{let t=k(e.buyer);return((0,n.useEffect)(()=>{t&&e.onOpen()},[]),t)?(0,a.jsx)(O,{isOpen:e.isOpen,onClose:e.onClose}):null};var M=s(82509),w=s(32851),F=s(22244),V=s(44252),U=s(73391),z=s(59596),W=s(64266),H=s(53762),Q=s(11923);let Y=e=>(0,a.jsx)(Q.I,{...e}),$=e=>{let{t}=(0,h.yi)(),s=I.m.buildForBrowser(),[i,r]=(0,n.useState)([]),[l,d]=(0,n.useState)([]),[c,o]=(0,n.useState)(null),[u,m]=(0,n.useState)(null);(0,n.useEffect)(()=>{e.isOpen&&(o(e.validItemsByBrand),m(e.invalidItemsByBrand))},[e.isOpen]);let p=async(e,t,a)=>{if(!c||!u)return;let i=Array.from(c),n=i.findIndex(s=>{var a;return s.brandId===e&&(null==(a=s.skuQuantity)?void 0:a.find(e=>e.skuId===t))});if(n>=0){var r,l,d;let c=i[n],u=(c.skuQuantity||[]).filter(e=>e.skuId!==t).concat([{skuId:t,quantity:a,sku:null}]).map(e=>({skuId:e.skuId,quantity:e.quantity})),m=await s.getCalcPriceDetailForCart({brandId:e,skuQuantityList:u,orderId:null}),p=null!=(d=null==(r=c.skuQuantity)?void 0:r.findIndex(e=>e.skuId===t))?d:-1;c.skuQuantity&&p>=0&&(c.skuQuantity[p].quantity=a),(null==(l=m.session.session)?void 0:l.calcPriceDetail)&&(c.priceDetail={subtotalDiscountFromBillingPriceByTaxMode:null,...m.session.session.calcPr
1iceDetail},i[n]=c,o(i))}},x=async(e,t,a)=>{if(!c||!u)return;let i={};Object.keys(u).forEach(async n=>{var r,l,d,c,o,p;i[n]=Array.from(u[n]||[]);let x=null!=(l=null==(r=u[n])?void 0:r.findIndex(s=>{var a;return s.brandId===e&&(null==(a=s.skuQuantity)?void 0:a.find(e=>e.skuId===t))}))?l:-1;if(x>=0){let r=null==u||null==(d=u[n])?void 0:d[x];if(r){let l=(r.skuQuantity||[]).filter(e=>e.skuId!==t).concat([{skuId:t,quantity:a,sku:null}]).map(e=>({skuId:e.skuId,quantity:e.quantity})),d=await s.getCalcPriceDetailForCart({brandId:e,skuQuantityList:l,orderId:null}),u=null!=(p=null==(c=r.skuQuantity)?void 0:c.findIndex(e=>e.skuId===t))?p:-1;r.skuQuantity&&u>=0&&(r.skuQuantity[u].quantity=a),(null==(o=d.session.session)?void 0:o.calcPriceDetail)&&(r.priceDetail={subtotalDiscountFromBillingPriceByTaxMode:null,...d.session.session.calcPriceDetail},(i[n]||(i[n]=[]))[x]=r)}}m(i)})},g=async(e,t,s)=>{let a=i.find(t=>t.brandId===e),n=i.filter(t=>t.brandId!==e);a?r([...n,{brandId:e,skuQuantityList:[...a.skuQuantityList.filter(e=>e.skuId!==t),{skuId:t,quantity:s}]}]):r([...n,{brandId:e,skuQuantityList:[{skuId:t,quantity:s}]}]),setTimeout(async()=>{await p(e,t,s),await x(e,t,s)},10)},y=(e,t)=>{g(e,t,0),d([...l,t])},v=()=>{r([]),d([]),r([]),d([]),o(null),m(null)},f=async()=>{for(let t=0;t<i.length;t++){let s=i[t];await e.updateList(s.brandId,s.skuQuantityList)}v(),e.onClose()},j=(c||[]).map((e,s)=>{var i,n,r,d;if(null==(n=e.brand)||null==(i=n.seller)||!i.sellerConfiguration||!e.priceDetail)return null;{let i=C.P.productItemProps("cart",null,g,y,e).map(e=>({...e,productItems:e.productItems.filter(e=>!l.includes(e.skuId))})).filter(e=>e.productItems.length>0),n=C.P.splitValidItems(c||[]),o=Object.keys(n.invalidItemsByBrand).find(t=>{var s,a;return null==(a=n.invalidItemsByBrand)||null==(s=a[t])?void 0:s.find(t=>t.brandId===e.brandId)});return i.length>0?(0,a.jsx)("div",{className:"bg-white rounded-3xl",children:(0,a.jsx)(V.B,{userType:"buyer",variety:"cart",brand:{id:e.brandId,name:e.brand.name,keyColor:e.brand.keyColor,iconImages:e.brand.iconImages,ongoingBrandSale:e.brand.ongoingBrandSale},sellerConfiguration:e.brand.seller.sellerConfiguration,productItems:i,initialOrder:null,priceDetail:e.priceDetail,errorMessage:"OUT_OF_STOCK"===o?t("在庫がありません"):"INVALID_STATUS"===o?t("現在お取り扱いがありません"):"BRAND_MINIMUM_ORDER_PRICE_UNSATISFIED"===o?(null==(d=e.brand.brandConfiguration)||null==(r=d.minimumOrderPriceE6)?void 0:r.exists)?t("ブランドの最低購入金額({{price}})に達していません",{price:W.w.formatPriceE6(e.brand.brandConfiguration.minimumOrderPriceE6.v,e.priceDetail.currency)}):t("ブランドの最低購入金額に達していません"):"",isBeforeTaxMigration20230701:!1,showSaleInfo:!0,remainingAmountForCouponE6:e.remainingAmountForCouponE6})},s):null}}).filter(z.TL);return(0,a.jsx)(N.QJ5,{size:"medium",title:t("カートを編集"),...e,footerLeftButton:(0,a.jsx)(S.$,{gds:!0,variant:"outline",onClick:()=>{v(),e.onClose()},children:t("キャンセル")}),footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:f,children:t("カートを更新する")}),children:(0,a.jsxs)("div",{className:"bg-gray2",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 text-gds-m",children:j.length>0?j:Object.keys(u||{}).length>0?(0,a.jsx)(H.SF,{}):(0,a.jsx)(H.U6,{})}),(0,a.jsx)("div",{className:"pt-12",children:(0,a.jsx)(Y,{variety:"cart",updateList:e.updateList,invalidItemsByBrand:u||{},updateTo:null,onUpdateQuantity:g,onClickDelete:y,hideSkuIds:l,buyerInfo:e.buyerInfo,dynamicSellerShippingConfigurationDetail:null})})]})})},J=e=>{let{t}=(0,h.yi)(),s=(0,o.j)(),i=e.checkoutPaymentContext.checkoutItems.some(e=>{var t;return null==(t=e.skuQuantity)?void 0:t.some(e=>{var t,s,a,i;return(0,y.Vk)(null==(s=e.sku)||null==(t=s.item)?void 0:t.category)||(0,y.Vk)(null==(i=e.sku)||null==(a=i.item)?void 0:a.categorySecondary)})});return(0,a.jsxs)("div",{className:"pt-6 text-gds-m",children:[(0,a.jsx)($,{...s,updateList:(t,s)=>e.updateList(t,s,!0),validItemsByBrand:e.checkoutPaymentContext.validItemsByBrand,invalidItemsByBrand:e.invalidItemsByBrand,buyerInfo:e.buyerInfo}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-gds-xl",children:t("カート内の商品")}),(0,a.jsxs)(S.$,{gds:!0,variant:"outline",onClick:s.onOpen,children:[(0,a.jsx)(M.A,{className:"size-4"}),t("編集")]})]}),i&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)("div",{className:"py-4 px-6 bg-white rounded-3xl",children:(0,a.jsx)("div",{className:"text-gds-l-bold",children:"法律にã
1‚ˆã‚Š20歳未満のお酒の購入や飲酒は禁止されています。"})})}),"ALL_CREDIT_CARD_AND_INVOICE"===e.checkoutPaymentContext.checkoutPaymentMethodMode||"PARTIALLY_CREDIT_CARD"===e.checkoutPaymentContext.checkoutPaymentMethodMode?(0,a.jsxs)(a.Fragment,{children:[e.checkoutPaymentContext.creditCardAvailableItems.length>0&&(0,a.jsxs)("div",{className:"flex flex-col pt-6 text-gds-m",children:[(0,a.jsx)(F.q,{as:"h3",borderColor:"gds.black",children:t("クレジットカード一括払い対象")}),e.checkoutPaymentContext.creditCardAvailableItems.map((t,s)=>{var i,n;return(null==(n=t.brand)||null==(i=n.seller)?void 0:i.sellerConfiguration)&&t.priceDetail&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)("div",{className:"bg-white rounded-3xl",children:(0,a.jsx)(V.B,{variety:"confirmation",userType:"buyer",brand:t.brand,sellerConfiguration:t.brand.seller.sellerConfiguration,sellerInfo:t.brand.seller,productItems:C.P.productItemProps("confirmation",null,null,null,t),initialOrder:null,priceDetail:t.priceDetail,isBeforeTaxMigration20230701:!1,showSaleInfo:!0,showSaleBannerForBuyer:!0,dynamicSellerShippingConfigurationDetail:e.dynamicSellerShippingConfigurationDetail,availablePaymentMethodTypes:["AVAILABLE"===t.cartItemCreditCardPaymentAvailability?A.ymB.CREDIT_CARD_ON_SHIPMENT:null,A.ymB.EMAIL_INVOICE].filter(z.TL),remainingAmountForCouponE6:t.remainingAmountForCouponE6})})},s)})]}),e.checkoutPaymentContext.creditCardUnavailableItems.length>0&&(0,a.jsxs)("div",{className:"flex flex-col pt-6 text-gds-m",children:[(0,a.jsx)(F.q,{as:"h3",borderColor:"gds.black",children:t("請求書払い対象")}),"PARTIALLY_CREDIT_CARD"===e.checkoutPaymentContext.checkoutPaymentMethodMode&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsxs)(U.Fc,{variant:"warning",className:"border-none!",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.XL,{children:e.checkoutPaymentContext.isInvoiceAvailable&&e.checkoutPaymentContext.isExceedingCreditLimit?(0,a.jsx)("p",{children:t("請求書払いのご利用枠を超過しているため、注文できません。")}):(0,a.jsx)("p",{children:t("請求書払いがご利用いただけないため、注文できません。")})}),e.checkoutPaymentContext.isInvoiceAvailable&&e.checkoutPaymentContext.isExceedingCreditLimit&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(U.TN,{children:(0,a.jsx)("p",{children:t("注文金額を調整してください。与信枠の増枠をご希望の場合は、ヘルプページをご確認ください。")})}),(0,a.jsx)(U.T2,{children:(0,a.jsx)(S.$,{size:"sm",asChild:!0,children:(0,a.jsx)("a",{href:g.rhF,target:"_blank",rel:"noopener noreferrer",children:t("ヘルプページを確認")})})})]})]})}),e.checkoutPaymentContext.creditCardUnavailableItems.map((t,s)=>{var i,n;return(null==(n=t.brand)||null==(i=n.seller)?void 0:i.sellerConfiguration)&&t.priceDetail&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)("div",{className:"bg-white rounded-3xl",children:(0,a.jsx)(V.B,{variety:"confirmation",userType:"buyer",brand:t.brand,sellerConfiguration:t.brand.seller.sellerConfiguration,sellerInfo:t.brand.seller,productItems:C.P.productItemProps("confirmation",null,null,null,t),initialOrder:null,priceDetail:t.priceDetail,isBeforeTaxMigration20230701:!1,showSaleInfo:!0,showSaleBannerForBuyer:!0,dynamicSellerShippingConfigurationDetail:e.dynamicSellerShippingConfigurationDetail,availablePaymentMethodTypes:["AVAILABLE"===t.cartItemCreditCardPaymentAvailability?A.ymB.CREDIT_CARD_ON_SHIPMENT:null,A.ymB.EMAIL_INVOICE].filter(z.TL),remainingAmountForCouponE6:t.remainingAmountForCouponE6})})},s)})]})]}):e.checkoutPaymentContext.validItemsByBrand.map((t,s)=>{var i,n;return(null==(n=t.brand)||null==(i=n.seller)?void 0:i.sellerConfiguration)&&t.priceDetail&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)("div",{className:"bg-white rounded-3xl",children:(0,a.jsx)(V.B,{userType:"buyer",variety:"confirmation",brand:t.brand,sellerConfiguration:t.brand.seller.sellerConfiguration,sellerInfo:t.brand.seller,productItems:C.P.productItemProps("confirmation",null,null,null,t),initialOrder:null,priceDetail:t.priceDetail,isBeforeTaxMigration20230701:!1,showSaleInfo:!0,showSaleBannerForBuyer:!0,dynamicSellerShippingConfigurationDetail:e.dynamicSellerShippingConfigurationDetail,availablePaymentMethodTypes:["AVAILABLE"===t.cartItemCreditCardPaymentAvailability?A.ymB.CREDIT_CARD_ON_SHIPMENT:null,A.ymB.EMAIL_INVOICE].filter(z.TL),remainingAmou
1ntForCouponE6:t.remainingAmountForCouponE6})})},s)})]})};var q=s(1741),G=s(31851),K=s(98886),X=s(27398),Z=s(43438),ee=s(65670);class et{}et.GOOOODS_STORE_BUYER_ID="f9fbad80-c239-4a23-b1a9-eefcc5046fa0",et.MEDIA_AID_BUYER_ID="a61677a9-f823-4ea4-93e6-e9514f6104bb",et.INNOVATIVE_AI_BUYER_ID="70192ee7-291e-4bfa-aee1-6a0d873c67b8";var es=s(32012),ea=s(4315),ei=s(42095),en=s(52887);let er=e=>{let{t}=(0,h.yi)(),{isInvalidAddressSelected:s,isAllPaymentMethodDisabled:i,isAllCreditCardPaymentUnavailable:n,isPaymentMethodDisabled:r,paymentMethodType:l}=e;if("INVALID"===l&&!i)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("支払い方法を選択してください。")});if(s)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("配送先住所を選択してください。")});if(i)return null;if(n&&"CREDIT_CARD_ON_SHIPMENT"===l)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-faded-orange",children:t("請求書払いを選択してください。")});if(r)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("有効な支払い方法を選択してください。")});else if(e.hasOutOfStock)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("カート内の商品が在庫切れです。カート内の商品を編集してください。")});else if(e.hasInvalidStatus)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("カート内の商品が非公開になりました。カート内の商品を編集してキャンセルしてください。")});else if(e.hasAssortmentUnsatisfied)return(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("アソート商品の発注可能数を満たしていません。カート内の商品を編集してください。")});else return null},el=(e,t,s)=>{var a;let i=(null==(a=e[s])?void 0:a.map(e=>e.brandId))||[],n=t.map(e=>e.brandId);return i.some(e=>n.includes(e))},ed=[et.GOOOODS_STORE_BUYER_ID,et.MEDIA_AID_BUYER_ID,et.INNOVATIVE_AI_BUYER_ID],ec=e=>ed.includes(e)?1e5:3,eo=e=>{let{isOpen:t,onClose:s,sampleOrdersLast7Days:i,buyerId:n}=e,{t:r}=(0,h.yi)(),l=ec(n),d=l-i;return(0,a.jsx)(N.QJ5,{size:"small",title:"サンプル商品についてのご注意",footerLeftButton:(0,a.jsx)(S.$,{gds:!0,variant:"outline",onClick:s,children:"閉じる"}),isOpen:t,onClose:s,children:(0,a.jsxs)("div",{className:"p-4",children:[d>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-gds-m",children:r("サンプルを含む注文の申込の上限を超えています。(7日間で{{limit}}回まで)",{limit:l})}),(0,a.jsx)("div",{className:"text-gds-m",children:r("注文回数は、決済ごとではなくブランドごとに1回とカウントされます。サンプル商品をカートから削除するか、サンプルを含む注文が {{remaining}} 回以内になるよう変更して、注文申込をしてください。",{remaining:d})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-gds-m",children:r("サンプルを含む注文の申込の上限を超えているため、サンプル商品をご購入いただけません。(7日間で{{limit}}回まで)",{limit:l})}),(0,a.jsx)("div",{className:"text-gds-m",children:r("サンプル商品をカートから削除の上ご注文ください。")}),(0,a.jsx)("div",{className:"text-gds-m",children:r("ご質問がある場合ヘルプページをご確認の上、サポートまでお問い合わせください。")})]}),(0,a.jsx)(en.h,{className:"h-6"}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsxs)(ei.N,{href:g.Ht8,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[r("サンプル商品についてもっと詳しく(ヘルプページへ移動)"),(0,a.jsx)(u.A,{className:"size-3"})]})})]})})},eu=e=>{let{t}=(0,h.yi)(),s=I.m.buildForBrowser(),n=(0,i.useRouter)(),{isLoading:r,isLoadingRef:l,setIsLoading:d}=(0,ea.M)(),c=(0,o.j)(),u=(0,o.j)(),{handleCheckoutCartInvalidRequest:m}=(0,H.zB)(),p=!H.Dc.isValidAddressSelected(e.checkoutData.session.user.buyer,e.selectedState),C=!H.Dc.isPaymentMethodEnabled(e.selectedState.paymentMethodType,e.checkoutPaymentContext.checkoutItems,e.credit),y=0===e.checkoutPaymentContext.credit
1CardAvailableItems.length&&!H.Dc.isPaymentMethodEnabled(A.ymB.EMAIL_INVOICE,e.checkoutPaymentContext.validItemsByBrand,e.credit),v=el(e.invalidItemsByBrand,e.checkoutPaymentContext.checkoutItems,"OUT_OF_STOCK"),f=el(e.invalidItemsByBrand,e.checkoutPaymentContext.checkoutItems,"INVALID_STATUS"),N=el(e.invalidItemsByBrand,e.checkoutPaymentContext.checkoutItems,"ITEM_ASSORTMENT_UNSATISFIED"),b=e.disabled||0===e.checkoutPaymentContext.checkoutItems.length||p||C||y||v||f||N,E=async(a,i)=>{var r,l,d,c;let o=(0,x.ao)(e.checkoutPaymentContext.creditCardAvailableItems).totalBillingPriceWithTax/1e6;if(o<=0)return{continueWithoutRedirect:!0,fincodeCardTransactionId:null};let u=await s.authorizeFincodeCreditCardPayment({request:{creditCardId:e.selectedState.creditCardId,amountYen:o,returnUrl:location.origin+(0,es.eR)(n.locale||"ja",g.hNU+"?"+i.toString()),contextPayload:(0,X.eA)(JSON.stringify(a))}});return u.authorizeFincodeCreditCardPayment.status===A.xUx.OK_WITHOUT_REDIRECT&&(null==(r=u.authorizeFincodeCreditCardPayment.fincodeCardTransactionId)?void 0:r.exists)?{continueWithoutRedirect:!0,fincodeCardTransactionId:u.authorizeFincodeCreditCardPayment.fincodeCardTransactionId.v}:u.authorizeFincodeCreditCardPayment.status===A.xUx.OK_WITH_REDIRECT&&(null==(l=u.authorizeFincodeCreditCardPayment.redirectUrl)?void 0:l.exists)?(n.push(u.authorizeFincodeCreditCardPayment.redirectUrl.v),{continueWithoutRedirect:!1,fincodeCardTransactionId:null}):u.authorizeFincodeCreditCardPayment.status===A.xUx.ERROR_FINCODE?(j.o.error(t("{{errorCode}} {{errorMessage}}",{errorCode:null==(d=u.authorizeFincodeCreditCardPayment.fincodeErrorCode)?void 0:d.v,errorMessage:null==(c=u.authorizeFincodeCreditCardPayment.fincodeErrorMessage)?void 0:c.v})),{continueWithoutRedirect:!1,fincodeCardTransactionId:null}):(j.o.error(t("クレジットカードの認証に失敗しました。")),{continueWithoutRedirect:!1,fincodeCardTransactionId:null})},D=async()=>{var a,i,r,c,o,u;if(l.current)return;let p=e.checkoutPaymentContext.checkoutItems.map(e=>e.brandId),x=(0,q.Fs)(e.displayCoupons,e.selectedState.usingCouponIds),h={brandIds:p,shippingAddressId:e.selectedState.addressId,paymentMethodType:e.selectedState.paymentMethodType,creditCardId:e.selectedState.creditCardId,...x,fincodeCardTransactionId:ee.y.nullString};if(d(!0),!(!b&&(H.Dc.isValidAddressSelected(e.checkoutData.session.user.buyer,e.selectedState)?!!H.Dc.isPaymentMethodEnabled(e.selectedState.paymentMethodType,e.checkoutPaymentContext.checkoutItems,e.credit)||(j.o.error(H.Dc.InvalidPaymentMethodText(t)),!1):(j.o.error(H.Dc.InvalidShippingAddressText(t)),!1))))return void d(!1);if("CREDIT_CARD_ON_SHIPMENT"===e.selectedState.paymentMethodType){let s=null==(a=e.checkoutData.session.user.buyer.creditCards)?void 0:a.find(t=>t.id===e.selectedState.creditCardId);if(!s)return void j.o.error(t("不正な操作が行われました。画面をリロードして再度お試しください"));let i=new URLSearchParams;if(i.set("enable_invited_buyer_onboarding",e.enableInvitedBuyerOnboarding?"1":"0"),s.creditCardPspType===A.no2.FINCODE){let e=await E(h,i);if(!e.continueWithoutRedirect)return void d(!1);h.fincodeCardTransactionId=W.w.wrapNullable(e.fincodeCardTransactionId)}else{j.o.error(t("このクレジットカードはご利用いただけません。別のクレジットカードをご利用ください。")),d(!1);return}}let C=await s.checkoutCart(h);if(d(!1),"OK"===C.checkoutCart.status){let t=null==(r=C.checkoutCart.checkoutResult)||null==(i=r[0])?void 0:i.orderId;t&&s.sendMetaConversionEvent({input:{metaConversionEventType:"FIRST_CHECKOUT",metaConversionEventFirstCheckout:{orderId:t}}}).catch(()=>{});let a=null==(c=C.checkoutCart.issuedBuyerCoupons)?void 0:c.find(e=>e.buyerCouponType.id===q._C);n.push((0,g.tGj)({enableInvitedBuyerOnboarding:e.enableInvitedBuyerOnboarding,issuedBuyerCouponId:null!=(o=null==a?void 0:a.id)?o:null}))}else"ERROR_INVALID_REQUEST"===C.checkoutCart.status?m(C):((0,Z.q)().report(Error((null==(u=C.checkoutCart.errors)?void 0:u.map(e=>e.orderErrorFieldDetailErrorCode).join(", "))||"")),j.o.error(t("購入できませんでした。")))},_=async()=>
1{if(b)return;if(k(e.checkoutData.session.user.buyer))return void e.businessDetailMissingModal.onOpen();if(!(()=>{let t=e.checkoutPaymentContext.validItemsByBrand.filter(e=>(e.skuQuantity||[]).findIndex(e=>{var t,s;return(null==(s=e.sku)||null==(t=s.item)?void 0:t.itemDealType)==="SAMPLE"&&e.quantity>0})>=0).length;return!(e.sampleOrdersLast7Days+t>ec(e.checkoutData.session.user.buyer.id))})()){d(!1),u.onOpen();return}let t=Array.from(e.displayCoupons).filter(t=>e.selectedState.usingCouponIds.includes(t.id)).map(e=>e.id);return e.displayCoupons.length>0&&0===t.length&&"PARTIALLY_CREDIT_CARD"!==e.checkoutPaymentContext.checkoutPaymentMethodMode?void c.onOpen():D()},L=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"pb-2 text-gds-m",children:t("クーポンをお持ちですが、選択されていません。このまま注文を申し込みますか?")}),(0,a.jsx)("div",{className:"p-4 bg-gray2 rounded-[4px]",children:(0,a.jsx)("div",{className:"flex flex-col gap-1 text-gds-m",children:e.displayCoupons.map((e,t)=>(0,a.jsx)("div",{className:"text-gds-m",children:e.displayName},t))})}),(0,a.jsx)("div",{className:"pt-2 text-gds-m text-accent-faded-orange",children:t("クーポン利用条件により、今回の注文に適用できない場合があります。")})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"hidden lg:block",children:[(0,a.jsx)(eo,{buyerId:e.checkoutData.session.user.buyer.id,sampleOrdersLast7Days:e.sampleOrdersLast7Days,...u}),(0,a.jsx)(G.b,{title:t("クーポン利用確認"),approveAction:D,approveLabel:t("クーポン適用せずに申込する"),cancelLabel:t("戻ってクーポンを選択する"),isLoading:r,...c,children:L})]}),(0,a.jsx)("div",{className:"block lg:hidden",children:(0,a.jsx)(G.b,{title:t("クーポン利用確認"),approveAction:D,approveLabel:t("クーポン適用せず申込"),cancelLabel:t("クーポンを選択"),isLoading:r,...c,children:L})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(S.$,{gds:!0,size:"lg",loading:r,disabled:b,onClick:_,children:t("注文を申込する")}),b&&(0,a.jsx)(er,{isInvalidAddressSelected:p,isPaymentMethodDisabled:C,isAllPaymentMethodDisabled:y,isAllCreditCardPaymentUnavailable:(0,K.Wt)(e.checkoutPaymentContext.validItemsByBrand),paymentMethodType:e.selectedState.paymentMethodType,hasOutOfStock:v,hasInvalidStatus:f,hasAssortmentUnsatisfied:N}),!b&&"PARTIALLY_CREDIT_CARD"===e.checkoutPaymentContext.checkoutPaymentMethodMode&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、クレジットカードが利用可能な商品のみご購入いただけます。")})}),!b&&"ALL_CREDIT_CARD_AND_INVOICE"===e.checkoutPaymentContext.checkoutPaymentMethodMode&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-pale-teal",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、支払いはクレジットカード一括払いと請求書払いで行われます。")})})]})]})},em=e=>(0,a.jsx)("div",{className:"py-2 px-4 bg-white border-gray3! border rounded-sm",children:(0,a.jsx)(N.Sc0,{isChecked:e.isChecked,onChange:t=>e.onChange(t.target.checked),children:(0,a.jsx)("div",{className:"text-gds-l",children:(0,a.jsxs)(T.H,{children:["セール品の注文について、",(0,a.jsx)(ei.N,{href:g.CoX,isExternal:!0,variant:"default",className:"text-gds-l text-black underline",children:"こちらの規約"}),"と、返品・交換不可であることを確認しました。"]})})})}),ep=e=>Object.keys(e.invalidItemsByBrand).length>0?(0,a.jsx)("div",{className:"pt-6 lg:pt-12",children:(0,a.jsx)(Y,{variety:"confirmation",updateTo:null,updateList:e.updateList,invalidItemsByBrand:e.invalidItemsByBrand,onClickDelete:null,onUpdateQuantity:null,buyerInfo:e.buyerInfo,dynamicSellerShippingConfigurationDetail:e.dynamicSellerShippingConfigurationDetail})}):(0,a.jsx)(a.Fragment,{});var ex=s(69684),eh=s(94904),eg=s(58392);
1let eC=(e,t,s)=>t.sort(q.C2).map(t=>{var i;return[t.id,(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(T.H,{values:{couponPrice:W.w.formatPriceE6(t.couponPriceE6,t.currency),couponName:t.displayName},children:[(0,a.jsxs)("p",{className:"text-gds-l-bold whitespace-nowrap",children:["{{couponPrice}}","割引"]}),(0,a.jsxs)("p",{className:"truncate text-gds-m text-gray8",children:["/","{{couponName}}"]})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-2 pt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(N.cvg,{label:e("対象ブランド"),color:"gds.gray3"}),(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:null==(i=t.availableBrands)?void 0:i.map(e=>e.name).join(", ")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(N.cvg,{label:e("有効期限"),color:"gds.gray3"}),(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:W.w.formatDateTimeForCouponEnd(Date.now(),t.validUntilMs-1,e)})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(N.cvg,{label:e("利用条件"),color:"gds.gray3"}),(0,a.jsx)("div",{className:"text-gray8",children:(0,a.jsx)(ex.GG,{coupon:t,buyer:s})})]})]})]})]}),ey=e=>{let{t}=(0,h.yi)(),s=e.displayCoupons.filter(e=>e.buyerCouponType.buyerCouponAccountingMode===A.MR6.SELLER_FUNDED),i=e.displayCoupons.filter(e=>e.buyerCouponType.buyerCouponAccountingMode===A.MR6.PLATFORM),n=e.selectedState.couponMode,r=t=>{let a=[];if("BRAND_SPECIFIC"===t){let t=s.sort((e,t)=>t.couponPriceE6-e.couponPriceE6||0).filter(t=>e.applicableCouponIds.includes(t.id));a=Array.from(new Set(t.map(e=>{var t;return null==(t=e.availableBrandIds)?void 0:t[0]}).filter(z.TL))).map(e=>{var s;return null==(s=t.find(t=>{var s;return(null==(s=t.availableBrandIds)?void 0:s[0])===e}))?void 0:s.id}).filter(z.TL)}else a=[];e.setSelectedState(e=>({...e,couponMode:t,usingCouponIds:a}))};return(0,a.jsx)(N.QJ5,{size:"small",title:t("クーポン利用を設定"),footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:e.selectDisclosure.onClose,children:t("選択したクーポンを設定")}),...e.selectDisclosure,children:(0,a.jsxs)("div",{className:"px-4 py-6",children:[s.length>0&&(0,a.jsxs)("div",{className:(0,eg.cn)("relative pb-6","BRAND_SPECIFIC"!==n&&"cursor-pointer"),onClick:()=>"BRAND_SPECIFIC"!==n&&r("BRAND_SPECIFIC"),children:[(0,a.jsx)("div",{className:"pb-2",children:(0,a.jsx)(N.z6M,{value:n,layout:"vertical-large",choices:[["BRAND_SPECIFIC",t("ブランドごとに適用されるクーポン")]],onChange:r})}),(0,a.jsx)("div",{className:"pl-8",children:(0,a.jsx)(eh.Q,{selected:"BRAND_SPECIFIC"===n?e.selectedState.usingCouponIds:[],size:"large",choices:eC(t,s,e.buyer),checkboxProps:t=>"BRAND_SPECIFIC"!==n||e.isProcessingCouponApplication||!e.applicableCouponIds.includes(t)&&!e.selectedState.usingCouponIds.includes(t)||(0,q.lO)(s,e.selectedState.usingCouponIds,t)?{isDisabled:!0,_hover:{cursor:"not-allowed"}}:{},onChange:t=>e.setSelectedState(e=>({...e,usingCouponIds:t.map(e=>"".concat(e))}))})})]}),i.length>0&&(0,a.jsxs)("div",{className:(0,eg.cn)("relative pb-6","CART_WIDE"!==n&&"cursor-pointer"),onClick:()=>"CART_WIDE"!==n&&r("CART_WIDE"),children:[(0,a.jsx)("div",{className:"pb-2",children:(0,a.jsx)(N.z6M,{value:n,layout:"vertical-large",choices:[["CART_WIDE",t("カート全体に適用されるクーポン")]],onChange:r})}),(0,a.jsx)("div",{className:"pl-8",children:(0,a.jsx)(eh.Q,{selected:"CART_WIDE"===n?e.selectedState.usingCouponIds:[],size:"large",choices:eC(t,i,e.buyer),checkboxProps:t=>"CART_WIDE"===n&&!e.isProcessingCouponApplication&&(e.applicableCouponIds.includes(t)||e.selectedState.usingCouponIds.includes(t))?{}:{isDisabled:!0,_hover:{cursor:"not-allowed"}},onChange:t=>e.setSelectedState(e=>({...e,usingCouponIds:t.map(e=>"".concat(e))}))})})]}),(0,a.jsx)("div",{children:(0,a.jsx)(N.z6M,{value:n,layout:"vertical-large",choices:[["NONE",t("クーポンを利用しない")]],onChange:r})}),(0,a.jsxs)("div",{className:"pt-2 text-end",children:[(0,a.jsxs)(ei.N,{href:g.ReK,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:["ブランドごとに適用されるクーポン(セラークーポン)について詳しく",(0,a.jsx)(u.A,{className:"size-3"})]}),(0,a.jsxs)(ei.N,{href:g.dch,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:["グッズクーポンとセラークーポンの違いについて詳しく",(0,a.jsx)(u.A,{className:"size-3"})]})]})]})})},eI=e=>(0,a.jsx)(ey,{...e}),ev=e=>{let{t}=(0,h.yi)();return(0,a.jsx)("ul",{className:"list-none",children:e.lines.map(e=>(0,a.jsxs)("li",{children:["・",((e,t)=>
1null!==e.brandName?t("{{brandName}} {{couponPrice}}クーポン",{brandName:e.brandName,couponPrice:e.couponPrice}):t("{{couponPrice}}グッズクーポン",{couponPrice:e.couponPrice}))(e,t)]},e.couponId))})},ef=e=>{let{t}=(0,h.yi)(),{diff:s}=e;if(!s)return null;let i=s.notApplicableCouponIds.map(t=>{var a,i,n,r;let l=e.displayCoupons.find(e=>e.id===t);if(!l)return null;let d=s.brandIdByCouponId[t],c=void 0===d?null:null!=(n=null==(i=e.cartItems.find(e=>e.brandId===d))||null==(a=i.brand)?void 0:a.name)?n:null;return void 0!==d&&null===c?null:{couponId:t,brandName:c,couponPrice:W.w.formatPriceE6(l.couponPriceE6,null!=(r=l.currency)?r:A.QeY.JPY)}}).filter(z.TL);return 0===i.length?null:(0,a.jsxs)(U.Fc,{variant:"warning","data-testid":"checkout-coupon-auto-application-notice",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{children:t("お支払い方法の条件により、次のクーポンはこの注文に適用できませんでした")}),(0,a.jsx)(ev,{lines:i})]})})]})};var ej=s(4523),eN=s(86292),eA=s(308),eb=s(20442),eE=s(62585),eD=s(96852),e_=s(17958);let eL="__ADD_NEW_CARD__",eP=e=>{let{t}=(0,h.yi)(),s=(0,i.useRouter)();return(0,a.jsx)(N.QJ5,{size:"small",title:t("クレジットカードを追加"),hasCloseButton:!0,autoFocus:!1,isOpen:e.newCreditCardDisclosure.isOpen,onClose:()=>{e.newCreditCardDisclosure.onClose(),setTimeout(e.selectDisclosure.onOpen,200)},children:(0,a.jsx)("div",{className:"py-6 px-4",children:(0,a.jsx)(eA.A,{onRedirectTo:"/register_creditcard?buyer_id=".concat(e.buyerId)+"&redirect_to=".concat(encodeURIComponent(s.asPath)),onSuccessWithoutRedirect:async t=>{await e.onUpdateCheckoutData(),e.setRecentlyAddedCardId(t),e.newCreditCardDisclosure.onClose(),e.onUpdatePaymentMethodOrId("CREDIT_CARD_ON_SHIPMENT",t),setTimeout(e.selectDisclosure.onOpen,200)}})})})},eT=(e,t)=>{null!=e&&t(e)},eR=e=>{let{t}=(0,h.yi)(),{paymentMethodType:s,checkoutPaymentContext:i}=e;if(i.isInvoiceAvailable)if(H.Dc.isInvoice(s))switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsxs)(U.Fc,{gds:!0,variant:"information",children:[(0,a.jsx)(e_.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内のブランドはクレジットカード払いがご利用できません。")}),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});return(0,a.jsxs)(U.Fc,{gds:!0,variant:"information",children:[(0,a.jsx)(e_.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内のブランドはクレジットカード払いがご利用できません。請求書払いを選択してください。")}),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]})}else if(H.Dc.isCreditCard(s))switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsx)(a.Fragment,{});return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内のブランドはクレジットカード払いがご利用できません。請求書払いを選択してください。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsxs)(U.Fc,{gds:!0,variant:"information",children:[(0,a.jsx)(e_.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、クレジットカードが利用可能な商品のみご購入いただけます。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});return(0,a.jsxs)(U.Fc,{gds:!0,variant:"information",children:[(0,a.jsx)(e_.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、支払いはクレジットカード一括払いと請求書払いで行われます。")}),!i.isExceedingCreditLimitIfInvoiceIsSelected&&(0,a.jsx)("div",{className:"text-gds-m",children:t("支払い方法を請求書払いに変更した場合、まとめてお支払いいただけます。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]})}else switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsx)(a.Fragment,{});return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内のブランドはクレジットカード払いがご利用できません。請求書払いを選択してください。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]})}if(H.Dc.isInvoice(s))return(0,a.jsx)(a.Fragment,{});if(!H.Dc.isCreditCard(s))return(0,a.jsx)(a.Fragment,{});switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"ALL_CREDIT_CARD_UNAVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":return(0,a.jsxs)(U.Fc,{gds:!0,variant:"information",children:[(0,a.jsx)(e_.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsx)("div",{className:"flex flex-col gap-2",children:(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、クレジットカードが利用可能な商品のみご購入いただけます。")})})})]})}},eS=e=>{let{t}=(0,h.yi)(),s=e.credit,[i,r]=n.useState(!0),l=n.useCallback(()=>
1{if(e.recentlyAddedCardId&&e.creditCards.some(t=>t.id===e.recentlyAddedCardId)){let t=e.creditCards.find(t=>t.id===e.recentlyAddedCardId);if(t&&!(0,K.l5)(t))return e.recentlyAddedCardId}let t=e.checkoutPaymentContext.isExceedingCreditLimitIfInvoiceIsSelected;if(e.defaultPaymentMethodOrId===A.ymB.EMAIL_INVOICE&&!t)return"EMAIL_INVOICE";if(e.defaultPaymentMethodOrId&&e.creditCards.some(t=>t.id===e.defaultPaymentMethodOrId)){let t=e.creditCards.find(t=>t.id===e.defaultPaymentMethodOrId);if(t&&!(0,K.l5)(t))return e.defaultPaymentMethodOrId}if(t||!e.checkoutPaymentContext.isInvoiceAvailable){let t=e.creditCards.find(e=>!(0,K.l5)(e));return t?t.id:eL}if(0===e.creditCards.length)return eL;let s=e.creditCards.find(e=>!(0,K.l5)(e));return s?s.id:eL},[e.creditCards,e.defaultPaymentMethodOrId,e.checkoutPaymentContext.isExceedingCreditLimitIfInvoiceIsSelected,e.checkoutPaymentContext.isInvoiceAvailable,e.recentlyAddedCardId]),[d,c]=n.useState(l());n.useEffect(()=>{e.selectDisclosure.isOpen&&(c(l()),r(!0))},[e.selectDisclosure.isOpen,l]);let o=I.m.buildForBrowser(),[m,p]=(0,n.useState)(!1),x=e.creditCards.find(e=>e.id===d),C=!!x&&(0,K.l5)(x),y=t=>"EMAIL_INVOICE"===t||"EMAIL_INVOICE_IN_NEXT_2_MONTHS_END"===t||"EMAIL_INVOICE_IN_NEXT_MONTH_END"===t?t:e.creditCards.some(e=>e.id===t)||t===eL?"CREDIT_CARD_ON_SHIPMENT":"INVALID",v=async()=>{let s="INVALID",a=null;if("EMAIL_INVOICE"===d||"EMAIL_INVOICE_IN_NEXT_2_MONTHS_END"===d||"EMAIL_INVOICE_IN_NEXT_MONTH_END"===d)s=d;else if(e.creditCards.some(e=>e.id===d)){let i=e.creditCards.find(e=>e.id===d);if(i&&(0,K.l5)(i))return void j.o.error(t("クレジットカードが期限切れです"));s="CREDIT_CARD_ON_SHIPMENT",a=d}if(e.onUpdatePaymentMethodOrId(s,a),!i||e.defaultPaymentMethodOrId===d)return void e.selectDisclosure.onClose();p(!0),"OK"===(await o.updateBuyerPrimaryConfig({input:{paymentMethodType:s,primaryIdDependingOnPaymentMethodType:W.w.wrapNullable(a)}})).updateBuyerPrimaryConfig.status?(await e.onUpdateCheckoutData(),p(!1),j.o.success(t("デフォルトの支払い方法を変更しました")),e.selectDisclosure.onClose()):(p(!1),j.o.error(t("エラー")))},f=0===e.checkoutPaymentContext.creditCardAvailableItems.length,E=((e,t,s,i,n,r,l,d,c,o,m,p,x,h,C,y)=>{let I=[],v=e=>"EMAIL_INVOICE"===e||"EMAIL_INVOICE_IN_NEXT_2_MONTHS_END"===e||"EMAIL_INVOICE_IN_NEXT_MONTH_END"===e?e:i.some(t=>t.id===e)||e===eL?"CREDIT_CARD_ON_SHIPMENT":"INVALID",f="CREDIT_CARD_ON_SHIPMENT"===v(c)&&c===eL;if(I.push(["CREDIT_CARD",(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-gds-m",children:[(0,a.jsxs)("div",{className:"flex flex-col min-[480px]:flex-row items-start min-[480px]:items-center gap-1 min-[480px]:gap-2",children:[(0,a.jsx)("div",{className:(0,eg.cn)("text-base",d?"text-gray7":"text-gray8"),children:y("クレジットカード")}),(0,a.jsxs)("div",{className:(0,eg.cn)("flex items-center gap-1",d?"opacity-50":"opacity-100"),children:[(0,a.jsx)(eN.CreditCardIcon,{brand:"VISA",width:8,height:6}),(0,a.jsx)(eN.CreditCardIcon,{brand:"MASTER",width:8,height:6}),(0,a.jsx)(eN.CreditCardIcon,{brand:"JCB",width:8,height:6}),(0,a.jsx)(eN.CreditCardIcon,{brand:"AMEX",width:8,height:6}),(0,a.jsx)(eN.CreditCardIcon,{brand:"DINERS",width:8,height:6}),(0,a.jsx)(eN.CreditCardIcon,{brand:"DISCOVER",width:8,height:6})]})]}),"CREDIT_CARD_ON_SHIPMENT"===v(c)&&(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsx)(N.wRv,{onChange:e=>{eT(e,e=>{e===eL?o(eL):o(e)})},value:(()=>{if("CREDIT_CARD_ON_SHIPMENT"===v(c))return i.find(e=>e.id===c)?c:eL})(),size:"medium",choices:[...i.map(e=>[e.id,(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(eN.CreditCardIcon,{brand:e.brand,width:10,height:7}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-2 gap-y-0",children:[(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:y("下4桁:{{creditCardLast4}}",{creditCardLast4:e.last4})}),(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:y("有効期限:{{expiration}}",{expiration:(0,K.Oi)(e.expireYear,e.expireMonth)})})]})]}),(0,a.jsx)(en.h,{}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,K.l5)(e)&&(0,a.jsx)(eD.Wh,{status:"special",contrast:"high",label:y("期限切れ"),size:"small"}),n===e.id&&(0,a.jsx)(N.cvg,{label:y("デフォルト"),color:"gds.gray3",fontSize:10})]})]}),n===e.id&&d&&(0,a.jsx)("div",{className:"text-gds-s text-accent-faded-orange",children:y("クレジットカード利用不可ブランドがカートに含まれているため、選択できません")})]},e.id),(0,K.l5)(e)||d,{containerProps:{...d?{bg:"gds.gray1"}:{},minH:"64px",borderColor:c===e.id?"gds.gray8":"gds.gray3"},radioProps:d?{opacity:.6}
1:void 0,disableHover:d}]),[eL,(0,a.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:y("クレジットカードを追加")}),f&&(0,a.jsx)("div",{className:"relative left-[-26px] w-[calc(100%+26px)] bg-white rounded-sm",children:(0,a.jsx)(eA.A,{onRedirectTo:"/register_creditcard?buyer_id=".concat(m)+"&redirect_to=".concat(encodeURIComponent(window.location.pathname+window.location.search)),onSuccessWithoutRedirect:async e=>{await p(),o(e),C(e)}})})]},eL),d,{containerProps:{...f?{alignItems:"flex-start",pt:"space-16"}:{},...d?{bg:"gds.gray1"}:{},...!f?{minH:"64px"}:{},borderColor:c===eL&&f?"gds.gray8":"gds.gray3"},radioProps:{...d?{opacity:.6}:{}},disableHover:d}]],radioProps:e=>{let t=i.find(t=>t.id===e);return t&&((0,K.l5)(t)||d)||e===eL&&d?{isDisabled:!0}:{}}})})})]},"CREDIT_CARD"),d,{containerProps:{bg:"gds.white",border:"none",alignItems:"flex-start",px:"space-0"},radioProps:{style:{marginTop:"6px"},opacity:d?.6:1}}]),!(0,eE.F)(r)){let i=l||"OK"!==s.status||"ACTIVE"!==s.creditStatus;I.push(["EMAIL_INVOICE",(0,a.jsxs)("div",{className:(0,eg.cn)("flex flex-col gap-2 text-gds-m",i?"cursor-not-allowed":"cursor-pointer"),children:[(0,a.jsx)("div",{className:(0,eg.cn)("text-base",i?"text-gray7":"text-gray8"),children:y("請求書払い")}),(0,a.jsx)("div",{className:(0,eg.cn)("flex px-4 py-2 min-h-[64px] rounded-sm border border-gray3!",i?"bg-gray1":"bg-white"),children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(N.J3M,{width1x:40,height1x:28}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("div",{className:(0,eg.cn)(i?"text-gray7":"text-gray8"),children:(0,b.QU)(A.ymB.EMAIL_INVOICE,e,y)}),!H.Dc.isUnlimitedCredit(s)&&(e!==A.oNR.EMAIL_INVOICE_DISABLED?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-gray7",dangerouslySetInnerHTML:{__html:y("あと&nbsp;{{restCreditPrice}}&nbsp;までご利用可能",{restCreditPrice:W.w.formatPriceObject(H.Dc.getRestCreditPrice(s,A.ymB.EMAIL_INVOICE))})}}),l&&(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:y("与信枠を超過しているため選択できません")}),(0,a.jsxs)(ei.N,{isExternal:!0,href:g.rhF,variant:"emphasis",className:"inline-flex items-center gap-1",children:[y("与信の増枠申請について"),(0,a.jsx)(u.A,{className:"size-4"})]})]}):(0,a.jsx)(eb.v,{reviewStatus:t,creditType:e})),i&&!l&&e!==A.oNR.EMAIL_INVOICE_DISABLED&&(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:"INACTIVE_MISSING_PAYMENT_EXISTS"===s.creditStatus?y("未払いの請求書があるため、一時的にご利用いただけません"):y("一時的にご利用いただけません。詳しくはサポートまでお問い合わせください")})]}),e!==A.oNR.EMAIL_INVOICE_DISABLED&&n===A.ymB.EMAIL_INVOICE&&(0,a.jsx)("div",{className:"self-center",children:(0,a.jsx)(N.cvg,{label:y("デフォルト"),color:"gds.gray3",fontSize:10})})]})})]},"EMAIL_INVOICE"),i,{containerProps:{bg:"gds.white",border:"none",alignItems:"flex-start",px:"space-0"},radioProps:{style:{marginTop:"6px"}}}])}return I})(e.creditType,e.invoiceReviewStatus,s,e.creditCards,e.defaultPaymentMethodOrId,e.buyerCountry,e.checkoutPaymentContext.isExceedingCreditLimitIfInvoiceIsSelected,f,d,c,e.buyerId,e.onUpdateCheckoutData,e.selectDisclosure,e.newCreditCardDisclosure,e.setRecentlyAddedCardId,t),D=E.every(e=>e[2]);return(0,a.jsx)(N.QJ5,{size:"small",title:t("支払い方法を選択"),footerLeftButton:(0,a.jsx)(S.$,{gds:!0,variant:"outline",loading:m,onClick:e.selectDisclosure.onClose,children:t("キャンセル")}),footerRightButton:(0,a.jsx)(S.$,{gds:!0,loading:m,disabled:d===eL||C||D,onClick:v,children:t("支払い方法を選択")}),...e.selectDisclosure,children:(0,a.jsxs)("div",{className:"px-4 py-6",children:[((e,t)=>{if(t.isInvoiceAvailable)if(H.Dc.isInvoice(e))switch(t.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return!1;case"ALL_CREDIT_CARD_UNAVAILABLE":return!0}else if(H.Dc.isCreditCard(e))switch(t.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":default:return!1;case"ALL_CREDIT_CARD_UNAVAILABLE":return!t.isExceedingCreditLimit;case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":return!0}else switch(t.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return!1;case"ALL_CREDIT_CARD_UNAVAILABLE":return!t.isExceedingCreditLimit}if(H.Dc.isCreditCard(e))switch(t.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"ALL_CREDIT_CARD_UNAVAILABLE":default:break;case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":return!0}return!1})(y(d),e.checkoutPaymentContext)&&(0,a.jsx)("div",{className:"pb-4",children:(0,a.jsx)(eR,{paymentMethodType:y(d),checkoutPaymentContext:e.checkoutPaymentContext})}),(0,a.jsx)(N.wRv,{onChange:t=>{eT(t,t=>{if("CREDIT_CARD"===t){if(e.creditCards.some(e=>e.id===d)||d===eL)return;let t=e.creditCards.find(e=>!(0,K.l5)(e));t&&!f?c(t.id):c(eL)}else"EMAIL_INVOICE"===t&&c("EMAIL_INVOICE")})},value:"CREDIT_CARD_ON_SHIPMENT"===y(d)?"CREDIT_CARD":d,size:"medium",choices:E,radioProps:t=>
1"EMAIL_INVOICE"===t&&(e.checkoutPaymentContext.isExceedingCreditLimitIfInvoiceIsSelected||"OK"!==e.credit.status||"ACTIVE"!==e.credit.creditStatus)?{isDisabled:!0}:{}}),E.length>0&&(0,a.jsx)("div",{className:"pt-4",children:(0,a.jsx)(N.Sc0,{isChecked:i,onChange:e=>r(e.target.checked),disabled:D,children:t("この支払い方法をデフォルトに設定する")})}),!(0,eE.F)(e.buyerCountry)&&e.creditType===A.oNR.EMAIL_INVOICE_DISABLED&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(eb.$,{invoiceReviewStatus:e.invoiceReviewStatus,accountReviewStatus:e.accountReviewStatus})})})]})})},eO=e=>{let[t,s]=n.useState(null);return n.useEffect(()=>{e.selectDisclosure.isOpen||e.newCreditCardDisclosure.isOpen||s(null)},[e.selectDisclosure.isOpen,e.newCreditCardDisclosure.isOpen]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eS,{...e,recentlyAddedCardId:t,setRecentlyAddedCardId:s}),(0,a.jsx)(eP,{...e,setRecentlyAddedCardId:s})]})},ek=e=>{var t,s,i;let{t:n}=(0,h.yi)(),{buyer:r,buyerCredit:l}=e,d=(0,o.j)(),c=(0,o.j)(),u=(0,o.j)(),m=e.selectedState.paymentMethodType,p=e.selectedState.creditCardId,x=(null==(t=r.creditCards)?void 0:t.find(e=>e.id===p))||null,g=0===e.checkoutPaymentContext.creditCardAvailableItems.length&&!H.Dc.isPaymentMethodEnabled("EMAIL_INVOICE",e.checkoutPaymentContext.creditCardUnavailableItems,l),C=0===e.checkoutPaymentContext.creditCardAvailableItems.length&&(!e.checkoutPaymentContext.isInvoiceAvailable||e.checkoutPaymentContext.isExceedingCreditLimit&&"EMAIL_INVOICE"!==e.selectedState.paymentMethodType);return(0,a.jsxs)("div",{className:"pt-6 lg:pt-0",children:[(0,a.jsx)(eO,{buyerId:e.buyer.id,invoiceReviewStatus:e.buyer.invoiceReviewStatus,accountReviewStatus:e.buyer.accountReviewStatus,buyerCountry:e.buyer.country,creditType:r.creditType,credit:l,checkoutPaymentContext:e.checkoutPaymentContext,selectedPaymentMethodOrId:H.Dc.isInvoice(m)?m:(null==(s=r.creditCards)?void 0:s.some(e=>e.id===p))&&p||"",defaultPaymentMethodOrId:"INVALID"===r.paymentMethodType||H.Dc.isInvoice(r.paymentMethodType)?r.paymentMethodType:(null==(i=r.primaryIdDependingOnPaymentMethodType)?void 0:i.v)||"",onUpdatePaymentMethodOrId:(t,s)=>{var a,i;if(e.onPaymentMethodChangedWithAutoApplication)return void e.onPaymentMethodChangedWithAutoApplication({paymentMethodType:t,creditCardId:s});null==(a=e.cartOps)||a.setPaymentMethodType(H.Dc.isInvoice(t)?t:"CREDIT_CARD_IN_60_DAYS"),e.selectedState.usingCouponIds.length>0?(e.setSelectedState(e=>({...e,usingCouponIds:[],paymentMethodType:t,creditCardId:s})),null==(i=e.cartOps)||i.resetCouponIds(),u.onOpen()):e.setSelectedState(e=>({...e,paymentMethodType:t,creditCardId:s}))},onUpdateCheckoutData:e.onUpdateCheckoutData,creditCards:r.creditCards||[],selectedState:e.selectedState,setSelectedState:e.setSelectedState,selectDisclosure:d,newCreditCardDisclosure:c}),(0,a.jsx)(N.QJ5,{isOpen:u.isOpen,onClose:u.onClose,size:"small",title:n("支払い方法を変更しました"),hasCloseButton:!0,footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:u.onClose,children:n("閉じる")}),children:(0,a.jsx)("div",{className:"px-4 py-6 text-gds-m",children:n("支払い方法を変更したためクーポンの選択を解除しました。")})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-gds-xl",children:n("支払い方法")}),(0,a.jsxs)(S.$,{gds:!0,variant:"outline",disabled:C,onClick:d.onOpen,children:[(0,a.jsx)(M.A,{className:(0,eg.cn)("size-4",C?"opacity-50":"opacity-100")}),n("編集")]})]}),!g&&(!m||"INVALID"===m)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"hidden lg:block pt-2 text-gds-m-bold text-accent-pale-teal",children:n("支払い方法を選択してください。")}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(ej.f,{enabled:!0,render:e=>(0,a.jsx)(S.$,{gds:!0,variant:"outline",onClick:d.onOpen,style:e,children:n("支払い方法を選択")})})})]}),(0,a.jsxs)("div",{className:"pt-2",children:[!g&&x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-gds-l-bold",children:n("クレジットカード一括払い")}),(0,a.jsxs)("div",{className:"flex items-center gap-4 pt-0 lg:pt-2",children:[(0,a.jsx)("div",{children:(0,a.jsx)(eN.CreditCardIcon,{brand:x.brand,width:"48px",height:"32px"})}),(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:n("下4桁番号: {{creditCardLast4}}",{creditCardLast4:x.last4})}),(0,a.jsx)("div",{className:"text-gds-m text-gray8",children:n("有効期限:{{expiration}}",{expiration:(0,K.Oi)(x.expireYear,x.expireMonth)})})]}),(0,K.l5)(x)&&(0,a.jsx)("div",{className:"pt-2 text-gds-m-bold text-accent-faded-orange",children:n("ご登録のクレジットカードの有効期限が切れています。有効なクレジットカードを登録してください。")})]}),"ACTIVE"===l.creditStatus&&(H.Dc.isInvoice(m)||"ALL_CREDIT_CARD_AND_INVOICE"===e.checkoutPaymentContext.checkoutPaymentMethodMode)&&(0,a.jsxs)("div",{className:"pt-2",children:[(0,a.jsx)("div",{className:"text-gds-l-bold",children:(0,b.QU)(m,r.creditType,n)}),!H.Dc.isUnlimitedCredit(l)&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"text-gds-m text-gray8",dangerouslySetInnerHTML:{__html:n("あと&nbsp;{{restCreditPrice}}&nbsp;までご利用可能",{restCreditPrice:W.w.formatPriceObject(e.checkoutPaymentContext.
1invoicePaymentCreditRest)})}})})]}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(eB,{paymentMethodType:m,invoiceReviewStatus:e.buyer.invoiceReviewStatus,checkoutPaymentContext:e.checkoutPaymentContext})})]})]})},eB=e=>{let{t}=(0,h.yi)(),{paymentMethodType:s,checkoutPaymentContext:i}=e;if(i.isInvoiceAvailable)if(H.Dc.isInvoice(s))switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("与信枠を超過しました。クレジットカード払いなどの支払い方法に変更するか、注文商品の金額を調整してください。")}),(0,a.jsx)("div",{className:"text-gds-m",children:t("請求書払いの与信枠の増枠をご希望の場合は下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("与信枠を超過しました。注文商品の金額を調整してください。")}),(0,a.jsx)("div",{className:"text-gds-m",children:t("請求書払いの与信枠の増枠をご希望の場合は下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});return(0,a.jsx)(a.Fragment,{});default:return(0,a.jsx)(a.Fragment,{})}else if(H.Dc.isCreditCard(s))switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":if(i.isExceedingCreditLimit)return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("選択可能な支払い方法がありません。")}),(0,a.jsx)("div",{className:"text-gds-m",dangerouslySetInnerHTML:{__html:t("請求書払いはあと&nbsp;{{restCreditPrice}}&nbsp;までご利用可能ですが、カート内商品合計金額がご利用可能枠を超過しています。",{restCreditPrice:W.w.formatPriceObject(i.invoicePaymentCreditRest)})}}),(0,a.jsx)("div",{className:"text-gds-m",children:t("請求書払いの与信枠の増枠をご希望の場合は下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カート内のブランドはクレジットカード払いがご利用できません。請求書払いを選択してください。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]})}else if(i.isExceedingCreditLimit)return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("選択可能な支払い方法がありません。")}),(0,a.jsx)("div",{className:"text-gds-m",dangerouslySetInnerHTML:{__html:t("請求書払いはあと&nbsp;{{restCreditPrice}}&nbsp;までご利用可能ですが、カート内商品合計金額がご利用可能枠を超過しています。",{restCreditPrice:W.w.formatPriceObject(i.invoicePaymentCreditRest)})}}),(0,a.jsx)("div",{className:"text-gds-m",children:t("請求書払いの与信枠の増枠をご希望の場合は下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})]});else return(0,a.jsx)(a.Fragment,{});if(H.Dc.isInvoice(s))switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("請求書払いは現在ご利用いただけません。クレジットカードをご選択ください。")}),(0,a.jsxs)("div",{className:"text-gds-m",children:[t("請求書払いをご希望の場合は下記ヘルプページをご確認ください。"),(0,a.jsxs)(ei.N,{href:g.rhF,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})]})})]});case"ALL_CREDIT_CARD_UNAVAILABLE":return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsx)("div",{className:"flex flex-col gap-2",children:(0,a.jsxs)("div",{className:"text-gds-m",children:[t("選択可能な支払い方法がありません。詳しくは下記ヘルプページをご確認ください。"),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})})]});default:return(0,a.jsx)(a.Fragment,{})}if(H.Dc.isCreditCard(s))switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":return(0,a.jsx)(eM,{invoiceReviewStatus:e.invoiceReviewStatus})}switch(i.cartItemPaymentMethodTypeCombination){case"ALL_CREDIT_CARD_AVAILABLE":case"PARTIALLY_CREDIT_CARD_UNAVAILABLE":default:return(0,a.jsx)(a.Fragment,{});case"ALL_CREDIT_CARD_UNAVAILABLE":return(0,a.jsx)(eM,{invoiceReviewStatus:e.invoiceReviewStatus})}},eM=e=>{let{t}=(0,h.yi)();switch(e.invoiceReviewStatus){case"BEFORE_REVIEW":return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{children:(0,a.jsxs)(T.H,{children:["請求書でのお支払いをご希望の場合は",(0,a.jsx)(ei.N,{href:g.Yy6,variant:"emphasis",children:"請求書支払い申請ページ"}),"から申請してください。",(0,a.jsx)("br",{}),"※請求書を有効化するには所定の審査がございます。"]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("選択可能な支払い方法については下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})]})})]});case"IN_REVIEW":return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("請求書支払いの利用申請の審査中です。数営業日〜10営業日程度(土日祝日を除く)かかります。")}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("選択可能な支払い方法については下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})]})})]});case"NO_REVIEW":case"ACTIVE":case"REJECT_REFINEMENT_NEEDED":case"REJECT_NO_CHANCE":case"REJECT_IDENTITY_VERIFICATION_NEEDED":case"INVALID":return(0,a.jsxs)(U.Fc,{gds:!0,variant:"warning",children:[(0,a.jsx)(w.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsx)("div",{className:"flex flex-col gap-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("選択可能な支払い方法がありません。詳しくは下記ヘルプページをご確認ください。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})})})]})}};var ew=s(15716);let eF=e=>{var t,s;let{t:i}
1=(0,h.yi)(),[r,l]=(0,n.useState)(!1),d=null==(t=e.checkoutData.session.user)?void 0:t.buyer,c=null==(s=e.checkoutData.session.session)?void 0:s.getBuyerCredit,u=(0,o.j)(),m=(e.cartOps.cart.displayCoupons||[]).filter(t=>"NONE"!==e.selectedState.couponMode&&e.selectedState.usingCouponIds.includes(t.id)),p=m.length>0,x=e.cartOps.cart.displayCoupons.length,g=e.cartOps.cart.applicableCouponIds.filter(t=>!e.selectedState.usingCouponIds.includes(t)).length,C=0===x;return d&&c?(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(eI,{buyerId:e.buyerId,buyerCountry:d.country,displayCoupons:e.cartOps.cart.displayCoupons||[],applicableCouponIds:e.cartOps.cart.applicableCouponIds,selectedState:e.selectedState,setSelectedState:e.setSelectedState,selectDisclosure:u,buyer:d,isProcessingCouponApplication:e.isProcessingCouponApplication}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-gds-xl",children:i("クーポン")}),(0,a.jsxs)(S.$,{gds:!0,variant:"outline",onClick:C?void 0:u.onOpen,disabled:C,children:[(0,a.jsx)(M.A,{className:(0,eg.cn)("size-4",C?"opacity-50":"opacity-100")}),i("編集")]})]}),(0,a.jsx)(ef,{diff:e.couponAutoApplicationDiff,displayCoupons:e.cartOps.cart.displayCoupons,cartItems:e.cartOps.cart.cartItemsByBrand}),!p&&(0,a.jsx)("div",{className:(0,eg.cn)("text-gds-m-bold",g>0&&"text-accent-pale-teal"),children:g>0?i("利用可能なクーポンがあります。利用するクーポンを選択してください"):i("現在、利用可能なクーポンはありません")}),p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-gds-m-bold",children:i("{{count}}枚を適用中",{count:m.length})}),(0,a.jsx)("div",{className:"flex flex-col gap-1 text-gds-m",children:(m.length>=3&&!r?m.slice(0,2):m).map(e=>{var t,s,n;return(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(N.HIN,{width1x:24,height1x:24}),(0,a.jsx)("p",{className:"text-gds-m text-gray8",children:"SELLER_FUNDED"===e.buyerCouponType.buyerCouponAccountingMode?i("{{couponPrice}}割引/{{couponName}} ({{brandName}})",{couponPrice:W.w.formatPriceE6(e.couponPriceE6,"JPY"),couponName:e.displayName,brandName:null!=(n=null==(s=e.availableBrands)||null==(t=s[0])?void 0:t.name)?n:""}):i("{{couponPrice}}割引/{{couponName}}",{couponPrice:W.w.formatPriceE6(e.couponPriceE6,"JPY"),couponName:e.displayName})})]},e.id)})}),m.length>=3&&(0,a.jsx)(S.$,{variant:"link",className:"text-accent-pale-teal no-underline",onClick:()=>l(e=>!e),children:r?i("閉じる"):i("他{{count}}枚を表示",{count:m.length-2})})]})]}):(0,a.jsx)(a.Fragment,{})},eV=e=>{let{t}=(0,h.yi)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"text-center text-gds-2xl lg:text-left",children:t("注文内容確認")}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-0 lg:gap-4 pt-6",children:[(0,a.jsx)(ew.m,{buyer:e.checkoutData.session.user.buyer,selectedState:e.selectedState,setSelectedState:e.setSelectedState,onChangeShippingAddressId:e.onChangeShippingAddressId,onUpdateCheckoutData:e.onUpdateCheckoutData}),(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(ek,{buyer:e.checkoutData.session.user.buyer,buyerCredit:e.checkoutData.session.session.getBuyerCredit,checkoutPaymentContext:e.checkoutPaymentContext,selectedState:e.selectedState,setSelectedState:e.setSelectedState,onUpdateCheckoutData:e.onUpdateCheckoutData,cartOps:e.cartOps,onPaymentMethodChangedWithAutoApplication:e.onPaymentMethodChangedWithAutoApplication}),(0,a.jsx)(eF,{...e})]})]})]})};var eU=s(10071),ez=s(22528);let eW=e=>(0,a.jsx)("div",{className:"text-gds-xl",children:W.w.formatPriceE6(e.totalBillingPriceWithTaxE6,e.currency)}),eH=e=>{var t,s,i;let{t:n}=(0,h.yi)(),r=[],l=Date.now();Array.from(e.displayCoupons).filter(t=>"NONE"!==e.selectedState.couponMode&&(e.selectedState.usingCouponIds||[]).includes(t.id)).sort((e,t)=>e.validUntilMs-t.validUntilMs).forEach(t=>{let s=e.displayCoupons.find(e=>e.id===t.id);if(s){let e=W.w.formatDateTimeForCouponEnd(l,s.validUntilMs-1,n),t=r.find(t=>t.endTimeString===e&&t.currency===s.currency);t?t.totalPriceE6+=s.couponPriceE6:r.push({type:(e=>{switch(e){case"UNSPECIFIED":case"PLATFORM":return"goooods";case"SELLER_FUNDED":return"seller"}})(s.buyerCouponType.buyerCouponAccountingMode),endTimeString:e,currency:s.currency,totalPriceE6:s.couponPriceE6})}});let d=r.filter(e=>"goooods"===e.type),c=e.validItemsByBrand.map(e=>{var t,s,a,i,n;return((null==(t=e.priceDetail)?void 0:t.sellerFundedDiscountFromGoodsPriceE6)||0)>0?{currency:(null==(s=e.priceDetail)?void 0:s.currency)||"JPY",totalPriceE6:((null==(a=e.priceDetail)?void 0:a.sellerFundedDiscountFromGoodsPriceE6)||0)+((null==(i=e.priceDetail)?void 0:i.sellerFundedDiscountFromConsumptionTaxE6)||0),brandName:(null==(n=e.brand)?void 0:n.name)||""}:null}).filter(z.TL),o=(0,x.ao)(e.validItemsByBrand),u=(0,eU.Ey)(e.validItemsByBrand.map(e=>e.priceDetail).filter(z.TL).map(e=>({currency:e.currency,salesPriceByTaxMode:e.salesPriceByTaxMode}))),m=null==(s=e.validItemsByBrand[0])||null==(t=s.priceDetail)?void 0:t.buyerCountry,p=(0,K.mc)(e.validItemsByBrand),g=e.validItemsByBrand.filter(e=>e.cartItemCreditCardPaymentAvailability===A.bRc.AVAILABLE),C=(0,x.ao)(g),y=e.validItemsByBrand.filter(e=>e.cartItemCreditCardPaymentAvailability===A.bRc.UNAVAILABLE),I=(0,x.ao)(y);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"pt-6 px-6 pb-4 bg-gray2 rounded-xl",children:[!(0,eE.F)(m)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-0",children:[(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:n("10%対象")}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"text-gds-m-bold",dangerouslySetInnerHTML:{__html:n("{{priceWithTax}}&nbsp;(内消費税{{consumptionTax}})",{priceWithTax:u.normalPriceWithTaxRaw,consumptionTax:u.normalConsumptionTaxRaw})}})]}),(0,a.jsxs)("div",{className:"flex items-center gap-0",children:[(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:n("8%対象")}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"text-gds-m-bold",dangerouslySetInnerHTML:{__html:n("{{priceWithTax}}&nbsp;(内消費税{{consumptionTax}})",{priceWithTax:u.reducedPriceWithTaxRaw,consumptionTax:u.reducedConsumptionTaxRaw})}})]}),(0,a.jsx)(ez.w,{className:"mt-6 bg-gray6"})]}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:(0,eg.cn)("flex items-center gap-0",(0,eE.F)(m)?"pt-0":"pt-6"),children:[(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:n("小計")}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"text-gds-m-bold",children:W.w.formatPriceE6(o.totalSalesPriceWithoutTaxE6,o.currency)})]})}),!(0,eE.F)(m)&&(0,a.jsxs)("div",{className:"flex items-center gap-0 pt-2",children:[(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:n("消費税")}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"text-gds-m-bold",children:W.w.formatPriceE6(o.totalSalesConsumptionTaxE6,o.currency)})]}),(0,a.jsxs)("div",{className:"flex items-start gap-0 pt-2",children:[(0,a.jsx)("div",{className:"text-gds-m text-gray7",children:(0,eE.F)(m)?n("送料"):n("送料(税込)")}),(0,a.jsx)(en.h,{}),Number.isInteger(o.shippingPriceE6)?(0,a.jsx)("div",{className:"text-gds-m-bold",children:W.w.formatPriceE6((null!=(i=o.shippingPriceE6)?i:0)-o.totalDiscountFromShippingPriceWithTax,o.currency)}):(0,a.jsxs)("div",{className:"flex flex-col gap-0",children:[(0,a.jsx)("div",{className:"text-right text-gds-m-bold",children:n("送料別(発送時に確定)")}),e.validItemsByBrand.length>1&&(0,a.jsx)("div",{className:"text-gds-m-bold text-gray7",children:n("送料はブランドごとに計算")})]})]}),c.length>0&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsxs)("div",{className:"p-4 text-gds-m bg-white rounded-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(e_.A,{className:"size-4"}),(0,a.jsx)("div",{className:"text-gds-m",children:n("上記は、以下のクーポンを適用済みの金額です。")})]}),c.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center pt-2",children:[(0,a.jsx)("div",{className:"shrink-0 text-gds-m-bold text-accent-pale-teal",children:n("適用済みクーポン")}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"px-1 overflow-hidden text-ellipsis",children:(0,a.jsx)("div",{className:"flex px-[6px] py-[1px] whitespace-nowrap text-white bg-accent-pale-teal rounded-full",children:(0,a.jsx)(T.H,{values:{brandName:e.brandName},children:(0,a.jsx)("span",{className:"line-clamp-1 text-gds-s",children:"{{brandName}}"})})})}),(0,a.jsxs)("div",{className:"shrink-0 text-gds-m-bold whitespace-nowrap text-accent-pale-teal",children:["-",W.w.formatPriceE6(e.totalPriceE6,e.currency)]})]},t))]})}),(o.totalPromotionEventOrderDiscountForGoods>0||o.totalPerBuyerPromotionProgramOrderDiscountForGoods>0||d.length>0)&&(0,a.jsx)(ez.w,{className:"mt-6 bg-gray6"}),o.totalPromotionEventOrderDiscountForGoods>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsx)("div",{className:"text-gds-m-bold text-accent-pale-teal",children:n("グッズセール割引")}),(0,a.jsx)(en.h,{}),(0,a.jsxs)("div",{className:"text-gds-m-bold text-accent-pale-teal",children:["-",W.w.formatPriceE6(o.totalPromotionEventOrderDiscountForGoods,o.currency)]})]}),o.totalPerBuyerPromotionProgramOrderDiscountForGoods>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsx)("div",{className:"text-gds-m-bold text-accent-pale-teal",children:n("グッズセール割引")}),(0,a.jsx)(en.h,{}),(0,a.jsxs)("div",{className:"text-gds-m-bold text-accent-pale-teal",children:["-",W.w.formatPriceE6(o.totalPerBuyerPromotionProgramOrderDiscountForGoods,o.currency)]})]}),d.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 text-gds-m",children:[(0,a.jsx)("div",{className:"text-gds-m-bold text-accent-pale-teal",children:n("グッズクーポン割引")}),d.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center self-end gap-2",children:[(0,a.jsx)(N.cvg,{label:n("有効期限{{coupon}}まで",{coupon:e.endTimeString}),rawBgColor:"gds.paleteal",contrast:"high"}),(0,a.jsxs)("div",{className:"text-gds-m-bold text-accent-pale-teal",children:["-",W.w.formatPriceE6(e.totalPriceE6,e.currency)]})]},t))]})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsxs)("div",{className:"px-6 py-4 bg-accent-light-khaki rounded-xl",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-0 pt-2",children:[(0,a.jsx)("div",{className:"text-gds-m",children:n("合計")}),(0,a.jsxs)("div",{className:"flex items-end gap-1",children:[(0,a.jsx)(eW,{totalBillingPriceWithTaxE6:o.totalBillingPriceWithTax,currency:o.currency}),(0,eE.F)(m)?(0,a.jsx)("div",{className:"text-gds-m-bold",children:n("+送料+税")}):Number.isInteger(o.shippingPriceE6)?(0,a.jsx)(a.Fragment,{}):(0,a.jsx)("div",{className:"text-gds-m-bold",children:n("+送料(発送時確定分)")})]})]}),p&&"CREDIT_CARD_ON_SHIPMENT"===e.selectedState.paymentMethodType&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"pt-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-4 px-6 bg-white rounded-xl",children:[(0,a.jsxs)("div",{className:"flex flex-row items-end gap-1",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("p",{className:"text-gds-m-bold text-gray6",children:n("クレジットカード一括払い")}),(0,a.jsx)("p",{className:"text-gds-m-bold text-gds-black",children:n("合計(税込)")})]}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"text-gds-xl",children:W.w.formatPriceE6(C.totalBillingPriceWithTax,C.currency)}),Number.isInteger(C.shippingPriceE6)?(0,a.jsx)(a.Fragment,{}):(0,a.jsx)("div",{className:"min-w-[36px] text-gds-m-bold",children:n("+送料")})]}),(0,a.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[(0,a.jsx)(N.cvg,{contrast:"high",label:n("対象ブランド")}),(0,a.jsx)("p",{className:"text-gds-m-bold break-all",children:g.map(e=>{var t;return null==(t=e.brand)?void 0:t.name}).join(n("、 "))})]})]})}),(0,a.jsx)("div",{className:"pt-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-4 px-6 bg-white rounded-xl",children:[(0,a.jsxs)("div",{className:"flex flex-row items-end gap-1",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("p",{className:"text-gds-m-bold text-gray6",children:n("請求書払い")}),(0,a.jsx)("p",{className:"text-gds-m-bold text-gds-black",children:n("合計(税込)")})]}),(0,a.jsx)(en.h,{}),(0,a.jsx)("div",{className:"text-gds-xl",children:W.w.formatPriceE6(I.totalBillingPriceWithTax,I.currency)}),Number.isInteger(I.shippingPriceE6)?(0,a.jsx)(a.Fragment,{}):(0,a.jsx)("div",{className:"min-w-[36px] text-gds-m-bold",children:n("+送料")})]}),(0,a.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[(0,a.jsx)(N.cvg,{contrast:"high",label:n("対象ブランド")}),(0,a.jsx)("p",{className:"text-gds-m-bold break-all",children:y.map(e=>{var t;return null==(t=e.brand)?void 0:t.name}).join(n("、 "))})]})]})})]})]})})]})},eQ=e=>{let{t}=(0,h.yi)();return(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsxs)("div",{className:"static lg:sticky top-0 pt-6 w-full lg:w-[var(--checkout-summary-width)]",style:{"--checkout-summary-width":v.l.nColumnPcWidth(4,4)},children:[e.goooodsCampaignNotice.show&&(0,a.jsx)("div",{className:"flex lg:hidden pb-6",children:(0,a.jsx)(em,{isChecked:e.goooodsCampaignNotice.checked||!1,onChange:e.goooodsCampaignNotice.setChecked})}),(0,a.jsx)("div",{className:"flex lg:hidden items-center justify-center pb-6 w-full",children:(0,a.jsx)(eu,{...e,disabled:e.goooodsCampaignNotice.show&&!e.goooodsCampaignNotice.checked,enableInvitedBuyerOnboarding:e.enableInvitedBuyerOnboarding,cartItemPrices:(0,x.ao)(e.checkoutPaymentContext.checkoutItems),sampleOrdersLast7Days:e.sampleOrdersLast7Days})}),(0,a.jsx)("h1",{className:"text-gds-2xl",children:t("注文概要")}
1),(0,a.jsxs)("div",{className:"pt-6",children:[(0,a.jsx)(eH,{validItemsByBrand:e.checkoutPaymentContext.checkoutItems,displayCoupons:e.displayCoupons,selectedState:e.selectedState}),e.showSampleInformation&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(en.h,{className:"h-6"}),(0,a.jsxs)(U.Fc,{gds:!0,variant:"default",children:[(0,a.jsx)(e_.A,{}),(0,a.jsx)(U.TN,{children:(0,a.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,a.jsxs)("div",{className:"text-gds-m",children:[t("サンプル商品について"),(0,a.jsx)("ul",{className:"list-disc pl-6 text-gds-m",children:(0,a.jsx)("li",{children:t("サンプルの請求は1回までとなります。")})}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsxs)(ei.N,{href:g.Ht8,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("サンプル商品についてもっと詳しく(ヘルプページへ移動)"),(0,a.jsx)(u.A,{className:"size-3"})]})})]})})})]})]}),e.goooodsCampaignNotice.show&&(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(em,{isChecked:e.goooodsCampaignNotice.checked||!1,onChange:e.goooodsCampaignNotice.setChecked})}),(0,a.jsx)("div",{className:"flex items-center justify-center py-6 w-full",children:(0,a.jsx)(eu,{...e,disabled:e.goooodsCampaignNotice.show&&!e.goooodsCampaignNotice.checked,cartItemPrices:(0,x.ao)(e.checkoutPaymentContext.checkoutItems)})})]})]})})},eY=e=>{let{t}=(0,h.yi)(),{notice:s}=e,i=(()=>{switch(null==s?void 0:s.reason){case"paymentMethodChanged":return t("支払い方法を変更しました");case"cartUpdated":return t("カートの内容を更新しました");case void 0:return""}})(),n=(()=>{if(!s)return"";switch(s.reason){case"paymentMethodChanged":return"reselected"===s.outcome?t("支払い方法を変更したため、クーポンを選び直しました。適用中のクーポンをご確認ください"):t("支払い方法を変更したため、クーポンの選択を解除しました。この支払い方法で利用できるクーポンはありません");case"cartUpdated":return"reselected"===s.outcome?t("カートの内容を更新したため、クーポンを選び直しました。適用中のクーポンをご確認ください"):t("カートの内容を更新したため、クーポンの選択を解除しました。この内容で利用できるクーポンはありません")}})();return(0,a.jsx)(N.QJ5,{isOpen:null!==s,onClose:e.onClose,size:"small",title:i,hasCloseButton:!0,footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:e.onClose,children:t("閉じる")}),children:(0,a.jsx)("div",{className:"px-4 py-6 text-gds-m",children:n})})},e$=e=>{let{t}=(0,h.yi)(),[s,i]=(0,n.useState)(!1),r=(0,o.j)();(0,n.useEffect)(()=>{var t,s,a;let i=null==(a=e.checkoutData.session.user)||null==(s=a.buyer)||null==(t=s.buyerSpecialTermAgreementType)?void 0:t.includes("ALCOHOL_TRANSACTION"),n=e.validItemsByBrand.some(e=>{var t;return null==(t=e.skuQuantity)?void 0:t.some(e=>{var t,s,a,i;return(0,y.Vk)(null==(s=e.sku)||null==(t=s.item)?void 0:t.category)||(0,y.Vk)(null==(i=e.sku)||null==(a=i.item)?void 0:a.categorySecondary)})});!i&&n&&r.onOpen()},[]);let l=async()=>{i(!0);let s=I.m.buildForBrowser();"OK"===(await s.addBuyerSpecialTermAgreement({input:{buyerSpecialTermAgreementType:["ALCOHOL_TRANSACTION"]}})).addBuyerSpecialTermAgreement.status?(await e.onUpdateCheckoutData(),i(!1),r.onClose()):j.o.error(t("エラーが発生しました。お手数をおかけしますが、時間をおいてから再度お試しください。"))};return(0,a.jsx)(N.QJ5,{isOpen:r.isOpen,onClose:()=>history.back(),size:"small",title:t("酒類の購入に関する特則の確認"),footerLeftButton:(0,a.jsx)(S.$,{gds:!0,variant:"outline",onClick:()=>history.back(),children:t("戻る")}),footerRightButton:(0,a.jsx)(S.$,{gds:!0,loading:s,onClick:l,children:t("同意してカートを確認")}),closeOnEsc:!1,closeOnOverlayClick:!1,children:(0,a.jsxs)("div",{className:"py-6 px-4",children:[(0,a.jsx)("div",{className:"text-gds-m",children:t("カートにお酒カテゴリの商品が含まれています。")}),(0,a.jsx)("div",{className:"text-gds-m",children:t("お酒の注文には、酒類の購入に関する特則への同意が必要です。")}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsxs)(ei.N,{href:g.QV$,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("酒類の購入に関する特則を確認"),(0,a.jsx)(u.A,{className:"size-4"})]})})]})})},eJ=e=>{let{t}=(0,h.yi)(),s=(0,i.useRouter)(),r=(0,o.j)(),l=e.checkoutPaymentContext.checkoutPaymentMethodMode;return(0,n.useEffect)(()=>{void 0===s.query.checkout_success&&("ALL_CREDIT_CARD_AND_INVOICE"===l||"PARTIALLY_CREDIT_CARD"===l)&&r.onOpen()},[]),(0,a.jsxs)(N.QJ5,{size:"small",title:t("支払い方法についてのご注意"),footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:r.onClose,children:t("閉じる")}),isOpen:r.isOpen,onClose:r.onClose,autoFocus:!1,children:["ALL_CREDIT_CARD_AND_INVOICE"===l&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 py-6 px-4",children:[(0,a.jsx)("p",{className:"text-gds-m",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、支払いはクレジットカード一括払いと請求書払いで行われます。")}
1),!e.checkoutPaymentContext.isExceedingCreditLimitIfInvoiceIsSelected&&(0,a.jsx)("p",{className:"text-gds-m",children:t("支払い方法を請求書払いに変更した場合、まとめてお支払いいただけます。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]}),"PARTIALLY_CREDIT_CARD"===l&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 py-6 px-4",children:[(0,a.jsx)("p",{className:"text-gds-m",children:t("カート内にクレジットカード利用不可のブランドが含まれているため、クレジットカードが利用可能な商品のみご購入いただけます。")}),(0,a.jsxs)(ei.N,{href:g.Pe9,isExternal:!0,variant:"emphasis",className:"inline-flex items-center gap-1",children:[t("ヘルプページを確認"),(0,a.jsx)(u.A,{className:"size-4"})]})]})]})},eq=e=>{var t,s,i,r,l,d,c,u;let{t:g}=(0,h.yi)(),y=I.m.buildForBrowser(),j=C.P.splitValidItems(e.cartOps.cart.cartItemsByBrand),b=(0,m.D)(),[T,R]=(0,n.useState)(e.checkoutData),O=async()=>{var e,t;let s=await y.getCheckoutData();(null==(t=s.session.user)||null==(e=t.buyer)?void 0:e.profile)&&s.session.session&&R({...s,session:{...s.session,user:{...s.session.user,buyer:{...s.session.user.buyer,profile:s.session.user.buyer.profile}},session:s.session.session}})},[k,M]=(0,n.useState)(()=>{var t;return(e=>{let{cart:t,buyer:s,defaultShippingAddressId:a,isCouponAutoApplicationEnabled:i}=e;return{addressId:a||"",...P(s),...i?_(t.couponAutoApplication):(e=>{let t=e.cartItemsByBrand.flatMap(e=>e.autoAppliedBuyerCouponId||[]);return t.length>0?{couponMode:e.displayCoupons.some(e=>t.includes(e.id)&&e.buyerCouponType.buyerCouponAccountingMode===A.MR6.SELLER_FUNDED)?"BRAND_SPECIFIC":"CART_WIDE",usingCouponIds:t}:e.displayCoupons.length>0&&e.applicableCouponIds.length>0?{couponMode:e.displayCoupons.some(e=>e.buyerCouponType.buyerCouponAccountingMode===A.MR6.SELLER_FUNDED)?"BRAND_SPECIFIC":"NONE",usingCouponIds:[]}:{couponMode:"NONE",usingCouponIds:[]}})(t)}})({cart:e.cartOps.cart,buyer:null==(t=e.checkoutData.session.user)?void 0:t.buyer,defaultShippingAddressId:e.defaultShippingAddressId,isCouponAutoApplicationEnabled:e.isCouponAutoApplicationEnabled})}),[w,F]=(0,n.useState)(!1),V=(0,n.useRef)(e.isCouponAutoApplicationEnabled?L(k):null),U=(0,n.useMemo)(()=>e.isCouponAutoApplicationEnabled?((e,t)=>{let s=E(e),a=E(t);return D(s,a)?null:{notApplicableCouponIds:a.filter(e=>!s.includes(e)),brandIdByCouponId:(e=>{var t;return Object.fromEntries((null!=(t=null==e?void 0:e.brandOrderBuyerCouponId)?t:[]).flatMap(e=>{var t;return(null!=(t=e.buyerCouponId)?t:[]).map(t=>[t,e.brandId])}))})(t)}})(e.cartOps.cart.couponAutoApplication,e.cartOps.cart.unconstrainedCouponAutoApplication):null,[e.isCouponAutoApplicationEnabled,e.cartOps.cart.couponAutoApplication,e.cartOps.cart.unconstrainedCouponAutoApplication]),[z,W]=(0,n.useState)(null);(0,n.useEffect)(()=>{let t=L(k);V.current!==t&&(V.current=t,F(!0),e.cartOps.applyCouponIds("NONE"!==k.couponMode?k.usingCouponIds:[]).finally(()=>F(!1)))},[k.couponMode,k.usingCouponIds]);let Q=async(t,s)=>{let a=(e=>"NONE"!==e.couponMode?e.usingCouponIds:[])(k);F(!0);try{let i=await e.cartOps.reapplyCouponsAutomatically(s?{paymentMethodType:s.paymentMethodType}:void 0);if(!i){s&&M(e=>({...e,...s}));return}let n=_(i.couponAutoApplication);V.current=L(n),M(e=>({...e,...s,...n})),D(a,n.usingCouponIds)||W({reason:t,outcome:n.usingCouponIds.length>0?"reselected":"cleared"})}finally{F(!1)}},Y=H.Dc.createCheckoutPaymentContext(k.paymentMethodType,j.validItemsByBrand,e.checkoutData.session.session.getBuyerCredit),$=Y.checkoutItems.some(e=>{var t,s;return((null==(s=e.brand)||null==(t=s.goooodsCampaigns)?void 0:t.length)||0)>0}),[q,G]=(0,n.useState)(void 0),K={show:$,checked:q,setChecked:G},X=(0,o.j)(),Z=t=>async function(){for(var s=arguments.length,a=Array(s),i=0;i<s;i++)a[i]=arguments[i];let n=await t(...a);return e.isCouponAutoApplicationEnabled?await Q("cartUpdated"):k.usingCouponIds.length>0&&(M(e=>({...e,usingCouponIds:[]})),X.onOpen()),n},ee=Z(e.cartOps.updateTo),et=Z(e.cartOps.updateList),es=Y.checkoutItems.flatMap(e=>e.skuQuantity).some(e=>{var t;return(null==e||null==(t=e.sku)?void 0:t.item)&&f.v.isSampleItem(e.sku.item)}),ea=!!(e.inviterSellerId&&!Y.checkoutItems.find(t=>{var s,a;return(null==(a=t.brand)||null==(s=a.seller)?void 0:s.id)!==e.inviterSellerId})),ei=(0,o.j)();return(null==(t=T.session.user)?void 0:t.buyer)?(0,a.jsxs)("div",{className:"flex items-center justify-center w-full",children:[(0,a.jsx)(m.gt,{...b.props}),(0,a.jsx)(e$,{checkoutData:T,onUpdateCheckoutData:O,validItemsByBrand:j.validItemsByBrand}),(0,a.jsx)(eJ,{checkoutPaymentContext:Y}),(0,a.jsx)(eY,{notice:z,onClose:()=>W(null)}),(0,a.jsx)(B,{isOpen:ei.isOpen,onClose:ei.onClose,onOpen:ei.onOpen,buyer:T.session.user.buyer}),(0,a.jsxs)("div",{className:"w-full max-w-[var(--checkout-pc-width)] text-gds-m",style:{"--checkout-pc-width":"".concat(p.ud,"px")},children:[(0,a.jsxs)("div",{className:"hidden lg:flex max-w-[min(100vw,100%)] pb-14",children:[(0,a.jsx)("div",{className:"flex justify-center pt-6",style:{width:v.l.nColumnPcWidth(8)},children:(0,a.jsxs)("div",{style:{width:v.l.nColumnPcWidth(6)},children:[(0,a.jsx)(N.QJ5,{isOpen:X.isOpen,onClose:X.onClose,size:"small",title:g("カートの内容を更新しました"),hasCloseButton:!0,footerRightButton:(0,a.jsx)(S.$,{gds:!0,onClick:X.onClose,children:g("閉じる")}),children:(0,a.jsx)("div",{className:"px-4 py-6 text-gds-m",children:g("カートの内容を更新したためクーポンの選択を解除しました。")})}),(0,a.jsx)(eV,{buyerId:e.buyerId,cartOps:e.cartOps,checkoutPaymentContext:Y,checkoutData:T,onUpdateCheckoutData:O,selectedState:k,setSelectedState:M,onChangeShippingAddressId:t=>{e.cartOps.setShippingAddressId(t)},defaultShippingAddressId:e.defaultShippingAddressId,isProcessingCouponApplication:w,invoiceReviewStatus:(null==(i=e.checkoutData.session.user)||null==(s=i.buyer)?void 0:s.invoiceReviewStatus)||"INVALID",isCouponAutoApplicationEnabled:e.isCouponAutoApplicationEnabled,couponAutoApplicationDiff:U,onPaymentMethodChangedWithAutoApplication:e.isCouponAutoApplicationEnabled?e=>void Q("paymentMethodChanged",e):void 0}),(0,a.jsx)(J,{checkoutPaymentContext:Y,invalidItemsByBrand:j.invalidItemsByBrand,buyerInfo:e.cartOps.cart.buyerInfo,updateList:et,updateTo:ee,dynamicSellerShippingConfigurationDetail:b,selectedState:k}
1),(0,a.jsx)(ep,{updateList:e.cartOps.updateList,invalidItemsByBrand:j.invalidItemsByBrand,buyerInfo:e.cartOps.cart.buyerInfo,dynamicSellerShippingConfigurationDetail:b})]})}),(0,a.jsx)("div",{className:"relative px-6 bg-white lg:rounded-l-5xl after:absolute after:top-0 after:bottom-0 after:left-full after:w-[calc((100vw-var(--checkout-pc-width))/2+24px)] after:bg-white",children:(0,a.jsx)(eQ,{checkoutData:T,credit:(null==(r=e.checkoutData.session.session)?void 0:r.getBuyerCredit)||null,checkoutPaymentContext:Y,invalidItemsByBrand:j.invalidItemsByBrand,selectedState:k,displayCoupons:e.cartOps.cart.displayCoupons||[],goooodsCampaignNotice:K,showSampleInformation:es,enableInvitedBuyerOnboarding:ea,sampleOrdersLast7Days:e.checkoutData.orderSummary.sampleOrdersLast7Days,businessDetailMissingModal:ei})})]}),(0,a.jsxs)("div",{className:"flex lg:hidden flex-col w-full",children:[(0,a.jsx)("div",{className:"px-4 pb-2",children:(0,a.jsx)(eV,{buyerId:e.buyerId,cartOps:e.cartOps,checkoutPaymentContext:Y,checkoutData:T,onUpdateCheckoutData:O,selectedState:k,setSelectedState:M,onChangeShippingAddressId:t=>{e.cartOps.setShippingAddressId(t)},defaultShippingAddressId:e.defaultShippingAddressId,isProcessingCouponApplication:w,invoiceReviewStatus:(null==(d=e.checkoutData.session.user)||null==(l=d.buyer)?void 0:l.invoiceReviewStatus)||"INVALID",isCouponAutoApplicationEnabled:e.isCouponAutoApplicationEnabled,couponAutoApplicationDiff:U,onPaymentMethodChangedWithAutoApplication:e.isCouponAutoApplicationEnabled?e=>void Q("paymentMethodChanged",e):void 0})}),(0,a.jsx)("div",{className:"px-4 bg-white",children:(0,a.jsx)(eQ,{checkoutData:T,credit:(null==(c=e.checkoutData.session.session)?void 0:c.getBuyerCredit)||null,checkoutPaymentContext:Y,invalidItemsByBrand:j.invalidItemsByBrand,selectedState:k,displayCoupons:e.cartOps.cart.displayCoupons||[],goooodsCampaignNotice:K,showSampleInformation:es,enableInvitedBuyerOnboarding:ea,sampleOrdersLast7Days:e.checkoutData.orderSummary.sampleOrdersLast7Days,businessDetailMissingModal:ei})}),(0,a.jsxs)("div",{className:"px-4 bg-gray2",children:[(0,a.jsx)(J,{checkoutPaymentContext:Y,invalidItemsByBrand:j.invalidItemsByBrand,buyerInfo:e.cartOps.cart.buyerInfo,updateList:et,updateTo:ee,dynamicSellerShippingConfigurationDetail:b,selectedState:k}),K.show&&(0,a.jsx)("div",{className:"flex lg:hidden pt-6",children:(0,a.jsx)(em,{isChecked:K.checked||!1,onChange:K.setChecked})}),(0,a.jsx)("div",{className:"flex items-center justify-center py-6 w-full",children:(0,a.jsx)(eu,{checkoutData:T,checkoutPaymentContext:Y,invalidItemsByBrand:j.invalidItemsByBrand,selectedState:k,displayCoupons:e.cartOps.cart.displayCoupons||[],credit:(null==(u=e.checkoutData.session.session)?void 0:u.getBuyerCredit)||null,disabled:K.show&&!K.checked,enableInvitedBuyerOnboarding:ea,cartItemPrices:(0,x.ao)(Y.checkoutItems),sampleOrdersLast7Days:e.checkoutData.orderSummary.sampleOrdersLast7Days,businessDetailMissingModal:ei})}),(0,a.jsx)(ep,{updateList:e.cartOps.updateList,invalidItemsByBrand:j.invalidItemsByBrand,buyerInfo:e.cartOps.cart.buyerInfo,dynamicSellerShippingConfigurationDetail:b})]})]})]})]}):(0,a.jsx)(a.Fragment,{})};var eG=s(29105),eK=s(2659),eX=s(27089),eZ=s(9626),e0=s(61455),e6=s(16050),e1=!0;function e2(e){var t,s,o,u,m,p,x,C,y;let{t:v}=(0,h.yi)(),f=eZ.m.isBuyer(null==(t=e.headerData.session)?void 0:t.user),j=null==(s=e.checkoutData.session.user)?void 0:s.buyer,N=(0,eK.J)(f,e.initialCart,void 0,e.isCouponAutoApplicationEnabled?P(j).paymentMethodType:null!=(y=null==j?void 0:j.paymentMethodType)?y:null,e.isCouponAutoApplicationEnabled?A.j4R.AUTO_APPLY_ALL:A.j4R.DISABLED),b=(0,eX.y)(f),[E,D]=(0,n.useState)([]);return(function(){let{t:e}=(0,h.yi)(),t=(0,i.useRouter)(),{toastError:s,handleCheckoutCartErrorCodes:a}=(0,H.zB)();(0,n.useEffect)(()=>{let{checkout_success:i,errors:n,...r}=t.query;("0"===i||n)&&(a((Array.isArray(n)?n[0]:n||"").split(",").map(e=>e in A.YKd?e:null).filter(z.TL),()=>s(e("クレジットカードの決済に失敗しました。別のクレジットカードをお試しください。"))),t.replace({pathname:t.pathname,query:r},void 0,{shallow:!0}))},[t.query])}(),(0,n.useEffect)(()=>
1{if(!N||N.cart.cartItemsByBrand.length>0)return;let e=I.m.buildForBrowser(),t=e0.n.getRecentViewedProducts();e6.Q.catchPromise(e.getSkus({skuIds:t.map(e=>e.skuId)})).then(e=>{var t;return D((null==(t=e6.Q.getOrNull(e))?void 0:t.skus)||[])})},[null==N?void 0:N.cart.cartItemsByBrand]),(null==(u=e.headerData.session.user)||null==(o=u.buyerId)?void 0:o.exists)&&N)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{title:v("カート")}),(0,a.jsxs)("div",{className:"bg-gray2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center py-6 lg:py-8 w-full",children:(0,a.jsxs)("div",{className:"flex items-end gap-4",children:[(0,a.jsx)(ei.N,{href:g.ipP,variant:"emphasis",children:(0,a.jsx)(r.E_,{width:"160px",height:"40px"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gds-l-bold",children:"Checkout"}),(0,a.jsx)("div",{className:"h-[2px] w-full"})]})]})}),N.cart.cartItemsByBrand.length>0?(0,a.jsx)(eq,{buyerId:e.headerData.session.user.buyerId.v,cartOps:N,checkoutData:e.checkoutData,inviterSellerId:(null==(p=e.headerData.session.user.buyer)||null==(m=p.inviterSeller)?void 0:m.id)||null,defaultShippingAddressId:e.defaultShippingAddressId,invoiceReviewStatus:(null==(C=e.checkoutData.session.user)||null==(x=C.buyer)?void 0:x.invoiceReviewStatus)||"INVALID",isCouponAutoApplicationEnabled:e.isCouponAutoApplicationEnabled}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(H.U6,{hasRecommendItemsLink:!0}),(0,a.jsx)("div",{className:"flex flex-col gap-y-0 lg:gap-y-8 pt-0 pb-0 px-0 lg:pt-8 lg:px-6 w-full bg-white",children:(0,a.jsx)(c.q,{user:e.headerData.session.user,cartOps:N,title:v("最近チェックした商品"),moreBtnLink:null,buyerConsiderationState:b,skuEdges:E.filter(z.TL).map(e=>({node:{sku:e}}))||[],promotionEvent:e.headerData.getActivePromotionEvent.exists?e.headerData.getActivePromotionEvent.promotionEvent:null,contrast:"low",bgColor:"gds.lightkhaki",isLoaded:!0})})]})]}),(0,a.jsx)(l.A,{headerData:e.headerData})]}):(0,a.jsx)(a.Fragment,{})}e2.getLayout=e=>{let t=(0,eG.R)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{suppressHydrationWarning:!0,children:"\n          html {\n            scroll-padding-top: ".concat("sp"===t?g.yIL:g.oib,";\n          }\n          body {\n            margin-top: 0px;\n            letter-spacing: 0;\n          }\n        ")}),e]})}},31851:(e,t,s)=>{"use strict";s.d(t,{b:()=>p,u:()=>x});var a=s(37876),i=s(91644),n=s(22426),r=s(20119),l=s(95539),d=s(6078),c=s(14232),o=s(57234),u=s(74281),m=s(57503);let p=e=>{let{t}=(0,o.yi)(),s=(0,u.yY)();return(0,c.useEffect)(()=>{e.isOpen&&s({modalTrackingType:"OPEN",title:e.title})},[e.isOpen]),(0,a.jsxs)(i.aF,{isOpen:e.isOpen,onClose:e.onClose,size:e.size||"2xl",children:[(0,a.jsx)(n.m,{}),(0,a.jsxs)(r.$,{children:[(0,a.jsx)("div",{className:"border-b border-gray2!",children:(0,a.jsx)("p",{className:"py-4 px-6 text-gds-l-bold",children:e.title})}),(0,a.jsx)(l.s,{}),(0,a.jsx)(d.c,{children:e.children}),(0,a.jsx)("div",{className:"border-t border-gray2!",children:(0,a.jsx)("div",{className:"flex items-center justify-end gap-2 py-4 px-6",children:e.footerDescription?(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 w-full",children:[(0,a.jsx)("div",{className:"pr-4 text-gds-m",children:e.footerDescription}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.$nd,{variety:"primary",isLoading:e.isLoading,onClick:e.approveAction,children:e.approveLabel||t("OK")}),(0,a.jsx)(m.$nd,{variety:"secondary",isLoading:e.isLoading,onClick:e.onClose,children:e.cancelLabel||t("キャンセル")})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.$nd,{variety:"primary",isLoading:e.isLoading,onClick:e.approveAction,isDisabled:e.approveButtonDisabled||e.isLoading,disabled:e.approveButtonDisabled||e.isLoading,children:e.approveLabel||t("OK")}),(0,a.jsx)(m.$nd,{variety:"secondary",isLoading:e.isLoading,onClick:e.onClose,children:e.cancelLabel||t("キャンセル")})]})})})]})]})},x=e=>{let{t}=(0,o.yi)(),s=(0,u.yY)();return(0,c.useEffect)(()=>{e.isOpen&&s({modalTrackingType:"OPEN",title:e.title})},[e.isOpen]),(0,a.jsx)(m.QJ5,{isOpen:e.isOpen,onClose:e.onClose,size:"small",title:e.title,statusText:e.footerDescription,footerLeftButton:(0,a.jsx)(m.$nd,{variety:"secondary",onClick:e.onClose,isLoading:e.isLoading,children:e.cancelLabel||t("キャンセル")}),footerRightButton:(0,a.jsx)(m.$nd,{variety:"primary",onClick:e.approveAction,isLoading:e.isLoading,isDisabled:e.approveButtonDisabled||e.isLoading,disabled:e.approveButtonDisabled||e.isLoading,children:e.approveLabel||t("OK")}),children:(0,a.jsx)("div",{className:"p-4 text-gds-m",children:e.children})})}},94904:(e,t,s)=>{"use strict";s.d(t,{Q:()=>u});var a=s(37876),i=s(58972),n=s(14232),r=s(68764),l=s(95810),d=s(5847),c=s(95353);let o={large:"space-8",medium:"space-4"},u=e=>{let{size:t,choices:s,checkboxProps:u,...m}
1=e,[p,x]=(0,n.useState)(m.defaultValue||null);return(0,n.useEffect)(()=>{e.selected&&x(e.selected)},[e.selected]),(0,a.jsx)(i.$,{value:p||void 0,...m,children:(0,a.jsx)(d.s,{direction:"column",gap:"space-8",w:"100%",children:s.map(s=>(0,a.jsx)(c.z,{alignItems:"center",bg:"gds.white",rounded:"8px",border:"1px solid",borderColor:(null==p?void 0:p.includes(s[0]))?"gds.gray8":"gds.gray3",_hover:{borderColor:"gds.gray6"},children:(0,a.jsx)(r.a,{w:"100%",children:(0,a.jsx)(l.S,{px:"space-16",py:"space-8",w:"100%",value:s[0],checked:null==p?void 0:p.includes(s[0]),...Object.assign({onChange:(t=>async()=>{var s;let a=new Promise(e=>x(s=>{let a=(s||[]).includes(t[0])?[...(s||[]).filter(e=>e!==t[0])]:[...s||[],t[0]];return e(a),a})),i=await a;null==(s=e.onChange)||s.call(e,i)})(s)},"function"==typeof u?u(s[0]):u),children:(0,a.jsx)(r.a,{pl:o[t],w:"100%",children:s[1]})})})},s[0]))})})}}},e=>{e.O(0,[80184,96415,81300,79454,47576,49473,80682,10505,26170,34815,88,67442,9118,23396,45024,90636,46593,38792],()=>e(e.s=7340)),_N_E=e.O()}]);
2//# sourceMappingURL=checkout-e7d36c9ca34d3c8e.js.map

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.