@camstack/addon-admin-ui 1.2.427 → 1.2.428
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/{AddonAssetIcon-BgXfFdy2.js → AddonAssetIcon-Cs_blBpK.js} +1 -1
- package/dist/assets/Addons-2xWF73cR.js +4 -0
- package/dist/assets/{AdminPage-C0Zxs_ot.js → AdminPage-DuuyDIsY.js} +1 -1
- package/dist/assets/{AdminSectionedPage-D2kYQhvu.js → AdminSectionedPage-C3VHg80L.js} +1 -1
- package/dist/assets/AiProfiles-DmHcVlS2.js +3 -0
- package/dist/assets/BrokerForm-Dqhjsi3Y.js +1 -0
- package/dist/assets/Build-CBYP1fT5.js +40 -0
- package/dist/assets/Calendars-C926x7b_.js +1 -0
- package/dist/assets/Cluster-OZlA14uV.js +1 -0
- package/dist/assets/ClusterStepModel-DHbwIGAW.js +1 -0
- package/dist/assets/CompositionEditor-vP3JcV2R.js +1 -0
- package/dist/assets/{CompositionEditorPage-CDyW_Buu.js → CompositionEditorPage-Acq7iapA.js} +1 -1
- package/dist/assets/Data-7BoejvKA.js +1 -0
- package/dist/assets/DeviceDetail-ByM0856T.js +2 -0
- package/dist/assets/DeviceDoActionFields-BDJsvRNX.js +1 -0
- package/dist/assets/{Devices-CHeb_BTk.js → Devices-PIrWjfhq.js} +1 -1
- package/dist/assets/EmbedPlayerPage-RXOmf2F3.js +1 -0
- package/dist/assets/Identity-C-tztwfa.js +1 -0
- package/dist/assets/IntegrationDetail-DugB7cv6.js +1 -0
- package/dist/assets/IntegrationHub-BePMbmC5.js +1 -0
- package/dist/assets/Integrations-Dj3nT9ZT.js +1 -0
- package/dist/assets/Integrations-OH5z-t03.js +1 -0
- package/dist/assets/Library-DDNti2te.js +1 -0
- package/dist/assets/Locations-OL9_NoSi.js +3 -0
- package/dist/assets/Logs-DIeXeCqI.js +1 -0
- package/dist/assets/{MotionZonesSettings-DjvGw8j4.js → MotionZonesSettings-CfTOerul.js} +1 -1
- package/dist/assets/MyAccess-iJP3JQIS.js +2 -0
- package/dist/assets/Network-DYssxNiN.js +1 -0
- package/dist/assets/NodeAddonsSettingsPanel-mmtEgDbu.js +1 -0
- package/dist/assets/Notifications-DEcxFWp3.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-IK6ytyM8.js → PrivacyMaskSettings-CJUKFEIs.js} +1 -1
- package/dist/assets/Recordings-lygSYEJj.js +1 -0
- package/dist/assets/ScanNetworkModal-C2oJlLfj.js +1 -0
- package/dist/assets/{SceneMonitorEditor-V_pHxg3U.js → SceneMonitorEditor-D1S-D2V9.js} +1 -1
- package/dist/assets/SessionsList-CIN4GdSm.js +2 -0
- package/dist/assets/{Showroom-Cw-6ZdvC.js → Showroom-W2yJvb8s.js} +1 -1
- package/dist/assets/System-ChWpOOqN.js +1 -0
- package/dist/assets/{Terminal-D-YHBrHK.js → Terminal-CrFum1tE.js} +5 -5
- package/dist/assets/{Viewer-BmXiweP2.js → Viewer-YBzeS3RA.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-wt87pCBz.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CE2IIKhe.js} +1 -1
- package/dist/assets/{addon-icons-context-CvwUgMRr.js → addon-icons-context-D6glxUQF.js} +1 -1
- package/dist/assets/{archive-Bwv0mNo-.js → archive-kvflMCgL.js} +1 -1
- package/dist/assets/{authed-media-0TPg9TTZ.js → authed-media-CSlndmzS.js} +1 -1
- package/dist/assets/{bell-off-D2KzCQW2.js → bell-off-BYnwGeiH.js} +1 -1
- package/dist/assets/{boxes-BXQUMgws.js → boxes-Dx4USyB3.js} +1 -1
- package/dist/assets/circle-slash-D5mo-8G0.js +1 -0
- package/dist/assets/client-CMlUvfoK.js +358 -0
- package/dist/assets/{cloud-upload-BsULjxPu.js → cloud-upload-82x5w5u8.js} +1 -1
- package/dist/assets/crop-Dev61hIh.js +1 -0
- package/dist/assets/{device-integration-icon-CCoHGEQZ.js → device-integration-icon-bTnWrYe0.js} +1 -1
- package/dist/assets/device-picker-model-DlnG_8P7.js +1 -0
- package/dist/assets/{dist-DQtBl_2T.js → dist--5X8Gy0U.js} +1 -1
- package/dist/assets/{dist-DWoekMi0.js → dist-Dod19ois.js} +13 -13
- package/dist/assets/{eraser-DB7_WMyf.js → eraser-B8Awx5Sj.js} +1 -1
- package/dist/assets/{file-up-DuqaeMYR.js → file-up-LqDVgVVa.js} +1 -1
- package/dist/assets/{hard-drive-download-CKj8xKOz.js → hard-drive-download-C24D80x2.js} +1 -1
- package/dist/assets/{history-V8RQKQAb.js → history-DZsORyBG.js} +1 -1
- package/dist/assets/{hostInit-CdxLRG1l.js → hostInit-D2EmEDvv.js} +1 -1
- package/dist/assets/i18n-vggiB6gm.js +1 -0
- package/dist/assets/{icons-CEMmjIEL.js → icons-D5RaCH1q.js} +1 -1
- package/dist/assets/index-BgQGn3LX.js +4 -0
- package/dist/assets/index-BndCgmxf.css +2 -0
- package/dist/assets/{key-Bj5-ZBrb.js → key-DLwSBrPM.js} +1 -1
- package/dist/assets/{key-round-B2I1YisX.js → key-round-CYflkUyd.js} +1 -1
- package/dist/assets/{layers-BARFkXZ5.js → layers-C1wzFfr1.js} +1 -1
- package/dist/assets/linked-devices-model-CCTQ_gka.js +1 -0
- package/dist/assets/{list-ordered-9lF0Gp3K.js → list-ordered-CFeS9o_w.js} +1 -1
- package/dist/assets/location-owned-usage-DSLiI6RY.js +1 -0
- package/dist/assets/{log-in-CjtrIfG3.js → log-in-Be_RcxDr.js} +1 -1
- package/dist/assets/{memory-stick-B26_SbtH.js → memory-stick-4BwYEagi.js} +1 -1
- package/dist/assets/{message-square-plus-COMrVZEZ.js → message-square-plus-D7BNG3h7.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-ec37d41a.js → mf-entry-bootstrap-0-9df0d08c.js} +2 -2
- package/dist/assets/{mic-off-DBIqFVjg.js → mic-off-e162Bcfu.js} +1 -1
- package/dist/assets/{monitor-off-CTQMySOs.js → monitor-off-CARYfHC4.js} +1 -1
- package/dist/assets/{monitor-smartphone-iBd_3nPv.js → monitor-smartphone-lsNgnRRZ.js} +1 -1
- package/dist/assets/mount-DlnG_8P7.js +1 -0
- package/dist/assets/notification-schedule-field-DWpT_5Vh.js +1 -0
- package/dist/assets/{octagon-alert-DMjnTemh.js → octagon-alert-h80nyWRM.js} +1 -1
- package/dist/assets/{player-overlays-DWMIy1MJ.js → player-overlays-Cda8wso6.js} +1 -1
- package/dist/assets/{recycle-BCVF0r6Y.js → recycle-0MLWppmT.js} +1 -1
- package/dist/assets/remoteEntry-V_83-NrI.js +1 -0
- package/dist/assets/{scan-eye-DRXP3PgB.js → scan-eye-DVK8MF3K.js} +1 -1
- package/dist/assets/{scissors-DUFtPb9T.js → scissors-Cz3GoeOd.js} +1 -1
- package/dist/assets/{search-x-B3nve3vV.js → search-x-i_A-Upbe.js} +1 -1
- package/dist/assets/{send-P2KlabIu.js → send-B5VKcNUH.js} +1 -1
- package/dist/assets/{settings-2-reEhyiKz.js → settings-2-ZQsYJ0Zb.js} +1 -1
- package/dist/assets/{speaker-DSNMuvS8.js → speaker-Cl8DZGk_.js} +1 -1
- package/dist/assets/{src-BLkInT8U.js → src-eoSUZcV-.js} +8 -8
- package/dist/assets/{timer-reset-CsRTbSzh.js → timer-reset-A5ofAkBW.js} +1 -1
- package/dist/assets/{ungroup-BLeVa8__.js → ungroup-t0yDnzVf.js} +1 -1
- package/dist/assets/{unlink-DeNvF8r-.js → unlink-C1ZpCxl3.js} +1 -1
- package/dist/assets/{usb-CFseVsQJ.js → usb-DmUPajSy.js} +1 -1
- package/dist/assets/{use-scenes-feed-C8frh3hQ.js → use-scenes-feed-BQlYhRMq.js} +1 -1
- package/dist/assets/{use-stationary-objects-DNayAuMq.js → use-stationary-objects-BWM4vE0E.js} +1 -1
- package/dist/assets/useEventInvalidation-DlnG_8P7.js +1 -0
- package/dist/assets/{useNodeUrlSelection-BsLRiUy8.js → useNodeUrlSelection-CTxv9Em7.js} +1 -1
- package/dist/assets/user-round-BTaID248.js +1 -0
- package/dist/assets/{user-x-CpaZ5HO0.js → user-x-DRcPeM9C.js} +1 -1
- package/dist/assets/{video--MLJeLNU.js → video-tLHyNE3q.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-1Do_dc2z.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DOOXjnRq.js} +2 -2
- package/dist/index.html +11 -10
- package/dist/server/addon.js +27 -3
- package/package.json +1 -1
- package/dist/assets/Addons-BTWw53aT.js +0 -4
- package/dist/assets/AiProfiles-Ca7zuVMp.js +0 -3
- package/dist/assets/BrokerForm-6-BwPs-g.js +0 -1
- package/dist/assets/Build-BsduavcU.js +0 -40
- package/dist/assets/Calendars-DVTk_2iT.js +0 -1
- package/dist/assets/Cluster-BPJ4maiI.js +0 -1
- package/dist/assets/ClusterStepModel-CjuZ-oml.js +0 -1
- package/dist/assets/CompositionEditor-DJcmWU2U.js +0 -1
- package/dist/assets/Data-CLLvqZwG.js +0 -1
- package/dist/assets/DeviceDetail-BKw1gufS.js +0 -2
- package/dist/assets/DeviceDoActionFields-R-ZYIdMv.js +0 -1
- package/dist/assets/EmbedPlayerPage-B4y0Q0wO.js +0 -1
- package/dist/assets/Identity-NOlTR-3q.js +0 -1
- package/dist/assets/IntegrationDetail-CcZkPlbN.js +0 -1
- package/dist/assets/IntegrationHub-CuW7-WRy.js +0 -1
- package/dist/assets/Integrations-ACdx4iPR.js +0 -1
- package/dist/assets/Integrations-DjnhmLye.js +0 -1
- package/dist/assets/Library-B3iyoKdK.js +0 -1
- package/dist/assets/Locations-Cs1VwmXB.js +0 -3
- package/dist/assets/Logs-BMc6WXCH.js +0 -1
- package/dist/assets/MyAccess-BfUfTXrv.js +0 -2
- package/dist/assets/Network-F2lAIcbT.js +0 -1
- package/dist/assets/NodeAddonsSettingsPanel-D3ux_JIo.js +0 -1
- package/dist/assets/Notifications-Cp3qo_EC.js +0 -1
- package/dist/assets/Recordings-D91q74Ga.js +0 -1
- package/dist/assets/ScanNetworkModal-DjU-xM4X.js +0 -1
- package/dist/assets/SessionsList-DQ7kj8fX.js +0 -2
- package/dist/assets/System-DLLa4weE.js +0 -1
- package/dist/assets/circle-slash-DpUtlEnB.js +0 -1
- package/dist/assets/client-CjyKfSu1.js +0 -358
- package/dist/assets/crop-BtQBZ9jm.js +0 -1
- package/dist/assets/device-picker-model-1Z6p3UkP.js +0 -1
- package/dist/assets/index-D66JvELZ.js +0 -4
- package/dist/assets/index-dmZ34NAY.css +0 -2
- package/dist/assets/location-owned-usage-CNXQ-Obv.js +0 -1
- package/dist/assets/mount-1Z6p3UkP.js +0 -1
- package/dist/assets/notification-schedule-field-D8dd67dT.js +0 -1
- package/dist/assets/remoteEntry-RwWzzVu_.js +0 -1
- package/dist/assets/useEventInvalidation-1Z6p3UkP.js +0 -1
- package/dist/assets/user-round-BB0VDRnJ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as e,S as t,W as n,b as r,i,q as a,x as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{It as s,On as c,Qi as l,dn as u,dt as d,ot as f}from"./player-overlays-DWMIy1MJ.js";import{At as p,Ct as m,Dt as h,Et as g,F as ee,G as te,I as ne,In as re,K as ie,Ln as ae,M as oe,N as se,O as ce,Ot as le,P as ue,R as de,St as fe,Tt as _,ct as v,dt as pe,et as me,ft as he,gt as ge,ht as _e,it as ve,jr as ye,jt as be,kt as xe,lt as y,nt as Se,pt as Ce,rt as b,st as x,tt as we,vt as S,wt as C,yt as Te}from"./client-CjyKfSu1.js";import{Gl as w,Xl as T,Ya as Ee,bc as De,d as Oe,nr as ke,vc as Ae}from"./src-BLkInT8U.js";import{t as E}from"./useTranslation-Bc5yH9V9.js";e();function D(e){return t=>Object.prototype.hasOwnProperty.call(e,t)}var je=D({devices:!0}),Me=D({classes:!0,classesExclude:!0,labelEquals:!0,identities:!0,identitiesExclude:!0,eventTypeTokens:!0,sensorKinds:!0}),Ne=D({minConfidence:!0,minImportance:!0,minLabelConfidence:!0}),Pe=D({minDwellSeconds:!0}),Fe=D({source:!0}),Ie=D({crossing:!0}),Le=D({packagePhase:!0}),Re=D({sensorTransition:!0}),ze=D({plates:!0}),Be=D({occupancy:!0}),Ve=D({audio:!0}),He=D({systemEvent:!0}),Ue=D({deviceState:!0}),We=D({scene:!0});function Ge(e,t){let n=e[t];return Array.isArray(n)?n:[]}function Ke(e,t){let n=e[t];return typeof n==`number`?n:void 0}function O(e,t){let r=f().trpcClient,a=i({queries:e.map(e=>({queryKey:[[`nc-pickers`,`zones`],{deviceId:e}],staleTime:3e4,queryFn:async()=>({deviceId:e,zones:(await r.zones.listZones.query({deviceId:e})).map(e=>({id:e.id,name:e.name}))})}))});return n(()=>{let e=[],n=new Set;for(let r of a){if(!r.data)continue;let i=t.find(e=>e.id===r.data.deviceId)?.name;for(let t of r.data.zones)n.has(t.id)||(n.add(t.id),e.push({value:t.id,label:t.name,...i===void 0?{}:{hint:i}}))}return{options:e,loading:a.some(e=>e.isLoading),failed:a.some(e=>e.isError)}},[a,t])}function qe(e){let t=f().trpcClient,r=i({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 n(()=>{let e=new Map;for(let t of r)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:r.some(e=>e.isLoading)}},[r])}function Je(){let e=Ee();return n(()=>({options:(e.data??[]).map(e=>({value:e.id,label:e.name})),loading:e.isLoading,failed:e.isError===!0}),[e.data,e.isLoading,e.isError])}function Ye(){let e=Ae({limit:200}),t=De();return n(()=>{let n=new Set;for(let e of t.data??[])e.name.trim().length>0&&n.add(e.name);let r=new Set;for(let t of e.data??[])t.text.trim().length>0&&r.add(t.text);return[...[...n].sort(),...[...r].sort()]},[e.data,t.data])}function k({options:e,value:r,onChange:i,loading:s,emptyHint:c,placeholder:l,noFreeText:u=!1}){let[d,f]=a(``),p=n(()=>new Set(e.map(e=>e.value)),[e]),m=n(()=>new Set(r),[r]),h=r.filter(e=>!p.has(e)),g=e=>{i(m.has(e)?r.filter(t=>t!==e):[...r,e])},ee=()=>{let e=d.trim();e.length===0||r.includes(e)||(i([...r,e]),f(``))};return t(`div`,{className:`mt-1 space-y-1.5`,children:[h.length>0&&o(`div`,{className:`flex flex-wrap gap-1`,children:h.map(e=>t(`button`,{type:`button`,onClick:()=>i(r.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?o(`div`,{className:`max-h-40 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:e.map(e=>t(`label`,{className:`flex items-center gap-2.5 px-3 py-1.5 text-xs text-foreground cursor-pointer hover:bg-surface-hover`,children:[o(`input`,{type:`checkbox`,checked:m.has(e.value),onChange:()=>g(e.value),className:`accent-primary`}),o(`span`,{className:`flex-1 truncate`,children:e.label}),e.hint!==void 0&&o(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.hint})]},e.value))}):o(`p`,{className:`text-[10px] text-foreground-subtle`,children:s===!0?`Loading…`:c}),!u&&o(`input`,{value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ee())},placeholder:l,className:`w-full rounded-md border border-border bg-background px-2 py-1 text-xs text-foreground placeholder:text-foreground-subtle`})]})}var A=[{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, or an occupancy edge on a linked device.`},{value:`package-event`,label:`Package event`,hint:`A parcel delivery or pick-up.`},{value:`system-event`,label:`System event`,hint:`The installation itself: a camera or stream going offline, a node leaving the cluster, an addon or server update becoming available.`}],j=`Immediate, grouped`,Xe=A.flatMap(e=>e.value===`immediate`?[e,{value:`immediate-grouped`,label:j,hint:`Waits for subjects to be recognised, then sends one message with a mosaic, one picture per subject.`}]:[e]);function Ze(e){return e.groupingSec!==void 0&&x(e)?`immediate-grouped`:e.delivery}function Qe(e){let t=(e.delivery===`immediate`||e.delivery===`track-end`)&&x({delivery:`immediate`,conditions:e.conditions});return Xe.filter(e=>e.value!==`immediate-grouped`||t)}function $e(e){return Xe.find(t=>t.value===e)?.value}function et(e,t=j){return Ze(e)===`immediate-grouped`?`${t} · ${String(e.groupingSec)} s`:nt(e.delivery)}function tt(e){if(e.trim().length===0)return;let t=Number(e);return Number.isFinite(t)&&t>=0?Math.trunc(t):void 0}function nt(e){return A.find(t=>t.value===e)?.label??e}function rt(e){return A.some(t=>t.value===e)}var it=[{key:`all`,label:`All rules`,blurb:`Every notification rule — event-driven and scheduled producers. Tabs filter this same list; pick the type under New rule when creating from here.`,newRuleLabel:`New rule`,emptyHint:`No rules yet. Click "New rule" and pick a kind (Detection, Summary, Calendar events, …).`,creatable:!0},{key:`detection`,label:`Detections`,blurb:`Rules driven by what the cameras SEE — detections, tracks and package events. Doorbell presses and other sensor changes have their own section now (operator ruling, 2026-10-01).`,newRuleLabel:`New detection rule`,emptyHint:`No detection rules yet. Click "New detection rule" to author one.`,creatable:!0},{key:`sensor`,label:`Sensors`,blurb:`Rules driven by a device or sensor CHANGING STATE — a doorbell press, a linked sensor opening or closing. The picture is one snapshot of the camera the sensor is attributed to; there is no media choice to make.`,newRuleLabel:`New sensor rule`,emptyHint:`No sensor rules yet. Click "New sensor rule" to be told when a doorbell is pressed or a linked sensor changes.`,creatable:!0},{key:`audio`,label:`Sound`,blurb:`Rules on what the cameras HEAR: a sustained window of sound loud enough, or classified as one of the sounds you name. A sound rule is an immediate rule carrying the sound condition — it fires only on a confirmed sampling window, never on a picture.`,newRuleLabel:`New sound rule`,emptyHint:`No sound rules yet. Click "New sound rule" — it opens on the sound condition already filled in with a level threshold, so you only have to name the sounds and the targets.`,creatable:!0},{key:`occupancy`,label:`Occupancy`,blurb:`Rules on how many objects are in a camera frame or a zone, and for how long: "the driveway became occupied", "the garden emptied". An occupancy rule is a device-event rule carrying the occupancy condition.`,newRuleLabel:`New occupancy rule`,emptyHint:`No occupancy rules yet. Click "New occupancy rule" — it opens on the occupancy condition; pick the camera on the Devices tab, then the zone and the count.`,creatable:!0},{key:`device-events`,label:`Device events`,blurb:`Rules about your devices: offline or back, switched off or on, a stream dropping, a battery or consumable running low, a camera detecting nothing. These carry no image.`,newRuleLabel:`New device-event rule`,emptyHint:`No device-event rules yet. Click "New device-event rule" to be told when a device drops, a battery runs low or a camera goes blind.`,creatable:!0},{key:`system`,label:`System events`,blurb:`Rules about the installation itself: a node leaving the cluster, an addon crash-looping, an update available or installed, a backup or export finishing. These carry no image and are not tied to a detection.`,newRuleLabel:`New system rule`,emptyHint:`No system rules yet. Click "New system rule" to be told when a node leaves, an update lands or a backup finishes.`,creatable:!0},{key:`alarm`,label:`Alarm`,blurb:`Rules about the alarm panel: arming, armed, triggered, disarmed, and the refusals in between.`,newRuleLabel:`New alarm rule`,emptyHint:`No alarm rules yet. Click "New alarm rule" to be told when the alarm arms, goes off or is disarmed.`,creatable:!0},{key:`mixed`,label:`To recreate`,blurb:`System rules authored before the three families existed. Each mixes families and keeps firing as it is, but it cannot be edited: recreate it as one rule per family (Device events, System events, Alarm). Open none of them: Delete each once its replacements exist.`,newRuleLabel:`New rule`,emptyHint:`Nothing to recreate.`,creatable:!1}];function at(e){return y(v(e)).editable}function ot(e){return ve(st(e))}function st(e){switch(e){case`device-events`:case`system`:case`alarm`:case`mixed`:return e;default:return}}var ct=new Map([[0,`No cooldown`],[60,`1 minute`],[3600,`1 hour`]]),lt=86400;function ut(e){let t=ct.get(e);return t===void 0?e%3600==0?`${e/3600} hours`:e%60==0?`${e/60} minutes`:`${e} seconds`:t}function dt(e){if(e.trim().length===0)return;let t=Number(e);return Number.isFinite(t)&&t>=0?Math.trunc(t):void 0}var ft=[{value:`rule-device`,label:`Per device`},{value:`rule`,label:`Whole rule (one window for every device)`}];function pt(e){return ft.find(t=>t.value===e)?.value}var mt=[{value:`per-class`,label:`Separate windows per class (default)`},{value:`shared`,label:`Shared across classes`}];function ht(e){return mt.find(t=>t.value===e)?.value}var gt=[{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 _t(e){return gt.find(t=>t.value===e)?.value}var M=[{value:``,label:`Automatic`},{value:`cropped`,label:`Cropped on the subject`},{value:`full`,label:`Full frame`},{value:`boxed`,label:`Full frame with boxes`}];function vt(e){let t=M.find(t=>t.value===e)?.value;return t===``?void 0:t}var N=[{value:``,label:`Mosaic of every linked camera (default)`},{value:`mosaic`,label:`Mosaic of every linked camera`},{value:`each`,label:`One image per camera (first camera where only one is allowed)`}];function yt(e){let t=N.find(t=>t.value===e)?.value;return t===``?void 0:t}var P=[{value:``,label:`Lowest available`},{value:`low`,label:`Low`},{value:`mid`,label:`Medium`},{value:`high`,label:`High`}];function bt(e){let t=P.find(t=>t.value===e)?.value;return t===``?void 0:t}var xt=[{value:`any`,label:`Any source`},{value:`pipeline`,label:`Pipeline`},{value:`onboard`,label:`Onboard (camera)`},{value:`sensor`,label:`Sensor`}],St=[{value:`delivered`,label:`Delivered`},{value:`picked-up`,label:`Picked up`},{value:`both`,label:`Both`}],Ct=[{value:``,label:`It triggers and when it clears`},{value:`raised`,label:`Only when it triggers`},{value:`cleared`,label:`Only when it clears`}];function wt(e){return e===`raised`||e===`cleared`?e:void 0}function F(e,t){return e===`sensorTransition`?ie(t.sensorKinds):!0}var Tt=[{value:`enter`,label:`Entering`},{value:`exit`,label:`Leaving`},{value:`any`,label:`Entering or leaving`}],Et=`enter`;function I(e){return e===`exit`||e===`any`?e:void 0}var Dt=[{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 Ot(e,t){return e.options&&e.options.length>0?e.options:t}var kt=[{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 At(e){if(e===``)return;let t=Number(e);return Number.isFinite(t)&&t>=1&&t<=8?t:void 0}var jt=new Map(Object.entries({"device-offline":`Device offline`,"device-online":`Device online`,"device-disabled":`Device switched off`,"device-enabled":`Device switched on`,"stream-offline":`Stream offline`,"stream-online":`Stream online`,"device-battery-low":`Battery low`,"device-battery-normal":`Battery back to normal`,"device-consumable-low":`Consumable low`,"device-consumable-normal":`Consumable back to normal`,"device-tank-low":`Tank low (water, detergent)`,"device-tank-full":`Tank full (dirty water, dust)`,"device-tank-normal":`Tank back to normal`,"detection-blind":`Camera detecting nothing`,"recording-stalled":`Recording stalled`,"recording-healthy":`Recording healthy again`,"recording-degraded":`Recording degraded (restart storm)`,"storage-location-low":`Storage location low`,"storage-location-critical":`Storage location critical`,"storage-location-ok":`Storage location ok again`,"node-offline":`Node offline`,"node-online":`Node online`,"node-restarting":`Node restarting`,"node-updating":`Node updating (restart imminent)`,"node-inference-unavailable":`Node has no usable inference device`,"addon-crash-loop":`Addon stopped after repeated crashes`,"addon-update-available":`Addon update available`,"addon-updated":`Addons updated`,"server-update-available":`Server update available`,"server-updated":`Server updated`,"wrapper-update-available":`Container / app update available`,"export-completed":`Export completed`,"backup-completed":`Backup completed`,"alarm-arm-refused":`Alarm arm refused (something is open)`,"alarm-check-failed":`Alarm check failed (armed anyway)`,"alarm-arming":`Alarm arming (exit delay)`,"alarm-armed":`Alarm armed`,"alarm-pending":`Alarm entry delay started`,"alarm-triggered":`Alarm triggered`,"alarm-rearmed":`Alarm re-armed after siren`,"alarm-sensor-bypass":`Alarm sensor bypass`,"alarm-disarmed":`Alarm disarmed`}));function Mt(e){return jt.get(e)}var Nt={"device-state":`A device the hub can no longer reach, or that came back. Switched off / on is a device an operator turned off or back on — not a fault, a choice.`,streams:`A stream that stopped or came back.`,battery:`A battery below the cluster threshold, and (optionally) its return to normal. Devices with a binary low-battery indicator are judged by the indicator, not by the percentage.`,consumables:`A consumable — filter, brush, bag — at or below this rule’s threshold, or that the device reports as due for replacement, and (optionally) its return to normal after a change. A device that only says "replace" is judged by that, not by a percentage.`,tanks:`A robot vacuum tank the device reports as running low (clean water, detergent) or full (dirty water, dust bin), and (optionally) its return to normal once refilled or emptied.`,"detection-blind":`A camera that is running and being analysed, but detects nothing — up, and producing no work.`,recording:`A camera whose recording is on but no footage is landing (stall), a writer that burned its restart budget (degraded), and (optionally) the return to healthy writing.`,nodes:`An agent or worker node joining or leaving the cluster, or an online node whose inference devices all went away.`,addons:`An addon the hub has stopped restarting after repeated crashes.`,"addon-updates":`A newer version of an addon, or an addon update that just finished.`,updates:`A newer version of the server itself, or of the container / app the node runs inside, is available — or a server update just finished.`,"backups-exports":`A scheduled or manual backup of the hub finished, or a footage export finished rendering.`,storage:`A storage location running low or critical on free space — or whose capacity probe failed — and (optionally) its return to ok.`,alarm:`The alarm panel refusing to arm, arming, armed, counting down to a siren, going off, re-arming, excluding an open sensor, or being disarmed.`},L=ge.map(e=>({id:e.id,family:e.family,label:e.label,hint:Nt[e.id]??``,kinds:e.kinds.flatMap(e=>{let t=Mt(e);return t===void 0?[]:[{value:e,label:t}]})}));function R(e){return L.filter(t=>t.family===e)}function z(e){let t=pe(e).conditions.systemEvent;return t===void 0?{kinds:(R(e)[0]?.kinds??[]).map(e=>e.value)}:{...t,kinds:[...t.kinds]}}var B=L.flatMap(e=>e.kinds);function V(e){return B.find(t=>t.value===e)?.label??e}function Pt(e){return{devices:S(e,`deviceIds`),deviceTypes:S(e,`deviceTypes`),nodes:S(e,`nodeIds`),packages:S(e,`packageNames`),consumableThreshold:S(e,`consumableLowPercent`)}}function H(e,t){let n=_e[e],r=Pt(t);return{devices:n.includes(`deviceIds`)&&r.devices,excludeDevices:n.includes(`excludeDeviceIds`)&&r.devices,deviceTypes:n.includes(`deviceTypes`)&&r.deviceTypes,nodes:n.includes(`nodeIds`)&&r.nodes,packages:n.includes(`packageNames`)&&r.packages,consumableThreshold:n.includes(`consumableLowPercent`)&&r.consumableThreshold}}var Ft=Object.values(ye).map(e=>({value:e,label:It(e)})).toSorted((e,t)=>e.label.localeCompare(t.label));function It(e){let t=e.replaceAll(`-`,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(e,t,n){if(!R(n).some(e=>e.kinds.some(e=>e.value===t)))return e;let r=e?.kinds??[];return r.length===1&&r[0]===t?e:Bt(e,r.includes(t)?r.filter(e=>e!==t):B.filter(e=>e.value===t||r.includes(e.value)).map(e=>e.value),n)}function Rt(e,t){return t===void 0?void 0:Bt(t,t.kinds,e)}function zt(e,t){let n=e?.kinds??[];if(n.length===0)return;let r=U(t,`deviceIds`,e?.deviceIds),i=U(t,`excludeDeviceIds`,e?.excludeDeviceIds),a=U(t,`deviceTypes`,e?.deviceTypes),o=U(t,`nodeIds`,e?.nodeIds),s=U(t,`packageNames`,e?.packageNames),c=Object.prototype.hasOwnProperty.call(t,`consumableLowPercent`)?t.consumableLowPercent:e?.consumableLowPercent;return{kinds:[...n],...r===void 0?{}:{deviceIds:[...r]},...i===void 0?{}:{excludeDeviceIds:[...i]},...a===void 0?{}:{deviceTypes:[...a]},...o===void 0?{}:{nodeIds:[...o]},...s===void 0?{}:{packageNames:[...s]},...c===void 0?{}:{consumableLowPercent:c}}}function U(e,t,n){let r=Object.prototype.hasOwnProperty.call(e,t)?e[t]:n;return r!==void 0&&r.length===0?void 0:r}function Bt(e,t,n){let r=H(n,t),i=r.devices?e?.deviceIds:void 0,a=r.excludeDevices?e?.excludeDeviceIds:void 0,o=r.deviceTypes?e?.deviceTypes:void 0,s=r.nodes?e?.nodeIds:void 0,c=r.packages?e?.packageNames:void 0,l=r.consumableThreshold?e?.consumableLowPercent:void 0;return{kinds:[...t],...i&&i.length>0?{deviceIds:[...i]}:{},...a&&a.length>0?{excludeDeviceIds:[...a]}:{},...o&&o.length>0?{deviceTypes:[...o]}:{},...s&&s.length>0?{nodeIds:[...s]}:{},...c&&c.length>0?{packageNames:[...c]}:{},...l===void 0?{}:{consumableLowPercent:l}}}var Vt=95;function Ht(e){let t=e.trim();if(t===``)return{kind:`clear`};let n=Number(t);return Number.isInteger(n)&&n>=1&&n<=Vt?{kind:`set`,value:n}:{kind:`invalid`}}function Ut(e,t=2){if(e===void 0||e.length===0)return`No event selected`;let n=e.slice(0,t).map(V).join(`, `),r=e.length-Math.min(t,e.length);return r>0?`${n} +${r}`:n}function Wt(e){if(e===void 0)return`—`;let t=[],n=e.deviceIds?.length??0,r=e.deviceTypes?.length??0,i=e.nodeIds?.length??0,a=e.packageNames?.length??0,o=e.excludeDeviceIds?.length??0;r>0&&t.push(e.deviceTypes?.map(It).join(`, `)??``),n>0&&t.push(`${n} device${n===1?``:`s`}`),i>0&&t.push(`${i} node${i===1?``:`s`}`),a>0&&t.push(`${a} package${a===1?``:`s`}`);let s=o>0?`except ${o} device${o===1?``:`s`}`:null,c=e.consumableLowPercent===void 0?[]:[`consumables at ${e.consumableLowPercent}%`];return t.length===0?[s===null?`Everything`:`Everything ${s}`,...c].join(` · `):[...t,...s===null?[]:[s],...c].join(` · `)}function Gt(e){return e===void 0||(e.deviceTypes?.length??0)===0?!1:e.kinds.some(e=>re.includes(e))}var Kt=[`all`,`only`,`except`];function qt(e,t){return(e??[]).length>0?`only`:(t??[]).length>0?`except`:`all`}function W(e,t){let n=[...e??[]],r=[...t??[]];return{mode:qt(n,r),include:n,exclude:r,legacyBoth:n.length>0&&r.length>0}}function Jt(e,t){return{...e,mode:t}}function Yt(e){switch(e.mode){case`only`:return e.include;case`except`:return e.exclude;case`all`:return[]}}function Xt(e,t){switch(e.mode){case`only`:return{...e,include:[...t]};case`except`:return{...e,exclude:[...t]};case`all`:return e}}function Zt(e){return e.mode===`only`&&e.legacyBoth?e.exclude:[]}function Qt(e){return{...e,exclude:[],legacyBoth:!1}}function G(e){switch(e.mode){case`all`:return{};case`except`:return e.exclude.length>0?{exclude:[...e.exclude]}:{};case`only`:{let t=Zt(e);return{...e.include.length>0?{include:[...e.include]}:{},...t.length>0?{exclude:[...t]}:{}}}}}function $t(e){let t=G(e),n=t.include??[],r=t.exclude??[];return[...e.include.filter(e=>!n.includes(e)),...e.exclude.filter(e=>!r.includes(e))]}var K=[`onActivation`,`onDeactivation`,`onTrigger`,`onTriggerOff`],q={onActivation:{title:`On activation`,hint:`Runs when the rule is turned on.`},onDeactivation:{title:`On deactivation`,hint:`Runs when the rule is turned off.`},onTrigger:{title:`On trigger`,hint:`Runs on a positive / raised match.`},onTriggerOff:{title:`On trigger off`,hint:`Runs on a clear / leave match. Delivery types without a clear edge never fire this.`}},en={onActivation:[],onDeactivation:[],onTrigger:[],onTriggerOff:[],buttons:[]};function tn(e){return e===void 0?en:{onActivation:[...e.onActivation??[]],onDeactivation:[...e.onDeactivation??[]],onTrigger:[...e.onTrigger??[]],onTriggerOff:[...e.onTriggerOff??[]],buttons:[...e.buttons??[]]}}function J(e){let t=e.buttons.filter(e=>e.id.trim()!==``&&e.label.trim()!==``&&e.sequenceId.trim()!==``),n={onActivation:e.onActivation,onDeactivation:e.onDeactivation,onTrigger:e.onTrigger,onTriggerOff:e.onTriggerOff};if(!(!K.some(e=>n[e].length>0)&&t.length===0))return{...n.onActivation.length>0?{onActivation:[...n.onActivation]}:{},...n.onDeactivation.length>0?{onDeactivation:[...n.onDeactivation]}:{},...n.onTrigger.length>0?{onTrigger:[...n.onTrigger]}:{},...n.onTriggerOff.length>0?{onTriggerOff:[...n.onTriggerOff]}:{},...t.length>0?{buttons:t}:{}}}function nn(e,t){let n=[];for(let r of K){let i=e[r];i.length>4&&n.push({kind:`too-many`,message:`${q[r].title} has more than 4 bindings.`});for(let e of i)e.kind===`sequence`&&!t.has(e.sequenceId)&&n.push({kind:`unknown-sequence`,message:`${q[r].title} points at a sequence that does not exist.`})}let r=new Set;for(let i of e.buttons){let e=i.id.trim();e!==``&&(r.has(e)&&n.push({kind:`duplicate-button`,message:`Two buttons share the id "${e}". The id is what the audit line names when one is tapped.`}),r.add(e),t.has(i.sequenceId.trim())||n.push({kind:`unknown-sequence`,message:`"${i.label||e}" points at a sequence that does not exist. It would never appear on a notification.`}))}return n}function rn(e,t){return{id:`action-${String(e+1)}`,label:`Action`,sequenceId:t}}function an(){return{kind:`do`,action:{kind:`cap`,deviceId:0,cap:``,method:``}}}function on(e){return{kind:`sequence`,sequenceId:e}}function sn(){return{kind:`wait`,seconds:5}}var cn=[{value:`acknowledge`,label:`Acknowledge`},{value:`dismiss`,label:`Dismiss`},{value:`silence`,label:`Silence`},{value:`snooze`,label:`Snooze`},{value:`view`,label:`View`},{value:`play`,label:`Play`},{value:`camera`,label:`Camera`},{value:`open`,label:`Open`},{value:`close`,label:`Close`},{value:`unlock`,label:`Unlock`},{value:`lock`,label:`Lock`},{value:`disarm`,label:`Disarm`},{value:`arm`,label:`Arm`},{value:`arm-home`,label:`Arm — home`},{value:`arm-away`,label:`Arm — away`},{value:`arm-night`,label:`Arm — night`},{value:`light`,label:`Light`},{value:`alert`,label:`Alert`}],ln=[10,30,60],un=[5,10,15,30,60,120,240,480];function dn(e){return e>=60&&e%60==0?`${e/60} h`:`${e} min`}var fn=new Set([`alarm-arm-refused`,`alarm-check-failed`,`alarm-arming`,`alarm-armed`,`alarm-pending`,`alarm-triggered`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-disarmed`]),pn=`alarm-panel`;function mn(e,t){for(let t of e.systemEvent?.kinds??[])if(fn.has(t))return!0;for(let e of t)if(e.kind===`cap`&&e.cap===pn)return!0;return!1}function hn(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of[`onActivation`,`onDeactivation`,`onTrigger`,`onTriggerOff`])for(let i of e[t])if(i.kind===`do`)r.push(i.action);else{let e=n.get(i.sequenceId);e!==void 0&&r.push(...e.actions)}for(let t of e.buttons){let e=n.get(t.sequenceId);e!==void 0&&r.push(...e.actions)}return r}function gn(e){let{devices:t,devicesExclude:n,classes:r,classesExclude:i,...a}=e;return{conditions:a,deviceScope:W(t,n),classScope:W(r,i)}}function _n(e){let t=G(e.deviceScope),n=G(e.classScope);return{...e.conditions,...t.include===void 0?{}:{devices:[...t.include]},...t.exclude===void 0?{}:{devicesExclude:[...t.exclude]},...n.include===void 0?{}:{classes:[...n.include]},...n.exclude===void 0?{}:{classesExclude:[...n.exclude]}}}function vn(e){return e.deviceScope.mode===`only`?e.deviceScope.include:[]}function yn(e,t,n){let r=v(n);return e.some(e=>e.id===t&&we(e,n.delivery,r))}function bn(e=`immediate`,t={}){return{name:``,enabled:!0,delivery:e,targetIds:[],targetUsers:[],targetParams:{},priority:3,mediaAttach:`best`,mediaZoneCrop:!1,mediaFrame:void 0,mediaGif:!1,mediaClip:!1,mediaProfile:void 0,mediaClipSpeed:void 0,mediaLinkedCameras:void 0,templateTitle:``,templateBody:``,...gn(t),schedule:void 0,systemEventDelivery:void 0,snoozeAllowGlobal:!1,groupingSec:void 0,snoozeOptions:void 0,actions:en,cooldownSec:30,cooldownScope:`rule-device`,cooldownGranularity:void 0}}function xn(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,mediaLinkedCameras:e.media.linkedCameras,templateTitle:e.template?.title??``,templateBody:e.template?.body??``,...gn(e.conditions),schedule:e.schedule,systemEventDelivery:e.systemEventDelivery,snoozeAllowGlobal:e.snoozeAllowGlobal===!0,groupingSec:e.groupingSec,snoozeOptions:e.snoozeOptions,actions:tn(e.actions),cooldownSec:e.throttle.cooldownSec,cooldownScope:e.throttle.scope,cooldownGranularity:e.throttle.granularity}}function Sn(e,t){let n=[];if(On(e)){let r=e.groupingSec;r!==void 0&&(!Number.isInteger(r)||r<5||r>60)&&n.push(`The grouping window is a whole number of seconds between 5 and 60.`);let i=t?.confirm;i?.enabled===!0&&i.expect!==void 0&&!kn(i.expect)&&n.push(`This rule’s AI confirm expects more than one subject, but a grouped message judges one picture per subject, so it would never send. Remove the confirm expectation (viewer or API), or choose Immediate.`)}if(_(e.conditions.audio)&&n.push(`This sound rule names neither a sound nor a level threshold, so it can never fire — every sample would count as a hit and the engine refuses it rather than notifying on silence. Pick at least one sound, or add a level.`),(!Number.isInteger(e.cooldownSec)||e.cooldownSec<0||e.cooldownSec>86400)&&n.push(`The cooldown is a whole number of seconds between 0 and ${String(lt)} (24 hours). 0 means every match is delivered.`),Y(e))for(let t of ne({delivery:e.delivery,conditions:e.conditions,...e.systemEventDelivery===void 0?{}:{systemEventDelivery:e.systemEventDelivery},...J(e.actions)===void 0?{}:{actions:J(e.actions)}}))n.push(oe(t));return n}function Cn(e){let t=e.systemEventDelivery;if(t===void 0)return{};if(!b(e.delivery))return t.mode===`summary`?{systemEventDelivery:{mode:`instant`}}:{};if(t.mode===`summary`&&ee(t.schedule)===null){let e=ue(t.schedule);if(e!==null&&e.times.length>0)return{systemEventDelivery:{...t,schedule:se(e.times,t.schedule.timezone)}}}return{systemEventDelivery:t}}function wn(e){if(!Y(e))return null;if(!de(e.templateBody))return`This body names none of the summary ({{summaryText}} or a section variable) — the hub appends {{summaryText}} to it when it sends.`;let t=e.templateBody;return(e.systemEventDelivery?.mode===`summary`?e.systemEventDelivery.split:void 0)===`section`&&t.trim().length>0&&!/\{\{\s*summaryText\s*\}\}/.test(t)?`Sent one per category: this body names no {{summaryText}}, so on every other category’s notification the hub appends {{summaryText}} (that category’s lines).`:null}function Y(e){return b(e.delivery)&&e.systemEventDelivery?.mode===`summary`}function Tn(e,t,n=new Set){return Sn(e,t).length===0&&rt(e.delivery)&&(!b(e.delivery)||Nn(e)>0)&&v(e)!==`mixed`&&e.name.trim().length>0&&(e.targetIds.length>0||e.targetUsers.length>0)&&nn(e.actions,n).length===0}function En(e,t){let n=jn(e.conditions,t);return b(t)&&(n.systemEvent?.kinds.length??0)===0?{...e,delivery:t,conditions:{...n,systemEvent:z(`device-events`)}}:{...e,delivery:t,conditions:n}}function Dn(e,t){return t===`immediate-grouped`?{...En(e,`immediate`),groupingSec:e.groupingSec??20}:{...En(e,t),groupingSec:void 0}}function On(e){return e.groupingSec!==void 0&&x(e)}function kn(e){switch(e.op){case`>`:return 1>e.count;case`<=`:return 1<=e.count;case`<`:return 1<e.count;case`==`:return e.count===1;default:return 1>=e.count}}var An=new Set([`immediate`,`track-end`,`package-event`]);function jn(e,t){if(e.source!==`pipeline`||An.has(t))return e;let{source:n,...r}=e;return r}function Mn(e,t){return Ce(e.conditions.systemEvent)===t?e:{...e,conditions:{...e.conditions,systemEvent:z(t)}}}function Nn(e){return e.conditions.systemEvent?.kinds.length??0}function X(e,t){return e.appliesTo.includes(t)}var Pn={source:`any`};function Fn(e,t){if(t==null)return!0;if(Array.isArray(t))return t.length===0;if(typeof t==`string`)return t.length===0||Pn[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}var In=ae.filter(e=>e.id===`audio`);function Ln(e){if(e.length===0)return e;let t=new Set(e.map(e=>e.id)),n=In.filter(e=>!t.has(e.id));return n.length===0?e:[...e,...n]}function Rn(e,t,n,r=v({delivery:t,conditions:e})){let i=n.length===0?null:new Set(n.filter(e=>e.id!==`schedule`&&we(e,t,r)).map(e=>e.id)),a={};for(let[t,n]of Object.entries(e))i!==null&&!i.has(t)||F(t,e)&&(Fn(t,n)||(a[t]=n));return a}function zn(e,t){if(e===void 0)return{};let n=Rt(e,t.systemEvent);return n===void 0?{}:{systemEvent:n}}function Bn(e){return e!==void 0&&e.windows.length>0}function Vn(e){let t={...e.clipPreRollSec===void 0?{}:{clipPreRollSec:e.clipPreRollSec},...e.clipPostRollSec===void 0?{}:{clipPostRollSec:e.clipPostRollSec}};return Object.keys(t).length>0?t:void 0}function Hn(e){let t=Vn(e.media);return{...e.confirm===void 0?{}:{confirm:e.confirm},...t===void 0?{}:{media:t}}}function Un(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=J(e.actions),s=v(e),c=y(s),l=he(s),u=n.length===0?!0:n.some(t=>t.id===`schedule`&&X(t,e.delivery)),d=!Y(e)&&u&&Bn(e.schedule)?e.schedule:void 0,f=n.length===0?!0:n.some(t=>t.id===`devices`&&X(t,e.delivery)),p=n.length===0?!0:n.some(t=>t.id===`devicesExclude`&&X(t,e.delivery)),{devices:m,devicesExclude:h,...g}=_n(e);return{name:e.name.trim(),enabled:e.enabled,delivery:e.delivery,conditions:{...Rn(g,e.delivery,n,s),...f&&m!==void 0?{devices:m}:{},...p&&h!==void 0?{devicesExclude:h}:{},...zn(l,e.conditions)},...d?{schedule:d}:{},...Cn(e),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:c.carriesMedia?{attach:e.mediaAttach,...c.carriesSubjectCrop&&e.mediaZoneCrop?{zoneCrop:!0}:{},...c.carriesSubjectCrop&&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},...s===`sensor`&&e.mediaAttach!==`none`&&e.mediaLinkedCameras!==void 0?{linkedCameras:e.mediaLinkedCameras}:{},...(e.mediaGif||e.mediaClip)&&t?.media?.clipPreRollSec!==void 0?{clipPreRollSec:t.media.clipPreRollSec}:{},...(e.mediaGif||e.mediaClip)&&t?.media?.clipPostRollSec!==void 0?{clipPostRollSec:t.media.clipPostRollSec}:{}}:{attach:`none`},throttle:{cooldownSec:e.cooldownSec,scope:e.cooldownScope,...e.cooldownGranularity===void 0?{}:{granularity:e.cooldownGranularity}},priority:e.priority,...a?{template:a}:{},...e.snoozeAllowGlobal?{snoozeAllowGlobal:!0}:{},...On(e)?{groupingSec:e.groupingSec}:{},...e.snoozeOptions===void 0?{}:{snoozeOptions:[...e.snoozeOptions]},...t?.confirm===void 0?{}:{confirm:t.confirm},...o===void 0?{}:{actions:o}}}function Wn(e,t){let n=Un(e,void 0,t);return[`template`,`schedule`,`targetUsers`,`snoozeOptions`,`snoozeAllowGlobal`,`groupingSec`,`actions`].filter(e=>n[e]===void 0)}var Gn=[{key:`rule`,label:`Rule`,fields:[`name`,`enabled`,`delivery`,`groupingSec`,`targetIds`,`targetUsers`,`targetParams`]},{key:`devices`,label:`Devices`,fields:[`deviceScope`]},{key:`conditions`,label:`Conditions`,fields:[`conditions`,`classScope`,`schedule`,`systemEventDelivery`]},{key:`notification`,label:`Notification`,fields:[`priority`,`mediaAttach`,`mediaFrame`,`mediaZoneCrop`,`mediaGif`,`mediaClip`,`mediaProfile`,`mediaClipSpeed`,`mediaLinkedCameras`,`templateTitle`,`templateBody`]},{key:`actions`,label:`Actions`,fields:[`actions`]},{key:`advanced`,label:`Advanced`,fields:[`snoozeAllowGlobal`,`snoozeOptions`,`cooldownSec`,`cooldownScope`,`cooldownGranularity`]}];function Kn(e,t={}){let n=v({delivery:e,conditions:t}),r=y(n),i=Gn.map(e=>e.key===`conditions`?{...e,label:r.label}:e);return ve(n)?i.filter(e=>e.key!==`devices`):i}function qn(e){if(e.audio!==void 0)return`Sound`;if(e.occupancy!==void 0)return`Occupancy`}function Jn(e){let t=v(e),n=Se(_n(e),t);return t===`sensor`&&e.conditions.sensorTransition!==void 0&&!F(`sensorTransition`,e.conditions)?[...n,{conditionId:`sensorTransition`,reason:te}]:n}var Yn=`rule`;function Xn(e){return Gn.find(t=>t.key===e)?.key}function Zn(e){return e?.toLowerCase().startsWith(`it`)===!0?`it`:`en`}function Qn(){let{i18n:e}=E(),t=Zn(e.language);return e=>ce(e,t)}e();var $n=`block text-[11px] font-medium text-foreground`,Z=`text-[10px] text-foreground-subtle mt-0.5`;function er({cameras:e,fleet:t,value:n,onChange:r,emptyMeansAll:i=!1,savedHadDevices:a=!1}){return o(Oe,{devices:e,listState:t.state,fleet:t,value:n,onChange:r,emptyMeansAll:i,savedHadDevices:a})}function tr({value:e,placeholder:n,onChange:r}){let[i,s]=a(``),c=()=>{let t=i.trim();if(t.length===0||e.includes(t)){s(``);return}r([...e,t]),s(``)},l=t=>r(e.filter(e=>e!==t));return t(`div`,{className:`mt-1 space-y-1.5`,children:[e.length>0&&o(`div`,{className:`flex flex-wrap gap-1`,children:e.map(e=>t(`span`,{className:`inline-flex items-center gap-1 rounded bg-surface-hover px-1.5 py-0.5 text-[11px] text-foreground`,children:[e,o(`button`,{type:`button`,onClick:()=>l(e),"aria-label":`remove ${e}`,className:`text-foreground-subtle hover:text-danger`,children:o(d,{className:`h-3 w-3`})})]},e))}),o(T,{value:i,placeholder:n,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())},onBlur:c})]})}function nr({picker:e,value:r,onChange:i}){let a=n(()=>Te(e),[e]),s=n(()=>new Set(r),[r]),c=r.filter(e=>!a.has(e)),l=e=>{i(s.has(e)?r.filter(t=>t!==e):[...r,e])};return t(`div`,{className:`space-y-2`,children:[c.length>0&&o(`div`,{className:`flex flex-wrap gap-1`,children:c.map(e=>t(`button`,{type:`button`,onClick:()=>i(r.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=>t(`div`,{children:[o(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-muted mb-1`,children:e.fallbackLabel}),o(`div`,{className:`flex flex-wrap gap-1`,children:e.options.map(e=>{let t=s.has(e.value);return o(`button`,{type:`button`,"aria-pressed":t,onClick:()=>l(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 rr({value:e,min:n,max:r,step:i,onChange:a}){return t(`div`,{className:`mt-1 flex items-center gap-2`,children:[o(T,{type:`number`,value:e??``,min:n,max:r,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&&r!==void 0&&o(`input`,{type:`range`,min:n,max:r,step:i,value:e,onChange:e=>a(Number(e.target.value)),className:`flex-1 accent-primary`,"aria-label":`value`})]})}function ir({value:e,onChange:n,options:r}){let{t:i}=E(),a=ar(r??[]),s=a.length>0?a:Tt;return t(`div`,{className:`mt-1 space-y-1`,children:[o(w,{value:e??`enter`,options:s.map(e=>({value:e.value,label:i(`notificationRules.crossing.${e.value}`,e.label)})),onChange:e=>n(I(e.target.value))}),o(`p`,{className:Z,children:i(`notificationRules.crossing.hint`,`Which way the subject crosses the zone.`)})]})}function ar(e){let t=[];for(let n of e){let e=n.value===``||n.value===`enter`?Et:I(n.value);e===void 0||t.some(t=>t.value===e)||t.push({value:e,label:n.label})}return t}function or({deviceIds:e,cameras:t,value:n,onChange:r}){let{options:i,loading:a}=O(e,t);return o(k,{options:i,value:n,onChange:r,loading:a,noFreeText:!0,emptyHint:e.length===0?`Select cameras first — a rule can only use zones those cameras actually have.`:`The selected cameras have no zones. Draw one in the camera’s zone editor first.`,placeholder:``})}function sr({deviceIds:e,value:t,onChange:n}){let{options:r,loading:i}=qe(e);return o(k,{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 cr=[{value:`became-occupied`,label:`Became occupied`},{value:`became-free`,label:`Became free`},{value:`>=`,label:`Count ≥`},{value:`<=`,label:`Count ≤`}];function lr(e,t){let n=e.map(e=>({value:e.value,label:e.label}));return t===void 0||t===``||n.some(e=>e.value===t)?n:[...n,{value:t,label:`${t} — sub-type, never counts (always 0)`}]}function ur({deviceIds:e,cameras:n,classOptions:r,value:i,onChange:a}){let{options:s,loading:c}=O(e,n),l=i??me,u=e=>a({...l,...e}),d=l.op===`became-occupied`||l.op===`became-free`,f=lr(r,l.className);return t(`div`,{className:`mt-1 space-y-1.5`,children:[t(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[o(`div`,{className:`min-w-[10rem]`,children:o(w,{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})})}),o(`div`,{className:`min-w-[9rem]`,children:o(w,{value:l.className??``,options:[{value:``,label:`— any class —`},...f],onChange:e=>u({className:e.target.value===``?void 0:e.target.value})})}),o(`div`,{className:`min-w-[9rem]`,children:o(w,{value:l.op,options:cr.map(e=>({value:e.value,label:e.label})),onChange:e=>{let t=cr.find(t=>t.value===e.target.value);t&&u({op:t.value})}})})]}),t(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-foreground-subtle`,children:[t(`label`,{className:`flex items-center gap-1`,children:[d?`Threshold`:`Count`,o(T,{type:`number`,min:0,className:`w-16`,value:String(l.count),onChange:e=>u({count:Math.max(0,Number(e.target.value)||0)})})]}),t(`label`,{className:`flex items-center gap-1`,children:[`Hold for`,o(T,{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`]}),i===void 0?null:o(`button`,{type:`button`,onClick:()=>a(void 0),className:`underline hover:text-foreground`,children:`Clear`})]}),e.length===0&&o(`p`,{className:`text-[11px] text-warning`,children:`No camera picked on the Devices tab: this watches EVERY camera's occupancy, and no zone can be offered until you choose one — a zone id belongs to a camera.`}),o(`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.`})]})}var dr=[{value:`label`,label:`Sounds — fires at once`,Icon:u},{value:`level`,label:`Volume — over a window`,Icon:l}];function fr({taxonomy:e,value:n,onChange:i}){let a=le(n),s=e=>i(p(n,e)),{choices:c,unknownLabels:l}=g(e,a.labels),u=h(n)??`label`;return t(`div`,{className:`mt-1 space-y-2`,children:[t(`div`,{className:`flex flex-wrap items-center gap-1`,children:[dr.map(e=>o(`button`,{type:`button`,"aria-pressed":u===e.value,onClick:()=>s({mode:e.value}),className:`rounded border px-2 py-0.5 text-[11px] ${u===e.value?`border-primary bg-primary/15 text-foreground`:`border-border text-foreground-subtle hover:bg-surface-hover`}`,children:t(`span`,{className:`inline-flex items-center gap-1`,children:[o(e.Icon,{className:`h-3 w-3`}),e.label]})},e.value)),n===void 0?null:o(`button`,{type:`button`,onClick:()=>i(void 0),className:`ml-1 text-xs text-foreground-subtle underline hover:text-foreground`,children:`Clear`})]}),u===`label`?t(r,{children:[o(`div`,{className:`flex flex-wrap gap-1`,children:c.map(e=>{let n=xe(a.labels,e.value),r=e.unknown?`border-dashed border-warning text-warning`:n?`border-primary bg-primary/15 text-foreground`:`border-border text-foreground hover:bg-surface-hover`;return o(`button`,{type:`button`,"aria-pressed":n,title:e.unknown?`Stored by the rule — not offered by this hub`:void 0,onClick:()=>s({labels:be(a.labels,e.value)}),className:`rounded border px-1.5 py-0.5 text-[10px] ${r}`,children:t(`span`,{className:`inline-flex items-center gap-1`,children:[o(ke,{iconId:e.iconId,size:12}),e.label]})},e.value)})}),l.length>0&&t(`p`,{className:`text-[10px] text-warning`,children:[`Kept from the rule, unknown to this hub: `,l.join(`, `)]}),t(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-foreground-subtle`,children:[t(`label`,{className:`flex items-center gap-1`,children:[`Confirm after`,o(T,{type:`number`,min:1,max:20,step:1,className:`w-16`,value:String(a.confirmHits??2),onChange:e=>s({confirmHits:Number(e.target.value)})}),`frames`]}),t(`label`,{className:`flex items-center gap-1`,children:[`within`,o(T,{type:`number`,min:1,max:60,step:1,className:`w-16`,value:String(a.confirmWindowSec??5),onChange:e=>s({confirmWindowSec:Number(e.target.value)})}),`s`]})]}),t(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`Fires when that many labelled frames land inside the window (default`,` `,2,` in `,5,` s). A single-frame false positive never reaches 2; a real episode usually labels two or three frames. The rule's cooldown is the other throttle.`]})]}):t(r,{children:[o(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-foreground-subtle`,children:t(`label`,{className:`flex items-center gap-1`,children:[`Louder than`,o(T,{type:`number`,min:fe,max:0,step:3,className:`w-20`,value:String(a.dbThreshold??m),onChange:e=>s({dbThreshold:Number(e.target.value)})}),`dBFS`]})}),t(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-foreground-subtle`,children:[t(`label`,{className:`flex items-center gap-1`,children:[`Hits`,o(T,{type:`number`,min:1,max:100,step:5,className:`w-16`,value:String(a.hitPercent),onChange:e=>s({hitPercent:Number(e.target.value)})}),`% (default `,C.hitPercent,`)`]}),t(`label`,{className:`flex items-center gap-1`,children:[`over`,o(T,{type:`number`,min:1,max:300,step:5,className:`w-16`,value:String(a.samplingSeconds),onChange:e=>s({samplingSeconds:Number(e.target.value)})}),`s (default `,C.samplingSeconds,`)`]})]}),t(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`dBFS is negative-going: 0 is full scale, `,fe,` is silence — so a HIGHER number is a narrower filter. Measured on this hub, a baby crying reads `,`−`,`55 to `,`−`,`26 dBFS, so a floor above `,`−`,`55 excludes most of it. The window must be FULL before it can match.`]})]}),_(n)?o(`p`,{className:`text-[11px] text-warning`,children:`With neither a sound nor a level threshold this can never match — every sample would be a hit, so the engine refuses it rather than notifying on silence.`}):null]})}function pr({value:e,onChange:n}){let r=e?.values??[],i=e?.maxDistance??1,a=e=>n(e.length>0?{values:e,maxDistance:i}:void 0),s=e=>n(r.length>0?{values:r,maxDistance:e}:void 0),c=Ye().filter(e=>!r.includes(e));return t(`div`,{className:`mt-1 space-y-1.5`,children:[o(tr,{value:r,placeholder:`Plate text…`,onChange:a}),c.length>0&&t(`div`,{className:`flex flex-wrap items-center gap-1`,children:[o(`span`,{className:`text-[10px] text-foreground-subtle`,children:`Seen:`}),c.slice(0,12).map(e=>o(`button`,{type:`button`,onClick:()=>a([...r,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))]}),t(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[`Max distance`,o(T,{type:`number`,min:0,max:3,step:1,value:i,className:`max-w-[5rem]`,onChange:e=>{let t=Number(e.target.value);s(Number.isFinite(t)?Math.max(0,Math.min(3,t)):1)}})]})]})}function mr({gateable:e,value:n,onChange:r}){let i=Qn(),a=e.find(e=>e.id===n?.deviceId),s=new Set(n?.states??[]),c=e=>{let t=Number(e);if(!Number.isFinite(t)||t===0)return r(void 0);r({deviceId:t,states:[]})},l=e=>{if(n===void 0)return;let t=new Set(s);t.has(e)?t.delete(e):t.add(e),r(t.size===0?void 0:{deviceId:n.deviceId,states:[...t]})};return t(`div`,{className:`mt-1 space-y-2`,children:[o(w,{value:n===void 0?``:String(n.deviceId),options:[{value:``,label:`— no device gate —`},...e.map(e=>({value:String(e.id),label:e.name}))],onChange:e=>c(e.target.value)}),a!==void 0&&o(`div`,{className:`flex flex-wrap gap-1.5`,children:a.states.map(e=>o(`button`,{type:`button`,onClick:()=>l(e),className:s.has(e)?`rounded-md border border-primary bg-primary/10 px-2 py-0.5 text-[11px] text-primary`:`rounded-md border border-border px-2 py-0.5 text-[11px] text-foreground-subtle`,children:i(e)},e))}),a!==void 0&&a.states.length===0&&o(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:`This device reports no state the gate can read, so it cannot arm a rule.`}),n!==void 0&&o(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:`The rule is silent while the device is in any other state — including when its state cannot be read at all.`})]})}function hr(e,t){let n=t(e.verdict);return e.latched?`${n} · ${t(`latched`)}`:n}function gr({scenes:e,value:n,onChange:r}){let{t:i}=E(),a=Qn(),s=e.find(e=>e.sceneId===n?.sceneId),c=t=>{if(t===``)return r(void 0);let i=e.find(e=>e.sceneId===t);if(i===void 0)return r(void 0);r({sceneId:t,deviceId:i.deviceId,requiredState:n?.requiredState??`diverged`,...n?.latched===void 0?{}:{latched:n.latched}})},l=e=>{n!==void 0&&r({...n,requiredState:e===`matched`?`matched`:`diverged`})},u=e=>{if(n!==void 0){if(e===``){let{latched:e,...t}=n;return r(t)}r({...n,latched:e===`latched`})}};return e.length===0?o(`p`,{className:Z,children:i(`notificationRules.scene.none`,`No scenes yet — create one on the Scenes page.`)}):t(`div`,{className:`mt-1 space-y-2`,children:[o(w,{value:n?.sceneId??``,options:[{value:``,label:i(`notificationRules.scene.noGate`,`— no scene gate —`)},...e.map(e=>({value:e.sceneId,label:`${e.cameraName} · ${e.label} — ${hr(e,a)}`}))],onChange:e=>c(e.target.value)}),n!==void 0&&t(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[i(`notificationRules.scene.onlyWhile`,`Only while it is`),o(w,{value:n.requiredState,options:[{value:`diverged`,label:a(`diverged`)},{value:`matched`,label:a(`matched`)}],onChange:e=>l(e.target.value)})]}),t(`label`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[i(`notificationRules.scene.read`,`Read`),o(w,{value:n.latched===void 0?``:n.latched?`latched`:`live`,options:[{value:``,label:s===void 0?i(`notificationRules.scene.readOwn`,`The scene's own setting`):`${i(`notificationRules.scene.readOwn`,`The scene's own setting`)} (${a(s.emit)})`},{value:`latched`,label:a(`latched`)},{value:`live`,label:a(`live`)}],onChange:e=>u(e.target.value)})]})]}),s!==void 0&&t(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:[i(`notificationRules.scene.rightNow`,`Right now:`),` `,hr(s,a)]}),n!==void 0&&s===void 0&&o(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:i(`notificationRules.scene.missing`,`This scene no longer exists — pick another or remove the gate.`)})]})}var Q={days:[0,1,2,3,4,5,6],minute:480},_r=[{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 vr(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function $(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 yr(e){if(typeof e!=`object`||!e||!(`data`in e))return;let t=e.data;if(!(typeof t!=`object`||!t||!(`code`in t)))return typeof t.code==`string`?t.code:void 0}function br(e){let t=Object.entries(e).map(([e,t])=>`${e} ${String(t)}`);return t.length>0?`Left out by this rule's filters or a camera mute: ${t.join(`, `)}.`:null}function xr(e,t,n,r=`rule`){if(e===`error`)return yr(n)===`NOT_FOUND`?{lines:[`This hub does not serve summary rules yet — update @camstack/server first. A rule saved now would be stored without its summary, and stay instant.`]}:{lines:[`The preview could not be read: ${n instanceof Error?n.message:String(n)}`]};if(e!==`success`||t===void 0)return null;let i=[];if(r===`section`&&t.split===void 0&&i.push(`This hub does not send per-category summaries yet — update @camstack/server first. Until then it sends one message.`),t.empty)i.push(`Nothing to report right now — no notification would be sent.`);else if(t.split===`section`&&t.rows!==void 0){let e=t.rows.length;i.push(`${String(e)} notification${e===1?``:`s`} would be sent now, one per category:`);for(let e of t.rows)i.push(`${e.title}\n${e.text}`)}else i.push(`${String(t.count)} item(s) would be sent now:\n${t.text}`);let a=br(t.dropped);return a!==null&&i.push(a),t.excludedGroups.includes(`backups-exports`)&&i.push(`Backups and exports are completed jobs, not a state — they are not in a summary.`),{lines:i}}function Sr(e,t){return{...e,schedule:t}}function Cr(e,t){let{split:n,...r}=e;return t===`section`?{...r,split:t}:r}function wr(e){return vr(e)}function Tr(e){return $(e)}function Er(){return{days:[1,2,3,4,5],startMinute:540,endMinute:1080}}function Dr(e){return{days:[...Q.days],minute:e}}var Or=`Always active — add a window to restrict when the rule fires.`;function kr({value:e,onChange:t,mode:n=`windows`,defaultMinute:r=Q.minute,emptyHint:i}){return n===`times`?o(jr,{value:e,onChange:t,defaultMinute:r}):o(Ar,{value:e,onChange:t,emptyHint:i??Or})}function Ar({value:e,onChange:n,emptyHint:r}){let i=e?.windows??[],a=e?.invert??!1,s=(t,r)=>{if(t.length===0){n(void 0);return}n({windows:t,...r?{invert:!0}:{},...e?.timezone?{timezone:e.timezone}:{}})},l=()=>s([...i,Er()],a),u=e=>s(i.filter((t,n)=>n!==e),a),d=(e,t)=>s(i.map((n,r)=>r===e?t:n),a);return t(`div`,{className:`mt-1 space-y-2`,"data-testid":`schedule-field-windows`,children:[i.length===0?o(`p`,{className:Z,children:r}):i.map((e,t)=>o(Mr,{window:e,onChange:e=>d(t,e),onRemove:()=>u(t)},t)),t(`div`,{className:`flex items-center gap-3`,children:[t(`button`,{type:`button`,onClick:l,className:`flex items-center gap-1 rounded-md bg-surface-hover px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground`,children:[o(c,{className:`h-3 w-3`}),` Add window`]}),i.length>0&&t(`label`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[o(`input`,{type:`checkbox`,checked:a,onChange:e=>s([...i],e.target.checked),className:`accent-primary`}),`Active outside the windows`]})]})]})}function jr({value:e,onChange:n,defaultMinute:r}){let i=e?.timezone,a=e===void 0?{times:[],approximated:!1}:ue(e);if(a===null)return t(`div`,{className:`mt-1 space-y-2`,"data-testid":`schedule-field-times-fallback`,children:[o(`p`,{className:Z,children:`Inverted schedule — shown as bands. Clear the invert flag (or the windows) to author punctual times.`}),o(Ar,{value:e,onChange:n,emptyHint:Or})]});let s=a.times,l=e=>{if(e.length===0){n(void 0);return}n(se(e,i))};return t(`div`,{className:`mt-1 space-y-2`,"data-testid":`schedule-field-times`,children:[a.approximated&&o(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,"data-testid":`schedule-field-times-approximated`,children:`Shown as send-at times from each window's end (when the summary fires). Edit or save to store them as punctual one-minute windows.`}),s.length===0?o(`p`,{className:Z,children:`No times yet — add one to send on those days at that clock time.`}):s.map((e,t)=>o(Nr,{time:e,index:t,onChange:e=>l(s.map((n,r)=>r===t?e:n)),onRemove:s.length>1?()=>l(s.filter((e,n)=>n!==t)):void 0},t)),t(`button`,{type:`button`,onClick:()=>l([...s,Dr(r)]),className:`flex items-center gap-1 rounded-md bg-surface-hover px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground`,"data-testid":`schedule-field-add-time`,children:[o(c,{className:`h-3 w-3`}),` Add a time`]})]})}function Mr({window:e,onChange:n,onRemove:r}){return t(`div`,{className:`space-y-1.5 rounded-md border border-border p-2`,children:[t(`div`,{className:`flex items-center gap-2 text-xs`,children:[o(`input`,{type:`time`,value:wr(e.startMinute),onChange:t=>n({...e,startMinute:Tr(t.target.value)}),className:`rounded-md border border-border bg-background px-1 py-0.5`}),o(`span`,{className:`text-foreground-subtle`,children:`→`}),o(`input`,{type:`time`,value:wr(e.endMinute),onChange:t=>n({...e,endMinute:Tr(t.target.value)}),className:`rounded-md border border-border bg-background px-1 py-0.5`}),o(`span`,{className:`flex-1`}),o(`button`,{type:`button`,onClick:r,"aria-label":`Remove window`,className:`text-foreground-subtle hover:text-danger`,children:o(s,{className:`h-3.5 w-3.5`})})]}),o(Pr,{days:e.days,onToggle:t=>{let r=e.days.includes(t)?e.days.filter(e=>e!==t):[...e.days,t];r.length!==0&&n({...e,days:r})}})]})}function Nr({time:e,index:n,onChange:r,onRemove:i}){return t(`div`,{className:`space-y-1.5 rounded-md border border-border p-2`,children:[t(`div`,{className:`flex items-center gap-2 text-xs`,children:[o(`span`,{className:`text-foreground-subtle`,children:`At`}),o(`input`,{type:`time`,value:vr(e.minute),onChange:t=>r({...e,minute:$(t.target.value)}),className:`rounded-md border border-border bg-background px-1 py-0.5`,"data-testid":`schedule-field-time-${String(n)}`}),o(`span`,{className:`flex-1`}),i!==void 0&&o(`button`,{type:`button`,onClick:i,"aria-label":`Remove time`,className:`text-foreground-subtle hover:text-danger`,children:o(s,{className:`h-3.5 w-3.5`})})]}),o(Pr,{days:e.days,onToggle:t=>{let n=e.days.includes(t)?e.days.filter(e=>e!==t):[...e.days,t];n.length!==0&&r({...e,days:n})}})]})}function Pr({days:e,onToggle:t}){return o(`div`,{className:`flex flex-wrap gap-1`,children:_r.map(n=>o(`button`,{type:`button`,onClick:()=>t(n.value),className:`rounded px-1.5 py-0.5 text-[10px] ${e.includes(n.value)?`bg-primary text-primary-foreground`:`bg-surface-hover text-foreground-subtle`}`,children:n.label},n.value))})}export{Kt as $,k as $t,un as A,it as At,yn as B,ot as Bt,Xn as C,ft as Ct,Hn as D,gt as Dt,Un as E,N as Et,hn as F,Ze as Ft,K as G,pt as Gt,dn as H,At as Ht,Tn as I,Qe as It,rn as J,yt as Jt,q as K,$e as Kt,mn as L,Ot as Lt,Mn as M,xt as Mt,bn as N,F as Nt,Ln as O,St as Ot,vn as P,ut as Pt,nn as Q,et as Qt,Y as R,rt as Rt,Jn as S,lt as St,Wn as T,j as Tt,wn as U,dt as Ut,xn as V,bt as Vt,cn as W,ht as Wt,on as X,vt as Xt,an as Y,_t as Yt,sn as Z,wt as Zt,tr as _,Ge as _n,V as _t,Cr as a,Ue as an,Yt as at,Yn as b,kt as bt,er as c,Be as cn,Vt as ct,Z as d,We as dn,Ht as dt,Je as en,G as et,$n as f,Re as fn,zt as ft,gr as g,Ke as gn,R as gt,pr as h,He as hn,H as ht,Sr as i,je as in,Zt as it,Dn as j,Ct as jt,ln as k,Dt as kt,mr as l,Le as ln,Ft as lt,ur as m,Me as mn,Wt as mt,Q as n,Ve as nn,$t as nt,fr as o,Ne as on,Xt as ot,rr as p,Fe as pn,Ut as pt,J as q,tt as qt,xr as r,Ie as rn,W as rt,ir as s,Pe as sn,Jt as st,kr as t,O as tn,Qt as tt,sr as u,ze as un,Gt as ut,nr as v,Lt as vt,Kn as w,M as wt,qn as x,mt as xt,or as y,P as yt,Sn as z,at as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-1Do_dc2z.js";export{t as get,e as init};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./src-BLkInT8U.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$i as e}from"./player-overlays-DWMIy1MJ.js";var t=e(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]);export{t};
|