import{C as N,ac as P,aI as A,V as E,T as v,q as n,N as o,K as F,E as L,O as _,Q as i,S as q,R as z,u as l}from"./vendor-BGtMsOoo.js";import{O as H,ae as K,i as Q}from"./index-CRze-aDK.js";import{u as j}from"./order-summary.vue_vue_type_style_index_0_scoped_471240a6_lang-DB8A0s2y.js";import"./address-type.enum-CGCAFS3X.js";import"./useUserCheckoutDefaults-BlmbrerI.js";import"./useOrganizationAddresses-DFhlvSxC.js";import"./payment-policies.vue_vue_type_style_index_0_lang-BQUPSUyI.js";import"./add-or-update-address-modal.vue_vue_type_script_setup_true_lang-EfEQeCT4.js";import"./address-form.vue_vue_type_script_setup_true_lang-OQrHDDSp.js";const te=N({__name:"index",setup(G){const x=P(),u=A(),{t}=E(),{themeContext:b}=H(),{loading:C,changing:f,allItemsAreDigital:p,forceFetch:k}=K(),{loading:y,changing:w,placedOrder:a,allOrderItemsAreDigital:V,canPayNow:S,initialize:I}=j(),d=v(()=>C.value||y.value),O=v(()=>f.value||w.value),c=n(()=>{var r,s;const e=[];return a.value?e.push({icon:"arrow-left-bold",route:{name:"OrderDetails",params:{orderId:a.value.id},replace:!0},text:t("common.buttons.back_to_order_details")}):e.push({icon:"arrow-left-bold",route:{name:"Cart",replace:!0},text:t("common.buttons.back_to_cart")}),(s=(r=b.value)==null?void 0:r.settings)!=null&&s.checkout_multistep_enabled&&e.push({id:"Shipping",route:{name:"Shipping",replace:!0},text:t("pages.checkout.steps.shipping"),disabled:!!a.value,hidden:V.value??p.value},{id:"Billing",route:{name:"Billing",replace:!0},text:t("pages.checkout.steps.billing"),disabled:!!a.value},{id:"Review",text:t("pages.checkout.steps.review"),disabled:!!a.value}),e.push({id:"CheckoutPayment",text:t("pages.checkout.steps.payment"),hidden:!S.value},{id:"CheckoutPaymentResult",text:t("pages.checkout.steps.completed")}),e}),m=n(()=>u.name),g=n(()=>c.value.findIndex(e=>e.id===m.value)),h=n(()=>{var e;return(e=c.value[g.value])==null?void 0:e.text});return Q({title:n(()=>[t("pages.checkout.meta.title"),h.value])}),(async()=>(await k(),u.name==="Checkout"&&(await I(),await x.push({name:p.value?"Billing":"Shipping",replace:!0}))))(),(e,r)=>{const s=o("VcTypography"),T=o("VcSteps"),B=o("VcLoaderOverlay"),R=o("router-view"),D=o("VcContainer");return L(),F(D,null,{default:_(()=>[i(s,{tag:"h1",class:"mb-5 print:mb-0"},{default:_(()=>[q(z(h.value),1)]),_:1}),i(T,{steps:c.value,"current-step-index":g.value,"start-step-index":0,disabled:l(d)||l(O),class:"mb-5"},null,8,["steps","current-step-index","disabled"]),i(B,{visible:l(d)||!m.value,"fixed-spinner":""},null,8,["visible"]),i(R)]),_:1})}}});export{te as default};
//# sourceMappingURL=index-DpUZaiH5.js.map
