1import{_ as G}from"./3euPCkyG.js";import{d as z,j as A,ae as P,o as i,c,b as r,e as D,A as R,f as t,t as B,m as L,z as N,p as E,k as F,a9 as O,q as b,D as k,x as W,l as I,F as H,r as J,an as K,M as Q}from"./PLMnJyLB.js";const Z={class:"date-picker"},ee={class:"date-picker__button--icon"},te={class:"date-picker__button--text"},ne={class:"grey-text"},se={class:"light-grey-text small-text"},oe=z({__name:"DatePicker",props:{chosenDate:{type:[Object,Boolean],default:!1},deliveryDays:{type:[Array,Boolean],default:!1},disabled:{type:Boolean,default:!1},width:{default:"70%"}},emits:["returnDate"],setup(n,{emit:d}){const m=n,x=d,e=b(!1),f=b(null),v=b({position:"fixed",opacity:"0",pointerEvents:"none",zIndex:"10000"}),g=k(()=>{if(!m.chosenDate||typeof m.chosenDate!="object")return"Select date";const u=m.chosenDate;return u.full?String(u.full):"Select date"});function s(){if(!f.value)return;const u=f.value.getBoundingClientRect();v.value={position:"fixed",top:`${u.bottom+4}px`,left:`${u.left}px`,zIndex:"10000",opacity:"1",pointerEvents:"auto",transition:"opacity 0.15s ease"}}function p(){e.value=!e.value,e.value&&W(()=>s())}function _(u){x("returnDate",u),e.value=!1}return A(()=>{window.addEventListener("scroll",s,!0),window.addEventListener("resize",s)}),P(()=>{window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}),(u,y)=>{const S=I("fa"),T=G;return i(),c("div",Z,[r("div",{ref_key:"buttonRef",ref:f,class:L(["date-picker__button",[t(e)&&"selected",!n.chosenDate&&"error",n.disabled&&"disabled"]]),onClick:y[0]||(y[0]=w=>!n.disabled&&p())},[r("div",ee,[D(S,{icon:["fal","calendar-days"],class:"pink-text icon"})]),r("div",te,[r("p",ne,[y[2]||(y[2]=R(" Date ",-1)),D(S,{icon:["fal",t(e)?"chevron-up":"chevron-down"],class:"small-icon"},null,8,["icon"])]),r("p",se,B(t(g)),1)])],2),(i(),N(O,{to:"body"},[t(e)?(i(),c("div",{key:0,class:"date-picker__overlay",onClick:y[1]||(y[1]=w=>e.value=!1)})):E("",!0),t(e)?(i(),c("div",{key:1,class:"date-picker__calendar",style:F(t(v))},[D(T,{class:"date-picker__calendar--component","chosen-date":n.chosenDate,"delivery-days":n.deliveryDays,onReturnDate:_},null,8,["chosen-date","delivery-days"])],4)):E("",!0)]))])}}}),ke=Object.assign(oe,{__name:"DatePicker"}),ae={class:"time-picker"},ie={class:"time-picker__button--icon"},le={class:"time-picker__button--text"},ce={class:"grey-text"},re={key:0,class:"light-grey-text small-text"},de={key:1,class:"light-grey-text small-text"},ue={class:"time-picker__slots--times"},me=["onClick"],fe={key:1,class:"light-grey-text",style:{"text-align":"center",margin:"1rem 0"}},pe=z({__name:"TimePicker",props:{cart:{type:[Object,Boolean],default:!1},disabled:{type:Boolean,default:!1}},emits:["returnTime"],setup(n,{emit:d}){const m=n,x=d,e=b(!1),f=b(!1),v=b(null),g=b({}),s=k(()=>m.cart&&typeof m.cart=="object"?m.cart:null),p=k(()=>s.value?.date&&typeof s.value.date=="object"?s.value.date:null),_=k(()=>!!p.value?.full),u=k(()=>p.value?.selectedWindow||s.value?.selectedWindow),y=k(()=>S.value),S=k(()=>{const a=p.value?.selectedWindow||s.value?.selectedWindow;if(!a)return null;const o=String(a),[$,l]=o.split(":").map(Number),h=$*60+(l||0)-30;if(h<0)return o;const C=String(Math.floor(h/60)).padStart(2,"0"),M=String(h%60).padStart(2,"0");return`${C}:${M} - ${o}`}),T=k(()=>{const a=p.value?.deliveryWindows;return!a||a.length===0?[]:a.map(o=>{const[$,l]=o.name.split(":").map(Number),h=$*60+(l||0),C=h+30,M=String(Math.floor(h/60)).padStart(2,"0"),q=String(h%60).padStart(2,"0"),X=String(Math.floor(C/60)).padStart(2,"0"),Y=String(C%60).padStart(2,"0");return`${M}:${q} - ${X}:${Y}`})});function w(){if(!v.value)return;const a=v.value.getBoundingClientRect();g.value={position:"fixed",top:`${a.bottom+4}px`,left:`${a.left}px`,zIndex:"10000"}}function U(){_.value&&(e.value=!e.value,e.value&&W(()=>w()))}function V(a){f.value=a;const o=a.slice(8);e.value=!1,x("returnTime",o)}return A(()=>{window.addEventListener("scroll",w,!0),window.addEventListener("resize",w)}),P(()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}),(a,o)=>{const $=I("fa");return i(),c("div",ae,[r("div",{ref_key:"buttonRef",ref:v,class:L(["time-picker__button",[t(e)&&"selected",!t
1(u)&&"error",n.disabled&&"disabled"]]),onClick:o[0]||(o[0]=l=>!n.disabled&&U())},[r("div",ie,[D($,{icon:["fal","clock"],class:"pink-text icon"})]),r("div",le,[r("p",ce,[o[2]||(o[2]=R(" Time ",-1)),D($,{icon:["fal",t(e)?"chevron-up":"chevron-down"],class:"small-icon"},null,8,["icon"])]),t(S)?(i(),c("p",re,B(t(S)),1)):(i(),c("p",de,B(t(_)?"Select a time":"Choose a date first"),1))])],2),(i(),N(O,{to:"body"},[t(e)?(i(),c("div",{key:0,class:"time-picker__overlay",onClick:o[1]||(o[1]=l=>e.value=!1)})):E("",!0),t(e)?(i(),c("div",{key:1,class:"time-picker__slots",style:F(t(g))},[r("div",ue,[t(T).length?(i(!0),c(H,{key:0},J(t(T),l=>(i(),c("div",{key:l,class:L(["slots",{"selected-time":t(y)===l||t(f)===l}]),onClick:h=>V(l)},[r("p",null,B(l),1)],10,me))),128)):(i(),c("p",fe," No time slots available "))])],4)):E("",!0)]))])}}}),be=Object.assign(pe,{__name:"TimePicker"}),ve=12,_e=1500;function ge(){const{authFetch:n}=K(),d=b(0);async function m(e){const f=++d.value,v=e.maxAttempts??ve,g=e.delayMs??_e;for(let s=0;s<v;s++){if(f!==d.value)return"cancelled";let p;try{p=await n(`/api/customers/orders/payments/active-ledger/${e.orderId}/refund`)}catch{await j(g);continue}if(f!==d.value)return"cancelled";const _=p.batch;if(!_)return"success";if(_.any_failed)return"failed";if(_.all_confirmed)return"success";await j(g)}return"timeout"}function x(){d.value++}return Q(()=>{x()}),{pollRefundBatchConfirmation:m,cancelRefundBatchPolling:x}}function j(n){return new Promise(d=>setTimeout(d,n))}export{ke as _,be as a,ge as u}; 2//# sourceMappingURL=b4TSc3rd.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.