import{p as v,J as y,c as l,a as g,g as m,e as b,w as _,b as t,t as e,o as i,i as f,F as x,d as r,O as $,j as p,s as k}from"./app-CYVHboi-.js";import{_ as w}from"./Loading-C17YK6G3.js";import{_ as R,a as N,b as V}from"./TemplateTwo-D1yIj8Ou.js";import{_ as B}from"./TemplateOne-CqNNof5p.js";import"./browser-BwNzv7vE.js";import"./Modal-oUJ1UwGv.js";import"./Attachments-CeMFdFu2.js";import"./DialogModal-BGpz32gV.js";import"./SecondaryButton-CHQvCfls.js";import"./DangerButton-dMO1Xwz1.js";import"./ViewCustomFields-CiekLLjv.js";const C={key:0,class:"relative h-64"},D={class:"flex gap-1 text-sm"},j={class:"truncate hover:text-clip print:block print:text-clip",dir:"rtl"},O={class:"mx-4 mb-4 rounded-md border border-gray-200 bg-gray-50 px-5 py-4 dark:border-gray-700 dark:bg-gray-950"},T={class:"text-sm font-bold"},A={class:"text-lg font-semibold"},F={key:0,class:"text-lg font-semibold"},M={class:"flex gap-1 text-lg"},S={class:"mt-1"},E={class:"font-bold"},J={class:"mt-1"},P={class:"font-bold"},Q={class:"mt-1"},q={class:"font-bold"},z={key:2,class:"flex min-h-64 items-center justify-center p-6 text-lg font-thin"},se={__name:"QuickView",props:["current","custom_fields","editRow","xfetch"],setup(d){const u=k(),c=d,n=p(!0),o=p(null),h={One:B,Two:V,Three:N,Minimal:R};return v(async()=>{c.xfetch?(o.value=c.current,n.value=!1):await y.get(route("deliveries.show",{delivery:c.current.id,json:!0})).then(s=>{o.value=s.data,n.value=!1}).catch(()=>n.value=!1)}),(s,G)=>n.value?(i(),l("div",C,[g(m(w))])):o.value?(i(),b($(h[m(u).props.settings?.sale_template||"One"]),{key:1,type:"delivery",xfetch:d.xfetch,record:o.value,editRow:d.editRow,custom_fields:d.custom_fields},{"header-extra":_(()=>[t("div",D,[r(e(s.$t("Sale Reference"))+": ",1),t("p",j,e(o.value.sale?.reference),1)])]),amount:_(({record:a})=>[t("div",O,[t("div",T,e(s.$t("Address"))+":",1),t("div",A,e(a.address?.company||a.address?.name),1),a.address?.company?(i(),l("div",F,e(s.$t("Attn"))+": "+e(a.address?.name),1)):f("",!0),t("div",M,[t("span",null,e(s.$address(a.address)),1)]),a.delivered_at?(i(),l(x,{key:1},[t("div",S,[r(e(s.$t("Delivered at"))+": ",1),t("span",E,e(s.$datetime(a.delivered_at)),1)]),t("div",J,[r(e(s.$t("Delivered by"))+": ",1),t("span",P,e(a.delivered_by||""),1)]),t("div",Q,[r(e(s.$t("Received by"))+": ",1),t("span",q,e(a.received_by||""),1)])],64)):f("",!0)])]),_:1},8,["xfetch","record","editRow","custom_fields"])):(i(),l("div",z,e(s.$t("No data found, the record might not belong to the selected store.")),1))}};export{se as default};
