import{$ as e,C as t,G as n,S as r,Wt as i,_ as a,dt as o,g as s,h as c,v as l,vt as u,y as d,z as f}from"./vue.runtime.esm-bundler-DAWRyTnP.js";import{t as p}from"./http-BrugN6o-.js";import{a as m,i as h}from"./vue-router-Bna4o8ws.js";var g={class:`bg-white shadow overflow-hidden rounded-lg mt-6`},_={class:`px-4 py-5 sm:px-6`},v={class:`text-lg leading-6 font-medium text-gray-900`},y={key:0,class:`border-t border-gray-200 px-4 py-5 sm:p-0`},b={class:`sm:divide-y sm:divide-gray-200`},x={class:`py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`},S={class:`text-sm font-medium text-gray-500`},C={class:`mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2`},w={class:`py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`},T={class:`text-sm font-medium text-gray-500`},E={class:`mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2`},D={class:`py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`},O={class:`text-sm font-medium text-gray-500 capitalize`},k={class:`mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2`},A={class:`py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`},j={class:`text-sm font-medium text-gray-500`},M={class:`mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2`},N={key:0,class:`py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`},P={class:`text-sm font-medium text-gray-500`},F={class:`mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2`},I=[`innerHTML`],L={key:1,class:`w-full flex items-center justify-center p-5`},R={__name:`InvoiceInformationCard`,props:{invoice:{type:[Object,null],required:!0}},setup(r){return(a,o)=>{let c=n(`BaseInvoiceStatusLabel`),u=n(`BaseInvoiceStatusBadge`),p=n(`BaseFormatMoney`),m=n(`BaseSpinner`);return f(),d(`div`,g,[s(`div`,_,[s(`h3`,v,i(a.$t(`invoices.invoice_information`)),1)]),r.invoice?(f(),d(`div`,y,[s(`dl`,b,[s(`div`,x,[s(`dt`,S,i(a.$t(`general.from`)),1),s(`dd`,C,i(r.invoice.company.name),1)]),s(`div`,w,[s(`dt`,T,i(a.$t(`general.to`)),1),s(`dd`,E,i(r.invoice.customer.name),1)]),s(`div`,D,[s(`dt`,O,i(a.$t(`invoices.paid_status`).toLowerCase()),1),s(`dd`,k,[t(u,{status:r.invoice.paid_status,class:`px-3 py-1`},{default:e(()=>[t(c,{status:r.invoice.paid_status},null,8,[`status`])]),_:1},8,[`status`])])]),s(`div`,A,[s(`dt`,j,i(a.$t(`invoices.total`)),1),s(`dd`,M,[t(p,{currency:r.invoice.currency,amount:r.invoice.total},null,8,[`currency`,`amount`])])]),r.invoice.formatted_notes?(f(),d(`div`,N,[s(`dt`,P,i(a.$t(`invoices.notes`)),1),s(`dd`,F,[s(`span`,{innerHTML:r.invoice.formatted_notes},null,8,I)])])):l(``,!0)])])):(f(),d(`div`,L,[t(m,{class:`text-primary-500 h-10 w-10`})]))])}}},z={class:`h-screen overflow-y-auto min-h-0`},B={class:`relative p-6 pb-28 px-4 md:px-6 w-full md:w-auto md:max-w-xl mx-auto`},V={class:`flex flex-col md:flex-row absolute md:relative bottom-2 left-0 px-4 md:px-0 w-full md:space-x-4 md:space-y-0 space-y-2`},H=[`href`],U={key:0,class:`flex items-center justify-center mt-4 text-gray-500 font-normal`},W={href:`https://invoiceshelf.com`,target:`_blank`},G=[`src`],K={__name:`InvoicePublicPage`,setup(g){let _=o(null),v=h(),y=m();b();async function b(){_.value=(await p.get(`/customer/invoices/${v.params.hash}`)).data.data}let x=c(()=>v.path+`?pdf`);function S(){return new URL(`/build/assets/logo-gray-DmcZTzo8.png`,``+import.meta.url)}let C=c(()=>window.customer_logo?window.customer_logo:!1),w=c(()=>_.value?.invoice_number);function T(){y.push({name:`invoice.pay`,params:{hash:v.params.hash,company:_.value.company.slug}})}return(o,c)=>{let p=n(`BaseButton`),m=n(`BasePageHeader`);return f(),d(`div`,z,[c[1]||=s(`div`,{class:`bg-linear-to-r from-primary-500 to-primary-400 h-5`},null,-1),s(`div`,B,[t(m,{title:w.value||``},{actions:e(()=>[s(`div`,V,[s(`a`,{href:x.value,target:`_blank`,class:`block w-full`},[t(p,{variant:`primary-outline`,class:`justify-center w-full`},{default:e(()=>[r(i(o.$t(`general.download_pdf`)),1)]),_:1})],8,H),u(_)&&u(_).paid_status!==`PAID`&&u(_).payment_module_enabled?(f(),a(p,{key:0,variant:`primary`,class:`justify-center`,onClick:T},{default:e(()=>[r(i(o.$t(`general.pay_invoice`)),1)]),_:1})):l(``,!0)])]),_:1},8,[`title`]),t(R,{invoice:u(_)},null,8,[`invoice`]),C.value?l(``,!0):(f(),d(`div`,U,[c[0]||=r(` Powered by `,-1),s(`a`,W,[s(`img`,{src:S(),class:`h-4 ml-1 mb-1`},null,8,G)])]))])])}}};export{K as default};