import{d as K,f as g,a as x}from"../chunks/8V7BUHOp.js";import{i as N}from"../chunks/Cq4v1K7x.js";import{p as Q,a as U,c as a,s as o,r as t,g as s,m as T,t as V,e as u}from"../chunks/CwuLZfOX.js";import{s as _}from"../chunks/CaaTB9LM.js";import{i as z}from"../chunks/ChcH33Yj.js";import{e as W,i as X,a as Y}from"../chunks/BxoYaj6m.js";import{m as Z}from"../chunks/CPL3xYsw.js";import{G as tt}from"../chunks/8miJf-lk.js";function at(p,i,d){u(i,!1),u(d,null)}function st(p,i,d){s(i)&&(Z.publish(`fire-damper/${s(i).id}/test`,"start",!1),console.log(`Test signal sent to Fire Damper Module ${s(i).id}`),d())}var et=(p,i,d)=>i(s(d)),ot=(p,i,d)=>i(s(d)),lt=g('<tr><td> </td><td> </td><td><span> </span></td><td class="hidden sm:table-cell"> </td><td class="flex flex-col sm:flex-row gap-1"><button class="btn btn-primary btn-xs sm:btn-sm">View</button> <button class="btn btn-outline btn-xs sm:btn-sm">Send</button></td></tr>'),it=g('<div class="modal modal-open"><div class="modal-box"><h3 class="font-bold text-lg"> </h3> <p class="py-4"> </p> <div class="modal-action"><button class="btn btn-primary">Ok, thanks!</button></div></div></div>'),nt=g('<div class="modal modal-open"><div class="modal-box"><h3 class="font-bold text-lg"> </h3> <p class="py-4"> </p> <div class="modal-action"><button class="btn btn-outline">Cancel</button> <button class="btn btn-primary">Send Report</button></div></div></div>'),rt=g('<section><div class="container mx-auto p-2 sm:p-4"><div class="flex items-center gap-2 sticky bg-base-100 z-40 pb-2" style="top:4.11rem"><!></div> <h2 class="text-4xl font-semibold">Reports</h2> <h2 class="text-xl font-semibold py-1 sm:py-2">Send automatic and manual reports to customers.</h2> <div class="overflow-x-auto"><table class="table w-full text-sm sm:text-base"><thead><tr><th class="w-12">ID</th><th>Location</th><th>Status</th><th class="hidden sm:table-cell">Report Date</th><th>Actions</th></tr></thead><tbody></tbody></table></div> <!> <!></div></section>');function ft(p,i){Q(i,!1);let d=[{id:1,location:"Fiktivt kontorbygg",status:"Sent",lastTested:"2024-12-01"},{id:2,location:"Fiktiv boligblokk",status:"Pending",lastTested:"2024-12-02"}],c=T(null),k=T(!1);function C(l){u(c,l),u(k,!0)}function D(){u(k,!1),u(c,null)}let y=T(!1);function H(l){u(c,l),u(y,!0)}N();var w=rt(),F=a(w),S=a(F),L=a(S);tt(L,{}),t(S);var M=o(S,6),A=a(M),G=o(a(A));W(G,5,()=>d,X,(l,e)=>{var v=lt(),n=a(v),f=a(n,!0);t(n);var r=o(n),h=a(r,!0);t(r);var m=o(r),b=a(m),$=a(b,!0);t(b),t(m);var R=o(m),E=a(R,!0);t(R);var P=o(R),q=a(P);q.__click=[et,H,e];var J=o(q,2);J.__click=[ot,C,e],t(P),t(v),V(()=>{_(f,s(e).id),_(h,s(e).location),Y(b,1,`badge text-xs sm:text-sm ${s(e).status==="Sent"?"badge-success":s(e).status==="Pending"?"badge-warning":"badge-error"}`),_($,s(e).status),_(E,s(e).lastTested)}),x(l,v)}),t(G),t(A),t(M);var I=o(M,2);{var O=l=>{var e=it(),v=a(e),n=a(v),f=a(n);t(n);var r=o(n,2),h=a(r);t(r);var m=o(r,2),b=a(m);b.__click=[at,y,c],t(m),t(v),t(e),V(()=>{_(f,`Report ${s(c).id??""}`),_(h,`Report for ${s(c).location??""} will be here, I promise!`)}),x(l,e)};z(I,l=>{s(y)&&l(O)})}var j=o(I,2);{var B=l=>{var e=nt(),v=a(e),n=a(v),f=a(n);t(n);var r=o(n,2),h=a(r);t(r);var m=o(r,2),b=a(m);b.__click=D;var $=o(b,2);$.__click=[st,c,D],t(m),t(v),t(e),V(()=>{_(f,`Sending report ${s(c).id??""}`),_(h,`Are you sure you want to send the report from ${s(c).location??""}?`)}),x(l,e)};z(j,l=>{s(k)&&l(B)})}t(F),t(w),x(p,w),U()}K(["click"]);export{ft as component};
