1import{u as E,r as n,j as e,L as h,H as L}from"./app-DP13319Q.js";import{F as c,at as R,aH as T,az as H,aI as q}from"./index-CtyZ6W6U.js";import{D as V}from"./DraggableMenu-Bk7Spryo.js";/* empty css */import"./index-DQkUn08L.js";function Z(){const{props:f}=E(),{auth:g,template:t,invoice:s}=f,p=n.useCallback(a=>{try{return new URL(a),!0}catch{return!1}},[]),d=n.useCallback(a=>{var o;return(o=a.split("?")[0].split(".").pop())==null?void 0:o.toLowerCase()},[]),m=n.useCallback(a=>a?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(a):!1,[]),b=n.useMemo(()=>t!=null&&t.image&&m(d(t.image))?e.jsx("style",{children:` 2 .blur-bg { 3 background: url('${t.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${t.image}') no-repeat center center; 4 background-size: cover; 5 } 6 `}):null,[t,d,m]),y=n.useMemo(()=>{var x;if(!t)return null;const a=((x=t.image.split(".").pop())==null?void 0:x.toLowerCase())||"",o=`${t.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${t.image}`,v=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],j=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],N=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,$=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,k=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,z=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,P=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,I=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,_=/<blockquote/,r=t.image.match(N),F=t.image.match($),u=t.image.match(k),B=t.image.match(z),C=t.image.match(P),D=t.image.match(I)||_.test(t.image),M=new Blob([t.image],{type:"text/html"}),U=URL.createObjectURL(M);if(v.includes(a))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 7 .blur-overlay { 8 position: fixed; 9 top: 0; 10 left: 0; 11 width: 100%; 12 height: 100%; 13 backdrop-filter: blur(20px); 14 z-index: -1; 15 } 16 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:o,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:l=>console.error("Image failed to load",l)},`image-${t.image}`)]});if(j.includes(a))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${o}&embedded=true`,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",loading:"lazy",allow:"autoplay; fullscreen",allowFullScreen:!0,sandbox:"allow-scripts allow-same-origin",title:"Document Viewer",scrolling:"yes"},`doc-${t.image}`);if(D){const l=t.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),S=/<(iframe|blockquote)[^>]*class="/i.test(l)?l:l.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 17 .blur-overlay { 18 position: fixed; 19 top: 0; 20 left: 0; 21 width: 100%; 22 height: 100%; 23 backdrop-filter: blur(20px); 24 z-index: -2; 25 } 26 .twitter-tweet { 27 position: fixed; 28 top: 0; 29 left: 0; 30 width: 100vw; 31 height: 100vh; 32 object-fit: cover; 33 z-index: 0; 34 border: none; 35 } 36 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:S}},`iframe-${t.image}`)]})}if(r){const l=t.option==="autoplay"?"autoplay=1":t.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${r[1]}?${l}&loop=1&playlist=${r[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0},`youtube-1-${r[1]}`)}),e.jsx("style",{children:` 37 .blur-overlay { 38 position: fixed; 39 top: 0; 40 left: 0; 41 width: 100%; 42 height: 100%; 43 backdrop-filter: blur(20px); 44 z-index: -1; 45 } 46 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${r[1]}?${t.option}=1&mute=1&loop=1&playlist=${r[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
46 web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0},`youtube-2-${r[1]}`)]})}if(F){let l=t.image;return l.includes("?compact=1")||(l+=(l.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:l,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"},`linkedin-${l}`)})}return u?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 47 .blur-overlay { 48 position: fixed; 49 top: 0; 50 left: 0; 51 width: 100%; 52 height: 100%; 53 backdrop-filter: blur(20px); 54 z-index: -1; 55 } 56 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${u[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0},`vimeo-${u[3]}`)]}):B||C&&!t.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":t.image,"data-width":"1400","data-show-text":"true"},`fb-${t.image}`)}):a==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:o,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-bg-${t.image}`),e.jsx("style",{children:` 57 .blur-overlay { 58 position: fixed; 59 top: 0; 60 left: 0; 61 width: 100%; 62 height: 100%; 63 backdrop-filter: blur(20px); 64 z-index: -2; 65 } 66 `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:o,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-main-${t.image}`)]}):a==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 67 .blur-overlay { 68 position: fixed; 69 top: 0; 70 left: 0; 71 width: 100%; 72 height: 100%; 73 backdrop-filter: blur(20px); 74 z-index: -1; 75 } 76 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:o,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"},`model-${t.image}`)]}):p(t.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 77 .blur-overlay { 78 position: fixed; 79 top: 0; 80 left: 0; 81 width: 100%; 82 height: 100%; 83 backdrop-filter: blur(20px); 84 z-index: -1; 85 } 86 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:t.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"},`iframe-url-${t.image}`)]}):e.jsx("iframe",{src:U,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock 87 allow-popups allow-popups-to-escape-sandbox allow-presentation 88 allow-same-origin allow-scripts allow-top-navigation 89 allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"},`html-${t.image}`)}
89,[t,p]);if(!s)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center p-8 bg-white rounded-lg shadow-md",children:[e.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-4",children:"Invoice Not Found"}),e.jsx(h,{href:"/purchasehistory",className:"text-blue-600 hover:text-blue-800",children:"Back to Purchase History"})]})});const w=()=>{const a=window.open("","_blank");a?(a.document.write(` 90 <!DOCTYPE html> 91 <html> 92 <head> 93 <title>Invoice ${s.invoice_number}</title> 94 <style> 95 body { font-family: Arial, sans-serif; margin: 0; padding: 20px; color: #333; } 96 .invoice-header { background: #000; color: #fff; padding: 20px; } 97 .invoice-body { padding: 20px; } 98 table { width: 100%; border-collapse: collapse; margin: 20px 0; } 99 th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; } 100 th { background-color: #f5f5f5; } 101 .total-row { font-weight: bold; } 102 .status { display: inline-block; padding: 5px 10px; border-radius: 20px; font-size: 14px; } 103 .paid { background: #d4edda; color: #155724; } 104 .pending { background: #fff3cd; color: #856404; } 105 </style> 106 </head> 107 <body> 108 <div class="invoice-header"> 109 <h1>Invoice #${s.invoice_number}</h1> 110 <p>Issued: ${s.issue_date} | Due: ${s.due_date}</p> 111 <span class="status ${s.status==="paid"?"paid":"pending"}"> 112 ${s.status.toUpperCase()} 113 </span> 114 </div> 115 <div class="invoice-body"> 116 <h2>Transaction Details</h2> 117 <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px;"> 118 <div style="background: #f5f5f5; padding: 15px; border-radius: 5px;"> 119 <h3 style="font-size: 14px; color: #666; margin: 0 0 10px 0;">Payment Method</h3> 120 <div style="display: flex; align-items: center;"> 121 <span style="font-weight: bold; text-transform: capitalize;"> 122 ${s.transaction.payment_method} ending in ${s.transaction.last4} 123 </span> 124 </div> 125 </div> 126 <div style="background: #f5f5f5; padding: 15px; border-radius: 5px;"> 127 <h3 style="font-size: 14px; color: #666; margin: 0 0 10px 0;">Transaction ID</h3> 128 <div style="font-family: monospace;"> 129 ${s.transaction.id} 130 </div> 131 </div> 132 </div> 133 134 <h2>Bee Points Purchased</h2> 135 <table> 136 <thead> 137 <tr> 138 <th>Description</th> 139 <th>Quantity</th> 140 <th>Unit Price</th> 141 <th>Amount</th> 142 </tr> 143 </thead> 144 <tbody> 145 ${s.items.map(i=>` 146 <tr> 147 <td>${i.description}</td> 148 <td>${i.quantity.toLocaleString()}</td> 149 <td>$${i.unit_price}</td> 150 <td>$${i.amount}</td> 151 </tr> 152 `).join("")} 153 </tbody> 154 <tfoot> 155 <tr class="total-row"> 156 <td colspan="3" style="text-align: right;">Total</td> 157 <td>$${s.amount}</td> 158 </tr> 159 </tfoot> 160 </table> 161 162 ${s.notes?`
163 <h2>Notes</h2> 164 <p>${s.notes}</p> 165 `:""} 166 </div> 167 <script>window.print(); window.close();<\/script> 168 </body> 169 </html> 170 `),a.document.close()):window.print()};return e.jsxs(e.Fragment,{children:[e.jsxs(L,{children:[e.jsx("title",{children:`Invoice ${s.invoice_number} - Bee Points Purchase`}),e.jsx("meta",{name:"description",content:`Invoice for your Bee Points purchase - ${s.invoice_number}`}),b]}),e.jsx(V,{auth:g}),e.jsxs("main",{className:`relative min-h-screen p-4 md:p-8 ${t!=null&&t.image&&m(d(t.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:y}),e.jsx("div",{className:"relative z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[e.jsx("div",{className:"p-6 md:p-8 bg-gray-800 text-white",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center",children:[e.jsx(c,{icon:R,className:"mr-3"}),"Invoice #",s.invoice_number]}),e.jsxs("p",{className:"text-gray-300 mt-2",children:["Issued: ",s.issue_date]})]}),e.jsx("div",{className:"text-right",children:e.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${s.status==="paid"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:s.status.toUpperCase()})})]})}),e.jsxs("div",{className:"p-6 md:p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Transaction Details"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Payment Method"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(c,{icon:T,className:"text-blue-500 mr-2"}),e.jsxs("span",{className:"font-medium capitalize",children:[s.transaction.payment_method," ending in ",s.transaction.last4]})]})]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Transaction ID"}),e.jsx("div",{className:"font-mono text-sm",children:s.transaction.id})]})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Bee Points Purchased"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Description"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Quantity"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Unit Price"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:s.items.map((a,i)=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(c,{icon:H,className:"text-yellow-500 mr-2"}),e.jsx("div",{className:"text-sm font-medium text-gray-900",children:a.description})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:a.quantity.toLocaleString()}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:["$",a.unit_price]}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:["$",a.amount]})]},i))}),e.jsx("tfoot",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("td",{colSpan:3,className:"px-6 py-4 text-right text-sm font-medium text-gray-500",children:"Total"}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-bold text-gray-900",children:["$",s.amount]})]})})]})})]}),s.notes&&e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-2",children:"Notes"}),e.jsx("p",{className:"text-gray-600",children:s.notes})]}),e.jsxs("div",{className:"flex justify-end space-x-4",children:[e.jsxs("button",{onClick:w,className:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[e.jsx(c,{icon:q,className:"mr-2"}),"Print Invoice"]}),e.jsx(h,{href:"/purchasehistory",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Back to Purchase History"})]})]})]})})]})]})}export{Z 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.