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