1import{j as e,K as T,r as g}from"./@react-core-DAiQxeIm.js";import{M as E}from"./MainLayout-BG0Ff-G8.js";import{M as I}from"./MetaHeader-Dyrie7Xm.js";import{I as A,A as y,s as B}from"./WrapperLayout-DW7P2zvO.js";import{P as C,B as M}from"./useModal-DijYsnd1.js";import{x as R,l as k,c as $}from"./app-Cyh6yV_e.js";import{s as H}from"./fetch-DIMp6ACm.js";import"./renderComponents-PVdm_eq0.js";import"./MetricsEvents-ePHyF7G_.js";import"./useThemeVisuals-B1RdzApi.js";import"./useIsOnlineLightingShop-CZ-toRlz.js";import"./FormatPrice-DHQ3sYHY.js";const F=({data:s})=>e.jsx("ul",{children:s==null?void 0:s.map(c=>e.jsxs("li",{className:"flex gap-2 text-sm p-3 border-b border-colorBorder last:border-0",children:[e.jsx("img",{src:c==null?void 0:c.image,alt:c==null?void 0:c.name,className:"w-10 h-10"}),e.jsxs("div",{children:[e.jsx("p",{children:c.name}),e.jsx("p",{className:"text-gray-400",children:c.variantName})]})]},`products reduced ${c==null?void 0:c.name}`))}),N=({title:s,description:c,classContainer:l=""})=>e.jsxs("div",{className:`text-center text-sm ${l}`,children:[e.jsx("span",{className:"rounded-full p-2 bg-yellow-efl-200 inline-flex items-center justify-center mb-5",children:e.jsx(A,{name:"information-circle",classIcon:"text-yellow-efl-500"})}),e.jsx("p",{className:"text-lg sm:text-xl font-medium mb-3",children:s}),c]}),L="/ajax/partialShipment/confirm",O=({data:s,actionFetch:c})=>{var d,x,p,u,j,v,w;const{t:l,configuration:r}=T().props,[o,n]=g.useState({message:"",state:!1}),m=g.useRef(),b=R("token"),t=l==null?void 0:l.partial_shipment_selection,_=(p=(x=(d=t==null?void 0:t.info)==null?void 0:d.allowed)==null?void 0:x.subtitle_2)==null?void 0:p.replace("{date}",s==null?void 0:s.available_token_date).replace("{hour}",s==null?void 0:s.available_token_hours),a=f=>{n({state:!0,message:f}),setTimeout(()=>{n({state:!1,message:f})},4e3)},h=()=>{const f={shop_code:r==null?void 0:r.shopCode,token:b};n({...o,state:!1}),k(m.current,!0),H(L,f).then(i=>{var P,S;(P=i==null?void 0:i.data)!=null&&P.error?a((S=i==null?void 0:i.data)==null?void 0:S.error):c(i==null?void 0:i.status)}).catch(i=>{$(i,{tags:{component:"partial_shipment"}}),a(i)}).finally(()=>{k(m.current,!1),B()})};return e.jsxs(e.Fragment,{children:[e.jsx(N,{title:(j=(u=t==null?void 0:t.info)==null?void 0:u.allowed)==null?void 0:j.title,description:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:(w=(v=t==null?void 0:t.info)==null?void 0:v.allowed)==null?void 0:w.subtitle_1}),e.jsx("p",{children:_})]}),classContainer:"mb-8"}),e.jsxs("div",{className:"max-w-[520px] mx-auto",children:[e.jsxs("div",{className:"mb-10",children:[e.jsx(y,{type:"success",classAlert:"mb-3 justify-center",showIcon:!1,children:e.jsxs("p",{className:"text-center",children:[e.jsxs("span",{className:"font-medium",children:[t==null?void 0:t.estimated_delivery,":"]})," ",t==null?void 0:t.immediate_shipping]})}),e.jsx("div",{children:e.jsx(F,{data:s==null?void 0:s.products_in_stock})})]}),e.jsxs("div",{className:"mb-10 sm:mb-14",children:[e.jsx(y,{type:"warning",classAlert:"mb-3 justify-center",showIcon:!1,children:e.jsxs("p",{className:"text-center",children:[e.jsxs("span",{className:"font-medium",children:[t==null?void 0:t.estimated_delivery,":"]})," ",s==null?void 0:s.partial_date]})}),e.jsx("div",{children:e.jsx(F,{data:s==null?void 0:s.products_out_stock})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(C,{position:"top-left",isOpen:o==null?void 0:o.state,classPopUp:"!p-0 border-none",children:e.jsx(y,{type:"error",children:o==null?void 0:o.message})}),e.jsx(M,{typeStyles:"filled",size:"M",classButton:"mx-auto",action:h,reference:m,children:t==null?void 0:t.button_confirm})]})]})]})};function Z(){var a,h,d,x,p,u;const{metas:s,t:c,partialShipment:l}=T().props,r=(a=c==null?void 0:c.partial_shipment_selection)==null?void 0:a.info,[o,n]=g.useState(l==null?void 0:l.status),m=j=>{n(j)},b=(h=r==null?void 0:r.expired)==null?void 0:h.subtitle.replace("{hour}",l==null?void 0:l.available_token_hours),_={allowed:e.jsx(O,{data:l,actionFetch:m}),used:e.jsx(N,{title:(d=r==null?void 0:r.used)==null?void 0:d.title,de
1scription:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:(x=r==null?void 0:r.used)==null?void 0:x.subtitle_1}),e.jsxs("p",{children:[(p=r==null?void 0:r.used)==null?void 0:p.subtitle_2," ",e.jsx("a",{href:`tel:${l==null?void 0:l.phone_b2b}`,className:"text-colorPrimary",children:l==null?void 0:l.phone_b2b})]})]})}),expired:e.jsx(N,{title:(u=r==null?void 0:r.expired)==null?void 0:u.title,description:e.jsx("p",{className:"text-sm",children:b})})}[o];return e.jsx(e.Fragment,{children:e.jsxs(E,{children:[e.jsx(I,{metas:s}),e.jsx("div",{className:"bg-gray-efl-50 py-6 sm:py-10",children:e.jsx("section",{className:"l-wrap-small bg-white p-6 sm:p-10 rounded-xl",children:_})})]})})}export{Z as default};
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.