import{p,J as f,c as i,a as _,g as n,e as v,w,o as l,b as t,t as d,i as y,O as x,j as u,s as g}from"./app-CYVHboi-.js";import{_ as k}from"./Loading-C17YK6G3.js";import{_ as b,a as $,b as B}from"./TemplateTwo-D1yIj8Ou.js";import{_ as C}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 M={key:0,class:"relative h-64"},N={key:0,class:"col-span-full -mb-3 px-6 pt-6"},R=["href"],V={class:"flex"},j={class:"ms-3"},z={class:"text-sm font-medium text-yellow-800 dark:text-yellow-200"},O={key:2,class:"flex min-h-64 items-center justify-center p-6 text-lg font-thin"},S={__name:"QuickView",props:["current","custom_fields","editRow","xfetch","force"],setup(r){const h=g(),o=r,a=u(!0),e=u(null),m={One:C,Two:B,Three:$,Minimal:b};return p(async()=>{o.xfetch?(e.value=o.current,a.value=!1):await f.get(o.force?route("purchases.report.show",{id:o.current.id}):route("purchases.show",{purchase:o.current.id,json:!0})).then(s=>{e.value=s.data,a.value=!1}).catch(()=>a.value=!1)}),(s,c)=>a.value?(l(),i("div",M,[_(n(k))])):e.value?(l(),v(x(m[n(h).props.settings?.sale_template||"One"]),{key:1,type:"purchase",xfetch:r.xfetch,record:e.value,editRow:r.editRow,custom_fields:r.custom_fields,qrUrl:s.route("purchase.url",{id:e.value.id,hash:e.value.hash||"hash"})},{alerts:w(()=>[e.value.return_orders_count>0?(l(),i("div",N,[t("a",{href:s.route("return_orders.index",{purchase_id:e.value.id}),class:"block rounded-md border border-yellow-700 bg-yellow-50 px-4 py-2.5 dark:bg-yellow-800 print:border print:border-yellow-700"},[t("div",V,[c[0]||(c[0]=t("div",{class:"shrink-0"},[t("svg",{class:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})])],-1)),t("div",j,[t("h3",z,d(s.$t("This purchase has attached to return orders.")),1)])])],8,R)])):y("",!0)]),_:1},8,["xfetch","record","editRow","custom_fields","qrUrl"])):(l(),i("div",O,d(s.$t("No data found, the record might not belong to the selected store.")),1))}};export{S as default};
