PageSourceSearch

https://slugish.ai/build/assets/incentiveinvoice-CtVX9jNs.js

js slugish.ai collected 2026-10-05 12:40:07 UTC 20,102 bytes, 161 lines download raw bytes

1import{u as H,r as d,j as e,L as h,H as V}from"./app-DP13319Q.js";import{F as o,bl as g,au as Z,az as q,aI as Y,k as b,bk as W,f as O}from"./index-CtyZ6W6U.js";import{D as G}from"./DraggableMenu-Bk7Spryo.js";/* empty css            */import"./index-DQkUn08L.js";function te(){const{props:w}=H(),{auth:v,template:t,invoice:i,incentive:a}=w,x=d.useCallback(s=>{try{return new URL(s),!0}catch{return!1}},[]),m=d.useCallback(s=>{var n;return(n=s.split("?")[0].split(".").pop())==null?void 0:n.toLowerCase()},[]),u=d.useCallback(s=>s?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(s):!1,[]),y=d.useMemo(()=>t!=null&&t.image&&u(m(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,m,u]),j=d.useMemo(()=>{var f;if(!t)return null;const s=((f=t.image.split(".").pop())==null?void 0:f.toLowerCase())||"",n=`${t.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${t.image}`,I=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],z=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],_=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,D=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,F=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,E=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,S=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,P=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,B=/<blockquote/,c=t.image.match(_),C=t.image.match(D),p=t.image.match(F),R=t.image.match(E),U=t.image.match(S),L=t.image.match(P)||B.test(t.image),M=new Blob([t.image],{type:"text/html"}),T=URL.createObjectURL(M);if(I.includes(s))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:n,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(z.includes(s))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${n}&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(L){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"'),A=/<(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:A}},`iframe-${t.image}`)]})}if(c){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/${c[1]}?${l}&loop=1&playlist=${c[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-${c[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/${c[1]}?${t.option}=1&mute=1&loop=1&playlist=${c[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-${c[1]}`)]})}if(C){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 p?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/${p[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0},`vimeo-${p[3]}`)]}):R||U&&!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}`)}):s==="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:n,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:n,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-main-${t.image}`)]}):s==="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:n,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}`)]}):x(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:T,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\r
87                        allow-popups allow-popups-to-escape-sandbox allow-presentation\r
88                        allow-same-origin allow-scripts allow-top-navigation\r
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}`)},[t,x]);if(!i||!a)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:"/incentivehistory",className:"text-blue-600 hover:text-blue-800",children:"Back to Incentive History"})]})});const N=()=>{const s=window.open("","_blank");s?(s.document.write(`
90                <!DOCTYPE html>
91                <html>
92                <head>
93                    <title>Incentive Invoice ${i.invoice_number}</title>
94                    <style>
95                        body { font-family: Arial, sans-serif; margin: 0; padding: 20px; color: #333; }
96                        .invoice-header { background: #6b46c1; 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                        .incentive-details { background: #f0f9ff; padding: 15px; border-radius: 5px; margin: 20px 0; }
106                    </style>
107                </head>
108                <body>
109                    <div class="invoice-header">
110                        <h1>Incentive Invoice #${i.invoice_number}</h1>
111                        <p>Issued: ${i.issue_date} | Due: ${i.due_date}</p>
112                        <span class="status ${i.status==="paid"?"paid":"pending"}">
113                            ${i.status.toUpperCase()}
114                        </span>
115                    </div>
116                    <div class="invoice-body">
117                        <div class="incentive-details">
118                            <h2>Incentive Information</h2>
119                            <p><strong>Type:</strong> ${a.incentive_type}</p>
120                            <p><strong>Description:</strong> ${a.description}</p>
121                            <p><strong>Distributed:</strong> ${new Date(a.distributed_at).toLocaleDateString()}</p>
122                            <p><strong>Status:</strong> ${a.status}</p>
123                        </div>
124
125                        <h2>Bee Points Earned</h2>
126                        <table>
127                            <thead>
128                                <tr>
129                                    <th>Description</th>
130                                    <th>Quantity</th>
131                                    <th>Unit Price</th>
132                                    <th>Amount</th>
133                                </tr>
134                            </thead>
135                            <tbody>
136                                ${i.items.map(r=>`
137                                    <tr>
138                                        <td>${r.description}</td>
139                                        <td>${r.quantity.toLocaleString()}</td>
140                                        <td>EZ$${r.unit_price}</td>
141                                        <td>EZ$${r.amount}</td>
142                                    </tr>
143                                `).join("")}
144                            </tbody>
145                            <tfoot>
146                                <tr class="total-row">
147                                    <td colspan="3" style="text-align: right;">Total</td>
148                                    <td>EZ$${i.amount}</td>
149                                </tr>
150                            </tfoot>
151                        </table>
152
153                        ${i.notes?`
154                            <h2>Notes</h2>
155                            <p>${i.notes}</p>
156                        `:""}
157                    </div>
158                    <script>window.print(); window.close();<\/script>
159                </body>
160                </html>
161            `),s.document.close()):window.print()},$=s=>{switch(s){case"distributed":return e.jsx(o,{icon:O,className:"text-green-500"});case"failed":return e.jsx(o,{icon:W,className:"text-red-500"});case"pending":return e.jsx(o,{icon:b,className:"text-yellow-500 animate-spin"});default:return e.jsx(o,{icon:b,className:"text-gray-500"})}},k=s=>new Date(s).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"});return e.jsxs(e.Fragment,{children:[e.jsxs(V,{children:[e.jsx("title",{children:`Incentive Invoice ${i.invoice_number} - Bee Points Reward`}),e.jsx("meta",{name:"description",content:`Incentive invoice for your Bee Points reward - ${i.invoice_number}`}),y]}),e.jsx(G,{auth:v}),e.jsxs("main",{className:`relative min-h-screen p-4 md:p-8 ${t!=null&&t.image&&u(m(t.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:j}),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-purple-700 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(o,{icon:g,className:"mr-3"}),"Incentive Invoice #",i.invoice_number]}),e.jsxs("p",{className:"text-purple-200 mt-2",children:["Issued: ",i.issue_date]})]}),e.jsx("div",{className:"text-right",children:e.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${i.status==="paid"?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:i.status.toUpperCase()})})]})}),e.jsxs("div",{className:"p-6 md:p-8",children:[e.jsxs("div",{className:"mb-8 bg-blue-50 p-6 rounded-lg",children:[e.jsx("h2",{className:"text-lg font-medium text-blue-900 mb-4",children:"Incentive Details"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-blue-700 mb-2",children:"Incentive Type"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(o,{icon:g,className:"text-purple-500 mr-2"}),e.jsx("span",{className:"font-medium capitalize",children:a.incentive_type})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-blue-700 mb-2",children:"Status"}),e.jsxs("div",{className:"flex items-center",children:[$(a.status),e.jsx("span",{className:"ml-2 font-medium capitalize",children:a.status})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-blue-700 mb-2",children:"Distributed Date"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(o,{icon:Z,className:"text-blue-500 mr-2"}),e.jsx("span",{children:k(a.distributed_at)})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-blue-700 mb-2",children:"Reference"}),e.jsx("div",{className:"text-sm",children:a.reference_type||"N/A"})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-sm font-medium text-blue-700 mb-2",children:"Description"}),e.jsx("p",{className:"text-blue-900",children:a.description})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Bee Points Earned"}),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:"Amount"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:i.items.map((s,r)=>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(o,{icon:q,className:"text-yellow-500 mr-2"}),e.jsx("div",{className:"text-sm font-medium text-gray-900",children:s.description})]})}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:["EZ$",s.amount]})]},r))}),e.jsx("tfoot",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("td",{colSpan:1,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:["EZ$",i.amount]})]})})]})})]}),i.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:i.notes})]}),e.jsxs("div",{className:"flex justify-end space-x-4",children:[e.jsxs("button",{onClick:N,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-purple-500",children:[e.jsx(o,{icon:Y,className:"mr-2"}),"Print Invoice"]}),e.jsx(h,{href:"/incentivehistory",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500",children:"Back to Incentive History"})]})]})]})})]})]})}export{te 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.