1import{i as f}from"./DjVyTbxw.js";import{c as p,a as g}from"./D40aLWsd.js";import{r as A}from"./DkPRblCs.js";import{a as D,e as S,c as w,b as y}from"./CtXWAF1x.js";import{h}from"./BpTJceez.js";import{b as l,n as c,g as C,h as b,j as O,k as E,d as _,m as I,o as x,f as z,i as M}from"./Il4zDAxP.js";async function W({requireAddress:e=!1}={}){if(typeof localStorage>"u")return!0;const t=l();if(await t.syncStoreFromLocalStorage(),t.getCartProductsQuantity===0&&t.getOfferProductsQuantity===0&&await t.loadCart(),t.getCartProductsQuantity===0&&t.getOfferProductsQuantity===0)return await c("/warenkorb",{replace:!0}),!1;const r=C().currentRoute.value?.path??"",s=["/checkout/konto","/checkout/anschrift"].some(a=>r.startsWith(a));return p()&&!g({decisionPending:s})?(await c("/warenkorb",{replace:!0}),!1):e&&!Q(t)?(await c("/checkout/anschrift",{replace:!0}),!1):!0}function Q(e){const t=e.getBillingAddress;if(!t?.country?.id||!t?.zip)return!1;if(!e.getHasDeliveryAddress)return!0;const r=e.getDeliveryAddress;return!!r?.country?.id&&!!r?.zip}async function R(){if(typeof localStorage>"u")return!1;const e=l();if(await e.syncStoreFromLocalStorage(),e.getCartProductsQuantity===0&&e.getOfferProductsQuantity===0||p()&&!g()||(b()||O()||E())&&e.getTotalPrice>2e5)return!1;const t=e.getBillingAddress;if(!t||!t.firstName||!t.lastName||!t.street||!t.zip||!t.city||!h(t.phone)||f({street:t.street,zip:t.zip,city:t.city,countryIso:t.country?.iso})||_().isAuthenticated?.value&&!e.getBillingAddressId&&!t.id)return!1;const r=e.getDeliveryAddress,s=e.getHasDeliveryAddress;if(s&&(!r||!r.firstName||!r.lastName||!r.street||!r.zip||!r.city||!h(r.phone))||s&&f({street:r.street,zip:r.zip,city:r.city,countryIso:r.country?.iso}))return!1;const a=e.getDeliveryProvider;if(!a&&!e.isDigitalOnlyCart)return!1;const m=e.getPickupLocation;if(a?.mapSelect&&!m)return!1;const v=e.getEmail,P=I().getUserId;if(!v&&!P)return!1;const k=e.getIdentcheck;if(a?.key&&a.key!=="dhl"&&k&&e.clearIdentcheck(),a?.key==="dhl"&&e.getCartProductsTotalPrice>=2e3&&!(A(S(e),D(e))?!!w(e):!!(y(e.getIdentcheck)||y(x()?.value?.data?.birthday))))return!1;const u=e.getPostnummer;if(a?.key&&a.key!=="dhl-packstation"&&u&&e.clearPostnummer(),a?.key==="dhl-packstation"&&!u)return!1;const n=e.getOffer;if(n&&(!n.valid_until||new Date(n.valid_until)<new Date)||n&&n.preview)return!1;const{virtualShippingMethods:i}=await z({total:e.getCartProductsTotalPrice,productQuantities:e.getCartProductsQuantities,billingAddress:t,hasDeliveryAddress:s,deliveryAddress:r});e.$state.availableShippingMethods=i;const o=i.find(d=>d.id===a?.id);return!a&&e.isDigitalOnlyCart?(i.length===1&&(e.setDeliveryProvider({id:i[0].id,key:i[0].slug,name:i[0].name,price:0,mapSelect:!1,cashOnDeliveryAvailable:!1,allowVoucher:i[0].allow_voucher??!0}),e.setTemporaryDeliveryCosts(0)),!0):o?(e.setDeliveryProvider({...a,price:o.price}),e.setTemporaryDeliveryCosts(null),M()&&(e.setExchangeFees(o?.exchange_fee),e.setExchangeRate(o?.exchange_rate),e.setCustomsDuty(o?.customs_duty)),!0):!1}const B=["wire","ups-nachnahme","dhl-nachnahme","paypal","paypal_paylater"];async function K(){if(typeof localStorage>"u")return!1;const e=l();await e.syncStoreFromLocalStorage();const t=e.getPaymentProvider;return B.includes(t)?await R():!1}export{B as E,K as a,R as e,Q as h,W as v};
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.