@camstack/addon-admin-ui 1.2.22 → 1.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddLocationWizard-CXH0Vd7P.js → AddLocationWizard-Dq7esXUF.js} +1 -1
- package/dist/assets/{AddonCollectionPage-BDrreBA_.js → AddonCollectionPage-zISnCSia.js} +1 -1
- package/dist/assets/{Addons-BBee3W_5.js → Addons-CgUw615i.js} +1 -1
- package/dist/assets/{AdminTabs-C2h2Ess6.js → AdminTabs-Dm5dIblA.js} +1 -1
- package/dist/assets/{AiProfiles-CaMvgEcu.js → AiProfiles-n9YYWZm0.js} +1 -1
- package/dist/assets/{BrokerForm-Dg4179gd.js → BrokerForm-D3HfLXNS.js} +1 -1
- package/dist/assets/{Capabilities-CTViRMUz.js → Capabilities-DM9m0y2O.js} +1 -1
- package/dist/assets/{CapabilityBadges-CWTCenZn.js → CapabilityBadges-YLTOm6PM.js} +1 -1
- package/dist/assets/{Cluster-CyCE0oc3.js → Cluster-C2xbxwVH.js} +1 -1
- package/dist/assets/{ClusterRecordingTab-BFeUBRQL.js → ClusterRecordingTab-Dm3Biopz.js} +1 -1
- package/dist/assets/{Dashboard-kAuj8Qql.js → Dashboard-D-wnzhTu.js} +1 -1
- package/dist/assets/{Data-cxkPOpjt.js → Data-CIDrzfAW.js} +1 -1
- package/dist/assets/{DetectionIntelligence-BhkMTGhd.js → DetectionIntelligence-DqbLakFE.js} +1 -1
- package/dist/assets/{DeviceAggregateSection-nG_okgKX.js → DeviceAggregateSection-Bu8VWBW5.js} +1 -1
- package/dist/assets/{DeviceDetail-Bn6Ds2YE.js → DeviceDetail-Br2-0p9A.js} +1 -1
- package/dist/assets/{Devices-B95hLZbr.js → Devices-DI07Ba43.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-D7BKC58D.js → EmbedPlayerPage-CGwxGZ8a.js} +1 -1
- package/dist/assets/{Events-CQFwNvkG.js → Events-oKrdnmzL.js} +1 -1
- package/dist/assets/{FormBuilder-DjEl_aGp.js → FormBuilder-WQJMcWst.js} +1 -1
- package/dist/assets/{Identity-60VJAx02.js → Identity-jSwJ6Iv7.js} +1 -1
- package/dist/assets/{IntegrationDetail-BjZloyK4.js → IntegrationDetail-B-LhIl4a.js} +1 -1
- package/dist/assets/{Integrations-D9v-_8r-.js → Integrations-BXraNBU9.js} +1 -1
- package/dist/assets/{Integrations-CxEpaCLq.js → Integrations-XXz_SSij.js} +1 -1
- package/dist/assets/{Logs-C7F-ma4x.js → Logs-DwZnQjRw.js} +1 -1
- package/dist/assets/{MotionZonesSettings-DSIn5-s5.js → MotionZonesSettings-DfEKV9Q_.js} +1 -1
- package/dist/assets/{MyAccess-t85_pORz.js → MyAccess-Ds9GtLyA.js} +1 -1
- package/dist/assets/{Network-D7V-dc6V.js → Network-Bxr6yA2G.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-ujvGtNzi.js → NodeAddonsSettingsPanel-DLk9BjoX.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-fwySdAtB.js → NodeInferenceDevices-D8UFJ7N-.js} +1 -1
- package/dist/assets/Notifications-BGACh7EA.js +1 -0
- package/dist/assets/{Pipeline-CA-9DIEs.js → Pipeline-BJMxtRsG.js} +1 -1
- package/dist/assets/{Plates-BWcRlxDR.js → Plates-BYT1Sys7.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-Bfj57HiI.js → PrivacyMaskSettings-DHEZLINm.js} +1 -1
- package/dist/assets/{ProviderIcon-Bu6M7fez.js → ProviderIcon-qFD5vx-c.js} +1 -1
- package/dist/assets/{Recordings-DqkJ9Ane.js → Recordings-EdS7D4Nu.js} +1 -1
- package/dist/assets/{ScanNetworkModal-CkeHCFgJ.js → ScanNetworkModal-C2nxQYpR.js} +1 -1
- package/dist/assets/{Settings-CTvsgafi.js → Settings-DTvThy5s.js} +1 -1
- package/dist/assets/{Showroom-B43mwuk7.js → Showroom-CoCz7BCl.js} +1 -1
- package/dist/assets/{Terminal-BDSI390X.js → Terminal-CdHc7JGW.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-W4TOU_HF.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Qwbl6leh.js} +1 -1
- package/dist/assets/{build-cluster-graph-C4zGQLGF.js → build-cluster-graph-DCa5BVOm.js} +1 -1
- package/dist/assets/circle-check-big-BrI-BnLX.js +1 -0
- package/dist/assets/clock-BaUOxVoD.js +1 -0
- package/dist/assets/{copy-BgYRNf8b.js → copy-DT1LpWnW.js} +1 -1
- package/dist/assets/{debounced-invalidate-o_asci0-.js → debounced-invalidate-COlXMKcK.js} +1 -1
- package/dist/assets/dist-CavlSg96.js +7 -0
- package/dist/assets/{dist-CYCjmuN8.js → dist-pwV-cUFg.js} +1 -1
- package/dist/assets/{download-CdPioKV1.js → download-C5pWNY_z.js} +1 -1
- package/dist/assets/{face-bbox-BpDfTsFx.js → face-bbox-CQezXcbm.js} +1 -1
- package/dist/assets/{hostInit-DJ_7rd1-.js → hostInit-17HFqvQi.js} +1 -1
- package/dist/assets/{index-D0JhMwHm.js → index-CpIk9zzP.js} +3 -3
- package/dist/assets/{key-round-DDzoqyJC.js → key-round-BvJWrH6G.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-7d8a6853.js → mf-entry-bootstrap-0-11f10035.js} +2 -2
- package/dist/assets/{pencil-DjXB5Bxq.js → pencil-B6M2nE2x.js} +1 -1
- package/dist/assets/{player-overlays-BfUh6z3V.js → player-overlays-Cip1zMzf.js} +1 -1
- package/dist/assets/plus-CJX-7qpV.js +1 -0
- package/dist/assets/{radio-DdH4qqug.js → radio-7rKfflkG.js} +1 -1
- package/dist/assets/{refresh-cw-BSTOsxS_.js → refresh-cw-meywvLr6.js} +1 -1
- package/dist/assets/remoteEntry-CpGnB6JJ.js +1 -0
- package/dist/assets/{rotate-ccw-DIwpplTj.js → rotate-ccw-DG0IoVOG.js} +1 -1
- package/dist/assets/rotate-cw-BaaybXts.js +1 -0
- package/dist/assets/search-DqwBNJOd.js +1 -0
- package/dist/assets/{send-CcHJh0KO.js → send-BYEhx4h6.js} +1 -1
- package/dist/assets/{server-DwOZ36mY.js → server-Bmc0CVZj.js} +1 -1
- package/dist/assets/square-BphxIfpl.js +1 -0
- package/dist/assets/{square-check-big-D7LCZj5L.js → square-check-big-89xbxgw8.js} +1 -1
- package/dist/assets/{src-DmLu_IGX.js → src-Bz1FM7Iz.js} +10 -10
- package/dist/assets/src-CMBOTyxw.js +7 -0
- package/dist/assets/{upload-Tv3ztf7H.js → upload-CzKEUpu7.js} +1 -1
- package/dist/assets/{useEventInvalidation-CQK0jRw6.js → useEventInvalidation-Bwgjtt0n.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-B_wRVm4F.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-OzBzXogt.js} +2 -2
- package/dist/assets/{wifi-C6b9pnss.js → wifi-SBwRQpGK.js} +1 -1
- package/dist/assets/{zap-CWvZQmfa.js → zap-CG1_c3Ri.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/server/addon.js +237 -7
- package/package.json +1 -1
- package/dist/assets/Notifications-CUekQNjA.js +0 -1
- package/dist/assets/circle-check-big-C-IoJG5A.js +0 -1
- package/dist/assets/clock-J8ftFeJL.js +0 -1
- package/dist/assets/dist-ygAVnmuC.js +0 -7
- package/dist/assets/plus-BEbdi_Iz.js +0 -1
- package/dist/assets/remoteEntry-BVkvjsQm.js +0 -1
- package/dist/assets/rotate-cw-EHQK_WNV.js +0 -1
- package/dist/assets/search-BK_1ulaR.js +0 -1
- package/dist/assets/square-nYV2-xBc.js +0 -1
- package/dist/assets/src-D11G7q5Q.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as e,Ao as t,Co as n,Do as r,Eo as i,Ka as a,Ki as o,Oo as s,S as c,So as l,To as u,bo as d,do as f,fo as p,ko as m,lo as h,oo as g,uo as _,wo as v,yo as y}from"./src-Bz1FM7Iz.js";import{Q as b,S as x,W as S,a as C,b as w,i as T,o as E,q as D,t as O,x as k}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{E as A,T as j,k as M,w as N}from"./src-CMBOTyxw.js";import{p as P}from"./player-overlays-Cip1zMzf.js";import{t as F}from"./circle-check-big-BrI-BnLX.js";import{t as I}from"./copy-DT1LpWnW.js";import{t as L}from"./pencil-B6M2nE2x.js";import{t as R}from"./plus-CJX-7qpV.js";import{t as ee}from"./refresh-cw-meywvLr6.js";import{t as te}from"./search-DqwBNJOd.js";import{t as z}from"./send-BYEhx4h6.js";import{N as B,S as V,V as ne,W as H,i as re,s as ie}from"./index-CpIk9zzP.js";import{t as ae}from"./AdminPage-Dq33XE9j.js";import{t as oe}from"./AdminTabs-Dm5dIblA.js";var se=H(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),ce=H(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),le=H(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),U=H(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]);b();var W=e=>typeof e==`string`&&e.length>0;function ue(e){return{levels:e.levels,formats:e.format,bodyMaxLen:e.bodyMaxLen,attachmentSlots:e.attachments.mediaTypes,attachmentMode:e.attachments.mode,attachmentMax:e.attachments.max,attachmentMaxBytes:e.attachments.maxBytes,maxActions:e.actions,showActions:e.actions>0,showClickUrl:e.clickUrl,showSound:e.sound,showTtl:e.ttl,showTag:!0}}function de(e,t){return e.format.includes(t)?t:e.format[0]??`text`}function fe(e,t){let n=[];for(let r of e.attachments.mediaTypes){if(n.length>=e.attachments.max)break;let i=t[r];W(i)&&n.push({mediaType:r,url:i})}return n}function pe(e,t){if(e.actions<=0)return[];let n=[];for(let r of t){if(n.length>=e.actions)break;let t=W(r.label),i=W(r.url);!t&&!i||n.push({id:`test-${n.length+1}`,label:t?r.label:`Action ${n.length+1}`,...i?{url:r.url}:{}})}return n}function me(e,t){let n=e.levels.some(e=>e.id===t.level)?t.level:void 0,r=fe(e,t.attachmentUrls),i=pe(e,t.actions),a=e.ttl&&W(t.ttl)?Number(t.ttl):void 0;return{body:t.body,format:de(e,t.format),priority:he(t.priority),...W(t.title)?{title:t.title}:{},...n?{level:n}:{},...r.length>0?{attachments:r}:{},...i.length>0?{actions:i}:{},...e.clickUrl&&W(t.clickUrl)?{clickUrl:t.clickUrl}:{},...e.sound&&W(t.sound)?{sound:t.sound}:{},...a!==void 0&&Number.isFinite(a)?{ttl:a}:{},...W(t.tag)?{tag:t.tag}:{}}}function he(e){return Number.isFinite(e)?Math.min(5,Math.max(1,Math.round(e))):3}function ge(e){return e.levels.find(e=>e.flags?.critical===!0)||e.levels.filter(e=>typeof e.ordinal==`number`).sort((e,t)=>t.ordinal-e.ordinal)[0]}function G(e){return{level:``,priority:3,format:e.format[0]??`text`,title:``,body:``,attachmentUrls:{},actions:[],clickUrl:``,sound:``,ttl:``,tag:``}}var _e={image:`/addon/notifiers/samples/image`,video:`/addon/notifiers/samples/video`,gif:`/addon/notifiers/samples/gif`,audio:`/addon/notifiers/samples/audio`,icon:`/addon/notifiers/samples/icon`};function ve(e,t){return e.attachments.max>0&&e.attachments.mediaTypes.includes(t)}function ye(e){let t=[`text`];for(let n of[`image`,`gif`,`video`,`audio`])ve(e,n)&&t.push(n);return e.actions>0&&t.push(`actions`),e.levels.length>0&&t.push(`critical`),t.push(`overflow`),t}function K(e,t,n){let r=G(e);return ve(e,t)?{...r,body:n,attachmentUrls:{[t]:_e[t]}}:{...r,body:n}}function be(e,t){let n=G(e);switch(t){case`text`:return{...n,title:`CamStack`,body:`Test notification — text only.`};case`image`:return K(e,`image`,`Test notification with an image.`);case`gif`:return K(e,`gif`,`Test notification with an animation.`);case`video`:return K(e,`video`,`Test notification with a video.`);case`audio`:return K(e,`audio`,`Test notification with audio.`);case`actions`:{let t=Array.from({length:e.actions},(e,t)=>({label:`Action ${t+1}`,url:`/`}));return{...n,title:`CamStack`,body:`Test notification with action buttons.`,actions:t,...e.clickUrl?{clickUrl:`/`}:{}}}case`critical`:{let t=ge(e);return{...n,title:`CamStack`,body:`Critical test notification.`,priority:5,level:t?.id??``}}case`overflow`:return{...n,body:`X`.repeat(e.bodyMaxLen+50)}}}var xe={text:`Text only`,image:`With image`,gif:`With GIF`,video:`With video`,audio:`With audio`,actions:`With buttons`,critical:`Critical`,overflow:`Overflow (advanced)`},q=`w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none`,J=`block text-[11px] font-medium text-foreground mb-1`;function Se({target:e,kind:r,open:i,onClose:a}){let o=P(),s=S(()=>ue(r.caps),[r.caps]),c=S(()=>ye(r.caps),[r.caps]),[u,f]=D(()=>G(r.caps)),[p,h]=D(null),g=S(()=>me(r.caps,u),[r.caps,u]),_=u.body.length,b=_>s.bodyMaxLen,C=e=>f(t=>({...t,...e})),w=O({mutationFn:()=>o.trpcClient.notificationOutput.testTarget.mutate({addonId:e.addonId,targetId:e.id,sample:me(r.caps,u)}),onMutate:()=>h(null),onSuccess:e=>h(e),onError:e=>h({success:!1,error:e instanceof Error?e.message:`Test failed`})}),T=e=>{f(be(r.caps,e)),h(null)},E=(e,t,n)=>{let r=u.actions.length>0?[...u.actions]:[];for(;r.length<=e;)r.push({label:``,url:``});r[e]={...r[e],[t]:n},C({actions:r})};return k(y,{open:i,onOpenChange:e=>!e&&a(),children:x(d,{width:`lg`,className:`!max-w-2xl`,children:[k(n,{children:x(v,{children:[`Test "`,e.name,`" (`,r.label,`)`]})}),x(`div`,{className:`space-y-4 max-h-[60vh] overflow-y-auto pr-1`,children:[k(`div`,{className:`flex flex-wrap gap-1.5`,children:c.map(e=>k(t,{size:`sm`,variant:`outline`,type:`button`,onClick:()=>T(e),children:xe[e]},e))}),x(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[s.levels.length>0&&x(`div`,{children:[k(`label`,{className:J,children:`Level`}),x(`select`,{className:q,value:u.level,onChange:e=>C({level:e.target.value}),children:[k(`option`,{value:``,children:`— derive from priority —`}),s.levels.map(e=>x(`option`,{value:e.id,children:[e.label,e.ordinal===null?` (qualitative)`:` (p${e.ordinal})`]},e.id))]}),(()=>{let e=s.levels.find(e=>e.id===u.level);return e?x(`div`,{className:`mt-1 space-y-1`,children:[e.description&&k(`p`,{className:`text-[10px] text-foreground-subtle`,children:e.description}),x(`div`,{className:`flex flex-wrap gap-1`,children:[e.flags?.critical&&k(m,{variant:`danger`,"data-testid":`flag-critical`,children:`critical`}),e.flags?.silent&&k(m,{variant:`info`,children:`silent`}),e.flags?.noPush&&k(m,{variant:`warning`,children:`no-push`})]}),e.requires&&e.requires.length>0&&x(`p`,{className:`text-[10px] text-warning`,children:[`Requires target config: `,e.requires.join(`, `)]})]}):null})()]}),x(`div`,{children:[x(`label`,{className:J,children:[`Priority (ordinal): `,u.priority]}),k(`input`,{type:`range`,min:1,max:5,step:1,value:u.priority,onChange:e=>C({priority:Number(e.target.value)}),className:`w-full accent-primary`,"aria-label":`priority`})]})]}),s.formats.length>0&&x(`div`,{children:[k(`label`,{className:J,children:`Format`}),k(`div`,{className:`flex flex-wrap gap-2`,children:s.formats.map(e=>x(`label`,{className:`flex items-center gap-1.5 text-xs text-foreground cursor-pointer`,children:[k(`input`,{type:`radio`,name:`format`,className:`accent-primary`,checked:u.format===e,onChange:()=>C({format:e})}),e]},e))})]}),x(`div`,{children:[k(`label`,{className:J,children:`Title`}),k(`input`,{className:q,value:u.title,onChange:e=>C({title:e.target.value})})]}),x(`div`,{children:[x(`label`,{className:J,children:[`Body`,` `,x(`span`,{className:b?`text-danger`:`text-foreground-subtle`,children:[`(`,_,`/`,s.bodyMaxLen,b?` — overflow`:``,`)`]})]}),k(`textarea`,{className:`${q} min-h-[80px] resize-y`,value:u.body,onChange:e=>C({body:e.target.value})})]}),s.attachmentSlots.length>0&&x(`div`,{children:[x(`label`,{className:J,children:[`Attachments`,` `,x(`span`,{className:`text-foreground-subtle`,children:[`(mode: `,s.attachmentMode,`, max `,s.attachmentMax,s.attachmentMaxBytes?`, ≤${Math.round(s.attachmentMaxBytes/1024/1024)}MB`:``,`)`]})]}),k(`div`,{className:`space-y-1.5`,children:s.attachmentSlots.map(e=>x(`div`,{className:`flex items-center gap-2`,children:[k(`span`,{className:`text-[10px] w-12 shrink-0 text-foreground-subtle`,children:e}),k(`input`,{className:q,placeholder:`${e} URL`,value:u.attachmentUrls[e]??``,onChange:t=>C({attachmentUrls:{...u.attachmentUrls,[e]:t.target.value}})})]},e))})]}),s.showActions&&x(`div`,{children:[x(`label`,{className:J,children:[`Actions (up to `,s.maxActions,`)`]}),k(`div`,{className:`space-y-1.5`,children:Array.from({length:Math.min(s.maxActions,3)},(e,t)=>x(`div`,{className:`flex items-center gap-2`,children:[k(`input`,{className:q,placeholder:`label`,value:u.actions[t]?.label??``,onChange:e=>E(t,`label`,e.target.value)}),k(`input`,{className:q,placeholder:`url`,value:u.actions[t]?.url??``,onChange:e=>E(t,`url`,e.target.value)})]},t))})]}),x(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[s.showClickUrl&&x(`div`,{children:[k(`label`,{className:J,children:`Click URL`}),k(`input`,{className:q,value:u.clickUrl,onChange:e=>C({clickUrl:e.target.value})})]}),s.showSound&&x(`div`,{children:[k(`label`,{className:J,children:`Sound`}),k(`input`,{className:q,value:u.sound,onChange:e=>C({sound:e.target.value})})]}),s.showTtl&&x(`div`,{children:[k(`label`,{className:J,children:`TTL (seconds)`}),k(`input`,{className:q,type:`number`,value:u.ttl,onChange:e=>C({ttl:e.target.value})})]}),s.showTag&&x(`div`,{children:[k(`label`,{className:J,children:`Tag`}),k(`input`,{className:q,value:u.tag,onChange:e=>C({tag:e.target.value})})]})]}),p&&k(Ce,{result:p}),x(`details`,{className:`text-[10px]`,children:[k(`summary`,{className:`cursor-pointer text-foreground-subtle`,children:`Payload preview`}),k(`pre`,{className:`mt-1 overflow-x-auto rounded bg-surface p-2 text-foreground-subtle`,children:JSON.stringify(g,null,2)})]})]}),x(l,{children:[k(t,{variant:`secondary`,size:`sm`,type:`button`,onClick:a,children:`Close`}),x(t,{size:`sm`,type:`button`,disabled:w.isPending||u.body.length===0,onClick:()=>w.mutate(),children:[w.isPending?k(V,{className:`h-3.5 w-3.5 animate-spin`}):k(z,{className:`h-3.5 w-3.5`}),`Send test`]})]})]})})}function Ce({result:e}){let t=e.renderedAs;return x(`div`,{className:`rounded-md border px-3 py-2 text-xs ${e.success?`border-success/40 bg-success/10`:`border-danger/40 bg-danger/10`}`,"data-testid":`test-result`,children:[x(`div`,{className:`flex items-center gap-2 font-medium`,children:[e.success?k(F,{className:`h-3.5 w-3.5 text-success`}):k(B,{className:`h-3.5 w-3.5 text-danger`}),k(`span`,{children:e.success?`Delivered`:`Failed`})]}),e.error&&k(`p`,{className:`mt-1 text-danger`,children:e.error}),t&&x(`dl`,{className:`mt-2 grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11px] text-foreground-subtle`,children:[k(`dt`,{children:`Resolved level`}),k(`dd`,{className:`text-foreground`,children:t.level}),k(`dt`,{children:`Format sent`}),k(`dd`,{className:`text-foreground`,children:t.format}),k(`dt`,{children:`Attachments sent`}),k(`dd`,{className:`text-foreground`,children:t.attachmentsSent}),k(`dt`,{children:`Actions sent`}),k(`dd`,{className:`text-foreground`,children:t.actionsSent}),k(`dt`,{children:`Truncated`}),k(`dd`,{className:`text-foreground`,children:t.truncated?`yes`:`no`}),k(`dt`,{children:`Dropped`}),k(`dd`,{className:`text-foreground`,children:t.dropped.length>0?t.dropped.join(`, `):`—`})]})]})}function we(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.addonId);e?e.push(r):(n.set(r.addonId,[r]),t.push(r.addonId))}return t.map(e=>({addonId:e,kinds:n.get(e)??[]}))}function Te(e){let t=[],n=e=>{for(let r of e){if(r.type===`password`){t.push(r.key);continue}if(r.type===`group`){n(r.fields);continue}if(r.type===`sub-tabs`)for(let e of r.tabs)n(e.fields)}};for(let t of e.sections)n(t.fields);return t}function Ee(e,t,n){let r=new Set(n),i={};for(let[n,a]of Object.entries(e)){if(!r.has(n)){i[n]=a;continue}a==null||a===``||a!==t[n]&&(i[n]=a)}return i}function De(e,t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))r[t]=n.has(t)?``:i;return r}b();var Oe=[`notificationOutput`,`listTargets`],ke=[`notificationOutput`,`listTargetKinds`],Ae=[`userManagement`,`listUsers`],Y=`ownerUserId`;function je(e){let t=e.config[Y];return typeof t==`string`&&t.length>0?t:null}function Me(e){return[{key:`name`,header:`Target`,render:t=>{let n=e.kindByKey.get(t.kind);return x(`span`,{className:`flex items-center gap-2`,children:[k(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-surface text-xs`,title:n?.label??t.kind,children:k(Ne,{kind:n,imgClassName:`h-5 w-5 object-contain`,fallbackClassName:``})}),k(`span`,{className:`truncate text-sm font-medium text-foreground`,children:t.name}),!t.enabled&&k(m,{variant:`warning`,children:`disabled`})]})}},{key:`kind`,header:`Kind`,nowrap:!0,render:t=>k(`span`,{className:`text-[11px] text-foreground-subtle`,children:e.kindByKey.get(t.kind)?.label??t.kind})},{key:`owner`,header:`Owner`,nowrap:!0,render:t=>{let n=je(t);return n===null?k(m,{variant:`default`,children:`system`}):k(`span`,{className:`text-[11px] text-foreground`,children:e.userNameById.get(n)??n})}},{key:`enabled`,header:`On`,align:`center`,nowrap:!0,render:t=>k(u,{checked:t.enabled,onCheckedChange:n=>e.onToggle(t,n),"aria-label":`toggle ${t.name}`})},{key:`actions`,header:``,align:`right`,nowrap:!0,render:n=>{let r=e.kindByKey.get(n.kind);return x(`span`,{className:`flex items-center justify-end gap-1`,children:[k(t,{size:`sm`,variant:`ghost`,type:`button`,disabled:!r,onClick:()=>e.onTest(n),title:`Test`,children:k(z,{className:`h-3.5 w-3.5`})}),k(t,{size:`sm`,variant:`ghost`,type:`button`,disabled:!r,onClick:()=>r&&e.onEdit(n,r),title:`Edit`,children:k(L,{className:`h-3.5 w-3.5`})}),k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:()=>e.onDelete(n),title:`Delete`,children:k(ie,{className:`h-3.5 w-3.5 text-danger`})})]})}}]}function Ne({kind:e,imgClassName:t,fallbackClassName:n}){return e?.iconUrl?k(`img`,{src:e.iconUrl,alt:e.label,className:t,loading:`lazy`,draggable:!1}):k(`span`,{className:n,children:e?.icon??`🔔`})}function Pe(){let e=P(),[n,r]=D({mode:`closed`}),[i,o]=D(null),c=C({queryKey:Oe,queryFn:()=>e.trpcClient.notificationOutput.listTargets.query({})}),l=C({queryKey:ke,queryFn:async()=>(await e.trpcClient.notificationOutput.listTargetKinds.query({})).map(e=>{let t=e.iconUrl;return{...e,configSchema:e.configSchema,iconUrl:t}})}),u=S(()=>l.data??[],[l.data]),d=S(()=>{let e=new Map;for(let t of u)e.set(t.kind,t);return e},[u]),f=C({queryKey:Ae,queryFn:()=>e.trpcClient.userManagement.listUsers.query()}),p=S(()=>{let e=new Map;for(let t of f.data??[])e.set(t.id,t.username);return e},[f.data]),m=O({mutationFn:t=>e.trpcClient.notificationOutput.setTargetEnabled.mutate({addonId:t.target.addonId,targetId:t.target.id,enabled:t.enabled}),onSuccess:()=>void c.refetch()}),h=O({mutationFn:t=>e.trpcClient.notificationOutput.deleteTarget.mutate({addonId:t.addonId,targetId:t.id}),onSuccess:()=>void c.refetch()}),_=i?d.get(i.kind):void 0;return x(ae,{icon:ne,title:`Notification Targets`,subtitle:`Deliver notifications to ntfy, Pushover, Telegram, Home Assistant and more. Each target's kind declares its capabilities; the test panel shows exactly what a message degrades to.`,actions:x(t,{size:`sm`,type:`button`,onClick:()=>r({mode:`pick-kind`}),children:[k(R,{className:`h-3.5 w-3.5`}),`Add target`]}),children:[c.isLoading&&k(`div`,{className:`flex items-center justify-center py-16`,children:k(V,{className:`h-6 w-6 animate-spin text-primary`})}),c.isError&&!c.isLoading&&k(a,{title:`Failed to load targets`,message:c.error instanceof Error?c.error.message:`Unknown error`,onRetry:()=>void c.refetch()}),!c.isLoading&&!c.isError&&(c.data??[]).length===0&&k(`div`,{className:`text-xs text-foreground-subtle text-center py-16`,children:`No notification targets yet. Click "Add target" to configure one.`}),(c.data??[]).length>0&&k(s,{children:k(g,{columns:Me({kindByKey:d,userNameById:p,onToggle:(e,t)=>m.mutate({target:e,enabled:t}),onTest:o,onEdit:(e,t)=>r({mode:`form`,kind:t,target:e}),onDelete:e=>h.mutate(e)}),rows:c.data??[],rowKey:e=>e.id,minWidthPx:720,bordered:!1})}),n.mode===`pick-kind`&&k(Fe,{kinds:u,onCancel:()=>r({mode:`closed`}),onPick:e=>r({mode:`form`,kind:e,target:null})}),n.mode===`form`&&k(Ie,{kind:n.kind,target:n.target,users:f.data??[],onCancel:()=>r({mode:`closed`}),onSaved:()=>{r({mode:`closed`}),c.refetch()}}),i&&_&&k(Se,{target:i,kind:_,open:!0,onClose:()=>o(null)})]})}function Fe({kinds:e,onPick:n,onCancel:r}){let i=S(()=>we(e),[e]);return x(s,{className:`p-4 space-y-4`,children:[x(`div`,{className:`flex items-center justify-between`,children:[k(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Choose a notification kind`}),k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:r,children:`Cancel`})]}),i.length===0&&k(`p`,{className:`text-xs text-foreground-subtle`,children:`No notification providers are installed. Install the notifiers addon (or connect Home Assistant) to add targets.`}),i.map(e=>x(`div`,{children:[k(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1.5`,children:e.addonId}),k(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2`,children:e.kinds.map(t=>x(`button`,{type:`button`,onClick:()=>n(t),className:`flex flex-col items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-3 text-xs hover:border-primary/50 hover:bg-surface-hover transition-colors`,children:[k(Ne,{kind:t,imgClassName:`h-7 w-7 object-contain`,fallbackClassName:`text-lg leading-7`}),k(`span`,{className:`font-medium text-foreground`,children:t.label}),t.supportsDiscovery&&k(m,{variant:`info`,style:`outline`,children:`discover`})]},`${e.addonId}:${t.kind}`))})]},e.addonId))]})}function Ie({kind:e,target:n,users:r,onSaved:a,onCancel:o}){let l=P(),u=S(()=>Te(e.configSchema),[e.configSchema]),d=S(()=>n?.config??{},[n]),[f,p]=D(n?.name??e.label),[m,h]=D(()=>n?De(n.config,u):{}),[g,_]=D(null),[v,y]=D(null),[b,C]=D(n?je(n)??``:``),w=O({mutationFn:()=>l.trpcClient.notificationOutput.discoverTargets.query({addonId:e.addonId,kind:e.kind,config:m}),onSuccess:e=>_(e),onError:e=>y(e instanceof Error?e.message:`Discovery failed`)}),T=O({mutationFn:()=>{let{[Y]:t,...r}=Ee(m,d,u),i=b===``?r:{...r,[Y]:b},a={id:n?.id??`${e.kind}-${Date.now()}`,name:f,kind:e.kind,addonId:e.addonId,enabled:n?.enabled??!0,config:i};return l.trpcClient.notificationOutput.upsertTarget.mutate({addonId:e.addonId,target:a})},onSuccess:a,onError:e=>y(e instanceof Error?e.message:`Save failed`)}),E=e=>{p(e.suggestedName),h(t=>({...t,...e.config})),_(null)};return x(s,{className:`p-4 space-y-4`,children:[x(`div`,{className:`flex items-center justify-between`,children:[x(`h3`,{className:`text-sm font-semibold text-foreground flex items-center gap-2`,children:[k(Ne,{kind:e,imgClassName:`h-5 w-5 object-contain`,fallbackClassName:`text-lg`}),n?`Edit ${n.name}`:`Add ${e.label} target`]}),k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:o,children:`Cancel`})]}),v&&k(`div`,{className:`rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger`,children:v}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Name`}),k(`input`,{className:`w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none`,value:f,onChange:e=>p(e.target.value)})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Owner`}),k(i,{value:b,options:[{value:``,label:`System (shared, admin-managed)`},...r.map(e=>({value:e.id,label:e.username}))],onChange:e=>C(e.target.value)}),k(`p`,{className:`mt-0.5 text-[10px] text-foreground-subtle`,children:`A user-owned target belongs to that user: it shows in their viewer and their own rules may deliver to it. System targets stay admin-managed.`})]}),e.supportsDiscovery&&x(`div`,{className:`space-y-2`,children:[x(t,{size:`sm`,variant:`outline`,type:`button`,disabled:w.isPending,onClick:()=>{y(null),w.mutate()},children:[w.isPending?k(V,{className:`h-3.5 w-3.5 animate-spin`}):k(te,{className:`h-3.5 w-3.5`}),`Discover`]}),g&&g.length===0&&k(`p`,{className:`text-[11px] text-foreground-subtle`,children:`No candidates discovered.`}),g&&g.length>0&&k(`div`,{className:`rounded-md border border-border divide-y divide-border`,children:g.map((e,t)=>x(`button`,{type:`button`,onClick:()=>E(e),className:`flex w-full items-center justify-between px-3 py-1.5 text-xs hover:bg-surface-hover`,children:[k(`span`,{className:`text-foreground`,children:e.suggestedName}),k(`span`,{className:`text-[10px] text-primary`,children:`use`})]},`${e.suggestedName}-${t}`))})]}),u.length>0&&n&&k(`p`,{className:`text-[10px] text-foreground-subtle`,children:`Secret fields are hidden. Leave them blank to keep the stored value; type a new value to replace it.`}),k(c,{schema:e.configSchema,values:m,onChange:h}),x(`div`,{className:`flex justify-end gap-2`,children:[k(t,{variant:`secondary`,size:`sm`,type:`button`,onClick:o,children:`Cancel`}),x(t,{size:`sm`,type:`button`,disabled:T.isPending||f.trim().length===0,onClick:()=>{y(null),T.mutate()},children:[T.isPending&&k(V,{className:`h-3.5 w-3.5 animate-spin`}),n?`Save changes`:`Create target`]})]})]})}function X(e){return t=>Object.prototype.hasOwnProperty.call(e,t)}var Le=X({devices:!0}),Re=X({classes:!0,classesExclude:!0,labelEquals:!0,identities:!0,identitiesExclude:!0,eventTypeTokens:!0,sensorKinds:!0}),ze=X({zonesExclude:!0}),Be=X({minConfidence:!0,minImportance:!0,minLabelConfidence:!0}),Ve=X({minDwellSeconds:!0}),He=X({source:!0}),Ue=X({crossing:!0}),We=X({packagePhase:!0}),Ge=X({zones:!0}),Ke=X({plates:!0}),qe=X({occupancy:!0});function Z(e,t){let n=e[t];return Array.isArray(n)?n:[]}function Je(e,t){let n=e[t];return typeof n==`number`?n:void 0}var Ye=[{id:`scope`,label:`Scope`},{id:`class`,label:`Classes`},{id:`zones`,label:`Zones`},{id:`quality`,label:`Quality`},{id:`label`,label:`Identity & plates`},{id:`device`,label:`Device event`},{id:`package`,label:`Package`},{id:`occupancy`,label:`Occupancy`},{id:`schedule`,label:`Schedule`}];function Xe(e){let t=e.replace(/[-_]/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function Ze(e,t){let n=e.filter(t),r=new Set(Ye.map(e=>e.id)),i=[];for(let e of Ye){let t=n.filter(t=>t.group===e.id);t.length>0&&i.push({id:e.id,label:e.label,descriptors:t})}let a=[];for(let e of n)r.has(e.group)||a.includes(e.group)||a.push(e.group);for(let e of a)i.push({id:e,label:Xe(e),descriptors:n.filter(t=>t.group===e)});return i}b();function Qe(e,t){let n=P().trpcClient,r=T({queries:e.map(e=>({queryKey:[[`nc-pickers`,`zones`],{deviceId:e}],staleTime:3e4,queryFn:async()=>({deviceId:e,zones:(await n.zones.listZones.query({deviceId:e})).map(e=>({id:e.id,name:e.name}))})}))});return S(()=>{let e=[],n=new Set;for(let i of r){if(!i.data)continue;let r=t.find(e=>e.id===i.data.deviceId)?.name;for(let t of i.data.zones)n.has(t.id)||(n.add(t.id),e.push({value:t.id,label:t.name,...r===void 0?{}:{hint:r}}))}return{options:e,loading:r.some(e=>e.isLoading)}},[r,t])}function $e(e){let t=P().trpcClient,n=T({queries:e.map(e=>({queryKey:[[`nc-pickers`,`event-kinds`],{deviceId:e}],staleTime:6e4,queryFn:async()=>(await t.pipelineAnalytics.listEventKinds.query({deviceId:e})).map(e=>({kind:e.kind,label:e.label}))}))});return S(()=>{let e=new Map;for(let t of n)for(let n of t.data??[])e.has(n.kind)||e.set(n.kind,n.label);let t=[...e.entries()].map(([e,t])=>({value:e,label:t}));return t.sort((e,t)=>e.label.localeCompare(t.label)),{options:t,loading:n.some(e=>e.isLoading)}},[n])}function et(){let t=e();return S(()=>({options:(t.data??[]).map(e=>({value:e.name,label:e.name})),loading:t.isLoading}),[t.data,t.isLoading])}function tt(){let e=o({limit:200});return S(()=>{let t=new Set;for(let n of e.data??[])n.text.trim().length>0&&t.add(n.text);return[...t].sort()},[e.data])}function nt({options:e,value:t,onChange:n,loading:r,emptyHint:i,placeholder:a}){let[o,s]=D(``),c=S(()=>new Set(e.map(e=>e.value)),[e]),l=S(()=>new Set(t),[t]),u=t.filter(e=>!c.has(e)),d=e=>{n(l.has(e)?t.filter(t=>t!==e):[...t,e])},f=()=>{let e=o.trim();e.length===0||t.includes(e)||(n([...t,e]),s(``))};return x(`div`,{className:`mt-1 space-y-1.5`,children:[u.length>0&&k(`div`,{className:`flex flex-wrap gap-1`,children:u.map(e=>x(`button`,{type:`button`,onClick:()=>n(t.filter(t=>t!==e)),className:`inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground hover:bg-surface-hover`,title:`Custom value — click to remove`,children:[e,` ×`]},e))}),e.length>0?k(`div`,{className:`max-h-40 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:e.map(e=>x(`label`,{className:`flex items-center gap-2.5 px-3 py-1.5 text-xs text-foreground cursor-pointer hover:bg-surface-hover`,children:[k(`input`,{type:`checkbox`,checked:l.has(e.value),onChange:()=>d(e.value),className:`accent-primary`}),k(`span`,{className:`flex-1 truncate`,children:e.label}),e.hint!==void 0&&k(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.hint})]},e.value))}):k(`p`,{className:`text-[10px] text-foreground-subtle`,children:r===!0?`Loading…`:i}),k(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:a,className:`w-full rounded-md border border-border bg-background px-2 py-1 text-xs text-foreground placeholder:text-foreground-subtle`})]})}var Q=[{value:`immediate`,label:`Immediate`,hint:`Fires on the first matching detection of a track (lowest latency).`},{value:`track-end`,label:`Track end`,hint:`Evaluates the finalised track record when it closes.`},{value:`device-event`,label:`Device event`,hint:`Doorbell press / sensor state change on a linked device.`},{value:`package-event`,label:`Package event`,hint:`A parcel delivery or pick-up.`}];function rt(e){return Q.find(t=>t.value===e)?.label??e}function it(e){return Q.find(t=>t.value===e)?.value}var at=[{value:`best`,label:`Best available image`,description:`The best subject crop available when the notification is sent.`},{value:`best-matching`,label:`Best matching image`,description:`The image that explains why the rule fired — the face crop for an identity rule, the plate crop for a plate rule; falls back to the best image otherwise.`},{value:`keyFrame`,label:`Key frame`,description:`The clean full scene frame with no subject box.`},{value:`none`,label:`No attachment`,description:`Send the notification with no image.`}];function ot(e){return at.find(t=>t.value===e)?.value}var st=[{value:``,label:`Automatic`},{value:`cropped`,label:`Cropped on the subject`},{value:`full`,label:`Full frame`},{value:`boxed`,label:`Full frame with boxes`}];function ct(e){let t=st.find(t=>t.value===e)?.value;return t===``?void 0:t}var lt=[{value:``,label:`Lowest available`},{value:`low`,label:`Low`},{value:`mid`,label:`Medium`},{value:`high`,label:`High`}];function ut(e){let t=lt.find(t=>t.value===e)?.value;return t===``?void 0:t}var dt=[{value:`any`,label:`Any source`},{value:`pipeline`,label:`Pipeline`},{value:`onboard`,label:`Onboard (camera)`},{value:`sensor`,label:`Sensor`}],ft=[{value:`delivered`,label:`Delivered`},{value:`picked-up`,label:`Picked up`},{value:`both`,label:`Both`}],pt=[{value:``,label:`Not set — entering`,hint:`Entries, and every detection that is not a crossing at all. Exits are excluded. This is what a rule without a crossing condition already does, and choosing it writes nothing to the rule.`},{value:`enter`,label:`Entered a zone`,hint:`The same matches as "not set", stated explicitly: entries and non-crossing detections pass, exits do not.`},{value:`exit`,label:`Left a zone`,hint:`ONLY an exit crossing. A detection that is not a crossing fails, so this rule cannot fire on ordinary movement — pair it with the zones the subject must have left.`},{value:`any`,label:`Entered or left`,hint:`No direction filter: entries, exits and non-crossing detections alike. This is the only choice that adds exits to what the rule already matched.`}];function mt(e){let t=pt.find(t=>t.value===e)?.value;return t===``||t===void 0?void 0:t}var ht=[{value:`any`,label:`Any of`},{value:`all`,label:`All of`}],gt=[{value:1,label:`1 — Min`},{value:2,label:`2 — Low`},{value:3,label:`3 — Default`},{value:4,label:`4 — High`},{value:5,label:`5 — Max`}];function _t(){return{name:``,enabled:!0,delivery:`immediate`,targetIds:[],targetUsers:[],targetParams:{},priority:3,mediaAttach:`best`,mediaZoneCrop:!1,mediaFrame:void 0,mediaGif:!1,mediaClip:!1,mediaProfile:void 0,mediaClipSpeed:void 0,templateTitle:``,templateBody:``,conditions:{},schedule:void 0,snoozeAllowGlobal:!1}}function vt(e){let t={};for(let n of e.targets)n.params&&Object.keys(n.params).length>0&&(t[n.targetId]=n.params);return{name:e.name,enabled:e.enabled,delivery:e.delivery,targetIds:e.targets.map(e=>e.targetId),targetUsers:e.targetUsers??[],targetParams:t,priority:e.priority,mediaAttach:e.media.attach,mediaZoneCrop:e.media.zoneCrop===!0,mediaFrame:e.media.frame,mediaGif:e.media.gif===!0,mediaClip:e.media.clip===!0,mediaProfile:e.media.profile,mediaClipSpeed:e.media.clipSpeed,templateTitle:e.template?.title??``,templateBody:e.template?.body??``,conditions:e.conditions,schedule:e.schedule,snoozeAllowGlobal:e.snoozeAllowGlobal===!0}}function yt(e){return e.name.trim().length>0&&(e.targetIds.length>0||e.targetUsers.length>0)}function bt(e,t){return e.appliesTo.includes(t)}var xt={source:`any`};function St(e,t){if(t==null)return!0;if(Array.isArray(t))return t.length===0;if(typeof t==`string`)return t.length===0||xt[e]===t;if(typeof t==`number`)return!Number.isFinite(t);if(typeof t==`object`){if(`ids`in t){let e=t.ids;return!Array.isArray(e)||e.length===0}if(`values`in t){let e=t.values;return!Array.isArray(e)||e.length===0}return!1}return!1}function Ct(e,t,n){let r=n.length===0?null:new Set(n.filter(e=>e.id!==`schedule`&&bt(e,t)).map(e=>e.id)),i={};for(let[t,n]of Object.entries(e))r!==null&&!r.has(t)||St(t,n)||(i[t]=n);return i}function wt(e){return e!==void 0&&e.windows.length>0}function Tt(e,t,n=[]){let r=e.templateTitle.trim(),i=e.templateBody.trim(),a=r.length>0||i.length>0?{...r.length>0?{title:r}:{},...i.length>0?{body:i}:{}}:void 0,o=(n.length===0||n.some(t=>t.id===`schedule`&&bt(t,e.delivery)))&&wt(e.schedule)?e.schedule:void 0;return{name:e.name.trim(),enabled:e.enabled,delivery:e.delivery,conditions:Ct(e.conditions,e.delivery,n),...o?{schedule:o}:{},targets:e.targetIds.map(t=>{let n=e.targetParams[t];return n&&Object.keys(n).length>0?{targetId:t,params:n}:{targetId:t}}),...e.targetUsers.length>0?{targetUsers:[...e.targetUsers]}:{},media:{attach:e.mediaAttach,...e.mediaZoneCrop?{zoneCrop:!0}:{},...e.mediaFrame===void 0?{}:{frame:e.mediaFrame},...e.mediaGif?{gif:!0}:{},...e.mediaClip?{clip:!0}:{},...e.mediaProfile===void 0?{}:{profile:e.mediaProfile},...e.mediaClipSpeed===void 0?{}:{clipSpeed:e.mediaClipSpeed}},throttle:t?.throttle??{cooldownSec:60,scope:`rule-device`},priority:e.priority,...a?{template:a}:{},...e.snoozeAllowGlobal?{snoozeAllowGlobal:!0}:{}}}function Et(e,t){return e.options&&e.options.length>0?e.options:t}var Dt=[{value:``,label:`Default (2×)`},{value:`1`,label:`1× — real time`},{value:`2`,label:`2×`},{value:`3`,label:`3×`},{value:`4`,label:`4×`},{value:`6`,label:`6×`},{value:`8`,label:`8×`}];function Ot(e){if(e===``)return;let t=Number(e);return Number.isFinite(t)&&t>=1&&t<=8?t:void 0}var kt=[{key:`rule`,label:`Rule`,fields:[`name`,`enabled`,`delivery`,`targetIds`,`targetUsers`,`targetParams`]},{key:`conditions`,label:`Conditions`,fields:[`conditions`,`schedule`]},{key:`notification`,label:`Notification`,fields:[`priority`,`mediaAttach`,`mediaFrame`,`mediaZoneCrop`,`mediaGif`,`mediaClip`,`mediaProfile`,`mediaClipSpeed`,`templateTitle`,`templateBody`]},{key:`advanced`,label:`Advanced`,fields:[`snoozeAllowGlobal`]}],At=`rule`;function jt(e){return kt.find(t=>t.key===e)?.key}b();var Mt=`block text-[11px] font-medium text-foreground`,$=`text-[10px] text-foreground-subtle mt-0.5`;function Nt({cameras:e,value:t,onChange:n}){if(e.length===0)return k(`p`,{className:$,children:`No cameras available — the rule applies to all devices.`});let r=e=>n(t.includes(e)?t.filter(t=>t!==e):[...t,e]);return k(`div`,{className:`mt-1 max-h-40 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:e.map(e=>x(`label`,{className:`flex items-center gap-2.5 px-3 py-1.5 text-xs text-foreground cursor-pointer hover:bg-surface-hover`,children:[k(`input`,{type:`checkbox`,checked:t.includes(e.id),onChange:()=>r(e.id),className:`accent-primary`}),k(`span`,{className:`flex-1 truncate`,children:e.name})]},e.id))})}function Pt({value:e,placeholder:t,onChange:n}){let[i,a]=D(``),o=()=>{let t=i.trim();if(t.length===0||e.includes(t)){a(``);return}n([...e,t]),a(``)},s=t=>n(e.filter(e=>e!==t));return x(`div`,{className:`mt-1 space-y-1.5`,children:[e.length>0&&k(`div`,{className:`flex flex-wrap gap-1`,children:e.map(e=>x(`span`,{className:`inline-flex items-center gap-1 rounded bg-surface-hover px-1.5 py-0.5 text-[11px] text-foreground`,children:[e,k(`button`,{type:`button`,onClick:()=>s(e),"aria-label":`remove ${e}`,className:`text-foreground-subtle hover:text-danger`,children:k(re,{className:`h-3 w-3`})})]},e))}),k(r,{value:i,placeholder:t,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},onBlur:o})]})}function Ft({picker:e,value:t,onChange:n}){let r=S(()=>j(e),[e]),i=S(()=>new Set(t),[t]),a=t.filter(e=>!r.has(e)),o=e=>{n(i.has(e)?t.filter(t=>t!==e):[...t,e])};return x(`div`,{className:`space-y-2`,children:[a.length>0&&k(`div`,{className:`flex flex-wrap gap-1`,children:a.map(e=>x(`button`,{type:`button`,onClick:()=>n(t.filter(t=>t!==e)),className:`inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground hover:bg-surface-hover`,title:`Custom value — click to remove`,children:[e,` ×`]},e))}),e.groups.map(e=>x(`div`,{children:[k(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-muted mb-1`,children:e.fallbackLabel}),k(`div`,{className:`flex flex-wrap gap-1`,children:e.options.map(e=>{let t=i.has(e.value);return k(`button`,{type:`button`,"aria-pressed":t,onClick:()=>o(e.value),className:t?`rounded border border-primary bg-primary/15 px-1.5 py-0.5 text-[10px] text-foreground`:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground hover:bg-surface-hover`,children:e.label},e.value)})})]},e.key))]})}function It({value:e,min:t,max:n,step:i,onChange:a}){return x(`div`,{className:`mt-1 flex items-center gap-2`,children:[k(r,{type:`number`,value:e??``,min:t,max:n,step:i,className:`max-w-[8rem]`,onChange:e=>{let t=e.target.value;if(t===``){a(void 0);return}let n=Number(t);a(Number.isFinite(n)?n:void 0)}}),e!==void 0&&n!==void 0&&k(`input`,{type:`range`,min:t,max:n,step:i,value:e,onChange:e=>a(Number(e.target.value)),className:`flex-1 accent-primary`,"aria-label":`value`})]})}function Lt({value:e,onChange:t,options:n}){let r=e??``,a=n&&n.length>0?n:pt,o=a.find(e=>e.value===r);return x(`div`,{className:`mt-1 space-y-1`,children:[k(i,{value:r,options:a.map(e=>({value:e.value,label:e.label})),onChange:e=>t(mt(e.target.value))}),o!==void 0&&k(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:o.hint})]})}function Rt({deviceIds:e,cameras:t,value:n,onChange:r}){let a=n?.ids??[],o=n?.match??`any`,s=e=>r(e.length>0?{ids:e,match:o}:void 0),c=e=>r(a.length>0?{ids:a,match:e}:void 0);return x(`div`,{className:`mt-1 space-y-1.5`,children:[k(`div`,{className:`max-w-[10rem]`,children:k(i,{value:o,options:ht.map(e=>({value:e.value,label:e.label})),onChange:e=>c(e.target.value===`all`?`all`:`any`)})}),k(zt,{deviceIds:e,cameras:t,value:a,onChange:s})]})}function zt({deviceIds:e,cameras:t,value:n,onChange:r}){let{options:i,loading:a}=Qe(e,t);return k(nt,{options:i,value:n,onChange:r,loading:a,emptyHint:e.length===0?`Select cameras above to pick their zones by name — or type a zone id.`:`The selected cameras have no zones — type a zone id if you know one.`,placeholder:`Zone id…`})}function Bt({value:e,onChange:t}){let{options:n,loading:r}=et();return k(nt,{options:n,value:e,onChange:t,loading:r,emptyHint:`No identities in the face gallery yet — type a name.`,placeholder:`Identity name…`})}function Vt({deviceIds:e,value:t,onChange:n}){let{options:r,loading:i}=$e(e);return k(nt,{options:r,value:t,onChange:n,loading:i,emptyHint:e.length===0?`Select cameras above to pick their event kinds — or type a token.`:`No event kinds reported for the selected cameras — type a token.`,placeholder:`Event token…`})}var Ht=[{value:`became-occupied`,label:`Became occupied`},{value:`became-free`,label:`Became free`},{value:`>=`,label:`Count ≥`},{value:`<=`,label:`Count ≤`}],Ut={op:`became-occupied`,count:1,sustainSeconds:15};function Wt({deviceIds:e,cameras:t,classOptions:n,value:a,onChange:o}){let{options:s,loading:c}=Qe(e,t),l=a??Ut,u=e=>o({...l,...e}),d=l.op===`became-occupied`||l.op===`became-free`;return x(`div`,{className:`mt-1 space-y-1.5`,children:[x(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[k(`div`,{className:`min-w-[10rem]`,children:k(i,{value:l.zoneId??``,options:[{value:``,label:c?`Loading zones…`:`— whole frame —`},...s.map(e=>({value:e.value,label:e.label}))],onChange:e=>u({zoneId:e.target.value===``?void 0:e.target.value})})}),k(`div`,{className:`min-w-[9rem]`,children:k(i,{value:l.className??``,options:[{value:``,label:`— any class —`},...n.map(e=>({value:e.value,label:e.label}))],onChange:e=>u({className:e.target.value===``?void 0:e.target.value})})}),k(`div`,{className:`min-w-[9rem]`,children:k(i,{value:l.op,options:Ht.map(e=>({value:e.value,label:e.label})),onChange:e=>{let t=Ht.find(t=>t.value===e.target.value);t&&u({op:t.value})}})})]}),x(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-foreground-subtle`,children:[x(`label`,{className:`flex items-center gap-1`,children:[d?`Threshold`:`Count`,k(r,{type:`number`,min:0,className:`w-16`,value:String(l.count),onChange:e=>u({count:Math.max(0,Number(e.target.value)||0)})})]}),x(`label`,{className:`flex items-center gap-1`,children:[`Hold for`,k(r,{type:`number`,min:0,max:3600,className:`w-16`,value:String(l.sustainSeconds),onChange:e=>u({sustainSeconds:Math.min(3600,Math.max(0,Number(e.target.value)||0))})}),`s`]}),a===void 0?null:k(`button`,{type:`button`,onClick:()=>o(void 0),className:`underline hover:text-foreground`,children:`Clear`})]}),k(`p`,{className:`text-[11px] text-foreground-subtle`,children:`Counts confirmed tracked objects from zone analytics. The change must hold for the sustain window before it fires; with no snapshot for the camera or zone the rule never fires.`})]})}function Gt({value:e,onChange:t}){let n=e?.values??[],i=e?.maxDistance??1,a=e=>t(e.length>0?{values:e,maxDistance:i}:void 0),o=e=>t(n.length>0?{values:n,maxDistance:e}:void 0),s=tt().filter(e=>!n.includes(e));return x(`div`,{className:`mt-1 space-y-1.5`,children:[k(Pt,{value:n,placeholder:`Plate text…`,onChange:a}),s.length>0&&x(`div`,{className:`flex flex-wrap items-center gap-1`,children:[k(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Seen:`}),s.slice(0,12).map(e=>k(`button`,{type:`button`,onClick:()=>a([...n,e]),className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:e},e))]}),x(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[`Max distance`,k(r,{type:`number`,min:0,max:3,step:1,value:i,className:`max-w-[5rem]`,onChange:e=>{let t=Number(e.target.value);o(Number.isFinite(t)?Math.max(0,Math.min(3,t)):1)}})]})]})}var Kt=[{value:1,label:`Mon`},{value:2,label:`Tue`},{value:3,label:`Wed`},{value:4,label:`Thu`},{value:5,label:`Fri`},{value:6,label:`Sat`},{value:0,label:`Sun`}];function qt(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function Jt(e){let[t,n]=e.split(`:`),r=Number(t)*60+Number(n);return Number.isFinite(r)?Math.max(0,Math.min(1439,r)):0}function Yt(){return{days:[1,2,3,4,5],startMinute:540,endMinute:1080}}function Xt({value:e,onChange:t}){let n=e?.windows??[],r=e?.invert??!1,i=(n,r)=>{if(n.length===0){t(void 0);return}t({windows:n,...r?{invert:!0}:{},...e?.timezone?{timezone:e.timezone}:{}})},a=()=>i([...n,Yt()],r),o=e=>i(n.filter((t,n)=>n!==e),r),s=(e,t)=>i(n.map((n,r)=>r===e?t:n),r);return x(`div`,{className:`mt-1 space-y-2`,children:[n.length===0?k(`p`,{className:$,children:`Always active — add a window to restrict when the rule fires.`}):n.map((e,t)=>k(Zt,{window:e,onChange:e=>s(t,e),onRemove:()=>o(t)},t)),x(`div`,{className:`flex items-center gap-3`,children:[x(`button`,{type:`button`,onClick:a,className:`flex items-center gap-1 rounded-md bg-surface-hover px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground`,children:[k(R,{className:`h-3 w-3`}),` Add window`]}),n.length>0&&x(`label`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[k(`input`,{type:`checkbox`,checked:r,onChange:e=>i([...n],e.target.checked),className:`accent-primary`}),`Active outside the windows`]})]})]})}function Zt({window:e,onChange:t,onRemove:n}){let r=n=>{let r=e.days.includes(n)?e.days.filter(e=>e!==n):[...e.days,n];r.length!==0&&t({...e,days:r})};return x(`div`,{className:`space-y-1.5 rounded-md border border-border p-2`,children:[x(`div`,{className:`flex items-center gap-2 text-xs`,children:[k(`input`,{type:`time`,value:qt(e.startMinute),onChange:n=>t({...e,startMinute:Jt(n.target.value)}),className:`rounded-md border border-border bg-background px-1 py-0.5`}),k(`span`,{className:`text-foreground-subtle`,children:`→`}),k(`input`,{type:`time`,value:qt(e.endMinute),onChange:n=>t({...e,endMinute:Jt(n.target.value)}),className:`rounded-md border border-border bg-background px-1 py-0.5`}),k(`span`,{className:`flex-1`}),k(`button`,{type:`button`,onClick:n,"aria-label":`Remove window`,className:`text-foreground-subtle hover:text-danger`,children:k(ie,{className:`h-3.5 w-3.5`})})]}),k(`div`,{className:`flex flex-wrap gap-1`,children:Kt.map(t=>k(`button`,{type:`button`,onClick:()=>r(t.value),className:`rounded px-1.5 py-0.5 text-[10px] ${e.days.includes(t.value)?`bg-primary text-primary-foreground`:`bg-surface-hover text-foreground-subtle`}`,children:t.label},t.value))})]})}b();function Qt({catalog:e,taxonomy:t,delivery:n,conditions:r,schedule:i,cameras:a,onConditionsChange:o,onScheduleChange:s}){let c=(e,t)=>{let n={...r};t===void 0?delete n[e]:n[e]=t,o(n)},l=S(()=>Ze(e,e=>N(e.id)),[e]),u=S(()=>Ze(e,e=>!N(e.id)),[e]),[d,f]=D(()=>{if(en(r,i))return!0;try{return localStorage.getItem($t)===`1`}catch{return!1}}),p=()=>{let e=!d;f(e);try{localStorage.setItem($t,e?`1`:`0`)}catch{}},h=e=>e.map(e=>x(`div`,{className:`space-y-2.5`,children:[k(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-foreground-subtle`,children:e.label}),e.descriptors.map(e=>{let o=bt(e,n);return x(`div`,{className:o?``:`opacity-50`,"data-testid":`condition-${e.id}`,children:[x(`div`,{className:`flex items-center justify-between gap-2`,children:[k(`label`,{className:Mt,children:e.label}),!o&&x(m,{variant:`default`,children:[`not for `,e.appliesTo.join(` / `)]})]}),o?k(tn,{descriptor:e,taxonomy:t,conditions:r,schedule:i,cameras:a,onFieldChange:c,onScheduleChange:s}):k(`p`,{className:$,children:`Not evaluated for the selected trigger — switch the trigger to use it.`}),o&&e.description&&k(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:e.description})]},e.id)})]},e.id));return x(`div`,{className:`space-y-4`,children:[h(l),u.length>0&&k(`button`,{type:`button`,onClick:p,"data-testid":`nc-advanced-toggle`,className:`w-full rounded-md border border-border px-3 py-1.5 text-left text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:d?`▾ Hide advanced configurations`:`▸ Show more configurations`}),d&&h(u)]})}var $t=`camstack.nc.showAdvanced`;function en(e,t){for(let[t,n]of Object.entries(e))if(!N(t)&&n!==void 0&&!(Array.isArray(n)&&n.length===0))return!0;return t!==void 0&&t.windows.length>0}function tn({descriptor:e,taxonomy:t,conditions:n,schedule:r,cameras:a,onFieldChange:o,onScheduleChange:s}){switch(e.valueType){case`deviceIdList`:{if(!Le(e.id))break;let t=e.id;return k(Nt,{cameras:a,value:n[t]??[],onChange:e=>o(t,e.length>0?e:void 0)})}case`stringList`:{if(!Re(e.id))break;let r=e.id,i=e=>o(r,e.length>0?e:void 0);if(r===`identities`||r===`identitiesExclude`)return k(Bt,{value:Z(n,r),onChange:i});if(r===`eventTypeTokens`)return k(Vt,{deviceIds:n.devices??[],value:Z(n,r),onChange:i});let a=A(r,t);return a===null?k(Pt,{value:Z(n,r),placeholder:`Add value…`,onChange:i}):k(Ft,{picker:a,value:Z(n,r),onChange:i})}case`zoneIdList`:{if(!ze(e.id))break;let t=e.id;return k(zt,{deviceIds:n.devices??[],cameras:a,value:Z(n,t),onChange:e=>o(t,e.length>0?e:void 0)})}case`number01`:{if(!Be(e.id))break;let t=e.id;return k(It,{value:Je(n,t),min:0,max:1,step:.05,onChange:e=>o(t,e)})}case`number`:{if(!Ve(e.id))break;let t=e.id;return k(It,{value:Je(n,t),min:0,step:1,onChange:e=>o(t,e)})}case`sourceSelect`:{if(!He(e.id))break;let t=e.id;return k(i,{value:n[t]??`any`,options:Et(e,dt).map(e=>({value:e.value,label:e.label})),onChange:e=>o(t,an(e.target.value))})}case`crossingSelect`:{if(!Ue(e.id))break;let t=e.id;return k(Lt,{value:n[t],onChange:e=>o(t,e),...e.options?{options:e.options}:{}})}case`packagePhase`:{if(!We(e.id))break;let t=e.id;return k(i,{value:n[t]??``,options:[{value:``,label:`— any phase —`},...Et(e,ft).map(e=>({value:e.value,label:e.label}))],onChange:e=>o(t,on(e.target.value))})}case`zoneSelection`:{if(!Ge(e.id))break;let t=e.id;return k(Rt,{deviceIds:n.devices??[],cameras:a,value:n[t],onChange:e=>o(t,e)})}case`plateMatcher`:{if(!Ke(e.id))break;let t=e.id;return k(Gt,{value:n[t],onChange:e=>o(t,e)})}case`occupancy`:{if(!qe(e.id))break;let r=e.id;return k(Wt,{deviceIds:n.devices??[],cameras:a,classOptions:nn(t),value:n[r],onChange:e=>o(r,e)})}case`schedule`:return k(Xt,{value:r,onChange:s});default:break}return k(rn,{descriptor:e,conditions:n})}function nn(e){let t=A(`classes`,e);return t===null?[]:t.groups.flatMap(e=>e.options)}function rn({descriptor:e,conditions:t}){let n=Object.entries(t).find(([t])=>t===e.id);return x(`p`,{className:$,children:[n!==void 0&&n[1]!==void 0?`Authored elsewhere and preserved — this admin editor cannot change it yet.`:`Not editable here yet — this condition has no admin editor.`,` `,x(`span`,{className:`text-foreground-muted`,children:[`(`,e.valueType,`)`]})]})}function an(e){if(e===`pipeline`||e===`onboard`||e===`sensor`||e===`any`)return e}function on(e){return ft.find(t=>t.value===e)?.value}b();var sn=[`notificationRules`,`listSnoozes`],cn=3e4;function ln(e,t){return Math.max(0,Math.ceil((e.expiresAt-t)/6e4))}function un(e){if(e===0)return`ending`;if(e<60)return`${e}m left`;let t=Math.floor(e/60),n=e%60;return n===0?`${t}h left`:`${t}h ${n}m left`}function dn({rules:e}){let n=P(),r=E(),i=C({queryKey:sn,refetchInterval:cn,queryFn:async()=>(await n.trpcClient.notificationRules.listSnoozes.query({})).snoozes}),a=O({mutationFn:e=>n.trpcClient.notificationRules.cancelSnooze.mutate({snoozeId:e}),onSuccess:()=>r.invalidateQueries({queryKey:sn})}),o=S(()=>{let t=new Map;for(let n of e)t.set(n.id,n.name);return t},[e]),c=Date.now(),l=(i.data??[]).filter(e=>c>=e.startedAt&&c<e.expiresAt);return l.length===0?null:x(s,{className:`p-4`,children:[x(`div`,{className:`flex items-center gap-2 mb-3`,children:[k(se,{className:`h-4 w-4 text-foreground-subtle`}),k(`h3`,{className:`text-sm font-medium text-foreground`,children:`Silenced right now`})]}),k(`div`,{className:`space-y-2`,children:l.map(e=>x(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border px-3 py-2`,children:[x(`div`,{className:`min-w-0`,children:[x(`div`,{className:`flex items-center gap-2`,children:[k(`span`,{className:`text-xs text-foreground truncate`,children:e.scope===`all`?`Everything`:e.scope===`device`?`Camera ${e.deviceId??`?`}`:o.get(e.ruleId??``)??`A rule`}),e.global&&k(m,{variant:`warning`,className:`text-[10px]`,children:`everyone`}),!e.summary&&k(m,{variant:`default`,className:`text-[10px]`,children:`no summary`})]}),x(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`set by `,e.userId,` · `,un(ln(e,c))]})]}),k(t,{size:`sm`,variant:`outline`,disabled:a.isPending,onClick:()=>a.mutate(e.id),children:`End now`})]},e.id))})]})}b();var fn=[`notificationRules`,`listRules`],pn=[`notificationOutput`,`listTargets`,`forRules`],mn=[`notificationRules`,`getConditionCatalog`],hn=[`deviceManager`,`listAll`,`forRules`];function gn(){let e=P(),[n,r]=D({mode:`closed`}),[i,o]=D(null),c=C({queryKey:fn,queryFn:async()=>(await e.trpcClient.notificationRules.listRules.query({})).rules}),l=C({queryKey:pn,queryFn:()=>e.trpcClient.notificationOutput.listTargets.query({})}),u=C({queryKey:mn,queryFn:()=>e.trpcClient.notificationRules.getConditionCatalog.query({})}),d=C({queryKey:hn,queryFn:async()=>(await e.trpcClient.deviceManager.listAll.query({})).filter(e=>e.type===M.Camera).map(e=>({id:e.id,name:e.name}))}),f=S(()=>{let e=new Map;for(let t of l.data??[])e.set(t.id,t.name);return e},[l.data]),p=O({mutationFn:t=>e.trpcClient.notificationRules.setRuleEnabled.mutate(t),onSuccess:()=>void c.refetch()}),m=O({mutationFn:t=>e.trpcClient.notificationRules.deleteRule.mutate({ruleId:t}),onSuccess:()=>{o(null),c.refetch()}}),h=c.data??[];return x(ae,{icon:ce,title:`Notification Rules`,subtitle:`Author rules that turn detections, doorbell presses and package events into notifications. Each rule picks a trigger, matches conditions and fans out to one or more delivery targets.`,actions:x(t,{size:`sm`,type:`button`,onClick:()=>r({mode:`form`,rule:null}),children:[k(R,{className:`h-3.5 w-3.5`}),`New rule`]}),children:[k(dn,{rules:h}),c.isLoading&&k(`div`,{className:`flex items-center justify-center py-16`,children:k(V,{className:`h-6 w-6 animate-spin text-primary`})}),c.isError&&!c.isLoading&&k(a,{title:`Failed to load rules`,message:c.error instanceof Error?c.error.message:`Unknown error`,onRetry:()=>void c.refetch()}),!c.isLoading&&!c.isError&&h.length===0&&k(`div`,{className:`text-xs text-foreground-subtle text-center py-16`,children:`No notification rules yet. Click "New rule" to author one.`}),h.length>0&&k(s,{children:k(g,{columns:_n({targetNameById:f,confirmDeleteId:i,deletePending:m.isPending,onToggle:(e,t)=>p.mutate({ruleId:e.id,enabled:t}),onEdit:e=>r({mode:`form`,rule:e}),onDuplicate:e=>r({mode:`form`,rule:{...e,id:``,name:`${e.name} (copy)`}}),onAskDelete:o,onConfirmDelete:e=>m.mutate(e.id)}),rows:h,rowKey:e=>e.id,minWidthPx:760,bordered:!1})}),n.mode===`form`&&k(vn,{rule:n.rule,targets:l.data??[],catalog:u.data?.catalog??[],taxonomy:u.data?.taxonomy,cameras:d.data??[],onCancel:()=>r({mode:`closed`}),onSaved:()=>{r({mode:`closed`}),c.refetch()}})]})}function _n(e){return[{key:`name`,header:`Rule`,render:e=>x(`span`,{className:`flex items-center gap-2`,children:[k(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),!e.enabled&&k(m,{variant:`warning`,children:`disabled`})]})},{key:`trigger`,header:`Trigger`,nowrap:!0,render:e=>k(`span`,{className:`text-[11px] text-foreground-subtle`,children:rt(e.delivery)})},{key:`targets`,header:`Targets`,render:t=>{let n=t.targets[0],r=n?e.targetNameById.get(n.targetId)??n.targetId:null;return k(`span`,{className:`text-[11px] text-foreground-subtle`,children:t.targets.length===1&&r?r:`${t.targets.length} target${t.targets.length===1?``:`s`}`})}},{key:`priority`,header:`Priority`,align:`center`,nowrap:!0,render:e=>k(`span`,{className:`text-[11px] text-foreground-subtle`,children:e.priority})},{key:`enabled`,header:`On`,align:`center`,nowrap:!0,render:t=>k(u,{checked:t.enabled,onCheckedChange:n=>e.onToggle(t,n),"aria-label":`toggle ${t.name}`})},{key:`actions`,header:``,align:`right`,nowrap:!0,render:n=>x(`span`,{className:`flex items-center justify-end gap-1`,children:[k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:()=>e.onEdit(n),title:`Edit`,children:k(L,{className:`h-3.5 w-3.5`})}),k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:()=>e.onDuplicate(n),title:`Duplicate`,children:k(I,{className:`h-3.5 w-3.5`})}),e.confirmDeleteId===n.id?x(w,{children:[x(t,{size:`sm`,variant:`danger`,type:`button`,disabled:e.deletePending,onClick:()=>e.onConfirmDelete(n),children:[e.deletePending&&k(V,{className:`h-3.5 w-3.5 animate-spin`}),`Confirm`]}),k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:()=>e.onAskDelete(null),children:`Cancel`})]}):k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:()=>e.onAskDelete(n.id),title:`Delete`,children:k(ie,{className:`h-3.5 w-3.5 text-danger`})})]})}]}function vn({rule:e,targets:n,catalog:a,taxonomy:o,cameras:s,onSaved:c,onCancel:l}){let g=P(),v=e!=null&&e.id.length>0,[b,S]=D(()=>e?vt(e):_t()),[w,T]=D(null),[E,A]=D(null),[j,M]=D(At),N=e=>S(t=>({...t,...e})),F=v&&e?{throttle:e.throttle}:void 0,I=O({mutationFn:async()=>{let t=Tt(b,F,a);v&&e?await g.trpcClient.notificationRules.updateRule.mutate({ruleId:e.id,patch:t}):await g.trpcClient.notificationRules.createRule.mutate({rule:t})},onSuccess:c,onError:e=>T(e instanceof Error?e.message:`Save failed`)}),L=O({mutationFn:async()=>{let e=Tt(b,F,a);return(await g.trpcClient.notificationRules.testRule.mutate({rule:e,lookbackMinutes:60})).results},onMutate:()=>A(null),onSuccess:e=>A(e),onError:e=>T(e instanceof Error?e.message:`Test failed`)}),R=b.targetIds.map(e=>n.find(t=>t.id===e)?.name??e),ee=e=>N({targetIds:b.targetIds.includes(e)?b.targetIds.filter(t=>t!==e):[...b.targetIds,e]}),te=C({queryKey:[`userManagement`,`listUsers`],queryFn:()=>g.trpcClient.userManagement.listUsers.query()}).data,z=e=>N({targetUsers:b.targetUsers.includes(e)?b.targetUsers.filter(t=>t!==e):[...b.targetUsers,e]}),B=Q.find(e=>e.value===b.delivery)?.hint;return k(y,{open:!0,onOpenChange:e=>!e&&l(),children:x(d,{width:`lg`,placement:`sheet-on-mobile`,children:[x(`div`,{className:`flex items-center justify-between mb-3`,children:[x(`h3`,{className:`text-sm font-semibold text-foreground flex items-center gap-2`,children:[k(ce,{className:`h-4 w-4 text-foreground-subtle`}),v?`Edit ${e?.name}`:`New notification rule`]}),k(t,{size:`sm`,variant:`ghost`,type:`button`,onClick:l,children:`Cancel`})]}),w&&k(`div`,{className:`rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger mb-3`,children:w}),x(h,{value:j,onValueChange:e=>M(jt(e)??j),children:[k(f,{className:`mb-3`,children:kt.map(e=>k(p,{value:e.key,children:e.label},e.key))}),x(_,{value:`rule`,className:`space-y-4`,children:[x(`div`,{className:`flex items-end gap-3`,children:[x(`div`,{className:`min-w-0 flex-1`,children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Name`}),k(r,{value:b.name,onChange:e=>N({name:e.target.value}),placeholder:`e.g. Front door package`})]}),x(`label`,{className:`flex items-center gap-2 pb-1.5 text-[11px] font-medium text-foreground`,children:[k(u,{checked:b.enabled,onCheckedChange:e=>N({enabled:e}),"aria-label":`enabled`}),`Enabled`]})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Trigger`}),k(i,{value:b.delivery,onChange:e=>{let t=it(e.target.value);t&&N({delivery:t})},options:Q.map(e=>({value:e.value,label:e.label}))}),B&&k(`p`,{className:`text-[10px] text-foreground-subtle mt-1`,children:B})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Delivery targets`}),n.length===0?k(`p`,{className:`text-[11px] text-foreground-subtle`,children:`No delivery targets configured. Add one under the Targets tab first.`}):k(`div`,{className:`rounded-md border border-border divide-y divide-border`,children:n.map(e=>x(`label`,{className:`flex items-center gap-2.5 px-3 py-1.5 text-xs text-foreground cursor-pointer hover:bg-surface-hover`,children:[k(`input`,{type:`checkbox`,checked:b.targetIds.includes(e.id),onChange:()=>ee(e.id),className:`accent-primary`}),k(`span`,{className:`flex-1 truncate`,children:e.name}),!e.enabled&&k(m,{variant:`warning`,children:`disabled`})]},e.id))})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Notify users`}),(te??[]).length===0?k(`p`,{className:`text-[11px] text-foreground-subtle`,children:`No users to notify.`}):k(`div`,{className:`rounded-md border border-border divide-y divide-border`,children:(te??[]).map(e=>x(`label`,{className:`flex items-center gap-2.5 px-3 py-1.5 text-xs text-foreground cursor-pointer hover:bg-surface-hover`,children:[k(`input`,{type:`checkbox`,checked:b.targetUsers.includes(e.id),onChange:()=>z(e.id),className:`accent-primary`}),k(`span`,{className:`flex-1 truncate`,children:e.username}),e.isAdmin&&k(m,{variant:`info`,children:`admin`})]},e.id))}),k(`p`,{className:`text-[10px] text-foreground-subtle mt-1`,children:`Delivers to the targets each user owns, only for cameras that user can access.`})]})]}),k(_,{value:`advanced`,className:`space-y-4`,children:x(`div`,{children:[x(`label`,{className:`flex items-center gap-2 text-[11px] font-medium text-foreground`,children:[k(u,{checked:b.snoozeAllowGlobal,onCheckedChange:e=>N({snoozeAllowGlobal:e}),"aria-label":`allow global snooze`}),`Anyone may snooze this rule for everyone`]}),k(`p`,{className:`text-[10px] text-foreground-subtle mt-1`,children:`A snooze is personal by default — it silences only the person who set it. Turn this on for a rule where silencing the whole household is legitimate (the gardener is here all afternoon). Admins can always do it.`})]})}),x(_,{value:`notification`,className:`space-y-4`,children:[x(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Priority`}),k(i,{value:String(b.priority),onChange:e=>N({priority:Number(e.target.value)}),options:gt.map(e=>({value:String(e.value),label:e.label}))})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Media attachment`}),k(i,{value:b.mediaAttach,onChange:e=>{let t=ot(e.target.value);t&&N({mediaAttach:t})},options:at.map(e=>({value:e.value,label:e.label}))}),k(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:at.find(e=>e.value===b.mediaAttach)?.description}),x(`div`,{className:`mt-2 space-y-1`,children:[x(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[k(`input`,{type:`checkbox`,checked:b.mediaZoneCrop,onChange:e=>N({mediaZoneCrop:e.target.checked}),className:`accent-primary`}),`Crop the image to the rule's zone`]}),x(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[k(`input`,{type:`checkbox`,checked:b.mediaGif,onChange:e=>N({mediaGif:e.target.checked}),className:`accent-primary`}),`Attach a GIF around the event`]}),x(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[k(`input`,{type:`checkbox`,checked:b.mediaClip,onChange:e=>N({mediaClip:e.target.checked}),className:`accent-primary`}),`Attach an MP4 clip around the event`]})]}),(b.mediaGif||b.mediaClip)&&x(`div`,{className:`mt-2`,children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Video quality`}),k(i,{value:b.mediaProfile??``,onChange:e=>N({mediaProfile:ut(e.target.value)}),options:lt.map(e=>({value:e.value,label:e.label}))}),k(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`A notification is watched on a phone — the cheapest stream is normally the right one, and the high profile only costs CPU to render.`}),k(`label`,{className:`mt-2 block text-[11px] font-medium text-foreground mb-1`,children:`Playback speed`}),k(i,{value:b.mediaClipSpeed===void 0?``:String(b.mediaClipSpeed),onChange:e=>N({mediaClipSpeed:Ot(e.target.value)}),options:Dt.map(e=>({value:e.value,label:e.label}))}),k(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`A notification clip is glanced at, not watched: at 2× the recipient sees the whole passage in half the time and the file is half the size. Real time is there when the detail matters more than the glance.`})]})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Image frame`}),k(i,{value:b.mediaFrame??``,onChange:e=>N({mediaFrame:ct(e.target.value)}),options:st.map(e=>({value:e.value,label:e.label}))}),k(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`What the attached still shows. "Automatic" leaves it to the attachment mode above.`})]})]}),x(`div`,{className:`space-y-2`,children:[x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Notification title`}),k(r,{value:b.templateTitle,onChange:e=>N({templateTitle:e.target.value}),placeholder:`{{camera}} — {{class}}`})]}),x(`div`,{children:[k(`label`,{className:`block text-[11px] font-medium text-foreground mb-1`,children:`Notification body`}),k(`textarea`,{value:b.templateBody,onChange:e=>N({templateBody:e.target.value}),rows:2,placeholder:`{{label}} seen in {{zone}} at {{time}}`,className:`w-full rounded-md border border-border bg-surface px-2.5 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary`})]}),x(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Leave blank to use the backend default text. Supported variables include`,` `,k(`code`,{children:`{{camera}}`}),`, `,k(`code`,{children:`{{class}}`}),`, `,k(`code`,{children:`{{label}}`}),`,`,` `,k(`code`,{children:`{{zone}}`}),`, `,k(`code`,{children:`{{confidence}}`}),`,`,` `,k(`code`,{children:`{{time}}`}),`.`]})]})]}),x(_,{value:`conditions`,className:`space-y-4`,children:[x(`div`,{className:`rounded-md border border-border px-3 py-3`,children:[k(`div`,{className:`mb-2 text-[11px] font-semibold text-foreground`,children:`Conditions`}),a.length===0?k(`p`,{className:`text-[10px] text-foreground-subtle`,children:`Condition catalog unavailable — this rule matches on its trigger and targets alone.`}):k(Qt,{catalog:a,taxonomy:o,delivery:b.delivery,conditions:b.conditions,schedule:b.schedule,cameras:s,onConditionsChange:e=>N({conditions:e}),onScheduleChange:e=>N({schedule:e})})]}),x(`div`,{className:`rounded-md border border-border px-3 py-3`,children:[x(`div`,{className:`flex items-center justify-between gap-2`,children:[k(`div`,{className:`text-[11px] font-semibold text-foreground`,children:`Test rule`}),x(t,{size:`sm`,variant:`outline`,type:`button`,disabled:L.isPending||!yt(b),onClick:()=>{T(null),L.mutate()},children:[L.isPending?k(V,{className:`h-3.5 w-3.5 animate-spin`}):k(le,{className:`h-3.5 w-3.5`}),`Dry-run (last 60 min)`]})]}),k(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`Evaluate the CURRENT (unsaved) rule against recently persisted records — no notification is sent.`}),E!==null&&k(yn,{delivery:b.delivery,results:E,targetNames:R})]})]})]}),x(`div`,{className:`flex justify-end gap-2 mt-4`,children:[k(t,{variant:`secondary`,size:`sm`,type:`button`,onClick:l,children:`Cancel`}),x(t,{size:`sm`,type:`button`,disabled:I.isPending||!yt(b),onClick:()=>{T(null),I.mutate()},children:[I.isPending&&k(V,{className:`h-3.5 w-3.5 animate-spin`}),v?`Save changes`:`Create rule`]})]})]})})}function yn({delivery:e,results:t,targetNames:n}){if(e===`device-event`)return k(`p`,{className:`mt-2 text-[11px] text-foreground-subtle`,children:`Device-event rules cannot be dry-run: the sensor-event store has no cross-device scan surface, so a test returns no candidate records. The rule still fires live on a matching doorbell press / sensor change.`});if(t.length===0)return k(`p`,{className:`mt-2 text-[11px] text-foreground-subtle`,children:`No records in the last 60 minutes matched — nothing to evaluate.`});let r=t.filter(e=>e.wouldFire).length;return x(`div`,{className:`mt-2 space-y-1.5`,children:[x(`div`,{className:`text-[11px] text-foreground-subtle`,children:[r,` of `,t.length,` evaluated record`,t.length===1?``:`s`,` would fire.`]}),k(`ul`,{className:`divide-y divide-border rounded-md border border-border`,children:t.slice(0,50).map(e=>x(`li`,{className:`flex items-center gap-2 px-2.5 py-1.5 text-[11px]`,children:[e.wouldFire?k(F,{className:`h-3.5 w-3.5 shrink-0 text-success`}):k(B,{className:`h-3.5 w-3.5 shrink-0 text-foreground-subtle`}),k(`span`,{className:`w-32 shrink-0 text-foreground-subtle`,children:new Date(e.timestamp).toLocaleString()}),x(`span`,{className:`w-14 shrink-0 text-foreground-subtle`,children:[`#`,e.deviceId]}),k(`span`,{className:`min-w-0 flex-1 truncate text-foreground`,children:e.label??e.className??`object`}),e.wouldFire?x(`span`,{className:`shrink-0 truncate text-success`,children:[`→ `,n.join(`, `)||`targets`]}):e.failedCondition&&x(`span`,{className:`shrink-0 text-foreground-subtle`,children:[`failed: `,e.failedCondition]})]},e.recordId))})]})}b();var bn=[{value:1,label:`Last hour`},{value:24,label:`Last 24 hours`},{value:168,label:`Last 7 days`},{value:0,label:`All time`}],xn=[{value:``,label:`Any status`},{value:`pending`,label:`Pending`},{value:`sent`,label:`Sent`},{value:`dead`,label:`Dead`}],Sn=[50,100,250,500];function Cn(){return{ruleId:``,deviceId:``,status:``,windowHours:24,limit:100}}function wn(e){return e===`pending`||e===`sent`||e===`dead`?e:void 0}function Tn(e){switch(e){case`pending`:return`info`;case`sent`:return`success`;case`dead`:return`danger`}}function En(){let e=P(),[t,n]=D(Cn),r=e=>n(t=>({...t,...e})),a=C({queryKey:[`notificationRules`,`listRules`,`forHistory`],queryFn:async()=>(await e.trpcClient.notificationRules.listRules.query({})).rules}),o=C({queryKey:[`deviceManager`,`listAll`,`forHistory`],queryFn:async()=>(await e.trpcClient.deviceManager.listAll.query({})).filter(e=>e.type===M.Camera).map(e=>({id:e.id,name:e.name}))}),c=Date.now(),l=C({queryKey:[`notificationRules`,`getHistory`,t],retry:!1,queryFn:async()=>{let n=t.windowHours>0?c-t.windowHours*36e5:void 0;return(await e.trpcClient.notificationRules.getHistory.query({filter:{limit:t.limit,...t.ruleId?{ruleId:t.ruleId}:{},...t.deviceId?{deviceId:Number(t.deviceId)}:{},...wn(t.status)?{status:wn(t.status)}:{},...n===void 0?{}:{since:n}}})).entries}}),u=S(()=>{let e=new Map;for(let t of o.data??[])e.set(t.id,t.name);return e},[o.data]),d=e=>u.get(e)??`Camera #${String(e)}`,f=l.data??[],p=l.isError;return x(ae,{icon:U,title:`Delivery history`,subtitle:`A searchable log of every notification the rules delivered (or failed to deliver).`,children:[x(`div`,{className:`mb-4 grid grid-cols-2 gap-2 sm:grid-cols-5`,children:[x(`div`,{children:[k(`label`,{className:`mb-1 block text-[10px] font-medium text-foreground-subtle`,children:`Rule`}),k(i,{value:t.ruleId,onChange:e=>r({ruleId:e.target.value}),options:[{value:``,label:`All rules`},...(a.data??[]).map(e=>({value:e.id,label:e.name}))]})]}),x(`div`,{children:[k(`label`,{className:`mb-1 block text-[10px] font-medium text-foreground-subtle`,children:`Camera`}),k(i,{value:t.deviceId,onChange:e=>r({deviceId:e.target.value}),options:[{value:``,label:`All cameras`},...(o.data??[]).map(e=>({value:String(e.id),label:e.name}))]})]}),x(`div`,{children:[k(`label`,{className:`mb-1 block text-[10px] font-medium text-foreground-subtle`,children:`Status`}),k(i,{value:t.status,onChange:e=>r({status:e.target.value}),options:xn.map(e=>({value:e.value,label:e.label}))})]}),x(`div`,{children:[k(`label`,{className:`mb-1 block text-[10px] font-medium text-foreground-subtle`,children:`Window`}),k(i,{value:String(t.windowHours),onChange:e=>r({windowHours:Number(e.target.value)}),options:bn.map(e=>({value:String(e.value),label:e.label}))})]}),x(`div`,{children:[k(`label`,{className:`mb-1 block text-[10px] font-medium text-foreground-subtle`,children:`Limit`}),k(i,{value:String(t.limit),onChange:e=>r({limit:Number(e.target.value)}),options:Sn.map(e=>({value:String(e),label:String(e)}))})]})]}),l.isLoading&&k(`div`,{className:`flex items-center justify-center py-16`,children:k(V,{className:`h-6 w-6 animate-spin text-primary`})}),p&&!l.isLoading&&k(s,{children:x(`div`,{className:`flex flex-col items-center gap-2 px-4 py-14 text-center`,children:[k(U,{className:`h-6 w-6 text-foreground-subtle`}),k(`div`,{className:`text-sm font-medium text-foreground`,children:`Delivery history requires a server update`}),k(`p`,{className:`max-w-md text-xs text-foreground-subtle`,children:`The history query is not available on this hub yet. It becomes queryable after the next server update ships the notification-center history endpoint. Rules still deliver and record their outcome in the meantime.`}),x(`button`,{type:`button`,onClick:()=>void l.refetch(),className:`mt-1 inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:[k(ee,{className:`h-3 w-3`}),` Retry`]})]})}),!p&&!l.isLoading&&f.length===0&&k(`div`,{className:`py-16 text-center text-xs text-foreground-subtle`,children:`No deliveries match these filters.`}),!p&&f.length>0&&k(s,{children:k(g,{columns:Dn(d),rows:f,rowKey:e=>e.id,minWidthPx:720,bordered:!1})})]})}function Dn(e){return[{key:`when`,header:`When`,nowrap:!0,render:e=>k(`span`,{className:`text-[11px] text-foreground-subtle`,children:new Date(e.createdAt).toLocaleString()})},{key:`rule`,header:`Rule`,render:e=>k(`span`,{className:`text-xs font-medium text-foreground`,children:e.ruleName})},{key:`camera`,header:`Camera`,nowrap:!0,render:t=>k(`span`,{className:`text-[11px] text-foreground-subtle`,children:e(t.deviceId)})},{key:`subject`,header:`Subject`,render:e=>x(`span`,{className:`text-[11px] text-foreground-subtle`,children:[e.subject.label??e.subject.className,e.subject.confidence===void 0?``:` · ${Math.round(e.subject.confidence*100)}%`]})},{key:`status`,header:`Status`,nowrap:!0,render:e=>x(`span`,{className:`flex items-center gap-1.5`,children:[k(m,{variant:Tn(e.status),children:e.status}),e.attempts>1?x(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`×`,e.attempts]}):null]})},{key:`error`,header:`Detail`,render:e=>e.error?k(`span`,{className:`text-[11px] text-danger`,children:e.error}):k(`span`,{className:`text-[11px] text-foreground-subtle`,children:`—`})}]}function On(){return k(`div`,{className:`flex flex-col p-4`,children:k(oe,{tabs:[{id:`targets`,label:`Targets`,icon:ne,content:k(Pe,{})},{id:`rules`,label:`Rules`,icon:ce,content:k(gn,{})},{id:`history`,label:`History`,icon:U,content:k(En,{})}]})})}export{On as NotificationsPage,On as default};
|