1import{_ as C,E as N,r as d,H as g,G as P,c as w,y as A,b as u,d as p,g as B,A as D,e as t,t as a,i as S,v as V,l as f,f as z,B as E,F,as as Q}from"./main-fb4490b3.js";const W={name:"CheckoutWidgetNote",props:["order"],setup(s){var b;const o=N(),l=d((b=s.order)==null?void 0:b.note),e=d(!1),{success:h,error:_}=g("toast"),{t:c}=P(),r=d(!1),n=d({}),y=w(()=>i=>A(i).value);return{note:l,setNoteAction:async()=>{var i,k,v,x;if(!e.value){e.value=!0;try{await Q(s.order.code,{note:l.value}),o.refetchQueries(["order"]),h(c("checkout.noteSaveSuccess")),r.value=!1}catch(m){(k=(i=m.response)==null?void 0:i.data)!=null&&k.errors?n.value=(x=(v=m.response)==null?void 0:v.data)==null?void 0:x.errors:_(m.message)}e.value=!1}},submitting:e,component:y,notePopup:r,errors:n}}},j={class:"flex flex-col"},q={class:"flex items-center p-5 pb-0"},G={class:"font-semibold text-primary"},H=t("i",{class:"fa fa-times"},null,-1),I=[H],K={class:"flex flex-col space-y-3 p-5"},M=["placeholder"],T={key:0,class:"label py-0"},U={class:"label-text-alt text-sm text-red-500"},J={class:"CheckoutNote card mt-4"},L={class:"flex items-center"},O={class:"CheckoutNote-title font-bold text-sm uppercase"},R=t("i",{class:"fa fa-pen text-lg"},null,-1),X=[R],Y={class:"flex flex-col mt-2"},Z={class:"CheckoutNote-desc text-sm"},$={key:0,class:"CheckoutNote-note text-sm mt-2"};function ee(s,o,l,e,h,_){var c;return u(),p(F,null,[e.notePopup?(u(),B(E(e.component("Popup")),{key:0,onClose:o[4]||(o[4]=()=>e.notePopup=!1)},{default:D(()=>{var r;return[t("div",j,[t("div",q,[t("h3",G,a(s.$t("checkout.note")),1),t("span",{class:"btn btn-circle btn-ghost btn-sm ml-auto",onClick:o[0]||(o[0]=()=>e.notePopup=!1)},I)]),t("div",K,[S(t("textarea",{type:"text",placeholder:s.$t("checkout.note"),class:"textarea textarea-bordered min-h-[150px] flex-1 min-w-0",onKeydown:o[1]||(o[1]=n=>delete e.errors.note),"onUpdate:modelValue":o[2]||(o[2]=n=>e.note=n)},null,40,M),[[V,e.note]]),e.errors.note?(u(),p("label",T,[t("span",U,a(((r=e.errors.note[0])!=null?r:"").replace("note",s.$t("checkout.note"))),1)])):f("",!0),t("button",{onClick:o[3]||(o[3]=(...n)=>e.setNoteAction&&e.setNoteAction(...n)),class:z([{"opacity-40 pointer-events-none":e.submitting},"btn btn-primary capitalize"])},[t("span",null,a(s.$t("checkout.noteSave")),1)],2)])])]}),_:1},32)):f("",!0),t("div",J,[t("div",L,[t("span",O,a(s.$t("checkout.note")),1),t("button",{class:"btn btn-circle btn-ghost btn-sm text-orange-600 ml-auto",onClick:o[5]||(o[5]=()=>e.notePopup=!0)},X)]),t("div",Y,[t("p",Z,a(s.$t("checkout.noteDesc")),1),l.order.note?(u(),p("p",$,a((c=l.order.note)!=null?c:""),1)):f("",!0)])])],64)}var se=C(W,[["render",ee]]);export{se 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.