@camera.ui/server 2.0.13 → 2.0.14

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.
Files changed (118) hide show
  1. package/dist/interface/assets/{404-Dfyzm8bF.js → 404-Dc_0Olmy.js} +1 -1
  2. package/dist/interface/assets/{About-B4Y3WP7T.js → About-CRCM-TCh.js} +1 -1
  3. package/dist/interface/assets/{Adminpanel-DSk1uh2x.js → Adminpanel-BhxC4MaN.js} +1 -1
  4. package/dist/interface/assets/{Automation-CTSfLcmF.js → Automation-CjM_2c6p.js} +2 -2
  5. package/dist/interface/assets/{AutomationImport-B1P0T0Pe.js → AutomationImport-BbXsgU4b.js} +2 -2
  6. package/dist/interface/assets/{AutomationStore-ZaaXPPbd.js → AutomationStore-BCC23cZT.js} +2 -2
  7. package/dist/interface/assets/{AutomationStoreDetail-B2vc7mTZ.js → AutomationStoreDetail-Nvw6dcvk.js} +2 -2
  8. package/dist/interface/assets/{Automations-Bvw-jTKi.js → Automations-ocOGPBSG.js} +2 -2
  9. package/dist/interface/assets/{Camera-BxmJXk11.js → Camera-CVcl--Be.js} +2 -2
  10. package/dist/interface/assets/{CameraConsole-CVqgED5u.js → CameraConsole-DYnZN6CV.js} +1 -1
  11. package/dist/interface/assets/{Cameras-DT62fcZK.js → Cameras-0-cK5Qao.js} +1 -1
  12. package/dist/interface/assets/{Camview-CqSckgLr.js → Camview-CXAaiOIz.js} +1 -1
  13. package/dist/interface/assets/{Config-p9t9zgly.js → Config-BAQtGxV_.js} +1 -1
  14. package/dist/interface/assets/{ConfigActionCameraControl-BLROOU0q.js → ConfigActionCameraControl-qKmOFx9h.js} +1 -1
  15. package/dist/interface/assets/{ConfigActionNotification-DIkFNlKe.js → ConfigActionNotification-xoPwijU8.js} +1 -1
  16. package/dist/interface/assets/{ConfigActionPlugin-rQeJ4umG.js → ConfigActionPlugin-TsGugsaT.js} +1 -1
  17. package/dist/interface/assets/{ConfigActionSensor-BWHpkoMs.js → ConfigActionSensor-D6HHblmj.js} +1 -1
  18. package/dist/interface/assets/{ConfigActionSnapshot-BlvQZl1R.js → ConfigActionSnapshot-BbBzu2um.js} +1 -1
  19. package/dist/interface/assets/{ConfigConditionSensorState-8bIGEhQd.js → ConfigConditionSensorState-B3DK1TSR.js} +1 -1
  20. package/dist/interface/assets/{ConfigTriggerDetection-D4UitpXI.js → ConfigTriggerDetection-C-Y6dqJY.js} +1 -1
  21. package/dist/interface/assets/{ConfigTriggerGeofence-Ci-gkmjS.js → ConfigTriggerGeofence-uGk0ucgz.js} +1 -1
  22. package/dist/interface/assets/{ConfigTriggerSensor-CZMplCYs.js → ConfigTriggerSensor-C6eoElEO.js} +1 -1
  23. package/dist/interface/assets/{ConfigTriggerSystem-OOffe8rK.js → ConfigTriggerSystem-KYnubRsW.js} +1 -1
  24. package/dist/interface/assets/{ConfigTriggerWebhook-Baul6M1Y.js → ConfigTriggerWebhook-DHvAht-3.js} +1 -1
  25. package/dist/interface/assets/{Console-MXiL0z_X.js → Console-CT9DL8G6.js} +1 -1
  26. package/dist/interface/assets/{CuiAvatar-BUwQnIaI.js → CuiAvatar-CGs4KCeb.js} +1 -1
  27. package/dist/interface/assets/{CuiBottomSheet-CzG0n4Oa.js → CuiBottomSheet-Ccqs8aqt.js} +1 -1
  28. package/dist/interface/assets/CuiBottomSheet-D7tzN1B7.js +1 -0
  29. package/dist/interface/assets/{CuiCameraCard-GH-DR5_s.js → CuiCameraCard-DiiA1IHK.js} +1 -1
  30. package/dist/interface/assets/{CuiCameraPipCard-CL_wj05b.js → CuiCameraPipCard-164Vxpyy.js} +1 -1
  31. package/dist/interface/assets/{CuiCameraRecordings-BjErk9Gl.js → CuiCameraRecordings-CZg6-Joe.js} +1 -1
  32. package/dist/interface/assets/{CuiCameraShares-qrJhZMEt.js → CuiCameraShares-CQKMJS0b.js} +1 -1
  33. package/dist/interface/assets/{CuiCameraSnapshot-Dn1QSGrr.js → CuiCameraSnapshot-siWvyXxy.js} +1 -1
  34. package/dist/interface/assets/{CuiCameraTable-or8VpE34.js → CuiCameraTable-CmxdJniV.js} +1 -1
  35. package/dist/interface/assets/{CuiImage-Bq3bxOOL.js → CuiImage-D1OR7e_p.js} +1 -1
  36. package/dist/interface/assets/{CuiMenu-DtnIPhcr.js → CuiMenu-CZdrrvGm.js} +1 -1
  37. package/dist/interface/assets/{CuiPluginCard-DKNWUFpR.js → CuiPluginCard-BW8voSST.js} +2 -2
  38. package/dist/interface/assets/{CuiPluginOAuthButton-C6FQiVkt.js → CuiPluginOAuthButton-BrNhLZTM.js} +2 -2
  39. package/dist/interface/assets/{CuiQRCode-uQygC1dP.js → CuiQRCode-BNrRF1kj.js} +1 -1
  40. package/dist/interface/assets/{CuiRecordingsGrid-Cuwd4L67.js → CuiRecordingsGrid-BHK62CGb.js} +1 -1
  41. package/dist/interface/assets/{CuiSchema-CH0GXMWV.js → CuiSchema-DQekVg-C.js} +1 -1
  42. package/dist/interface/assets/{Faces-cpO5vJbp.js → Faces-BGt7OeMa.js} +1 -1
  43. package/dist/interface/assets/{FirstSteps-BHTcbs9O.js → FirstSteps-DOuZ0Ejq.js} +1 -1
  44. package/dist/interface/assets/{Instances-BXiVG2Dm.js → Instances-BKuNMjic.js} +1 -1
  45. package/dist/interface/assets/{Logs-hMg2QOGj.js → Logs-DlHlslG8.js} +1 -1
  46. package/dist/interface/assets/{Menu-BiPBCi8Z.js → Menu-s4tcmA39.js} +1 -1
  47. package/dist/interface/assets/{OAuthDeviceFlow-Bia9UA3I.js → OAuthDeviceFlow-CuTYrD9O.js} +1 -1
  48. package/dist/interface/assets/{Plugin-DfRaHAsi.js → Plugin-rxCnj2kj.js} +1 -1
  49. package/dist/interface/assets/{PluginConsole-CRw4zTRM.js → PluginConsole-Co4fjc4f.js} +1 -1
  50. package/dist/interface/assets/{PluginDetail-BqRoLZc7.js → PluginDetail-CTN85V6r.js} +2 -2
  51. package/dist/interface/assets/{PluginSchema-TtBJPR_R.js → PluginSchema-BBKqhEhT.js} +1 -1
  52. package/dist/interface/assets/{PluginSearch-B_NYpJi3.js → PluginSearch-BSkk8YEd.js} +2 -2
  53. package/dist/interface/assets/PluginSearch-CysXKG6O.js +1 -0
  54. package/dist/interface/assets/{Plugins-DVFEGtj3.js → Plugins-DscYFuBq.js} +1 -1
  55. package/dist/interface/assets/{Recordings-dwm6lAoJ.js → Recordings-CwnEqtEu.js} +1 -1
  56. package/dist/interface/assets/{Settings-BpBmrGpS.js → Settings-D3tqwxff.js} +1 -1
  57. package/dist/interface/assets/{SettingsAccount-8Kh1uQqn.js → SettingsAccount-5DJA1JXc.js} +1 -1
  58. package/dist/interface/assets/SettingsAccount-CAx-eRn1.js +1 -0
  59. package/dist/interface/assets/{SettingsAppearance-EoBxclgt.js → SettingsAppearance-BycQWjE1.js} +1 -1
  60. package/dist/interface/assets/SettingsAppearance-C5kgUTlV.js +1 -0
  61. package/dist/interface/assets/{SettingsBackup-Bpsbg6Pm.js → SettingsBackup-DN3fnfll.js} +1 -1
  62. package/dist/interface/assets/{SettingsMqtt-ZQolc9lR.js → SettingsMqtt-DcxlsTHF.js} +1 -1
  63. package/dist/interface/assets/{SettingsNotifications-BOoMt1Er.js → SettingsNotifications-D6OW8JdD.js} +1 -1
  64. package/dist/interface/assets/{SettingsRecordings-BQhxLCgM.js → SettingsRecordings-Dnq3B9t-.js} +1 -1
  65. package/dist/interface/assets/{SettingsRemote-Cvcmpdgb.js → SettingsRemote-DewU1s-u.js} +1 -1
  66. package/dist/interface/assets/{SettingsSystem-B-yhq40t.js → SettingsSystem-jgptDmFF.js} +2 -2
  67. package/dist/interface/assets/{SettingsUsers-CezygBk8.js → SettingsUsers-BWzWokSD.js} +1 -1
  68. package/dist/interface/assets/{Terminal-CDQJGwb_.js → Terminal-DNZZe-ly.js} +1 -1
  69. package/dist/interface/assets/{VersionsHandler-BHR1k9zz.js → VersionsHandler-DOUnzS4w.js} +1 -1
  70. package/dist/interface/assets/{Workers-Bv-bWBC-.js → Workers-BpYgRNR_.js} +1 -1
  71. package/dist/interface/assets/{api-BhOwzvxK.js → api-BDmdOpiE.js} +1 -1
  72. package/dist/interface/assets/api-BLTlDTXb.js +2 -0
  73. package/dist/interface/assets/{auth-CNPkdTXX.js → auth-Bz_wOZY_.js} +1 -1
  74. package/dist/interface/assets/{automations-DhLADBhd.js → automations-BZJH0t8U.js} +1 -1
  75. package/dist/interface/assets/{cameras-DyF2T0be.js → cameras-BeI58GuP.js} +1 -1
  76. package/dist/interface/assets/{cameras.schema-DBzgU4m6.js → cameras.schema-BNPdbNpH.js} +1 -1
  77. package/dist/interface/assets/cloudHandoff-B1v8OCuH.js +1 -0
  78. package/dist/interface/assets/{config-c7o4sJrQ.js → config-B7ya1VEA.js} +1 -1
  79. package/dist/interface/assets/{deviceId-BYu9Q8Ay.js → deviceId-CGGDdDuU.js} +1 -1
  80. package/dist/interface/assets/{hasPermission-CgyWyOhQ.js → hasPermission-ByNfMevH.js} +1 -1
  81. package/dist/interface/assets/{instances-CRYtaTQS.js → instances-B1yf-GZK.js} +1 -1
  82. package/dist/interface/assets/{main-CgXkx5UO.js → main-DSqwFZhx.js} +2 -2
  83. package/dist/interface/assets/{notifications-sejZCb0L.js → notifications-CRDDcfL2.js} +1 -1
  84. package/dist/interface/assets/{plugins-CCLFcD4c.js → plugins-yCjIwfVx.js} +1 -1
  85. package/dist/interface/assets/{round-restart-alt-PDSZur-0.js → round-restart-alt-DX8oW4nB.js} +1 -1
  86. package/dist/interface/assets/{router-DkMUvvnP.js → router-CLY-toId.js} +2 -2
  87. package/dist/interface/assets/{server-C7SETTy9.js → server-CL_7W-Ge.js} +1 -1
  88. package/dist/interface/assets/{shares-Cy1SLL98.js → shares-CNCmI_b5.js} +1 -1
  89. package/dist/interface/assets/{theme-DqbhRu7y.js → theme-DqZM6oaM.js} +1 -1
  90. package/dist/interface/assets/{useAppVersion-WfdoG9Ji.js → useAppVersion-BWNhVD0_.js} +1 -1
  91. package/dist/interface/assets/{useBackupRestore-ootsFhdF.js → useBackupRestore-5e3MURs9.js} +1 -1
  92. package/dist/interface/assets/{useBiometricCredentials-Ca75xEru.js → useBiometricCredentials-Td1PJjhl.js} +1 -1
  93. package/dist/interface/assets/{useCameraOptions-BpL2zbfV.js → useCameraOptions-nvj6-uZg.js} +1 -1
  94. package/dist/interface/assets/{useCuiDialog-yVh5UWKF.js → useCuiDialog-DwpKUbrp.js} +1 -1
  95. package/dist/interface/assets/{useFileDownload-BcaNWndS.js → useFileDownload-EHYhCRvk.js} +1 -1
  96. package/dist/interface/assets/{useLogsSocket-BRSsUNqv.js → useLogsSocket-BWN3k9kv.js} +1 -1
  97. package/dist/interface/assets/{useServerRestart-PZhND5H_.js → useServerRestart-ZFTJSxW7.js} +1 -1
  98. package/dist/interface/assets/{useStreamStatus-nCx5ux1-.js → useStreamStatus-DxtAbw4P.js} +1 -1
  99. package/dist/interface/assets/{useUpdateChannel-3eHk3KXZ.js → useUpdateChannel-m5t7lNTq.js} +1 -1
  100. package/dist/interface/assets/{useUserOptions-DVC4k8Zs.js → useUserOptions-B3MwA59K.js} +1 -1
  101. package/dist/interface/assets/{users.schema-B4fEuoKZ.js → users.schema-BOs7h9k2.js} +1 -1
  102. package/dist/interface/assets/{view-grid-BWJS0bBD.js → view-grid-Ot05h3Js.js} +1 -1
  103. package/dist/interface/index.html +30 -30
  104. package/dist/interface/sw.js +1 -1
  105. package/dist/server/package.json +2 -2
  106. package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/detection.py +2 -2
  107. package/dist/server/src/manager/downloadManager.d.ts +1 -0
  108. package/dist/server/src/manager/downloadManager.js +12 -0
  109. package/dist/server/src/manager/downloadManager.js.map +1 -1
  110. package/dist/server/src/workers/agent.js +5 -3
  111. package/dist/server/src/workers/agent.js.map +1 -1
  112. package/package.json +2 -2
  113. package/dist/interface/assets/CuiBottomSheet-BA-u9UtN.js +0 -1
  114. package/dist/interface/assets/PluginSearch-DnJgg6-6.js +0 -1
  115. package/dist/interface/assets/SettingsAccount-CjgYe5mF.js +0 -1
  116. package/dist/interface/assets/SettingsAppearance-3i3Ix7j-.js +0 -1
  117. package/dist/interface/assets/api-Cea16mc8.js +0 -2
  118. package/dist/interface/assets/cloudHandoff-LxdvSi1a.js +0 -1
@@ -1,4 +1,4 @@
1
- import{Ar as e,F as t,Li as n,O as r,_n as i,bn as a,pn as o,vn as s}from"./vendor-cameraui-QuTJKoXE.js";import{C as c,D as l,Tt as u,_t as d,o as f,p}from"./api-Cea16mc8.js";import{$n as m,$t as h,An as g,Cr as _,En as v,Er as y,F as b,Hn as x,I as S,Ln as C,P as w,Rn as T,Sr as E,Tr as D,Vn as O,Zn as k,an as ee,ar as A,br as j,dn as M,fn as N,fr as P,lr as te,mn as F,mr as I,nr as L,on as R,pn as z,pr as ne,rr as B,un as V,ur as H,vn as U,xn as W,yn as G,zn as K}from"./vendor-ClrOISZp.js";import{n as re,r as ie}from"./vendor-zod-XsuaxHRY.js";import{C as ae,E as oe,F as se,H as ce,N as le,O as ue,P as de,S as fe,T as pe,v as me,w as he}from"./vendor-primevue-BdB7McKg.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useSharedComposables-USqd05AG.js";import{t as ve}from"./close-BTPBtoEq.js";import{t as ye}from"./cctv-DbFrrwEm.js";import{t as be}from"./CuiFloatingButton-BjpU1EHv.js";import{t as xe}from"./hasPermission-CgyWyOhQ.js";import{t as Se}from"./cameras-DyF2T0be.js";import{n as Ce}from"./useCuiCameraDrawer-BHUHw6W6.js";import{t as we}from"./useCuiDialog-yVh5UWKF.js";import{n as Te,r as Ee,t as De}from"./CuiSchema-CH0GXMWV.js";import{t as Oe}from"./plus-CJzoaVfR.js";import{a as ke,r as Ae}from"./cameras.schema-DBzgU4m6.js";import{t as je}from"./CuiDataTable-CjXiUFiJ.js";import{t as Me}from"./ring-resize-QxO72Hs5.js";import{t as Ne}from"./plus-CJ2GnX_q.js";var Pe={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Fe(e,t){return K(),F(`svg`,Pe,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`m19.07 4.93l-1.41 1.41A8 8 0 0 1 20 12a8 8 0 0 1-8 8a8 8 0 0 1-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12a6 6 0 0 0 6 6a6 6 0 0 0 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12a4 4 0 0 1-4 4a4 4 0 0 1-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72a2 2 0 0 0 2 2a2 2 0 0 0 2-2c0-.74-.4-1.38-1-1.72V2h-1A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10c0-2.76-1.12-5.26-2.93-7.07`},null,-1)]])}var Ie=H({name:`mdi-radar`,render:Fe}),Le={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Re(e,t){return K(),F(`svg`,Le,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`M12 9a3 3 0 0 0-3 3a3 3 0 0 0 3 3a3 3 0 0 0 3-3a3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5a5 5 0 0 1 5-5a5 5 0 0 1 5 5a5 5 0 0 1-5 5m0-12.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5`},null,-1)]])}var ze=H({name:`mdi-eye`,render:Re}),Be={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ve(e,t){return K(),F(`svg`,Be,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`M11.83 9L15 12.16V12a3 3 0 0 0-3-3zm-4.3.8l1.55 1.55c-.05.21-.08.42-.08.65a3 3 0 0 0 3 3c.22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53a5 5 0 0 1-5-5c0-.79.2-1.53.53-2.2M2 4.27l2.28 2.28l.45.45C3.08 8.3 1.78 10 1 12c1.73 4.39 6 7.5 11 7.5c1.55 0 3.03-.3 4.38-.84l.43.42L19.73 22L21 20.73L3.27 3M12 7a5 5 0 0 1 5 5c0 .64-.13 1.26-.36 1.82l2.93 2.93c1.5-1.25 2.7-2.89 3.43-4.75c-1.73-4.39-6-7.5-11-7.5c-1.4 0-2.74.25-4 .7l2.17 2.15C10.74 7.13 11.35 7 12 7`},null,-1)]])}var He=H({name:`mdi-eye-off`,render:Ve}),Ue={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function We(e,t){return K(),F(`svg`,Ue,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`M12.5 9q-.275 0-.425-.25t0-.5L15 3.175q.2-.325.5-.387t.65.112q1.725.775 3.05 2.162T21.25 8.2q.125.325-.038.563T20.7 9zm-3.575 1.225l-3-5.2q-.2-.325-.1-.65t.4-.525Q7.425 3 8.888 2.5T12 2q.375 0 .825.038t.75.087q.35.05.463.3t-.063.55L9.8 10.225q-.15.25-.437.25t-.438-.25M2.85 14q-.275 0-.5-.187t-.275-.463t-.062-.6T2 12q0-1.575.513-3.137T4.1 5.9q.275-.35.638-.35t.562.375l4.2 7.325q.15.25-.012.5T9.05 14zm5 7.1q-1.65-.8-3.025-2.175T2.75 15.8q-.125-.325.05-.562T3.325 15h8.15q.275 0 .425.25t0 .5l-2.875 5.025q-.2.325-.5.425t-.675-.1M12 22q-.35 0-.788-.038t-.762-.087q-.35-.05-.475-.3t.05-.55l4.125-7.2q.15-.25.5-.25t.5.25l2.95 5.125q.175.275.113.6t-.413.6q-1.15.85-2.687 1.35T12 22m6.775-3.875l-4.25-7.375q-.15-.25.013-.5t.437-.25h6.175q.275 0 .5.188t.275.462t.062.6T22 12q0 1.575-.513 3.163T19.9 18.125q-.2.275-.575.288t-.55-.288`},null,-1)]])}var Ge=H({name:`material-symbols-camera-rounded`,render:We}),Ke="#### Source: Bubble\n\nOther names: [ESeeCloud](http://www.eseecloud.com/), [dvr163](http://help.dvr163.com/).\n\n- you can skip `username`, `password`, `port`, `ch` and `stream` if they are default\n- setup separate streams for different channels and streams\n\n```yaml\nstreams:\n camera1: bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0\n```\n\n_Source: [Go2Rtc Bubble](https://github.com/seydx/go2rtc#source-bubble)_\n",qe='#### Source: CUI\n\nThis source can be used to stream dynamically generated, go2rtc compatible, URLs. The source is just a placeholder for a `https://` URL.\n\n```yaml\nstreams:\n camera1: cui://192.168.1.123:34567/some-identifier-if-you-want\n```\n\nThe URL will be changed to `https://192.168.1.123:34567/some-identifier-if-you-want` and the response must be like this:\n\n```json\n{\n {\n "streamUrl": "rtsp://192.168.1.1:554/stream",\n }\n}\n```\n\nGo2rtc will then use the `streamUrl` to stream the video. The `streamUrl` can be any URL that is compatible with go2rtc. The response must be a valid JSON object with the `streamUrl` key.\n',Je=`#### Source: Doorbird
1
+ import{Ar as e,F as t,Li as n,O as r,_n as i,bn as a,pn as o,vn as s}from"./vendor-cameraui-QuTJKoXE.js";import{C as c,D as l,Tt as u,_t as d,o as f,p}from"./api-BLTlDTXb.js";import{$n as m,$t as h,An as g,Cr as _,En as v,Er as y,F as b,Hn as x,I as S,Ln as C,P as w,Rn as T,Sr as E,Tr as D,Vn as O,Zn as k,an as ee,ar as A,br as j,dn as M,fn as N,fr as P,lr as te,mn as F,mr as I,nr as L,on as R,pn as z,pr as ne,rr as B,un as V,ur as H,vn as U,xn as W,yn as G,zn as K}from"./vendor-ClrOISZp.js";import{n as re,r as ie}from"./vendor-zod-XsuaxHRY.js";import{C as ae,E as oe,F as se,H as ce,N as le,O as ue,P as de,S as fe,T as pe,v as me,w as he}from"./vendor-primevue-BdB7McKg.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useSharedComposables-USqd05AG.js";import{t as ve}from"./close-BTPBtoEq.js";import{t as ye}from"./cctv-DbFrrwEm.js";import{t as be}from"./CuiFloatingButton-BjpU1EHv.js";import{t as xe}from"./hasPermission-ByNfMevH.js";import{t as Se}from"./cameras-BeI58GuP.js";import{n as Ce}from"./useCuiCameraDrawer-BHUHw6W6.js";import{t as we}from"./useCuiDialog-DwpKUbrp.js";import{n as Te,r as Ee,t as De}from"./CuiSchema-DQekVg-C.js";import{t as Oe}from"./plus-CJzoaVfR.js";import{a as ke,r as Ae}from"./cameras.schema-BNPdbNpH.js";import{t as je}from"./CuiDataTable-CjXiUFiJ.js";import{t as Me}from"./ring-resize-QxO72Hs5.js";import{t as Ne}from"./plus-CJ2GnX_q.js";var Pe={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Fe(e,t){return K(),F(`svg`,Pe,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`m19.07 4.93l-1.41 1.41A8 8 0 0 1 20 12a8 8 0 0 1-8 8a8 8 0 0 1-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12a6 6 0 0 0 6 6a6 6 0 0 0 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12a4 4 0 0 1-4 4a4 4 0 0 1-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72a2 2 0 0 0 2 2a2 2 0 0 0 2-2c0-.74-.4-1.38-1-1.72V2h-1A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10c0-2.76-1.12-5.26-2.93-7.07`},null,-1)]])}var Ie=H({name:`mdi-radar`,render:Fe}),Le={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Re(e,t){return K(),F(`svg`,Le,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`M12 9a3 3 0 0 0-3 3a3 3 0 0 0 3 3a3 3 0 0 0 3-3a3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5a5 5 0 0 1 5-5a5 5 0 0 1 5 5a5 5 0 0 1-5 5m0-12.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5`},null,-1)]])}var ze=H({name:`mdi-eye`,render:Re}),Be={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ve(e,t){return K(),F(`svg`,Be,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`M11.83 9L15 12.16V12a3 3 0 0 0-3-3zm-4.3.8l1.55 1.55c-.05.21-.08.42-.08.65a3 3 0 0 0 3 3c.22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53a5 5 0 0 1-5-5c0-.79.2-1.53.53-2.2M2 4.27l2.28 2.28l.45.45C3.08 8.3 1.78 10 1 12c1.73 4.39 6 7.5 11 7.5c1.55 0 3.03-.3 4.38-.84l.43.42L19.73 22L21 20.73L3.27 3M12 7a5 5 0 0 1 5 5c0 .64-.13 1.26-.36 1.82l2.93 2.93c1.5-1.25 2.7-2.89 3.43-4.75c-1.73-4.39-6-7.5-11-7.5c-1.4 0-2.74.25-4 .7l2.17 2.15C10.74 7.13 11.35 7 12 7`},null,-1)]])}var He=H({name:`mdi-eye-off`,render:Ve}),Ue={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function We(e,t){return K(),F(`svg`,Ue,[...t[0]||=[M(`path`,{fill:`currentColor`,d:`M12.5 9q-.275 0-.425-.25t0-.5L15 3.175q.2-.325.5-.387t.65.112q1.725.775 3.05 2.162T21.25 8.2q.125.325-.038.563T20.7 9zm-3.575 1.225l-3-5.2q-.2-.325-.1-.65t.4-.525Q7.425 3 8.888 2.5T12 2q.375 0 .825.038t.75.087q.35.05.463.3t-.063.55L9.8 10.225q-.15.25-.437.25t-.438-.25M2.85 14q-.275 0-.5-.187t-.275-.463t-.062-.6T2 12q0-1.575.513-3.137T4.1 5.9q.275-.35.638-.35t.562.375l4.2 7.325q.15.25-.012.5T9.05 14zm5 7.1q-1.65-.8-3.025-2.175T2.75 15.8q-.125-.325.05-.562T3.325 15h8.15q.275 0 .425.25t0 .5l-2.875 5.025q-.2.325-.5.425t-.675-.1M12 22q-.35 0-.788-.038t-.762-.087q-.35-.05-.475-.3t.05-.55l4.125-7.2q.15-.25.5-.25t.5.25l2.95 5.125q.175.275.113.6t-.413.6q-1.15.85-2.687 1.35T12 22m6.775-3.875l-4.25-7.375q-.15-.25.013-.5t.437-.25h6.175q.275 0 .5.188t.275.462t.062.6T22 12q0 1.575-.513 3.163T19.9 18.125q-.2.275-.575.288t-.55-.288`},null,-1)]])}var Ge=H({name:`material-symbols-camera-rounded`,render:We}),Ke="#### Source: Bubble\n\nOther names: [ESeeCloud](http://www.eseecloud.com/), [dvr163](http://help.dvr163.com/).\n\n- you can skip `username`, `password`, `port`, `ch` and `stream` if they are default\n- setup separate streams for different channels and streams\n\n```yaml\nstreams:\n camera1: bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0\n```\n\n_Source: [Go2Rtc Bubble](https://github.com/seydx/go2rtc#source-bubble)_\n",qe='#### Source: CUI\n\nThis source can be used to stream dynamically generated, go2rtc compatible, URLs. The source is just a placeholder for a `https://` URL.\n\n```yaml\nstreams:\n camera1: cui://192.168.1.123:34567/some-identifier-if-you-want\n```\n\nThe URL will be changed to `https://192.168.1.123:34567/some-identifier-if-you-want` and the response must be like this:\n\n```json\n{\n {\n "streamUrl": "rtsp://192.168.1.1:554/stream",\n }\n}\n```\n\nGo2rtc will then use the `streamUrl` to stream the video. The `streamUrl` can be any URL that is compatible with go2rtc. The response must be a valid JSON object with the `streamUrl` key.\n',Je=`#### Source: Doorbird
2
2
 
3
3
  [Doorbird](https://www.doorbird.com/) proprietary camera protocol with **two way audio** support.
4
4
 
@@ -1 +1 @@
1
- import{Ar as e,O as t,_n as n,b as r,c as i,fi as a,lt as o,pn as s,u as c,vn as l}from"./vendor-cameraui-QuTJKoXE.js";import{D as u,Tt as d,h as f,o as p,w as m}from"./api-Cea16mc8.js";import{$n as h,$t as g,An as ee,Cr as _,En as v,Er as y,F as b,Gn as te,I as ne,Ln as x,On as S,P as re,Pn as C,Rn as w,Sr as T,Tr as E,Vn as ie,Zn as D,_r as O,an as k,br as A,dn as j,fn as M,fr as N,jn as P,mn as F,mr as I,nr as L,on as ae,pn as R,rn as oe,rr as z,un as B,ur as V,vr as se,xn as H,yn as U,zn as W}from"./vendor-ClrOISZp.js";import{f as ce}from"./vendor-core-CCcu_nmz.js";import{H as le,K as G,P as ue,o as K,z as de}from"./vendor-primevue-BdB7McKg.js";import{A as q,D as fe,E as pe,M as me,N as he,O as ge,P as _e,S as ve,T as ye,j as be,k as xe,w as Se}from"./CuiCameraCard-GH-DR5_s.js";import{t as Ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{i as we,n as Te,r as Ee,t as De}from"./useSharedComposables-USqd05AG.js";import{n as Oe}from"./ui-g5rCwxUE.js";import{t as J}from"./close-BTPBtoEq.js";import{t as ke}from"./grid-fill-DepYpY1i.js";import{t as Y}from"./CuiCameraSnapshot-Dn1QSGrr.js";import{t as Ae}from"./check-COWE52r_.js";import{a as X,i as Z,n as Q,r as je,t as Me}from"./vendor-dnd-B9-e5xxH.js";import{n as Ne,t as Pe}from"./CuiMenu-DtnIPhcr.js";import{t as Fe}from"./cameras-DyF2T0be.js";import{t as Ie}from"./useCuiDialog-yVh5UWKF.js";import{a as Le}from"./users.schema-B4fEuoKZ.js";import{t as Re}from"./routerState-BR88YV1H.js";import{n as ze,t as Be}from"./microphone-DJsihw9n.js";import{t as Ve}from"./plus-CJzoaVfR.js";import{t as He}from"./delete-BEupTYe7.js";import{t as Ue}from"./CuiCameraPipCard-CL_wj05b.js";import{n as We,t as Ge}from"./CuiTopNavbarItem-nGcC2em4.js";import{t as Ke}from"./vendor-gridstack-DD5uGA3X.js";var qe={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Je(e,t){return W(),F(`svg`,qe,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M7.5 5.6L5 7l1.4-2.5L5 2l2.5 1.4L10 2L8.6 4.5L10 7zm12 9.8L22 14l-1.4 2.5L22 19l-2.5-1.4L17 19l1.4-2.5L17 14zM22 2l-1.4 2.5L22 7l-2.5-1.4L17 7l1.4-2.5L17 2l2.5 1.4zm-8.66 10.78l2.44-2.44l-2.12-2.12l-2.44 2.44zm1.03-5.49l2.34 2.34c.39.37.39 1.02 0 1.41L5.04 22.71c-.39.39-1.04.39-1.41 0l-2.34-2.34c-.39-.37-.39-1.02 0-1.41L12.96 7.29c.39-.39 1.04-.39 1.41 0`},null,-1)]])}var Ye=V({name:`mdi-auto-fix`,render:Je}),Xe={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ze(e,t){return W(),F(`svg`,Xe,[...t[0]||=[j(`g`,{fill:`none`,"fill-rule":`evenodd`},[j(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),j(`path`,{fill:`currentColor`,d:`M19 11a2 2 0 0 1 1.995 1.85L21 13v6a2 2 0 0 1-1.85 1.995L19 21h-4a2 2 0 0 1-1.995-1.85L13 19v-6a2 2 0 0 1 1.85-1.995L15 11zM9 15a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2zM9 3a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`})],-1)]])}var Qe=V({name:`mingcute-grid2-fill`,render:Ze}),$e={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function et(e,t){return W(),F(`svg`,$e,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M13 6v5h5V7.75L22.25 12L18 16.25V13h-5v5h3.25L12 22.25L7.75 18H11v-5H6v3.25L1.75 12L6 7.75V11h5V6H7.75L12 1.75L16.25 6z`},null,-1)]])}var tt=V({name:`mdi-cursor-move`,render:et}),nt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rt(e,t){return W(),F(`svg`,nt,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`m8.471 7.237l3.056 12.992c.233.993 1.63 1.04 1.929.065l2.945-9.58l.384 1.527a1 1 0 0 0 .97.756H21a1 1 0 1 0 0-2h-2.466l-1.069-4.241c-.247-.981-1.628-1.017-1.925-.05l-2.912 9.472L9.475 2.771c-.24-1.02-1.688-1.03-1.943-.014l-2.065 8.24H3a1 1 0 0 0 0 2h3.247a1 1 0 0 0 .97-.757z`},null,-1)]])}var it=V({name:`fluent-pulse-24-filled`,render:rt}),at={viewBox:`0 0 16 16`,width:`1.2em`,height:`1.2em`};function ot(e,t){return W(),F(`svg`,at,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124m5.393.984a.75.75 0 1 0-1.06 1.06a5.5 5.5 0 0 1 0 7.78a.75.75 0 1 0 1.06 1.06a7 7 0 0 0 0-9.9`},null,-1),j(`path`,{fill:`currentColor`,d:`M10.828 5.172a.75.75 0 1 0-1.06 1.06a2.5 2.5 0 0 1 0 3.536a.75.75 0 1 0 1.06 1.06a4 4 0 0 0 0-5.656`},null,-1)]])}var st=V({name:`heroicons-speaker-wave-16-solid`,render:ot}),$={viewBox:`0 0 16 16`,width:`1.2em`,height:`1.2em`};function ct(e,t){return W(),F(`svg`,$,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124M11.28 5.72a.75.75 0 1 0-1.06 1.06L11.44 8l-1.22 1.22a.75.75 0 1 0 1.06 1.06l1.22-1.22l1.22 1.22a.75.75 0 1 0 1.06-1.06L13.56 8l1.22-1.22a.75.75 0 0 0-1.06-1.06L12.5 6.94z`},null,-1)]])}var lt=V({name:`heroicons-speaker-x-mark-16-solid`,render:ct}),ut={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dt(e,t){return W(),F(`svg`,ut,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M10.4 13.45h3.2l.6 1.625q.075.2.238.313t.362.112q.35 0 .538-.275t.062-.6l-2.55-6.7q-.075-.2-.237-.312T12.25 7.5h-.5q-.2 0-.363.113t-.237.312L8.625 14.65q-.125.3.05.575t.525.275q.2 0 .363-.112t.237-.313zm.4-1.15L11.95 9h.1l1.15 3.3zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12q0-.8.125-1.6T2.5 8.825q.125-.4.513-.537t.737.062q.375.2.538.588t.037.812q-.15.55-.238 1.113T4 12q0 3.35 2.325 5.675T12 20t5.675-2.325T20 12t-2.325-5.675T12 4q-.6 0-1.187.087T9.65 4.35q-.425.125-.8-.025T8.3 3.8t-.013-.762t.563-.513q.75-.275 1.55-.4T12 2q2.075 0 3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22M4.438 6.563Q4 6.125 4 5.5t.438-1.062T5.5 4t1.063.438T7 5.5t-.437 1.063T5.5 7t-1.062-.437M12 12`},null,-1)]])}var ft=V({name:`material-symbols-motion-photos-auto-outline-rounded`,render:dt}),pt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function mt(e,t){return W(),F(`svg`,pt,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3zm-7 3H3V6h16v7h2V6c0-1.11-.89-2-2-2H3a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11z`},null,-1)]])}var ht=V({name:`mdi-card-plus-outline`,render:mt}),gt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function _t(e,t){return W(),F(`svg`,gt,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M9 3h2v2H9zm4 0h2v2h-2zM9 7h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2z`},null,-1)]])}var vt=V({name:`mdi-drag-vertical`,render:_t}),yt={class:`text-sm text-muted truncate`},bt=Ce(H({__name:`ViewDnDDrag`,props:{camera:{},isDropped:{type:Boolean},canDrag:{type:Boolean}},setup(e){let{camera:t,canDrag:n}=A(e),r=D(`boxRef`),i=O(null),a=I(0),o=I(0),s=I(!1),{x:c,y:u,sourceType:d}=we(),[f,p]=Z(()=>({type:`camera-sidebar`,options:{dropEffect:`copy`},item:t.value,canDrag:n.value,collect:e=>({style:{opacity:e.isDragging()?.4:1},isDragging:e.isDragging()})})),m=B(()=>f.value.isDragging),g=B(()=>m.value&&d.value===`touch`);function ee(){i.value&&document.body.contains(i.value)&&document.body.removeChild(i.value),i.value=null}function v(){if(ee(),!r.value)return;let e=r.value.cloneNode(!0),t=r.value.getBoundingClientRect();e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.classList.add(`drag-preview`),e.style.position=`fixed`,e.style.left=`${c.value-a.value}px`,e.style.top=`${u.value-o.value}px`,document.body.appendChild(e),i.value=e}function b(){s.value=!1,ee()}function te(){b(),s.value=!0;let e=r.value?.getBoundingClientRect();e&&(a.value=c.value-e.left,o.value=u.value-e.top,v())}function ne(){!i.value||!s.value||requestAnimationFrame(()=>{i.value&&(i.value.style.left=`${c.value-a.value}px`,i.value.style.top=`${u.value-o.value}px`)})}return h(g,e=>e?te():b()),h([c,u],()=>ne(),{flush:`sync`}),C(()=>b()),(n,i)=>{let a=vt,o=Y,s=l;return W(),F(`div`,{ref_key:`boxRef`,ref:r},[j(`div`,{ref:T(p),style:E(T(f).style)},[U(s,{disabled:e.isDropped,fluid:``,severity:`secondary`,class:`cui-rounded-corner dark-mode shadow-sm items-center justify-normal`,style:E({cursor:e.isDropped?`not-allowed`:`grab`})},{default:L(()=>[U(a,{size:`20`,class:`text-muted mr-2`}),U(o,{camera:T(t),width:`110px`,class:_([`cui-rounded-corner shadow-md overflow-hidden`,{"opacity-30":e.isDropped}])},null,8,[`camera`,`class`]),j(`span`,yt,y(T(t).name),1)]),_:1},8,[`disabled`,`style`])],4)],512)}}}),[[`__scopeId`,`data-v-a4c67afd`]]),xt={editMode:!1,rearrangeMode:!1,viewSize:1},St=Object.fromEntries(Object.entries({1:{cols:1,rows:1},4:{cols:2,rows:2},6:{cols:3,rows:3},7:{cols:4,rows:4},9:{cols:3,rows:3},10:{cols:4,rows:4},12:{cols:6,rows:6},13:{cols:4,rows:4},15:{cols:12,rows:12},16:{cols:4,rows:4},20:{cols:6,rows:6},26:{cols:12,rows:12}}).map(([e,t])=>[e,{cols:t.cols*16,rows:t.rows*16}])),Ct=e=>e.map(e=>({x:e.x*16,y:e.y*16,w:e.w*16,h:e.h*16})),wt=Object.fromEntries(Object.entries({1:[{x:0,y:0,w:1,h:1}],4:[{x:0,y:0,w:1,h:1},{x:1,y:0,w:1,h:1},{x:0,y:1,w:1,h:1},{x:1,y:1,w:1,h:1}],6:[{x:0,y:0,w:2,h:2},{x:2,y:0,w:1,h:1},{x:2,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1}],7:[{x:0,y:0,w:2,h:2},{x:2,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],9:[{x:0,y:0,w:1,h:1},{x:1,y:0,w:1,h:1},{x:2,y:0,w:1,h:1},{x:0,y:1,w:1,h:1},{x:1,y:1,w:1,h:1},{x:2,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1}],10:[{x:0,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:2,y:0,w:1,h:1},{x:3,y:0,w:1,h:1},{x:2,y:1,w:1,h:1},{x:3,y:1,w:1,h:1},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],12:[{x:0,y:0,w:3,h:3},{x:3,y:0,w:3,h:3},{x:0,y:3,w:3,h:3},{x:3,y:3,w:1,h:1},{x:4,y:3,w:1,h:1},{x:5,y:3,w:1,h:1},{x:3,y:4,w:1,h:1},{x:4,y:4,w:1,h:1},{x:5,y:4,w:1,h:1},{x:3,y:5,w:1,h:1},{x:4,y:5,w:1,h:1},{x:5,y:5,w:1,h:1}],13:[{x:0,y:0,w:2,h:2},{x:2,y:0,w:1,h:1},{x:3,y:0,w:1,h:1},{x:2,y:1,w:1,h:1},{x:3,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:0,y:3,w:1,h:1},{x:1,y:3,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],15:[{x:0,y:0,w:6,h:6},{x:6,y:0,w:6,h:6},{x:0,y:6,w:3,h:3},{x:3,y:6,w:3,h:3},{x:0,y:9,w:3,h:3},{x:3,y:9,w:3,h:3},{x:6,y:6,w:2,h:2},{x:8,y:6,w:2,h:2},{x:10,y:6,w:2,h:2},{x:6,y:8,w:2,h:2},{x:8,y:8,w:2,h:2},{x:10,y:8,w:2,h:2},{x:6,y:10,w:2,h:2},{x:8,y:10,w:2,h:2},{x:10,y:10,w:2,h:2}],16:[{x:0,y:0,w:1,h:1},{x:1,y:0,w:1,h:1},{x:2,y:0,w:1,h:1},{x:3,y:0,w:1,h:1},{x:0,y:1,w:1,h:1},{x:1,y:1,w:1,h:1},{x:2,y:1,w:1,h:1},{x:3,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:0,y:3,w:1,h:1},{x:1,y:3,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],20:[{x:0,y:0,w:3,h:3},{x:0,y:3,w:3,h:3},{x:3,y:0,w:1,h:1},{x:4,y:0,w:1,h:1},{x:5,y:0,w:1,h:1},{x:3,y:1,w:1,h:1},{x:4,y:1,w:1,h:1},{x:5,y:1,w:1,h:1},{x:3,y:2,w:1,h:1},{x:4,y:2,w:1,h:1},{x:5,y:2,w:1,h:1},{x:3,y:3,w:1,h:1},{x:4,y:3,w:1,h:1},{x:5,y:3,w:1,h:1},{x:3,y:4,w:1,h:1},{x:4,y:4,w:1,h:1},{x:5,y:4,w:1,h:1},{x:3,y:5,w:1,h:1},{x:4,y:5,w:1,h:1},{x:5,y:5,w:1,h:1}],26:[{x:0,y:0,w:3,h:3},{x:3,y:0,w:3,h:3},{x:0,y:3,w:3,h:3},{x:3,y:3,w:3,h:3},{x:6,y:0,w:2,h:2},{x:8,y:0,w:2,h:2},{x:10,y:0,w:2,h:2},{x:6,y:2,w:2,h:2},{x:8,y:2,w:2,h:2},{x:10,y:2,w:2,h:2},{x:6,y:4,w:2,h:2},{x:8,y:4,w:2,h:2},{x:10,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:2,y:6,w:2,h:2},{x:4,y:6,w:2,h:2},{x:0,y:8,w:2,h:2},{x:2,y:8,w:2,h:2},{x:4,y:8,w:2,h:2},{x:0,y:10,w:2,h:2},{x:2,y:10,w:2,h:2},{x:4,y:10,w:2,h:2},{x:6,y:6,w:3,h:3},{x:9,y:6,w:3,h:3},{x:6,y:9,w:3,h:3},{x:9,y:9,w:3,h:3}]}).map(([e,t])=>[e,Ct(t)])),Tt={class:`text-lg font-semibold text-white`},Et={class:`flex flex-col gap-3 w-full h-full overflow-y-auto`},Dt={class:`cui-label`},Ot={key:0,class:`text-muted text-sm`},kt=H({__name:`ViewDnDSidebar`,props:{cameras:{},droppedCameras:{},title:{}},emits:[`changeViewSize`],setup(e,{emit:t}){let n=e,r=t,{droppedCameras:i}=A(n);function a(e){return i.value.some(t=>t.name===e.name)}return(t,n)=>{let i=l,o=bt;return W(),F(`div`,{class:`sidebar-view-background flex flex-col p-2 border-[1px] border-color gap-2 rounded-xl`,style:E({width:`${T(400)}px`})},[j(`span`,Tt,y(e.title),1),j(`div`,Et,[U(i,{fluid:``,label:`Change grid size`,class:`cui-button-small dark-mode shrink-0 my-4`,onClick:n[0]||=e=>r(`changeViewSize`)}),j(`label`,Dt,y(t.$t(`components.view_box.available_streams`)),1),(W(!0),F(ae,null,ie(e.cameras,(e,t)=>(W(),F(`div`,{key:t},[U(o,{camera:e,"is-dropped":a(e),"can-drag":!a(e)},null,8,[`camera`,`is-dropped`,`can-drag`])]))),128)),e.cameras.length?R(``,!0):(W(),F(`span`,Ot,y(t.$t(`components.view_box.no_cameras`)),1))])],4)}}}),At={key:1,class:`w-full h-full bg-[#1a1a1a] flex items-center justify-center`},jt={key:2,class:`w-full h-full bg-[#111]`},Mt={key:1,class:`w-full h-full flex items-center justify-center`},Nt={key:0},Pt=Ce(H({__name:`ViewDnDCard`,props:{camera:{},cameras:{},droppedCameras:{},mode:{},index:{},cameraCardProps:{},cameraCardModels:{},onDrop:{type:Function}},emits:[`drop`,`remove`,`expand`],setup(e,{expose:t,emit:n}){let r=e,i=n,{lgBreakpoint:o}=De(),{camera:c,mode:u,cameras:d,droppedCameras:f}=A(r),p=D(`boxRef`),m=D(`containerRef`),h=D(`playerRef`),g=D(`menuRef`),{width:v}=a(m),[y,b]=je({accept:`camera-sidebar`,drop:r.onDrop,collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()&&!c.value}),canDrop:()=>u.value===`edit`&&!c.value}),te=B(()=>y.value.canDrop&&y.value.isOver),ne=B(()=>u.value===`edit`?te.value?`#171717`:`#202020`:`#000`),x=B(()=>v.value<=200),S=B(()=>d.value.filter(e=>!f.value.some(t=>t.name===e.name))),re=B(()=>S.value.map(e=>({label:e.name,onClick:()=>i(`drop`,e)})));function C(e){h.value?.toggleMute(e)}async function w(e,t){await h.value?.toggleMicrophone(e,t)}function ie(e){h.value?.toggleActivityMode(e)}async function O(e){await h.value?.toggleSourceRole(e)}async function N(e){await h.value?.toggleStreamingMode(e)}function P(e){h.value?.toggleBbox(e)}function I(e){h.value?.togglePip(e)}return t({togglePlayerMute:C,toggleMicrophone:w,togglePlayerActivityMode:ie,togglePlayerSourceRole:O,togglePlayerStreamingMode:N,togglePlayerBbox:P,togglePip:I}),(t,n)=>{let r=Ue,a=Ve,f=J,v=l,y=Y,te=Pe,S=s;return W(),F(`div`,{ref_key:`boxRef`,ref:p,class:`view-dnd-card`},[T(u)===`normal`||T(u)===`rearrange`?(W(),F(ae,{key:0},[T(c)?(W(),M(r,ee({key:0,ref_key:`playerRef`,ref:h},e.cameraCardProps,{"activity-mode":e.cameraCardModels?.activityMode,"source-role":e.cameraCardModels?.sourceRole,"streaming-mode":e.cameraCardModels?.streamingMode,"camera-info":T(c),class:`w-full h-full`,onExpand:n[0]||=e=>i(`expand`,T(c),e)}),null,16,[`activity-mode`,`source-role`,`streaming-mode`,`camera-info`])):T(u)===`rearrange`?(W(),F(`div`,At,[U(a,{class:`w-6 h-6 text-white/20`})])):(W(),F(`div`,jt))],64)):T(u)===`edit`?(W(),F(ae,{key:1},[j(`div`,{ref:T(b),style:E({backgroundColor:T(ne)}),class:`w-full h-full`},[T(c)?(W(),F(`div`,{key:0,ref_key:`containerRef`,ref:m,class:`w-full h-full flex items-center justify-center relative min-w-0`},[U(v,{class:_([`z-1`,{"cui-icon-lg":T(x),"cui-button-small":!T(x)}]),label:T(x)?void 0:T(c).name,onClick:n[1]||=k(e=>i(`remove`,T(c)),[`prevent`])},{icon:L(()=>[U(f)]),_:1},8,[`class`,`label`]),U(y,{camera:T(c),class:`absolute w-full h-full top-0 left-0 bg-black/50 opacity-20`},null,8,[`camera`])],512)):T(o)?R(``,!0):(W(),F(`div`,Mt,[T(d).length?(W(),M(v,{key:1,text:``,rounded:``,class:`cui-icon-md`,onClick:T(g)?.toggleMenu},{icon:L(()=>[U(a,{width:`100%`,height:`100%`})]),_:1},8,[`onClick`])):z((W(),F(`div`,Nt,[U(v,{text:``,rounded:``,disabled:``,class:`cui-icon-md`},{icon:L(()=>[U(a,{width:`100%`,height:`100%`})]),_:1})])),[[S,{value:t.$t(`views.camview.no_cameras`)},void 0,{top:!0}]])]))],4),U(te,{ref_key:`menuRef`,ref:g,items:T(re),popover:{pt:{content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`])],64)):R(``,!0)],512)}}}),[[`__scopeId`,`data-v-49edf1f5`]]),Ft={class:`w-full h-full flex flex-row`},It=[`gs-id`,`gs-x`,`gs-y`,`gs-w`,`gs-h`],Lt={class:`grid-stack-item-content`},Rt=Ce(H({__name:`CuiCameraViewDnD`,props:S({cameras:{},viewSize:{},cards:{},title:{},editMode:{type:Boolean},rearrangeMode:{type:Boolean},cameraCardProps:{},cameraCardModels:{}},xt),emits:[`drop`,`remove`,`changeViewSize`,`expand`,`rearrange`],setup(e,{expose:t,emit:n}){let r=e,i=n,{isTouch:s}=Ee(),{smBreakpoint:u,lgBreakpoint:d}=De(),f=v(c,void 0),{routeFrom:p,routeTo:m}=ce(Re()),{editMode:g,rearrangeMode:ee,viewSize:y,cards:b,cameraCardProps:te}=A(r),ne=D(`viewRef`),S=D(`wrapperRef`),re=D(`gridRef`),w=D(`cardRefs`),O=I(),k=I(),N=null,{isFullscreen:V,toggle:H}=o(ne,{mode:`scroll`}),le=a(ne),G=a(S),ue=B(()=>g.value?`edit`:ee.value?`rearrange`:`normal`),K=B(()=>O.value??k.value),de=B(()=>e=>{let t={...se(te.value)};if(e){let n=p.value?.includes(`/cameras/${e.name}`)??!1,r=m.value?.includes(`/cameras/${e.name}`)??!1,i=t.viewTransition&&(n||r),a=`/cameras/${e.name}`;f?.isActive.value?t.routerLink=`${a}?startTs=${Math.floor(f.currentTimestamp.value/1e3)}`:t.routerLink=a,t.viewTransition=i}return t}),q=B(()=>(le.height.value-16)*(16/9)),fe=B(()=>b.value.filter(e=>e.lastDroppedCamera).map(e=>e.lastDroppedCamera));function pe(e){let t=b.value[e];if(u.value)return{x:0,y:t?.y??e,w:1,h:1};let n=wt[y.value]?.[e];return{x:t?.x??n?.x??0,y:t?.y??n?.y??0,w:t?.colSpan??n?.w??1,h:t?.rowSpan??n?.h??1}}function me(){if(!N)return;let e=[];for(let t of N.getGridItems()){let n=t.gridstackNode;if(!n)continue;let r=parseInt(n.id),i=b.value[r];i?.lastDroppedCamera&&e.push({index:r,cameraId:i.lastDroppedCamera._id,colSpan:n.w,rowSpan:n.h,x:n.x,y:n.y})}i(`rearrange`,e)}function he(){me()}function ge(){if(!re.value)return;let e=St[y.value];if(!e)return;let t=u.value,n=t?1:e.cols,r=t?b.value.length:e.rows,i=S.value?.clientWidth??0,a=t?i*9/16:i>0?i*9/16/e.rows:60,o=ue.value===`rearrange`;N=Ke.init({column:n,minRow:r,cellHeight:a,margin:o?3:1,float:!1,animate:!1,staticGrid:!o,resizable:t?{handles:``}:{handles:`se`},disableResize:t,alwaysShowResizeHandle:!t},re.value),N.on(`change`,he),requestAnimationFrame(()=>N?.setAnimation(!0))}function _e(){N&&=(N.offAll(),N.destroy(!1),null)}function ve(e,t,n){n?O.value=t:(k.value=t,O.value=void 0,setTimeout(()=>{k.value=void 0},250)),i(`expand`,e,n)}async function be(){await H()}function xe(e){for(let t of w.value||[])t.togglePlayerMute(e)}async function Se(e,t){await Promise.allSettled((w.value||[]).map(n=>n.toggleMicrophone(e,t)))}function Ce(e){for(let t of w.value||[])t.togglePlayerActivityMode(e)}async function we(e){await Promise.allSettled((w.value||[]).map(t=>t.togglePlayerSourceRole(e)))}async function Te(e){await Promise.allSettled((w.value||[]).map(t=>t.togglePlayerStreamingMode(e)))}function Oe(e){for(let t of w.value||[])t.togglePlayerBbox(e)}function J(e){for(let t of w.value||[])t.togglePip(e)}function ke(){N&&(N.compact(),me())}function Y(){if(!N)return;let e=St[y.value];if(!e)return;let t=e.cols,n=[];for(let e of N.getGridItems()){let t=e.gridstackNode;if(!t)continue;let r=parseInt(t.id),[i,a]=((b.value[r]?.lastDroppedCamera)?.interfaceSettings?.aspectRatio||`16:9`).split(`:`).map(Number);n.push({idx:r,el:e,cellRatio:i/a*(9/16)})}if(!n.length)return;let r=e.rows;function i(e){let r=[],i=0,a=0;for(;a<n.length;){let o=[],s=0,c=!1;for(;a<n.length;){let r=n[a].cellRatio;if(e*(s+r)>t&&o.length>0){c=!0;break}o.push(n[a]),s+=r,a++}let l=c?t/s:e;r.push({row:o,ratioSum:s,rowH:l,filled:c}),i+=l}return{rows:r,totalH:i}}let a=.25,o=r,s=a;for(let e=0;e<40;e++){let e=(a+o)/2;i(e).totalH<=r?(s=e,a=e):o=e}let{rows:c}=i(s),l=c.reduce((e,t)=>e+t.rowH,0)||1,u=l>r?r/l:1,d=c.map(e=>e.rowH*u),f=d.reduce((e,t)=>e+t,0),p=new Map,m=Math.max(0,Math.round((r-f)/2)),h=m;for(let e=0;e<c.length;e++){h+=d[e];let n=Math.min(r,Math.round(h)),i=Math.max(1,n-m),{row:a,ratioSum:o,filled:s}=c[e];if(s){let e=0;for(let n=0;n<a.length;n++){let r=n===a.length-1?Math.max(1,t-e):Math.max(1,Math.round(a[n].cellRatio/o*t));p.set(a[n].idx,{x:e,y:m,w:r,h:i}),e+=r}}else{let e=a.map(e=>Math.max(1,Math.round(e.cellRatio*i))),n=e.reduce((e,t)=>e+t,0),r=Math.max(0,Math.round((t-n)/2));for(let t=0;t<a.length;t++)p.set(a[t].idx,{x:r,y:m,w:e[t],h:i}),r+=e[t]}m=n}N.batchUpdate();for(let[e,t]of p){let r=n.find(t=>t.idx===e);r&&N.update(r.el,t)}N.batchUpdate(!1),me()}return h([y,()=>b.value.length,u],()=>{_e(),P(()=>ge())},{immediate:!1}),h(ue,e=>{if(!N)return;let t=e===`rearrange`;N.setStatic(!t),N.margin(t?3:1)}),h(()=>G.width.value,e=>{if(!(!N||e<=0)){if(N.setAnimation(!1),u.value)N.cellHeight(e*9/16);else{let t=St[y.value]?.rows??1;N.cellHeight(e*9/16/t)}requestAnimationFrame(()=>N?.setAnimation(!0))}}),x(()=>{P(()=>ge())}),C(()=>{_e()}),t({toggleFullscreen:be,toggleAllPlayerMute:xe,toggleAllPlayerMicrophone:Se,toggleAllPlayerActivityMode:Ce,toggleAllPlayerSourceRole:we,toggleAllPlayerStreamingMode:Te,toggleAllPlayerBbox:Oe,toggleAllPip:J,compactGrid:ke,fitAspectRatios:Y,isFullscreen:V}),(t,n)=>{let r=ye,a=l,o=Pt,c=kt;return W(),M(T(X),{backend:T(s)?T(Me):T(Q)},{default:L(()=>[j(`div`,Ft,[j(`div`,{ref_key:`viewRef`,ref:ne,class:_([`view-container w-full flex flex-col min-w-0 overflow-y-auto items-center`,{"px-2":T(g)&&T(d)}])},[T(V)?(W(),M(a,{key:0,severity:`secondary`,rounded:``,class:`cui-fs-exit`,"aria-label":t.$t(`components.form.tooltip.fullscreen_off`),onClick:T(H)},{icon:L(()=>[U(r,{class:`w-5 h-5`})]),_:1},8,[`aria-label`,`onClick`])):R(``,!0),T(K)===void 0?R(``,!0):(W(),F(`div`,{key:1,class:`w-full aspect-video relative my-auto`,style:E({maxWidth:`${T(q)}px`})},[U(o,{ref:`fsCardRef`,class:_([`w-full h-full`,{"card-expanded":T(O)!==void 0,"card-collapsing":T(k)!==void 0}]),camera:T(b)[T(K)]?.lastDroppedCamera,cameras:e.cameras,"dropped-cameras":T(fe),mode:`normal`,index:T(K),"camera-card-props":{...T(de)(T(b)[T(K)]?.lastDroppedCamera),expanded:!0},"camera-card-models":e.cameraCardModels,onExpand:n[0]||=(e,t)=>ve(e,T(K),t)},null,8,[`class`,`camera`,`cameras`,`dropped-cameras`,`index`,`camera-card-props`,`camera-card-models`])],4)),z(j(`div`,{ref_key:`wrapperRef`,ref:S,class:_([`w-full relative my-auto`,T(u)?`h-auto`:`aspect-video`]),style:E(T(u)?void 0:{maxWidth:`${T(q)}px`})},[j(`div`,{ref_key:`gridRef`,ref:re,class:`grid-stack w-full h-full`},[(W(!0),F(ae,null,ie(T(b),(t,r)=>(W(),F(`div`,{key:r,class:`grid-stack-item`,"gs-id":String(r),"gs-x":pe(r).x,"gs-y":pe(r).y,"gs-w":pe(r).w,"gs-h":pe(r).h},[j(`div`,Lt,[U(o,{ref_for:!0,ref_key:`cardRefs`,ref:w,camera:t.lastDroppedCamera,cameras:e.cameras,"dropped-cameras":T(fe),mode:T(ue),index:r,"camera-card-props":{...T(de)(t.lastDroppedCamera),expanded:T(K)===r},"camera-card-models":e.cameraCardModels,"on-drop":e=>i(`drop`,r,e),onExpand:(e,t)=>ve(e,r,t),onDrop:e=>i(`drop`,r,e),onRemove:n[1]||=e=>i(`remove`,e)},null,8,[`camera`,`cameras`,`dropped-cameras`,`mode`,`index`,`camera-card-props`,`camera-card-models`,`on-drop`,`onExpand`,`onDrop`])])],8,It))),128))],512)],6),[[oe,T(K)===void 0]])],2),T(g)&&T(d)?(W(),M(c,{key:0,cameras:e.cameras,"dropped-cameras":T(fe),title:e.title,class:`view-box shadow-xl`,style:E({"margin-right":T(g)?`0px`:`-${T(400)}px`}),onChangeViewSize:n[2]||=e=>i(`changeViewSize`)},null,8,[`cameras`,`dropped-cameras`,`title`,`style`])):R(``,!0)])]),_:1},8,[`backend`])}}}),[[`__scopeId`,`data-v-3273ba0f`]]),zt={class:`flex flex-col gap-3`},Bt={class:`text-wrap`},Vt={class:`w-full h-full flex items-center justify-center relative`},Ht=H({__name:`AudioVisualizer`,emits:[`listening`],setup(e,{expose:t,emit:n}){let r=n,i=d(),a=u(),o=v(`dialogRefProps`),s=D(`canvasRef`),c=O(),f=O(),p=I(!1),m=B(()=>!!o.loading?.value);async function h(){if(p.value)ee();else try{c.value&&ee();let e;try{e=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){a.add({severity:`warn`,detail:`Can not enable AudioVisualizer, see console.`,life:3e3}),i.warn(`Can not enable AudioVisualizer`,e);return}p.value=!0,r(`listening`,!0),c.value=new AudioContext;let t=c.value.createAnalyser();t.fftSize=1024,f.value=e.getTracks(),c.value.createMediaStreamSource(e).connect(t);let n,o=s.value?.getContext(`2d`),l=()=>{if(s.value&&o){let e=[],r=[];o.clearRect(0,0,s.value.width,s.value.height),requestAnimationFrame(l);let i=t.frequencyBinCount,a=new Uint8Array(i);t.getByteFrequencyData(a),e.push(a);for(let t=0;t<e[0].length;t++)r.push(0),e.forEach(e=>{r[t]+=e[t]});let c=s.value.width/2,u=s.value.height/2;o.beginPath(),o.arc(c,u,30,0,2*Math.PI),o.lineWidth=1,o.stroke(),o.closePath();for(let e=0;e<90;e++){n=r[e]*.4;let t=Math.PI*2/90,i=c+Math.cos(t*e)*30,a=u+Math.sin(t*e)*30,s=c+Math.cos(t*e)*(30+n),l=u+Math.sin(t*e)*(30+n);g(o,i,a,s,l,3)}p.value||o.clearRect(0,0,s.value.width,s.value.height)}};l()}catch(e){ee(),i.error(e)}}function g(e,t,n,r,i,a){let o=e.createLinearGradient(t,n,r,i);o.addColorStop(0,`#5b040f`),o.addColorStop(.5,`#b50b21`),o.addColorStop(.9,`#df2a4c`),o.addColorStop(1,`#df6380`),e.lineWidth=a,e.strokeStyle=o,e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke(),e.closePath()}function ee(){c.value?.close(),c.value=void 0,f.value?.forEach(e=>e.stop()),f.value=void 0,p.value=!1,r(`listening`,!1)}return w(()=>{ee()}),t({isLoading:m}),(e,t)=>{let n=Be,r=l;return W(),F(`div`,zt,[j(`span`,Bt,y(e.$t(`components.dialog.message.intercom_info`)),1),j(`div`,Vt,[U(r,{rounded:``,class:`w-[60px] h-[60px] absolute z-1`,onClick:h},{icon:L(()=>[U(n,{width:`100%`,height:`100%`})]),_:1}),j(`canvas`,{ref_key:`canvasRef`,ref:s,height:`300`,width:`300`},null,512)])])}}}),Ut=[`fill`],Wt=H({__name:`CuiCameraGridIcon1`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm0 8h952v532H9V9Z`},null,-1)]],8,Ut))}}),Gt=[`fill`],Kt=H({__name:`CuiCameraGridIcon10`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm726 275h226v130H735V276Zm-242 0h234v130H493V276Zm0 265V414h234v127H493ZM9 541V276h476v265H9Zm726 0V414h226v127H735ZM961 9v121H735V9h226ZM735 138h226v130H735V138ZM727 9v121H493V9h234ZM493 138h234v130H493V138ZM485 9v259H9V9h476Z`},null,-1)]],8,Gt))}}),qt=[`fill`],Jt=H({__name:`CuiCameraGridIcon12`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 275v129H810.5V276H961Zm-158.5 0v129h-152V276h152Zm-152 265V413h152v128h-152Zm-8-265v129H493V276h149.5ZM493 541V413h149.5v128H493ZM9 276h476v265H9V276Zm801.5 265V413H961v128H810.5ZM961 9v259H493V9h468ZM9 268V9h476v259H9Z`},null,-1)]],8,qt))}}),Yt=[`fill`],Xt=H({__name:`CuiCameraGridIcon13`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M250 549.5h.5v-.5H961a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h233.5v.5h7.5Zm.5-273.5H485v129.5H250.5V276Zm-8 0v129.5H9V276h233.5ZM961 9v121H735V9h226ZM727 9v121H493V9h234ZM493 138h234v130H493V138ZM485 9v259H9V9h476Zm250 129h226v130H735V138Zm0 267.5V276h226v129.5H735ZM493 276h234v129.5H493V276Zm0 265V413.5h234V541H493Zm-242.5 0V413.5H485V541H250.5ZM9 541V413.5h233.5V541H9Zm726 0V413.5h226V541H735Z`},null,-1)]],8,Yt))}}),Zt=[`fill`],Qt=H({__name:`CuiCameraGridIcon15`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M250 549.5h.5v-.5H961a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h233.5v.5h7.5Zm.5-144V276H485v129.5H250.5Zm-8-129.5v129.5H9V276h233.5Zm570 90H961v82H812.5v-82Zm-160 0h152v82h-152v-82ZM961 276v82H812.5v-82H961Zm-308.5 0h152v82h-152v-82Zm0 180h152v85h-152v-85ZM961 541H812.5v-85H961v85Zm-316.5-93H493v-82h151.5v82Zm0-172v82H493v-82h151.5Zm0 180v85H493v-85h151.5ZM485 413.5V541H250.5V413.5H485Zm-242.5 0V541H9V413.5h233.5ZM961 9v259H493V9h468ZM9 9h476v259H9V9Z`},null,-1)]],8,Zt))}}),$t=[`fill`],en=H({__name:`CuiCameraGridIcon16`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 8v121.5H732.5V9H961ZM724.5 9v121.5H493V9h231.5ZM493 268V138.5h231.5V268H493Zm0 137.5V276h231.5v129.5H493Zm468 0H732.5V276H961v129.5ZM493 541V413.5h231.5V541H493Zm468 0H732.5V413.5H961V541Zm0-273H732.5V138.5H961V268ZM485 9v121.5H250.5V9H485ZM250.5 138.5H485V268H250.5V138.5ZM242.5 9v121.5H9V9h233.5ZM9 138.5h233.5V268H9V138.5ZM250.5 276H485v129.5H250.5V276Zm0 137.5H485V541H250.5V413.5Zm-8-137.5v129.5H9V276h233.5ZM9 541V413.5h233.5V541H9Z`},null,-1)]],8,$t))}}),tn=[`fill`],nn=H({__name:`CuiCameraGridIcon20`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 94v82H812.5V95H961Zm-156.5 82h-152V95h152v82ZM961 9v78H812.5V9H961ZM652.5 9h152v78h-152V9Zm0 176h152v83h-152v-83ZM961 268H812.5v-83H961v83Zm-308.5 8h152v82h-152v-82Zm160 0H961v82H812.5v-82Zm-168-181v82H493V95h151.5Zm0-86v78H493V9h151.5ZM493 268v-83h151.5v83H493Zm0 90v-82h151.5v82H493ZM9 9h476v259H9V9Zm952 357v82H812.5v-82H961Zm-156.5 0v82h-152v-82h152Zm-152 90h152v85h-152v-85ZM961 541H812.5v-85H961v85ZM644.5 366v82H493v-82h151.5ZM493 541v-85h151.5v85H493ZM9 276h476v265H9V276Z`},null,-1)]],8,tn))}}),rn=[`fill`],an=H({__name:`CuiCameraGridIcon26`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M1.5 9A7.5 7.5 0 0 1 9 1.5h952a7.5 7.5 0 0 1 7.5 7.5v532a7.5 7.5 0 0 1-7.5 7.5H9a7.5 7.5 0 0 1-7.5-7.5V9Zm960 168V94h-153v83h153Zm-160 0h-153V94h153v83Zm7-90h153V9a.5.5 0 0 0-.5-.5H808.5V87Zm-7-78.5V87h-153V8.5h153Zm0 175.5v84.5h-153V184h153Zm7 84.5V184h153v84.5h-153Zm-167-91.5V94h-149v83h149Zm0-90V8.5h-149V87h149Zm-149 97h149v84.5h-149V184Zm0 91.5H719V402H492.5V275.5Zm0 133.5v132.5H719V409H492.5Zm233.5 0v132.5h235a.5.5 0 0 0 .5-.5V409H726Zm235.5-7V275.5H726V402h235.5Zm-476-270V8.5H252V132h233.5ZM245 139H8.5v129.5H245V139Zm0-7V8.5H9a.5.5 0 0 0-.5.5v123H245Zm240.5 136.5V139H252v129.5h233.5Zm-477 7h157v81H8.5v-81Zm164 81v-81h153v81h-153Zm153 7h-153v83h153v-83Zm7 83v-83h153v83h-153Zm-7 7h-153v88h153v-88Zm7 88v-88h153v88h-153Zm0-185v-81h153v81h-153Zm-324 7h157v83H8.5v-83Zm0 90h157v88H9a.5.5 0 0 1-.5-.5v-87.5Z`},null,-1)]],8,rn))}}),on=[`fill`],sn=H({__name:`CuiCameraGridIcon4`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 8v259H493V9h468ZM493 541V276h468v265H493ZM485 9v259H9V9h476ZM9 541V276h476v265H9Z`},null,-1)]],8,on))}}),cn=[`fill`],ln=H({__name:`CuiCameraGridIcon6`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm641.5 187.5H961v171H650.5v-171ZM961 9v171.5H650.5V9H961ZM642.5 9v350.5H9V9h633.5ZM9 541V367.5h315.5V541H9Zm323.5-173.5h310V541h-310V367.5Zm318 0H961V541H650.5V367.5Z`},null,-1)]],8,cn))}}),un=[`fill`],dn=H({__name:`CuiCameraGridIcon7`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm725.5 275H961v130H734.5V276Zm0 265V414H961v127H734.5Zm-8-265v130H493V276h233.5ZM493 541V414h233.5v127H493ZM9 276h476v265H9V276ZM961 9v259H493V9h468ZM9 268V9h476v259H9Z`},null,-1)]],8,un))}}),fn=[`fill`],pn=H({__name:`CuiCameraGridIcon9`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M969.5 359v-.5h-.5V9a8 8 0 0 0-8-8H9a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V366.5h.5V359ZM961 187v171.5H651V187h310ZM651 541V366.5h310V541H651Zm-8-354v171.5H330V187h313ZM330 541V366.5h313V541H330Zm-8-354v171.5H9V187h313ZM9 541V366.5h313V541H9ZM961 9v170H651V9h310ZM643 9v170H330V9h313ZM322 9v170H9V9h313Z`},null,-1)]],8,fn))}}),mn={for:`name`,class:`cui-label`},hn={key:0,class:`flex flex-col gap-6 justify-center`},gn={key:0,class:`text-red-500 text-center mb-5`},_n={class:`md:max-h-[350px] overflow-y-auto`},vn={class:`block cui-label mb-3`},yn={key:1,class:`flex flex-col gap-6 justify-center`},bn={key:0,class:`text-red-500 text-center mb-5`},xn={class:`md:max-h-[450px] overflow-y-auto`},Sn={class:`block cui-label mb-3`},Cn={class:`view-select-container`},wn=[`onClick`],Tn=Ce(H({__name:`CamviewForm`,props:{form:{},type:{},cameras:{},views:{}},setup(n,{expose:r}){let i=new m,a=n,o=d(),s=u(),{t:c}=e(),l=v(`dialogRefProps`),{user:S}=ce(f()),{mutateAsync:C,isPending:w}=i.createViewQuery(),{mutateAsync:E,isPending:O}=i.patchViewQuery(),{form:k,type:N,cameras:P,views:oe}=A(a),z=D(`formRef`),V=I([1,4,6,7,9,10,12,13,15,16,20,26]),se=I(!0),H=I(!0),G=I([]),K=I(!!k.value),q=I(k.value?p(k.value):{});!K.value&&N.value===`view`&&(q.value.viewSize=V.value[0]);let fe=B(()=>!!(l.loading?.value||w.value||O.value));function pe(e){let t=G.value.findIndex(t=>t.name===e.name);t===-1?G.value.push(e):G.value.splice(t,1)}function me(e){switch(e){case 1:return Wt;case 4:return sn;case 6:return ln;case 7:return dn;case 9:return pn;case 10:return Kt;case 12:return Jt;case 13:return Xt;case 15:return Qt;case 16:return en;case 20:return nn;case 26:return an;default:return Wt}}async function he(){if(!z.value||!S.value)return;let e=oe.value.find(e=>e.name===q.value.name);if(e&&!K.value)return o.error(`View already exists`,e),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null;if(N.value===`dnd`){if(H.value)return o.error(`No cameras selected`),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null;let e=G.value.map((e,t)=>({cameraId:e._id,index:t}));q.value.cameras=e,q.value.type=`dnd`,q.value.viewSize=1,z.value.setFieldValue(`type`,`dnd`),z.value.setFieldValue(`viewSize`,1),z.value.setFieldValue(`cameras`,e);let t=await z.value.validate();return t?.valid?K.value?await E({username:S.value.username,viewid:q.value._id,viewData:q.value}):await C({username:S.value.username,viewData:q.value}):(o.error(`Validation failed`,t),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null)}else{if(se.value)return o.error(`No view selected`),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null;q.value.cameras=[],q.value.type=`view`,z.value.setFieldValue(`type`,`view`),z.value.setFieldValue(`cameras`,[]);let e=await z.value.validate();return e?.valid?p(q.value):(o.error(`Validation failed`,e),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null)}}return h(q,e=>{for(let[t,n]of Object.entries(e))z.value?.setFieldValue(t,n);e.viewSize&&(se.value=!1),e.cameras?.length&&(H.value=!1)},{deep:!0,immediate:!0}),h(G,e=>{H.value=e.length===0},{deep:!0}),x(()=>{G.value=P.value?.filter(e=>q.value?.cameras?.some(t=>t.cameraId===e._id))||[]}),r({isLoading:fe,onConfirm:he}),(e,n)=>{let r=t,i=ue,a=de,o=le,s=Ne;return W(),M(T(ne),{ref_key:`formRef`,ref:z,class:`flex flex-col gap-6`,"validation-schema":T(Le),"initial-values":T(q)},{default:L(()=>[U(T(b),{modelValue:T(q).name,"onUpdate:modelValue":n[0]||=e=>T(q).name=e,modelModifiers:{trim:!0},name:`name`,as:`div`,class:`flex flex-col field-gap`},{default:L(({field:t,errors:n})=>[j(`label`,mn,y(e.$t(`components.form.label.name`)),1),U(i,null,{default:L(()=>[U(r,ee(t,{invalid:n.length>0,loading:T(fe),type:`text`}),null,16,[`invalid`,`loading`])]),_:2},1024),U(g,{name:`fade`},{default:L(()=>[U(T(re),{name:`name`,class:`cui-input-error`})]),_:1})]),_:1},8,[`modelValue`]),U(a,{class:`m-0 py-3`}),T(N)===`dnd`?(W(),F(`div`,hn,[U(g,{name:`fade`},{default:L(()=>[T(H)?(W(),F(`span`,gn,y(e.$t(`components.form.error.no_cameras_selected`)),1)):R(``,!0)]),_:1}),j(`div`,_n,[j(`label`,vn,y(e.$t(`components.form.label.cameras`)),1),(W(!0),F(ae,null,ie(T(P),(e,t)=>(W(),F(`div`,{key:t,class:`cui-list-item`},[U(s,{class:`h-14`,active:T(G).some(t=>t.name===e.name),onClick:t=>pe(e)},{append:L(()=>[U(o,{"model-value":T(G).some(t=>t.name===e.name),"onUpdate:modelValue":t=>pe(e)},null,8,[`model-value`,`onUpdate:modelValue`])]),default:L(()=>[j(`span`,null,y(e.name),1)]),_:2},1032,[`active`,`onClick`])]))),128))])])):(W(),F(`div`,yn,[U(g,{name:`fade`},{default:L(()=>[T(se)?(W(),F(`span`,bn,y(e.$t(`components.form.error.no_view_selected`)),1)):R(``,!0)]),_:1}),j(`div`,xn,[j(`label`,Sn,y(e.$t(`components.form.label.views`)),1),j(`div`,Cn,[(W(!0),F(ae,null,ie(T(V),t=>(W(),F(`div`,{key:t,class:`view-select-item w-full`,onClick:e=>T(q).viewSize=t},[j(`div`,{class:_([`view-select-item-icon w-full p-3`,{"selected-view":T(q).viewSize===t}])},[(W(),M(te(me(t)),{style:{width:`100%`,height:`100%`}}))],2),j(`span`,{class:_([`view-select-item-label text-muted mt-3 px-2 py-1 cui-rounded-corners`,{"selected-view-label":T(q).viewSize===t}])},y(t)+` `+y(e.$t(`views.camview.cameras`)),3)],8,wn))),128))])])]))]),_:1},8,[`validation-schema`,`initial-values`])}}}),[[`__scopeId`,`data-v-641aac54`]]),En={class:`h-full w-full dark-mode relative`},Dn={key:0,class:`flex flex-col w-full h-full items-center justify-center`},On={key:1,class:`flex flex-col w-full h-full`},kn={class:`flex flex-1 min-h-0 flex-col items-center justify-center w-full gap-4`},An={class:`text-muted text-sm`},jn={class:`relative w-6 h-6`},Mn=Ce(H({__name:`Camview`,props:{navbarWidth:{default:0},navbarLeft:{default:0}},setup(t){let a=new m,o=new Fe,c=t,u=e(),{t:d}=u,v=G(),b=Ie(),{bottombarHeight:ne}=Te(),{smBreakpoint:x,lgBreakpoint:S,mdBreakpoint:re}=De(),{user:C}=ce(f()),{uiSettings:w}=ce(Oe()),{data:ie,isLoading:O}=o.getCamerasQuery({page:1,pageSize:-1}),{data:k,isLoading:P}=a.getViewsQuery(C.value?.username??``,{page:1,pageSize:-1}),{mutate:ae,isPending:oe}=a.removeViewQuery(),{mutateAsync:V,isPending:se}=a.createViewQuery(),{mutateAsync:H,isPending:le}=a.patchViewQuery(),{navbarWidth:ue,navbarLeft:Ce}=A(c),we=D(`menuRef`),Ee=D(`newViewMenuRef`),J=D(`viewDndRef`),Y=I({}),X=I(!1),Z=I(!1),Q=I(!1),je=I(!1),Me=I(!1),Ne=I(!1),Le=I(!0),Re=I(`always-on`),Be=I(`low-resolution`),Ue=I(`webrtc`),Ke=I([]),qe=I({}),Je=N({sourceRole:Be.value,activityMode:Re.value,streamingMode:Ue.value}),Xe=B(()=>O.value||P.value||oe.value||se.value||le.value),Ze=B(()=>ue.value+Ce.value),$e=B(()=>({locale:u.locale.value,dayNames:v.config.locale?.dayNames,dayNamesShort:v.config.locale?.dayNamesShort,monthNames:v.config.locale?.monthNames,monthNamesShort:v.config.locale?.monthNamesShort})),et=B(()=>({doubleClickZoom:!1,flatCard:!0,cameraNameOverlay:!0,control:!0,toolbar:!1,expandableCard:($.value?.cameras?.length??0)>1,detectionIndicatorOverlay:!0,boundingBoxOverlay:!1,cardClickAction:`expand`,viewTransition:!0,cardProps:{pt:{root:{style:`background: #000`}}}})),nt=B(()=>k.value?.result.length?S.value?{width:Me.value?`calc(100% - 400px)`:`100%`,height:`100%`,overflowY:`scroll`}:{height:`100%`,paddingBottom:Me.value?ne.value>0?`200px`:`192px`:`0px`,overflowY:`scroll`}:{width:`100%`,height:`100%`,overflowY:`scroll`}),rt=B(()=>X.value||Z.value),at=B(()=>!!J.value?.isFullscreen),ot=B(()=>[{label:at.value?d(`components.form.tooltip.fullscreen_off`):d(`components.form.tooltip.fullscreen_on`),icon:at.value?ye:Se,command:Dt},{label:Le.value?d(`components.form.tooltip.unmute`):d(`components.form.tooltip.mute`),icon:Le.value?lt:st,command:Ot},{label:d(`components.form.tooltip.intercom`),icon:ve,command:()=>_t(`intercom`)},{label:Ue.value===`auto`?`${d(`components.form.tooltip.mode`)}: ${d(`components.form.tooltip.streaming_mode_auto`)}`:Ue.value===`webrtc`?`${d(`components.form.tooltip.mode`)}: ${d(`components.form.tooltip.streaming_mode_webrtc`)}`:`${d(`components.form.tooltip.mode`)}: ${d(`components.form.tooltip.streaming_mode_mse`)}`,icon:Ue.value===`auto`?ft:Ue.value===`webrtc`?q:xe,command:()=>jt()},{label:Re.value===`always-on`?d(`components.form.tooltip.activity_mode_always_on`):Re.value===`standby`?d(`components.form.tooltip.activity_mode_standby`):d(`components.form.tooltip.activity_mode_activity`),icon:Re.value===`always-on`?be:Re.value===`standby`?me:it,command:()=>kt()},{label:Be.value===`low-resolution`?`${d(`components.form.tooltip.resolution`)}: ${d(`components.form.tooltip.source_role_low`)}`:Be.value===`mid-resolution`?`${d(`components.form.tooltip.resolution`)}: ${d(`components.form.tooltip.source_role_mid`)}`:`${d(`components.form.tooltip.resolution`)}: ${d(`components.form.tooltip.source_role_high`)}`,icon:Be.value===`low-resolution`?pe:Be.value===`mid-resolution`?fe:ge,command:()=>At()}]),$=B(()=>{let e=k.value?.result.find(e=>e._id===w.value.camview.viewid)||k.value?.result[0];return e?(Y.value=e,w.value.camview.viewid=e._id):Y.value={},e}),ct=B(()=>$.value?.cameras?.map(e=>e.cameraId)??[]),{master:ut}=i(ct,{sourceRole:`low`}),dt=B(()=>ut.mode.value!==`idle`&&ut.currentTimestamp.value>0?Math.floor(ut.currentTimestamp.value/1e3):void 0),pt=B(()=>rt.value&&Y.value.viewSize>0?Y.value.viewSize:$.value?$.value.viewSize:1),mt=B(()=>{let e=[];for(let t of k.value?.result||[])e.push({label:t.name,active:t._id===$.value?._id,onClick:()=>vt(t)});return e}),gt=B(()=>[{label:d(`views.camview.new_view`),icon:ht,onClick:()=>_t(`newView`)}]);function _t(e){switch(e){case`newView`:case`editView`:{let t=e===`editView`,n=d(t?`components.dialog.title.edit_view`:`components.dialog.title.new_view`);t?X.value=!0:Z.value=!0,b.openComponentDialog(Tn,{data:{title:n,loading:Xe,confirmText:d(`components.form.button.next`),contentProps:{form:t?Y.value:void 0,type:`view`,cameras:ie.value?.result||[],views:k.value?.result||[]}},onConfirm:e=>{e&&(Y.value=e)},onCancel:()=>{Z.value=!1}});break}case`intercom`:b.openComponentDialog(Ht,{data:{title:d(`components.dialog.title.intercom`),hideConfirmButton:!0,loading:Xe,contentProps:{}},events:{listening:Mt}});break;case`removeView`:b.openTextDialog({data:{title:d(`components.dialog.title.confirm`),confirmText:d(`components.form.button.remove`),contentText:d(`components.dialog.message.confirm_remove_layout`),confirmButtonProps:{severity:`danger`}},onConfirm:yt});break}}function vt(e){w.value.camview.viewid=e._id}function yt(){!$.value||!C.value||ae({username:C.value.username,viewid:$.value._id},{onSuccess:e=>{e.length?w.value.camview.viewid=e[0]._id:w.value.camview.viewid=void 0}})}async function bt(){if(!C.value||Object.keys(Y.value).length===0)return;let e=Ke.value.filter(e=>e.lastDroppedCamera).map(e=>({cameraId:e.lastDroppedCamera._id,index:e.index,colSpan:e.colSpan,rowSpan:e.rowSpan})).sort((e,t)=>e.index-t.index);if(!e.length)return;let t=p(Y.value);t.cameras=e,t._id?Et(await H({username:C.value.username,viewid:t._id,viewData:t})):Et(await V({username:C.value.username,viewData:t}))}function xt(e,t){Ke.value[e].lastDroppedCamera=t}function St(e){Ke.value=Ke.value.map(t=>(t.lastDroppedCamera?.name===e.name&&(t.lastDroppedCamera=void 0),t))}function Ct(e){return`${x.value?`mobile`:`desktop`}:${e}`}function wt(e){let t=$.value?._id;t&&(w.value.camview.layouts||(w.value.camview.layouts={}),w.value.camview.layouts[Ct(t)]=e.map(e=>({index:e.index,cameraId:e.cameraId,x:e.x??0,y:e.y??0,w:e.colSpan??1,h:e.rowSpan??1})))}function Tt(e,t){qe.value[e._id]=t}function Et(e){w.value.camview.viewid=e._id,Z.value=!1,X.value=!1}function Dt(){J.value?.toggleFullscreen()}function Ot(){Le.value=!Le.value,J.value?.toggleAllPlayerMute(Le.value)}function kt(e){let t=Re.value;t=e||(t===`always-on`?`standby`:t===`standby`?`activity`:`always-on`),J.value?.toggleAllPlayerActivityMode(t),Re.value=t}async function At(e){let t=Be.value;t=e||(t===`low-resolution`?`mid-resolution`:t===`mid-resolution`?`high-resolution`:`low-resolution`),await J.value?.toggleAllPlayerSourceRole(t),Be.value=t}async function jt(e){let t=Ue.value;t===`auto`&&(t=`webrtc`);let n=e||(t===`mse`?`webrtc`:`mse`);await J.value?.toggleAllPlayerStreamingMode(n),Ue.value=n}async function Mt(e){await J.value?.toggleAllPlayerMicrophone(e)}return h(je,e=>{e&&(Ne.value=!0)}),h([pt,$,ie,rt,w,x],()=>{let e=Array.from({length:pt.value}).map((e,t)=>({accept:`camera`,index:t,lastDroppedCamera:void 0}));if(!Z.value){let t=$.value?._id,n=t?Ct(t):void 0,r=n?w.value.camview.layouts?.[n]:void 0,i=new Set(ie.value?.result.map(e=>e._id)??[]),a=!1;for(let t of $.value?.cameras||[]){if(!e[t.index])continue;let n=ie.value?.result.find(e=>e._id===t.cameraId);e[t.index].lastDroppedCamera=n;let o=r?.find(e=>e.index===t.index);o&&(!o.cameraId||i.has(o.cameraId)?(e[t.index].x=o.x,e[t.index].y=o.y,e[t.index].colSpan=o.w,e[t.index].rowSpan=o.h):a=!0)}a&&n&&w.value.camview.layouts?.[n]&&(w.value.camview.layouts[n]=w.value.camview.layouts[n].filter(e=>!e.cameraId||i.has(e.cameraId)))}Ke.value=e},{deep:!0,immediate:!0}),(e,t)=>{let i=Ge,a=tt,o=Ae,c=Qe,u=Ye,d=he,f=_e,p=de,m=He,h=ze,v=Ve,b=We,C=n,D=ke,O=l,A=K,N=Pe,P=s;return W(),F(`div`,En,[U(b,{"left-offset":T(Ze),animate:``},{left:L(()=>[!T(Z)&&T($)?(W(),M(i,{key:0,type:`dropdown`,label:T($).name,"menu-open":T(we)?.isOpen,disabled:T(Xe)||T(X),onClick:t[0]||=e=>T(we)?.toggleMenu(e)},null,8,[`label`,`menu-open`,`disabled`])):T(Z)&&T(Y).name?(W(),M(i,{key:1,label:T(Y).name,disabled:T(Xe)},null,8,[`label`,`disabled`])):R(``,!0)]),right:L(()=>[!T(rt)&&T($)?z((W(),M(i,{key:0,active:T(Q),onClick:t[1]||=e=>Q.value=!T(Q)},{icon:L(()=>[T(Q)?(W(),M(o,{key:1,width:`100%`,height:`100%`})):(W(),M(a,{key:0,width:`100%`,height:`100%`}))]),_:1},8,[`active`])),[[P,{value:T(Q)?e.$t(`views.camview.rearrange_done`):e.$t(`views.camview.rearrange`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)&&T(Q)&&!T(x)?z((W(),M(i,{key:1,onClick:t[2]||=e=>T(J)?.fitAspectRatios()},{icon:L(()=>[U(c,{width:`100%`,height:`100%`})]),_:1})),[[P,{value:e.$t(`views.camview.rearrange_fit_aspect`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)&&T(Q)&&!T(x)?z((W(),M(i,{key:2,onClick:t[3]||=e=>T(J)?.compactGrid()},{icon:L(()=>[U(u,{width:`100%`,height:`100%`})]),_:1})),[[P,{value:e.$t(`views.camview.rearrange_auto`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)?z((W(),M(i,{key:3,active:T(je),onClick:t[4]||=e=>je.value=!T(je)},{icon:L(()=>[T(je)?(W(),M(f,{key:1,width:`100%`,height:`100%`})):(W(),M(d,{key:0,width:`100%`,height:`100%`}))]),_:1},8,[`active`])),[[P,{value:T(je)?e.$t(`components.form.tooltip.hide_timeline`):e.$t(`components.form.tooltip.show_timeline`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)?(W(),M(p,{key:4,layout:`vertical`})):R(``,!0),!T(rt)&&T($)?z((W(),M(i,{key:5,disabled:T(Q),onClick:t[5]||=e=>_t(`removeView`)},{icon:L(()=>[U(m,{width:`100%`,height:`100%`})]),_:1},8,[`disabled`])),[[P,{value:e.$t(`components.form.tooltip.delete`)},void 0,{bottom:!0}]]):R(``,!0),!T(X)&&!T(Z)&&T($)?z((W(),M(i,{key:6,disabled:T(Q),onClick:t[6]||=e=>X.value=!0},{icon:L(()=>[U(h,{width:`100%`,height:`100%`})]),_:1},8,[`disabled`])),[[P,{value:e.$t(`components.form.tooltip.edit`)},void 0,{bottom:!0}]]):R(``,!0),!T(X)&&!T(Z)?z((W(),M(i,{key:7,disabled:T(Q),onClick:T(Ee)?.toggleMenu},{icon:L(()=>[U(v,{class:_([`transform transition-transform duration-300`,{"rotate-45":T(Ee)?.isOpen}]),width:`100%`,height:`100%`},null,8,[`class`])]),_:1},8,[`disabled`,`onClick`])),[[P,{value:e.$t(`components.form.tooltip.new`)},void 0,{bottom:!0}]]):R(``,!0),T(X)||T(Z)?(W(),M(i,{key:8,label:e.$t(`components.form.button.cancel`),onClick:t[7]||=e=>T(X)?X.value=!1:Z.value=!1},null,8,[`label`])):R(``,!0),T(X)||T(Z)?(W(),M(i,{key:9,label:e.$t(`components.form.button.save`),disabled:T(Ke).every(e=>e.lastDroppedCamera===void 0),primary:``,onClick:bt},null,8,[`label`,`disabled`])):R(``,!0)]),_:1},8,[`left-offset`]),j(`div`,{class:_([`w-full h-full flex relative`,{"flex-row":T(S),"flex-col":!T(S)}]),style:E({paddingTop:`${T(55)}px`})},[j(`div`,{class:_([`flex relative z-1 camview-content-transition`,{"h-full items-center justify-center":T(S)||!T(k)?.result.length,"w-full items-start justify-start":!T(S)&&T(k)?.result.length}]),style:E(T(nt))},[T(Xe)?(W(),F(`div`,Dn,[(W(),M(C,{key:0,class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`}))])):!T($)&&!T(Z)?(W(),F(`div`,On,[j(`div`,kn,[U(D,{class:`w-12 h-12 text-muted`}),j(`span`,An,y(e.$t(`views.camview.no_views_configured`)),1)])])):T($)||T(Z)?(W(),F(`div`,{key:2,class:_([`w-full h-full`,{"p-2 pb-0":!T(x)}])},[(W(),M(Rt,{ref_key:`viewDndRef`,ref:J,key:T(w).camview.viewid+(T(Z)?`-new`:T(X)?`-edit`:`-view`),cameras:T(ie)?.result||[],"edit-mode":T(Z)||T(X),"rearrange-mode":T(Q),"view-size":T(Z)?T(Y).viewSize:T(pt),title:T(Y).name,cards:T(Ke),"camera-card-props":T(et),"camera-card-models":T(Je),onDrop:xt,onRemove:St,onChangeViewSize:t[8]||=e=>_t(`editView`),onExpand:Tt,onRearrange:wt},null,8,[`cameras`,`edit-mode`,`rearrange-mode`,`view-size`,`title`,`cards`,`camera-card-props`,`camera-card-models`]))],2)):R(``,!0)],6),U(g,{name:T(S)?`slide-left`:`slide-up`,onBeforeEnter:t[9]||=e=>Me.value=!0,onAfterEnter:t[10]||=e=>Ne.value=!1,onBeforeLeave:t[11]||=e=>Me.value=!1},{default:L(()=>[T(je)?(W(),M(T(r),{key:0,"camera-ids":T(ct),"initial-timestamp":T(dt),loading:T(Ne),type:T(S)?`vertical`:`horizontal`,"dark-mode":``,"md-breakpoint":T(re),class:_([`shrink-0 transition-[left] duration-200`,{"h-full w-[400px] pt-2 pr-2":T(S),"h-[200px] pt-2 px-2 pb-2 pb-safe-offset fixed right-safe-offset-0 z-10":!T(S),"p-0! pt-2! border-color":T(x)}]),"card-class":{"!shadow-xl":!0,"!rounded-none border-l-0! border-r-0!":T(x)},style:E(T(S)?void 0:{left:`${T(Ze)}px`,bottom:`calc(${T(ne)}px + env(safe-area-inset-bottom, 0px))`}),"locale-settings":T($e)},null,8,[`camera-ids`,`initial-timestamp`,`loading`,`type`,`md-breakpoint`,`class`,`card-class`,`style`,`locale-settings`])):R(``,!0)]),_:1},8,[`name`])],6),!T(rt)&&T($)?(W(),M(A,{key:0,model:T(ot),direction:`up`,"transition-delay":80,"tooltip-options":{position:`left`,event:void 0},class:`absolute right-2 z-11 dark-mode`,pt:{root:{style:`pointer-events: none`}},style:E({bottom:T(S)?`0`:`calc(${T(Me)?192:0}px + ${T(ne)>0?`0.5rem`:`0px`})`,right:T(S)?`calc(${T(Me)?400:0}px + 0.5rem)`:`0.5rem`,transition:`bottom 0.25s ease-out, right 0.25s ease-out`})},{button:L(({visible:e,toggleCallback:t})=>[U(O,{severity:`secondary`,class:_([`dark-mode opacity-40 hover:opacity-100 active:opacity-100 focus:opacity-100 transition pointer-events-auto`,{"opacity-100":e}]),rounded:``,loading:T(Xe),onClick:t},{icon:L(()=>[j(`div`,jn,[j(`div`,{class:_([`bg-white absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none":e}])},null,2),j(`div`,{class:_([`bg-white absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100`,{"opacity-0 scale-0":e}])},null,2),j(`div`,{class:_([`bg-white absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none":e}])},null,2)])]),_:2},1032,[`class`,`loading`,`onClick`])]),item:L(({item:e,toggleCallback:t})=>[z((W(),M(O,ee({loading:T(Xe),severity:`secondary`},e.buttonProps,{rounded:``,onClick:t}),{icon:L(()=>[(W(),M(te(e.icon)))]),_:2},1040,[`loading`,`onClick`])),[[P,{value:e.label}]])]),_:1},8,[`model`,`style`])):R(``,!0),U(N,{ref_key:`menuRef`,ref:we,items:T(mt),class:`dark-mode`,popover:{pt:{content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`]),U(N,{ref_key:`newViewMenuRef`,ref:Ee,items:T(gt),class:`dark-mode`,popover:{pt:{content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`])])}}}),[[`__scopeId`,`data-v-6ee3e146`]]);export{Mn as default};
1
+ import{Ar as e,O as t,_n as n,b as r,c as i,fi as a,lt as o,pn as s,u as c,vn as l}from"./vendor-cameraui-QuTJKoXE.js";import{D as u,Tt as d,h as f,o as p,w as m}from"./api-BLTlDTXb.js";import{$n as h,$t as g,An as ee,Cr as _,En as v,Er as y,F as b,Gn as te,I as ne,Ln as x,On as S,P as re,Pn as C,Rn as w,Sr as T,Tr as E,Vn as ie,Zn as D,_r as O,an as k,br as A,dn as j,fn as M,fr as N,jn as P,mn as F,mr as I,nr as L,on as ae,pn as R,rn as oe,rr as z,un as B,ur as V,vr as se,xn as H,yn as U,zn as W}from"./vendor-ClrOISZp.js";import{f as ce}from"./vendor-core-CCcu_nmz.js";import{H as le,K as G,P as ue,o as K,z as de}from"./vendor-primevue-BdB7McKg.js";import{A as q,D as fe,E as pe,M as me,N as he,O as ge,P as _e,S as ve,T as ye,j as be,k as xe,w as Se}from"./CuiCameraCard-DiiA1IHK.js";import{t as Ce}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{i as we,n as Te,r as Ee,t as De}from"./useSharedComposables-USqd05AG.js";import{n as Oe}from"./ui-g5rCwxUE.js";import{t as J}from"./close-BTPBtoEq.js";import{t as ke}from"./grid-fill-DepYpY1i.js";import{t as Y}from"./CuiCameraSnapshot-siWvyXxy.js";import{t as Ae}from"./check-COWE52r_.js";import{a as X,i as Z,n as Q,r as je,t as Me}from"./vendor-dnd-B9-e5xxH.js";import{n as Ne,t as Pe}from"./CuiMenu-CZdrrvGm.js";import{t as Fe}from"./cameras-BeI58GuP.js";import{t as Ie}from"./useCuiDialog-DwpKUbrp.js";import{a as Le}from"./users.schema-BOs7h9k2.js";import{t as Re}from"./routerState-BR88YV1H.js";import{n as ze,t as Be}from"./microphone-DJsihw9n.js";import{t as Ve}from"./plus-CJzoaVfR.js";import{t as He}from"./delete-BEupTYe7.js";import{t as Ue}from"./CuiCameraPipCard-164Vxpyy.js";import{n as We,t as Ge}from"./CuiTopNavbarItem-nGcC2em4.js";import{t as Ke}from"./vendor-gridstack-DD5uGA3X.js";var qe={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Je(e,t){return W(),F(`svg`,qe,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M7.5 5.6L5 7l1.4-2.5L5 2l2.5 1.4L10 2L8.6 4.5L10 7zm12 9.8L22 14l-1.4 2.5L22 19l-2.5-1.4L17 19l1.4-2.5L17 14zM22 2l-1.4 2.5L22 7l-2.5-1.4L17 7l1.4-2.5L17 2l2.5 1.4zm-8.66 10.78l2.44-2.44l-2.12-2.12l-2.44 2.44zm1.03-5.49l2.34 2.34c.39.37.39 1.02 0 1.41L5.04 22.71c-.39.39-1.04.39-1.41 0l-2.34-2.34c-.39-.37-.39-1.02 0-1.41L12.96 7.29c.39-.39 1.04-.39 1.41 0`},null,-1)]])}var Ye=V({name:`mdi-auto-fix`,render:Je}),Xe={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ze(e,t){return W(),F(`svg`,Xe,[...t[0]||=[j(`g`,{fill:`none`,"fill-rule":`evenodd`},[j(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),j(`path`,{fill:`currentColor`,d:`M19 11a2 2 0 0 1 1.995 1.85L21 13v6a2 2 0 0 1-1.85 1.995L19 21h-4a2 2 0 0 1-1.995-1.85L13 19v-6a2 2 0 0 1 1.85-1.995L15 11zM9 15a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2zM9 3a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`})],-1)]])}var Qe=V({name:`mingcute-grid2-fill`,render:Ze}),$e={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function et(e,t){return W(),F(`svg`,$e,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M13 6v5h5V7.75L22.25 12L18 16.25V13h-5v5h3.25L12 22.25L7.75 18H11v-5H6v3.25L1.75 12L6 7.75V11h5V6H7.75L12 1.75L16.25 6z`},null,-1)]])}var tt=V({name:`mdi-cursor-move`,render:et}),nt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rt(e,t){return W(),F(`svg`,nt,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`m8.471 7.237l3.056 12.992c.233.993 1.63 1.04 1.929.065l2.945-9.58l.384 1.527a1 1 0 0 0 .97.756H21a1 1 0 1 0 0-2h-2.466l-1.069-4.241c-.247-.981-1.628-1.017-1.925-.05l-2.912 9.472L9.475 2.771c-.24-1.02-1.688-1.03-1.943-.014l-2.065 8.24H3a1 1 0 0 0 0 2h3.247a1 1 0 0 0 .97-.757z`},null,-1)]])}var it=V({name:`fluent-pulse-24-filled`,render:rt}),at={viewBox:`0 0 16 16`,width:`1.2em`,height:`1.2em`};function ot(e,t){return W(),F(`svg`,at,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124m5.393.984a.75.75 0 1 0-1.06 1.06a5.5 5.5 0 0 1 0 7.78a.75.75 0 1 0 1.06 1.06a7 7 0 0 0 0-9.9`},null,-1),j(`path`,{fill:`currentColor`,d:`M10.828 5.172a.75.75 0 1 0-1.06 1.06a2.5 2.5 0 0 1 0 3.536a.75.75 0 1 0 1.06 1.06a4 4 0 0 0 0-5.656`},null,-1)]])}var st=V({name:`heroicons-speaker-wave-16-solid`,render:ot}),$={viewBox:`0 0 16 16`,width:`1.2em`,height:`1.2em`};function ct(e,t){return W(),F(`svg`,$,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124M11.28 5.72a.75.75 0 1 0-1.06 1.06L11.44 8l-1.22 1.22a.75.75 0 1 0 1.06 1.06l1.22-1.22l1.22 1.22a.75.75 0 1 0 1.06-1.06L13.56 8l1.22-1.22a.75.75 0 0 0-1.06-1.06L12.5 6.94z`},null,-1)]])}var lt=V({name:`heroicons-speaker-x-mark-16-solid`,render:ct}),ut={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dt(e,t){return W(),F(`svg`,ut,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M10.4 13.45h3.2l.6 1.625q.075.2.238.313t.362.112q.35 0 .538-.275t.062-.6l-2.55-6.7q-.075-.2-.237-.312T12.25 7.5h-.5q-.2 0-.363.113t-.237.312L8.625 14.65q-.125.3.05.575t.525.275q.2 0 .363-.112t.237-.313zm.4-1.15L11.95 9h.1l1.15 3.3zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12q0-.8.125-1.6T2.5 8.825q.125-.4.513-.537t.737.062q.375.2.538.588t.037.812q-.15.55-.238 1.113T4 12q0 3.35 2.325 5.675T12 20t5.675-2.325T20 12t-2.325-5.675T12 4q-.6 0-1.187.087T9.65 4.35q-.425.125-.8-.025T8.3 3.8t-.013-.762t.563-.513q.75-.275 1.55-.4T12 2q2.075 0 3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22M4.438 6.563Q4 6.125 4 5.5t.438-1.062T5.5 4t1.063.438T7 5.5t-.437 1.063T5.5 7t-1.062-.437M12 12`},null,-1)]])}var ft=V({name:`material-symbols-motion-photos-auto-outline-rounded`,render:dt}),pt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function mt(e,t){return W(),F(`svg`,pt,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3zm-7 3H3V6h16v7h2V6c0-1.11-.89-2-2-2H3a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11z`},null,-1)]])}var ht=V({name:`mdi-card-plus-outline`,render:mt}),gt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function _t(e,t){return W(),F(`svg`,gt,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M9 3h2v2H9zm4 0h2v2h-2zM9 7h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2zm-4 4h2v2H9zm4 0h2v2h-2z`},null,-1)]])}var vt=V({name:`mdi-drag-vertical`,render:_t}),yt={class:`text-sm text-muted truncate`},bt=Ce(H({__name:`ViewDnDDrag`,props:{camera:{},isDropped:{type:Boolean},canDrag:{type:Boolean}},setup(e){let{camera:t,canDrag:n}=A(e),r=D(`boxRef`),i=O(null),a=I(0),o=I(0),s=I(!1),{x:c,y:u,sourceType:d}=we(),[f,p]=Z(()=>({type:`camera-sidebar`,options:{dropEffect:`copy`},item:t.value,canDrag:n.value,collect:e=>({style:{opacity:e.isDragging()?.4:1},isDragging:e.isDragging()})})),m=B(()=>f.value.isDragging),g=B(()=>m.value&&d.value===`touch`);function ee(){i.value&&document.body.contains(i.value)&&document.body.removeChild(i.value),i.value=null}function v(){if(ee(),!r.value)return;let e=r.value.cloneNode(!0),t=r.value.getBoundingClientRect();e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.classList.add(`drag-preview`),e.style.position=`fixed`,e.style.left=`${c.value-a.value}px`,e.style.top=`${u.value-o.value}px`,document.body.appendChild(e),i.value=e}function b(){s.value=!1,ee()}function te(){b(),s.value=!0;let e=r.value?.getBoundingClientRect();e&&(a.value=c.value-e.left,o.value=u.value-e.top,v())}function ne(){!i.value||!s.value||requestAnimationFrame(()=>{i.value&&(i.value.style.left=`${c.value-a.value}px`,i.value.style.top=`${u.value-o.value}px`)})}return h(g,e=>e?te():b()),h([c,u],()=>ne(),{flush:`sync`}),C(()=>b()),(n,i)=>{let a=vt,o=Y,s=l;return W(),F(`div`,{ref_key:`boxRef`,ref:r},[j(`div`,{ref:T(p),style:E(T(f).style)},[U(s,{disabled:e.isDropped,fluid:``,severity:`secondary`,class:`cui-rounded-corner dark-mode shadow-sm items-center justify-normal`,style:E({cursor:e.isDropped?`not-allowed`:`grab`})},{default:L(()=>[U(a,{size:`20`,class:`text-muted mr-2`}),U(o,{camera:T(t),width:`110px`,class:_([`cui-rounded-corner shadow-md overflow-hidden`,{"opacity-30":e.isDropped}])},null,8,[`camera`,`class`]),j(`span`,yt,y(T(t).name),1)]),_:1},8,[`disabled`,`style`])],4)],512)}}}),[[`__scopeId`,`data-v-a4c67afd`]]),xt={editMode:!1,rearrangeMode:!1,viewSize:1},St=Object.fromEntries(Object.entries({1:{cols:1,rows:1},4:{cols:2,rows:2},6:{cols:3,rows:3},7:{cols:4,rows:4},9:{cols:3,rows:3},10:{cols:4,rows:4},12:{cols:6,rows:6},13:{cols:4,rows:4},15:{cols:12,rows:12},16:{cols:4,rows:4},20:{cols:6,rows:6},26:{cols:12,rows:12}}).map(([e,t])=>[e,{cols:t.cols*16,rows:t.rows*16}])),Ct=e=>e.map(e=>({x:e.x*16,y:e.y*16,w:e.w*16,h:e.h*16})),wt=Object.fromEntries(Object.entries({1:[{x:0,y:0,w:1,h:1}],4:[{x:0,y:0,w:1,h:1},{x:1,y:0,w:1,h:1},{x:0,y:1,w:1,h:1},{x:1,y:1,w:1,h:1}],6:[{x:0,y:0,w:2,h:2},{x:2,y:0,w:1,h:1},{x:2,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1}],7:[{x:0,y:0,w:2,h:2},{x:2,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],9:[{x:0,y:0,w:1,h:1},{x:1,y:0,w:1,h:1},{x:2,y:0,w:1,h:1},{x:0,y:1,w:1,h:1},{x:1,y:1,w:1,h:1},{x:2,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1}],10:[{x:0,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:2,y:0,w:1,h:1},{x:3,y:0,w:1,h:1},{x:2,y:1,w:1,h:1},{x:3,y:1,w:1,h:1},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],12:[{x:0,y:0,w:3,h:3},{x:3,y:0,w:3,h:3},{x:0,y:3,w:3,h:3},{x:3,y:3,w:1,h:1},{x:4,y:3,w:1,h:1},{x:5,y:3,w:1,h:1},{x:3,y:4,w:1,h:1},{x:4,y:4,w:1,h:1},{x:5,y:4,w:1,h:1},{x:3,y:5,w:1,h:1},{x:4,y:5,w:1,h:1},{x:5,y:5,w:1,h:1}],13:[{x:0,y:0,w:2,h:2},{x:2,y:0,w:1,h:1},{x:3,y:0,w:1,h:1},{x:2,y:1,w:1,h:1},{x:3,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:0,y:3,w:1,h:1},{x:1,y:3,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],15:[{x:0,y:0,w:6,h:6},{x:6,y:0,w:6,h:6},{x:0,y:6,w:3,h:3},{x:3,y:6,w:3,h:3},{x:0,y:9,w:3,h:3},{x:3,y:9,w:3,h:3},{x:6,y:6,w:2,h:2},{x:8,y:6,w:2,h:2},{x:10,y:6,w:2,h:2},{x:6,y:8,w:2,h:2},{x:8,y:8,w:2,h:2},{x:10,y:8,w:2,h:2},{x:6,y:10,w:2,h:2},{x:8,y:10,w:2,h:2},{x:10,y:10,w:2,h:2}],16:[{x:0,y:0,w:1,h:1},{x:1,y:0,w:1,h:1},{x:2,y:0,w:1,h:1},{x:3,y:0,w:1,h:1},{x:0,y:1,w:1,h:1},{x:1,y:1,w:1,h:1},{x:2,y:1,w:1,h:1},{x:3,y:1,w:1,h:1},{x:0,y:2,w:1,h:1},{x:1,y:2,w:1,h:1},{x:2,y:2,w:1,h:1},{x:3,y:2,w:1,h:1},{x:0,y:3,w:1,h:1},{x:1,y:3,w:1,h:1},{x:2,y:3,w:1,h:1},{x:3,y:3,w:1,h:1}],20:[{x:0,y:0,w:3,h:3},{x:0,y:3,w:3,h:3},{x:3,y:0,w:1,h:1},{x:4,y:0,w:1,h:1},{x:5,y:0,w:1,h:1},{x:3,y:1,w:1,h:1},{x:4,y:1,w:1,h:1},{x:5,y:1,w:1,h:1},{x:3,y:2,w:1,h:1},{x:4,y:2,w:1,h:1},{x:5,y:2,w:1,h:1},{x:3,y:3,w:1,h:1},{x:4,y:3,w:1,h:1},{x:5,y:3,w:1,h:1},{x:3,y:4,w:1,h:1},{x:4,y:4,w:1,h:1},{x:5,y:4,w:1,h:1},{x:3,y:5,w:1,h:1},{x:4,y:5,w:1,h:1},{x:5,y:5,w:1,h:1}],26:[{x:0,y:0,w:3,h:3},{x:3,y:0,w:3,h:3},{x:0,y:3,w:3,h:3},{x:3,y:3,w:3,h:3},{x:6,y:0,w:2,h:2},{x:8,y:0,w:2,h:2},{x:10,y:0,w:2,h:2},{x:6,y:2,w:2,h:2},{x:8,y:2,w:2,h:2},{x:10,y:2,w:2,h:2},{x:6,y:4,w:2,h:2},{x:8,y:4,w:2,h:2},{x:10,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:2,y:6,w:2,h:2},{x:4,y:6,w:2,h:2},{x:0,y:8,w:2,h:2},{x:2,y:8,w:2,h:2},{x:4,y:8,w:2,h:2},{x:0,y:10,w:2,h:2},{x:2,y:10,w:2,h:2},{x:4,y:10,w:2,h:2},{x:6,y:6,w:3,h:3},{x:9,y:6,w:3,h:3},{x:6,y:9,w:3,h:3},{x:9,y:9,w:3,h:3}]}).map(([e,t])=>[e,Ct(t)])),Tt={class:`text-lg font-semibold text-white`},Et={class:`flex flex-col gap-3 w-full h-full overflow-y-auto`},Dt={class:`cui-label`},Ot={key:0,class:`text-muted text-sm`},kt=H({__name:`ViewDnDSidebar`,props:{cameras:{},droppedCameras:{},title:{}},emits:[`changeViewSize`],setup(e,{emit:t}){let n=e,r=t,{droppedCameras:i}=A(n);function a(e){return i.value.some(t=>t.name===e.name)}return(t,n)=>{let i=l,o=bt;return W(),F(`div`,{class:`sidebar-view-background flex flex-col p-2 border-[1px] border-color gap-2 rounded-xl`,style:E({width:`${T(400)}px`})},[j(`span`,Tt,y(e.title),1),j(`div`,Et,[U(i,{fluid:``,label:`Change grid size`,class:`cui-button-small dark-mode shrink-0 my-4`,onClick:n[0]||=e=>r(`changeViewSize`)}),j(`label`,Dt,y(t.$t(`components.view_box.available_streams`)),1),(W(!0),F(ae,null,ie(e.cameras,(e,t)=>(W(),F(`div`,{key:t},[U(o,{camera:e,"is-dropped":a(e),"can-drag":!a(e)},null,8,[`camera`,`is-dropped`,`can-drag`])]))),128)),e.cameras.length?R(``,!0):(W(),F(`span`,Ot,y(t.$t(`components.view_box.no_cameras`)),1))])],4)}}}),At={key:1,class:`w-full h-full bg-[#1a1a1a] flex items-center justify-center`},jt={key:2,class:`w-full h-full bg-[#111]`},Mt={key:1,class:`w-full h-full flex items-center justify-center`},Nt={key:0},Pt=Ce(H({__name:`ViewDnDCard`,props:{camera:{},cameras:{},droppedCameras:{},mode:{},index:{},cameraCardProps:{},cameraCardModels:{},onDrop:{type:Function}},emits:[`drop`,`remove`,`expand`],setup(e,{expose:t,emit:n}){let r=e,i=n,{lgBreakpoint:o}=De(),{camera:c,mode:u,cameras:d,droppedCameras:f}=A(r),p=D(`boxRef`),m=D(`containerRef`),h=D(`playerRef`),g=D(`menuRef`),{width:v}=a(m),[y,b]=je({accept:`camera-sidebar`,drop:r.onDrop,collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()&&!c.value}),canDrop:()=>u.value===`edit`&&!c.value}),te=B(()=>y.value.canDrop&&y.value.isOver),ne=B(()=>u.value===`edit`?te.value?`#171717`:`#202020`:`#000`),x=B(()=>v.value<=200),S=B(()=>d.value.filter(e=>!f.value.some(t=>t.name===e.name))),re=B(()=>S.value.map(e=>({label:e.name,onClick:()=>i(`drop`,e)})));function C(e){h.value?.toggleMute(e)}async function w(e,t){await h.value?.toggleMicrophone(e,t)}function ie(e){h.value?.toggleActivityMode(e)}async function O(e){await h.value?.toggleSourceRole(e)}async function N(e){await h.value?.toggleStreamingMode(e)}function P(e){h.value?.toggleBbox(e)}function I(e){h.value?.togglePip(e)}return t({togglePlayerMute:C,toggleMicrophone:w,togglePlayerActivityMode:ie,togglePlayerSourceRole:O,togglePlayerStreamingMode:N,togglePlayerBbox:P,togglePip:I}),(t,n)=>{let r=Ue,a=Ve,f=J,v=l,y=Y,te=Pe,S=s;return W(),F(`div`,{ref_key:`boxRef`,ref:p,class:`view-dnd-card`},[T(u)===`normal`||T(u)===`rearrange`?(W(),F(ae,{key:0},[T(c)?(W(),M(r,ee({key:0,ref_key:`playerRef`,ref:h},e.cameraCardProps,{"activity-mode":e.cameraCardModels?.activityMode,"source-role":e.cameraCardModels?.sourceRole,"streaming-mode":e.cameraCardModels?.streamingMode,"camera-info":T(c),class:`w-full h-full`,onExpand:n[0]||=e=>i(`expand`,T(c),e)}),null,16,[`activity-mode`,`source-role`,`streaming-mode`,`camera-info`])):T(u)===`rearrange`?(W(),F(`div`,At,[U(a,{class:`w-6 h-6 text-white/20`})])):(W(),F(`div`,jt))],64)):T(u)===`edit`?(W(),F(ae,{key:1},[j(`div`,{ref:T(b),style:E({backgroundColor:T(ne)}),class:`w-full h-full`},[T(c)?(W(),F(`div`,{key:0,ref_key:`containerRef`,ref:m,class:`w-full h-full flex items-center justify-center relative min-w-0`},[U(v,{class:_([`z-1`,{"cui-icon-lg":T(x),"cui-button-small":!T(x)}]),label:T(x)?void 0:T(c).name,onClick:n[1]||=k(e=>i(`remove`,T(c)),[`prevent`])},{icon:L(()=>[U(f)]),_:1},8,[`class`,`label`]),U(y,{camera:T(c),class:`absolute w-full h-full top-0 left-0 bg-black/50 opacity-20`},null,8,[`camera`])],512)):T(o)?R(``,!0):(W(),F(`div`,Mt,[T(d).length?(W(),M(v,{key:1,text:``,rounded:``,class:`cui-icon-md`,onClick:T(g)?.toggleMenu},{icon:L(()=>[U(a,{width:`100%`,height:`100%`})]),_:1},8,[`onClick`])):z((W(),F(`div`,Nt,[U(v,{text:``,rounded:``,disabled:``,class:`cui-icon-md`},{icon:L(()=>[U(a,{width:`100%`,height:`100%`})]),_:1})])),[[S,{value:t.$t(`views.camview.no_cameras`)},void 0,{top:!0}]])]))],4),U(te,{ref_key:`menuRef`,ref:g,items:T(re),popover:{pt:{content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`])],64)):R(``,!0)],512)}}}),[[`__scopeId`,`data-v-49edf1f5`]]),Ft={class:`w-full h-full flex flex-row`},It=[`gs-id`,`gs-x`,`gs-y`,`gs-w`,`gs-h`],Lt={class:`grid-stack-item-content`},Rt=Ce(H({__name:`CuiCameraViewDnD`,props:S({cameras:{},viewSize:{},cards:{},title:{},editMode:{type:Boolean},rearrangeMode:{type:Boolean},cameraCardProps:{},cameraCardModels:{}},xt),emits:[`drop`,`remove`,`changeViewSize`,`expand`,`rearrange`],setup(e,{expose:t,emit:n}){let r=e,i=n,{isTouch:s}=Ee(),{smBreakpoint:u,lgBreakpoint:d}=De(),f=v(c,void 0),{routeFrom:p,routeTo:m}=ce(Re()),{editMode:g,rearrangeMode:ee,viewSize:y,cards:b,cameraCardProps:te}=A(r),ne=D(`viewRef`),S=D(`wrapperRef`),re=D(`gridRef`),w=D(`cardRefs`),O=I(),k=I(),N=null,{isFullscreen:V,toggle:H}=o(ne,{mode:`scroll`}),le=a(ne),G=a(S),ue=B(()=>g.value?`edit`:ee.value?`rearrange`:`normal`),K=B(()=>O.value??k.value),de=B(()=>e=>{let t={...se(te.value)};if(e){let n=p.value?.includes(`/cameras/${e.name}`)??!1,r=m.value?.includes(`/cameras/${e.name}`)??!1,i=t.viewTransition&&(n||r),a=`/cameras/${e.name}`;f?.isActive.value?t.routerLink=`${a}?startTs=${Math.floor(f.currentTimestamp.value/1e3)}`:t.routerLink=a,t.viewTransition=i}return t}),q=B(()=>(le.height.value-16)*(16/9)),fe=B(()=>b.value.filter(e=>e.lastDroppedCamera).map(e=>e.lastDroppedCamera));function pe(e){let t=b.value[e];if(u.value)return{x:0,y:t?.y??e,w:1,h:1};let n=wt[y.value]?.[e];return{x:t?.x??n?.x??0,y:t?.y??n?.y??0,w:t?.colSpan??n?.w??1,h:t?.rowSpan??n?.h??1}}function me(){if(!N)return;let e=[];for(let t of N.getGridItems()){let n=t.gridstackNode;if(!n)continue;let r=parseInt(n.id),i=b.value[r];i?.lastDroppedCamera&&e.push({index:r,cameraId:i.lastDroppedCamera._id,colSpan:n.w,rowSpan:n.h,x:n.x,y:n.y})}i(`rearrange`,e)}function he(){me()}function ge(){if(!re.value)return;let e=St[y.value];if(!e)return;let t=u.value,n=t?1:e.cols,r=t?b.value.length:e.rows,i=S.value?.clientWidth??0,a=t?i*9/16:i>0?i*9/16/e.rows:60,o=ue.value===`rearrange`;N=Ke.init({column:n,minRow:r,cellHeight:a,margin:o?3:1,float:!1,animate:!1,staticGrid:!o,resizable:t?{handles:``}:{handles:`se`},disableResize:t,alwaysShowResizeHandle:!t},re.value),N.on(`change`,he),requestAnimationFrame(()=>N?.setAnimation(!0))}function _e(){N&&=(N.offAll(),N.destroy(!1),null)}function ve(e,t,n){n?O.value=t:(k.value=t,O.value=void 0,setTimeout(()=>{k.value=void 0},250)),i(`expand`,e,n)}async function be(){await H()}function xe(e){for(let t of w.value||[])t.togglePlayerMute(e)}async function Se(e,t){await Promise.allSettled((w.value||[]).map(n=>n.toggleMicrophone(e,t)))}function Ce(e){for(let t of w.value||[])t.togglePlayerActivityMode(e)}async function we(e){await Promise.allSettled((w.value||[]).map(t=>t.togglePlayerSourceRole(e)))}async function Te(e){await Promise.allSettled((w.value||[]).map(t=>t.togglePlayerStreamingMode(e)))}function Oe(e){for(let t of w.value||[])t.togglePlayerBbox(e)}function J(e){for(let t of w.value||[])t.togglePip(e)}function ke(){N&&(N.compact(),me())}function Y(){if(!N)return;let e=St[y.value];if(!e)return;let t=e.cols,n=[];for(let e of N.getGridItems()){let t=e.gridstackNode;if(!t)continue;let r=parseInt(t.id),[i,a]=((b.value[r]?.lastDroppedCamera)?.interfaceSettings?.aspectRatio||`16:9`).split(`:`).map(Number);n.push({idx:r,el:e,cellRatio:i/a*(9/16)})}if(!n.length)return;let r=e.rows;function i(e){let r=[],i=0,a=0;for(;a<n.length;){let o=[],s=0,c=!1;for(;a<n.length;){let r=n[a].cellRatio;if(e*(s+r)>t&&o.length>0){c=!0;break}o.push(n[a]),s+=r,a++}let l=c?t/s:e;r.push({row:o,ratioSum:s,rowH:l,filled:c}),i+=l}return{rows:r,totalH:i}}let a=.25,o=r,s=a;for(let e=0;e<40;e++){let e=(a+o)/2;i(e).totalH<=r?(s=e,a=e):o=e}let{rows:c}=i(s),l=c.reduce((e,t)=>e+t.rowH,0)||1,u=l>r?r/l:1,d=c.map(e=>e.rowH*u),f=d.reduce((e,t)=>e+t,0),p=new Map,m=Math.max(0,Math.round((r-f)/2)),h=m;for(let e=0;e<c.length;e++){h+=d[e];let n=Math.min(r,Math.round(h)),i=Math.max(1,n-m),{row:a,ratioSum:o,filled:s}=c[e];if(s){let e=0;for(let n=0;n<a.length;n++){let r=n===a.length-1?Math.max(1,t-e):Math.max(1,Math.round(a[n].cellRatio/o*t));p.set(a[n].idx,{x:e,y:m,w:r,h:i}),e+=r}}else{let e=a.map(e=>Math.max(1,Math.round(e.cellRatio*i))),n=e.reduce((e,t)=>e+t,0),r=Math.max(0,Math.round((t-n)/2));for(let t=0;t<a.length;t++)p.set(a[t].idx,{x:r,y:m,w:e[t],h:i}),r+=e[t]}m=n}N.batchUpdate();for(let[e,t]of p){let r=n.find(t=>t.idx===e);r&&N.update(r.el,t)}N.batchUpdate(!1),me()}return h([y,()=>b.value.length,u],()=>{_e(),P(()=>ge())},{immediate:!1}),h(ue,e=>{if(!N)return;let t=e===`rearrange`;N.setStatic(!t),N.margin(t?3:1)}),h(()=>G.width.value,e=>{if(!(!N||e<=0)){if(N.setAnimation(!1),u.value)N.cellHeight(e*9/16);else{let t=St[y.value]?.rows??1;N.cellHeight(e*9/16/t)}requestAnimationFrame(()=>N?.setAnimation(!0))}}),x(()=>{P(()=>ge())}),C(()=>{_e()}),t({toggleFullscreen:be,toggleAllPlayerMute:xe,toggleAllPlayerMicrophone:Se,toggleAllPlayerActivityMode:Ce,toggleAllPlayerSourceRole:we,toggleAllPlayerStreamingMode:Te,toggleAllPlayerBbox:Oe,toggleAllPip:J,compactGrid:ke,fitAspectRatios:Y,isFullscreen:V}),(t,n)=>{let r=ye,a=l,o=Pt,c=kt;return W(),M(T(X),{backend:T(s)?T(Me):T(Q)},{default:L(()=>[j(`div`,Ft,[j(`div`,{ref_key:`viewRef`,ref:ne,class:_([`view-container w-full flex flex-col min-w-0 overflow-y-auto items-center`,{"px-2":T(g)&&T(d)}])},[T(V)?(W(),M(a,{key:0,severity:`secondary`,rounded:``,class:`cui-fs-exit`,"aria-label":t.$t(`components.form.tooltip.fullscreen_off`),onClick:T(H)},{icon:L(()=>[U(r,{class:`w-5 h-5`})]),_:1},8,[`aria-label`,`onClick`])):R(``,!0),T(K)===void 0?R(``,!0):(W(),F(`div`,{key:1,class:`w-full aspect-video relative my-auto`,style:E({maxWidth:`${T(q)}px`})},[U(o,{ref:`fsCardRef`,class:_([`w-full h-full`,{"card-expanded":T(O)!==void 0,"card-collapsing":T(k)!==void 0}]),camera:T(b)[T(K)]?.lastDroppedCamera,cameras:e.cameras,"dropped-cameras":T(fe),mode:`normal`,index:T(K),"camera-card-props":{...T(de)(T(b)[T(K)]?.lastDroppedCamera),expanded:!0},"camera-card-models":e.cameraCardModels,onExpand:n[0]||=(e,t)=>ve(e,T(K),t)},null,8,[`class`,`camera`,`cameras`,`dropped-cameras`,`index`,`camera-card-props`,`camera-card-models`])],4)),z(j(`div`,{ref_key:`wrapperRef`,ref:S,class:_([`w-full relative my-auto`,T(u)?`h-auto`:`aspect-video`]),style:E(T(u)?void 0:{maxWidth:`${T(q)}px`})},[j(`div`,{ref_key:`gridRef`,ref:re,class:`grid-stack w-full h-full`},[(W(!0),F(ae,null,ie(T(b),(t,r)=>(W(),F(`div`,{key:r,class:`grid-stack-item`,"gs-id":String(r),"gs-x":pe(r).x,"gs-y":pe(r).y,"gs-w":pe(r).w,"gs-h":pe(r).h},[j(`div`,Lt,[U(o,{ref_for:!0,ref_key:`cardRefs`,ref:w,camera:t.lastDroppedCamera,cameras:e.cameras,"dropped-cameras":T(fe),mode:T(ue),index:r,"camera-card-props":{...T(de)(t.lastDroppedCamera),expanded:T(K)===r},"camera-card-models":e.cameraCardModels,"on-drop":e=>i(`drop`,r,e),onExpand:(e,t)=>ve(e,r,t),onDrop:e=>i(`drop`,r,e),onRemove:n[1]||=e=>i(`remove`,e)},null,8,[`camera`,`cameras`,`dropped-cameras`,`mode`,`index`,`camera-card-props`,`camera-card-models`,`on-drop`,`onExpand`,`onDrop`])])],8,It))),128))],512)],6),[[oe,T(K)===void 0]])],2),T(g)&&T(d)?(W(),M(c,{key:0,cameras:e.cameras,"dropped-cameras":T(fe),title:e.title,class:`view-box shadow-xl`,style:E({"margin-right":T(g)?`0px`:`-${T(400)}px`}),onChangeViewSize:n[2]||=e=>i(`changeViewSize`)},null,8,[`cameras`,`dropped-cameras`,`title`,`style`])):R(``,!0)])]),_:1},8,[`backend`])}}}),[[`__scopeId`,`data-v-3273ba0f`]]),zt={class:`flex flex-col gap-3`},Bt={class:`text-wrap`},Vt={class:`w-full h-full flex items-center justify-center relative`},Ht=H({__name:`AudioVisualizer`,emits:[`listening`],setup(e,{expose:t,emit:n}){let r=n,i=d(),a=u(),o=v(`dialogRefProps`),s=D(`canvasRef`),c=O(),f=O(),p=I(!1),m=B(()=>!!o.loading?.value);async function h(){if(p.value)ee();else try{c.value&&ee();let e;try{e=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){a.add({severity:`warn`,detail:`Can not enable AudioVisualizer, see console.`,life:3e3}),i.warn(`Can not enable AudioVisualizer`,e);return}p.value=!0,r(`listening`,!0),c.value=new AudioContext;let t=c.value.createAnalyser();t.fftSize=1024,f.value=e.getTracks(),c.value.createMediaStreamSource(e).connect(t);let n,o=s.value?.getContext(`2d`),l=()=>{if(s.value&&o){let e=[],r=[];o.clearRect(0,0,s.value.width,s.value.height),requestAnimationFrame(l);let i=t.frequencyBinCount,a=new Uint8Array(i);t.getByteFrequencyData(a),e.push(a);for(let t=0;t<e[0].length;t++)r.push(0),e.forEach(e=>{r[t]+=e[t]});let c=s.value.width/2,u=s.value.height/2;o.beginPath(),o.arc(c,u,30,0,2*Math.PI),o.lineWidth=1,o.stroke(),o.closePath();for(let e=0;e<90;e++){n=r[e]*.4;let t=Math.PI*2/90,i=c+Math.cos(t*e)*30,a=u+Math.sin(t*e)*30,s=c+Math.cos(t*e)*(30+n),l=u+Math.sin(t*e)*(30+n);g(o,i,a,s,l,3)}p.value||o.clearRect(0,0,s.value.width,s.value.height)}};l()}catch(e){ee(),i.error(e)}}function g(e,t,n,r,i,a){let o=e.createLinearGradient(t,n,r,i);o.addColorStop(0,`#5b040f`),o.addColorStop(.5,`#b50b21`),o.addColorStop(.9,`#df2a4c`),o.addColorStop(1,`#df6380`),e.lineWidth=a,e.strokeStyle=o,e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke(),e.closePath()}function ee(){c.value?.close(),c.value=void 0,f.value?.forEach(e=>e.stop()),f.value=void 0,p.value=!1,r(`listening`,!1)}return w(()=>{ee()}),t({isLoading:m}),(e,t)=>{let n=Be,r=l;return W(),F(`div`,zt,[j(`span`,Bt,y(e.$t(`components.dialog.message.intercom_info`)),1),j(`div`,Vt,[U(r,{rounded:``,class:`w-[60px] h-[60px] absolute z-1`,onClick:h},{icon:L(()=>[U(n,{width:`100%`,height:`100%`})]),_:1}),j(`canvas`,{ref_key:`canvasRef`,ref:s,height:`300`,width:`300`},null,512)])])}}}),Ut=[`fill`],Wt=H({__name:`CuiCameraGridIcon1`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm0 8h952v532H9V9Z`},null,-1)]],8,Ut))}}),Gt=[`fill`],Kt=H({__name:`CuiCameraGridIcon10`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm726 275h226v130H735V276Zm-242 0h234v130H493V276Zm0 265V414h234v127H493ZM9 541V276h476v265H9Zm726 0V414h226v127H735ZM961 9v121H735V9h226ZM735 138h226v130H735V138ZM727 9v121H493V9h234ZM493 138h234v130H493V138ZM485 9v259H9V9h476Z`},null,-1)]],8,Gt))}}),qt=[`fill`],Jt=H({__name:`CuiCameraGridIcon12`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 275v129H810.5V276H961Zm-158.5 0v129h-152V276h152Zm-152 265V413h152v128h-152Zm-8-265v129H493V276h149.5ZM493 541V413h149.5v128H493ZM9 276h476v265H9V276Zm801.5 265V413H961v128H810.5ZM961 9v259H493V9h468ZM9 268V9h476v259H9Z`},null,-1)]],8,qt))}}),Yt=[`fill`],Xt=H({__name:`CuiCameraGridIcon13`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M250 549.5h.5v-.5H961a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h233.5v.5h7.5Zm.5-273.5H485v129.5H250.5V276Zm-8 0v129.5H9V276h233.5ZM961 9v121H735V9h226ZM727 9v121H493V9h234ZM493 138h234v130H493V138ZM485 9v259H9V9h476Zm250 129h226v130H735V138Zm0 267.5V276h226v129.5H735ZM493 276h234v129.5H493V276Zm0 265V413.5h234V541H493Zm-242.5 0V413.5H485V541H250.5ZM9 541V413.5h233.5V541H9Zm726 0V413.5h226V541H735Z`},null,-1)]],8,Yt))}}),Zt=[`fill`],Qt=H({__name:`CuiCameraGridIcon15`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M250 549.5h.5v-.5H961a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h233.5v.5h7.5Zm.5-144V276H485v129.5H250.5Zm-8-129.5v129.5H9V276h233.5Zm570 90H961v82H812.5v-82Zm-160 0h152v82h-152v-82ZM961 276v82H812.5v-82H961Zm-308.5 0h152v82h-152v-82Zm0 180h152v85h-152v-85ZM961 541H812.5v-85H961v85Zm-316.5-93H493v-82h151.5v82Zm0-172v82H493v-82h151.5Zm0 180v85H493v-85h151.5ZM485 413.5V541H250.5V413.5H485Zm-242.5 0V541H9V413.5h233.5ZM961 9v259H493V9h468ZM9 9h476v259H9V9Z`},null,-1)]],8,Zt))}}),$t=[`fill`],en=H({__name:`CuiCameraGridIcon16`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 8v121.5H732.5V9H961ZM724.5 9v121.5H493V9h231.5ZM493 268V138.5h231.5V268H493Zm0 137.5V276h231.5v129.5H493Zm468 0H732.5V276H961v129.5ZM493 541V413.5h231.5V541H493Zm468 0H732.5V413.5H961V541Zm0-273H732.5V138.5H961V268ZM485 9v121.5H250.5V9H485ZM250.5 138.5H485V268H250.5V138.5ZM242.5 9v121.5H9V9h233.5ZM9 138.5h233.5V268H9V138.5ZM250.5 276H485v129.5H250.5V276Zm0 137.5H485V541H250.5V413.5Zm-8-137.5v129.5H9V276h233.5ZM9 541V413.5h233.5V541H9Z`},null,-1)]],8,$t))}}),tn=[`fill`],nn=H({__name:`CuiCameraGridIcon20`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 94v82H812.5V95H961Zm-156.5 82h-152V95h152v82ZM961 9v78H812.5V9H961ZM652.5 9h152v78h-152V9Zm0 176h152v83h-152v-83ZM961 268H812.5v-83H961v83Zm-308.5 8h152v82h-152v-82Zm160 0H961v82H812.5v-82Zm-168-181v82H493V95h151.5Zm0-86v78H493V9h151.5ZM493 268v-83h151.5v83H493Zm0 90v-82h151.5v82H493ZM9 9h476v259H9V9Zm952 357v82H812.5v-82H961Zm-156.5 0v82h-152v-82h152Zm-152 90h152v85h-152v-85ZM961 541H812.5v-85H961v85ZM644.5 366v82H493v-82h151.5ZM493 541v-85h151.5v85H493ZM9 276h476v265H9V276Z`},null,-1)]],8,tn))}}),rn=[`fill`],an=H({__name:`CuiCameraGridIcon26`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M1.5 9A7.5 7.5 0 0 1 9 1.5h952a7.5 7.5 0 0 1 7.5 7.5v532a7.5 7.5 0 0 1-7.5 7.5H9a7.5 7.5 0 0 1-7.5-7.5V9Zm960 168V94h-153v83h153Zm-160 0h-153V94h153v83Zm7-90h153V9a.5.5 0 0 0-.5-.5H808.5V87Zm-7-78.5V87h-153V8.5h153Zm0 175.5v84.5h-153V184h153Zm7 84.5V184h153v84.5h-153Zm-167-91.5V94h-149v83h149Zm0-90V8.5h-149V87h149Zm-149 97h149v84.5h-149V184Zm0 91.5H719V402H492.5V275.5Zm0 133.5v132.5H719V409H492.5Zm233.5 0v132.5h235a.5.5 0 0 0 .5-.5V409H726Zm235.5-7V275.5H726V402h235.5Zm-476-270V8.5H252V132h233.5ZM245 139H8.5v129.5H245V139Zm0-7V8.5H9a.5.5 0 0 0-.5.5v123H245Zm240.5 136.5V139H252v129.5h233.5Zm-477 7h157v81H8.5v-81Zm164 81v-81h153v81h-153Zm153 7h-153v83h153v-83Zm7 83v-83h153v83h-153Zm-7 7h-153v88h153v-88Zm7 88v-88h153v88h-153Zm0-185v-81h153v81h-153Zm-324 7h157v83H8.5v-83Zm0 90h157v88H9a.5.5 0 0 1-.5-.5v-87.5Z`},null,-1)]],8,rn))}}),on=[`fill`],sn=H({__name:`CuiCameraGridIcon4`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm952 8v259H493V9h468ZM493 541V276h468v265H493ZM485 9v259H9V9h476ZM9 541V276h476v265H9Z`},null,-1)]],8,on))}}),cn=[`fill`],ln=H({__name:`CuiCameraGridIcon6`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm641.5 187.5H961v171H650.5v-171ZM961 9v171.5H650.5V9H961ZM642.5 9v350.5H9V9h633.5ZM9 541V367.5h315.5V541H9Zm323.5-173.5h310V541h-310V367.5Zm318 0H961V541H650.5V367.5Z`},null,-1)]],8,cn))}}),un=[`fill`],dn=H({__name:`CuiCameraGridIcon7`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M9 1a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V9a8 8 0 0 0-8-8H9Zm725.5 275H961v130H734.5V276Zm0 265V414H961v127H734.5Zm-8-265v130H493V276h233.5ZM493 541V414h233.5v127H493ZM9 276h476v265H9V276ZM961 9v259H493V9h468ZM9 268V9h476v259H9Z`},null,-1)]],8,un))}}),fn=[`fill`],pn=H({__name:`CuiCameraGridIcon9`,props:{color:{default:`currentColor`}},setup(e){let{color:t}=A(e);return(e,n)=>(W(),F(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 970 550`,role:`img`,"area-hidden":`true`,fill:T(t)},[...n[0]||=[j(`path`,{d:`M969.5 359v-.5h-.5V9a8 8 0 0 0-8-8H9a8 8 0 0 0-8 8v532a8 8 0 0 0 8 8h952a8 8 0 0 0 8-8V366.5h.5V359ZM961 187v171.5H651V187h310ZM651 541V366.5h310V541H651Zm-8-354v171.5H330V187h313ZM330 541V366.5h313V541H330Zm-8-354v171.5H9V187h313ZM9 541V366.5h313V541H9ZM961 9v170H651V9h310ZM643 9v170H330V9h313ZM322 9v170H9V9h313Z`},null,-1)]],8,fn))}}),mn={for:`name`,class:`cui-label`},hn={key:0,class:`flex flex-col gap-6 justify-center`},gn={key:0,class:`text-red-500 text-center mb-5`},_n={class:`md:max-h-[350px] overflow-y-auto`},vn={class:`block cui-label mb-3`},yn={key:1,class:`flex flex-col gap-6 justify-center`},bn={key:0,class:`text-red-500 text-center mb-5`},xn={class:`md:max-h-[450px] overflow-y-auto`},Sn={class:`block cui-label mb-3`},Cn={class:`view-select-container`},wn=[`onClick`],Tn=Ce(H({__name:`CamviewForm`,props:{form:{},type:{},cameras:{},views:{}},setup(n,{expose:r}){let i=new m,a=n,o=d(),s=u(),{t:c}=e(),l=v(`dialogRefProps`),{user:S}=ce(f()),{mutateAsync:C,isPending:w}=i.createViewQuery(),{mutateAsync:E,isPending:O}=i.patchViewQuery(),{form:k,type:N,cameras:P,views:oe}=A(a),z=D(`formRef`),V=I([1,4,6,7,9,10,12,13,15,16,20,26]),se=I(!0),H=I(!0),G=I([]),K=I(!!k.value),q=I(k.value?p(k.value):{});!K.value&&N.value===`view`&&(q.value.viewSize=V.value[0]);let fe=B(()=>!!(l.loading?.value||w.value||O.value));function pe(e){let t=G.value.findIndex(t=>t.name===e.name);t===-1?G.value.push(e):G.value.splice(t,1)}function me(e){switch(e){case 1:return Wt;case 4:return sn;case 6:return ln;case 7:return dn;case 9:return pn;case 10:return Kt;case 12:return Jt;case 13:return Xt;case 15:return Qt;case 16:return en;case 20:return nn;case 26:return an;default:return Wt}}async function he(){if(!z.value||!S.value)return;let e=oe.value.find(e=>e.name===q.value.name);if(e&&!K.value)return o.error(`View already exists`,e),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null;if(N.value===`dnd`){if(H.value)return o.error(`No cameras selected`),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null;let e=G.value.map((e,t)=>({cameraId:e._id,index:t}));q.value.cameras=e,q.value.type=`dnd`,q.value.viewSize=1,z.value.setFieldValue(`type`,`dnd`),z.value.setFieldValue(`viewSize`,1),z.value.setFieldValue(`cameras`,e);let t=await z.value.validate();return t?.valid?K.value?await E({username:S.value.username,viewid:q.value._id,viewData:q.value}):await C({username:S.value.username,viewData:q.value}):(o.error(`Validation failed`,t),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null)}else{if(se.value)return o.error(`No view selected`),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null;q.value.cameras=[],q.value.type=`view`,z.value.setFieldValue(`type`,`view`),z.value.setFieldValue(`cameras`,[]);let e=await z.value.validate();return e?.valid?p(q.value):(o.error(`Validation failed`,e),s.add({severity:`error`,detail:c(`components.toast.validation_failed`),life:3e3}),null)}}return h(q,e=>{for(let[t,n]of Object.entries(e))z.value?.setFieldValue(t,n);e.viewSize&&(se.value=!1),e.cameras?.length&&(H.value=!1)},{deep:!0,immediate:!0}),h(G,e=>{H.value=e.length===0},{deep:!0}),x(()=>{G.value=P.value?.filter(e=>q.value?.cameras?.some(t=>t.cameraId===e._id))||[]}),r({isLoading:fe,onConfirm:he}),(e,n)=>{let r=t,i=ue,a=de,o=le,s=Ne;return W(),M(T(ne),{ref_key:`formRef`,ref:z,class:`flex flex-col gap-6`,"validation-schema":T(Le),"initial-values":T(q)},{default:L(()=>[U(T(b),{modelValue:T(q).name,"onUpdate:modelValue":n[0]||=e=>T(q).name=e,modelModifiers:{trim:!0},name:`name`,as:`div`,class:`flex flex-col field-gap`},{default:L(({field:t,errors:n})=>[j(`label`,mn,y(e.$t(`components.form.label.name`)),1),U(i,null,{default:L(()=>[U(r,ee(t,{invalid:n.length>0,loading:T(fe),type:`text`}),null,16,[`invalid`,`loading`])]),_:2},1024),U(g,{name:`fade`},{default:L(()=>[U(T(re),{name:`name`,class:`cui-input-error`})]),_:1})]),_:1},8,[`modelValue`]),U(a,{class:`m-0 py-3`}),T(N)===`dnd`?(W(),F(`div`,hn,[U(g,{name:`fade`},{default:L(()=>[T(H)?(W(),F(`span`,gn,y(e.$t(`components.form.error.no_cameras_selected`)),1)):R(``,!0)]),_:1}),j(`div`,_n,[j(`label`,vn,y(e.$t(`components.form.label.cameras`)),1),(W(!0),F(ae,null,ie(T(P),(e,t)=>(W(),F(`div`,{key:t,class:`cui-list-item`},[U(s,{class:`h-14`,active:T(G).some(t=>t.name===e.name),onClick:t=>pe(e)},{append:L(()=>[U(o,{"model-value":T(G).some(t=>t.name===e.name),"onUpdate:modelValue":t=>pe(e)},null,8,[`model-value`,`onUpdate:modelValue`])]),default:L(()=>[j(`span`,null,y(e.name),1)]),_:2},1032,[`active`,`onClick`])]))),128))])])):(W(),F(`div`,yn,[U(g,{name:`fade`},{default:L(()=>[T(se)?(W(),F(`span`,bn,y(e.$t(`components.form.error.no_view_selected`)),1)):R(``,!0)]),_:1}),j(`div`,xn,[j(`label`,Sn,y(e.$t(`components.form.label.views`)),1),j(`div`,Cn,[(W(!0),F(ae,null,ie(T(V),t=>(W(),F(`div`,{key:t,class:`view-select-item w-full`,onClick:e=>T(q).viewSize=t},[j(`div`,{class:_([`view-select-item-icon w-full p-3`,{"selected-view":T(q).viewSize===t}])},[(W(),M(te(me(t)),{style:{width:`100%`,height:`100%`}}))],2),j(`span`,{class:_([`view-select-item-label text-muted mt-3 px-2 py-1 cui-rounded-corners`,{"selected-view-label":T(q).viewSize===t}])},y(t)+` `+y(e.$t(`views.camview.cameras`)),3)],8,wn))),128))])])]))]),_:1},8,[`validation-schema`,`initial-values`])}}}),[[`__scopeId`,`data-v-641aac54`]]),En={class:`h-full w-full dark-mode relative`},Dn={key:0,class:`flex flex-col w-full h-full items-center justify-center`},On={key:1,class:`flex flex-col w-full h-full`},kn={class:`flex flex-1 min-h-0 flex-col items-center justify-center w-full gap-4`},An={class:`text-muted text-sm`},jn={class:`relative w-6 h-6`},Mn=Ce(H({__name:`Camview`,props:{navbarWidth:{default:0},navbarLeft:{default:0}},setup(t){let a=new m,o=new Fe,c=t,u=e(),{t:d}=u,v=G(),b=Ie(),{bottombarHeight:ne}=Te(),{smBreakpoint:x,lgBreakpoint:S,mdBreakpoint:re}=De(),{user:C}=ce(f()),{uiSettings:w}=ce(Oe()),{data:ie,isLoading:O}=o.getCamerasQuery({page:1,pageSize:-1}),{data:k,isLoading:P}=a.getViewsQuery(C.value?.username??``,{page:1,pageSize:-1}),{mutate:ae,isPending:oe}=a.removeViewQuery(),{mutateAsync:V,isPending:se}=a.createViewQuery(),{mutateAsync:H,isPending:le}=a.patchViewQuery(),{navbarWidth:ue,navbarLeft:Ce}=A(c),we=D(`menuRef`),Ee=D(`newViewMenuRef`),J=D(`viewDndRef`),Y=I({}),X=I(!1),Z=I(!1),Q=I(!1),je=I(!1),Me=I(!1),Ne=I(!1),Le=I(!0),Re=I(`always-on`),Be=I(`low-resolution`),Ue=I(`webrtc`),Ke=I([]),qe=I({}),Je=N({sourceRole:Be.value,activityMode:Re.value,streamingMode:Ue.value}),Xe=B(()=>O.value||P.value||oe.value||se.value||le.value),Ze=B(()=>ue.value+Ce.value),$e=B(()=>({locale:u.locale.value,dayNames:v.config.locale?.dayNames,dayNamesShort:v.config.locale?.dayNamesShort,monthNames:v.config.locale?.monthNames,monthNamesShort:v.config.locale?.monthNamesShort})),et=B(()=>({doubleClickZoom:!1,flatCard:!0,cameraNameOverlay:!0,control:!0,toolbar:!1,expandableCard:($.value?.cameras?.length??0)>1,detectionIndicatorOverlay:!0,boundingBoxOverlay:!1,cardClickAction:`expand`,viewTransition:!0,cardProps:{pt:{root:{style:`background: #000`}}}})),nt=B(()=>k.value?.result.length?S.value?{width:Me.value?`calc(100% - 400px)`:`100%`,height:`100%`,overflowY:`scroll`}:{height:`100%`,paddingBottom:Me.value?ne.value>0?`200px`:`192px`:`0px`,overflowY:`scroll`}:{width:`100%`,height:`100%`,overflowY:`scroll`}),rt=B(()=>X.value||Z.value),at=B(()=>!!J.value?.isFullscreen),ot=B(()=>[{label:at.value?d(`components.form.tooltip.fullscreen_off`):d(`components.form.tooltip.fullscreen_on`),icon:at.value?ye:Se,command:Dt},{label:Le.value?d(`components.form.tooltip.unmute`):d(`components.form.tooltip.mute`),icon:Le.value?lt:st,command:Ot},{label:d(`components.form.tooltip.intercom`),icon:ve,command:()=>_t(`intercom`)},{label:Ue.value===`auto`?`${d(`components.form.tooltip.mode`)}: ${d(`components.form.tooltip.streaming_mode_auto`)}`:Ue.value===`webrtc`?`${d(`components.form.tooltip.mode`)}: ${d(`components.form.tooltip.streaming_mode_webrtc`)}`:`${d(`components.form.tooltip.mode`)}: ${d(`components.form.tooltip.streaming_mode_mse`)}`,icon:Ue.value===`auto`?ft:Ue.value===`webrtc`?q:xe,command:()=>jt()},{label:Re.value===`always-on`?d(`components.form.tooltip.activity_mode_always_on`):Re.value===`standby`?d(`components.form.tooltip.activity_mode_standby`):d(`components.form.tooltip.activity_mode_activity`),icon:Re.value===`always-on`?be:Re.value===`standby`?me:it,command:()=>kt()},{label:Be.value===`low-resolution`?`${d(`components.form.tooltip.resolution`)}: ${d(`components.form.tooltip.source_role_low`)}`:Be.value===`mid-resolution`?`${d(`components.form.tooltip.resolution`)}: ${d(`components.form.tooltip.source_role_mid`)}`:`${d(`components.form.tooltip.resolution`)}: ${d(`components.form.tooltip.source_role_high`)}`,icon:Be.value===`low-resolution`?pe:Be.value===`mid-resolution`?fe:ge,command:()=>At()}]),$=B(()=>{let e=k.value?.result.find(e=>e._id===w.value.camview.viewid)||k.value?.result[0];return e?(Y.value=e,w.value.camview.viewid=e._id):Y.value={},e}),ct=B(()=>$.value?.cameras?.map(e=>e.cameraId)??[]),{master:ut}=i(ct,{sourceRole:`low`}),dt=B(()=>ut.mode.value!==`idle`&&ut.currentTimestamp.value>0?Math.floor(ut.currentTimestamp.value/1e3):void 0),pt=B(()=>rt.value&&Y.value.viewSize>0?Y.value.viewSize:$.value?$.value.viewSize:1),mt=B(()=>{let e=[];for(let t of k.value?.result||[])e.push({label:t.name,active:t._id===$.value?._id,onClick:()=>vt(t)});return e}),gt=B(()=>[{label:d(`views.camview.new_view`),icon:ht,onClick:()=>_t(`newView`)}]);function _t(e){switch(e){case`newView`:case`editView`:{let t=e===`editView`,n=d(t?`components.dialog.title.edit_view`:`components.dialog.title.new_view`);t?X.value=!0:Z.value=!0,b.openComponentDialog(Tn,{data:{title:n,loading:Xe,confirmText:d(`components.form.button.next`),contentProps:{form:t?Y.value:void 0,type:`view`,cameras:ie.value?.result||[],views:k.value?.result||[]}},onConfirm:e=>{e&&(Y.value=e)},onCancel:()=>{Z.value=!1}});break}case`intercom`:b.openComponentDialog(Ht,{data:{title:d(`components.dialog.title.intercom`),hideConfirmButton:!0,loading:Xe,contentProps:{}},events:{listening:Mt}});break;case`removeView`:b.openTextDialog({data:{title:d(`components.dialog.title.confirm`),confirmText:d(`components.form.button.remove`),contentText:d(`components.dialog.message.confirm_remove_layout`),confirmButtonProps:{severity:`danger`}},onConfirm:yt});break}}function vt(e){w.value.camview.viewid=e._id}function yt(){!$.value||!C.value||ae({username:C.value.username,viewid:$.value._id},{onSuccess:e=>{e.length?w.value.camview.viewid=e[0]._id:w.value.camview.viewid=void 0}})}async function bt(){if(!C.value||Object.keys(Y.value).length===0)return;let e=Ke.value.filter(e=>e.lastDroppedCamera).map(e=>({cameraId:e.lastDroppedCamera._id,index:e.index,colSpan:e.colSpan,rowSpan:e.rowSpan})).sort((e,t)=>e.index-t.index);if(!e.length)return;let t=p(Y.value);t.cameras=e,t._id?Et(await H({username:C.value.username,viewid:t._id,viewData:t})):Et(await V({username:C.value.username,viewData:t}))}function xt(e,t){Ke.value[e].lastDroppedCamera=t}function St(e){Ke.value=Ke.value.map(t=>(t.lastDroppedCamera?.name===e.name&&(t.lastDroppedCamera=void 0),t))}function Ct(e){return`${x.value?`mobile`:`desktop`}:${e}`}function wt(e){let t=$.value?._id;t&&(w.value.camview.layouts||(w.value.camview.layouts={}),w.value.camview.layouts[Ct(t)]=e.map(e=>({index:e.index,cameraId:e.cameraId,x:e.x??0,y:e.y??0,w:e.colSpan??1,h:e.rowSpan??1})))}function Tt(e,t){qe.value[e._id]=t}function Et(e){w.value.camview.viewid=e._id,Z.value=!1,X.value=!1}function Dt(){J.value?.toggleFullscreen()}function Ot(){Le.value=!Le.value,J.value?.toggleAllPlayerMute(Le.value)}function kt(e){let t=Re.value;t=e||(t===`always-on`?`standby`:t===`standby`?`activity`:`always-on`),J.value?.toggleAllPlayerActivityMode(t),Re.value=t}async function At(e){let t=Be.value;t=e||(t===`low-resolution`?`mid-resolution`:t===`mid-resolution`?`high-resolution`:`low-resolution`),await J.value?.toggleAllPlayerSourceRole(t),Be.value=t}async function jt(e){let t=Ue.value;t===`auto`&&(t=`webrtc`);let n=e||(t===`mse`?`webrtc`:`mse`);await J.value?.toggleAllPlayerStreamingMode(n),Ue.value=n}async function Mt(e){await J.value?.toggleAllPlayerMicrophone(e)}return h(je,e=>{e&&(Ne.value=!0)}),h([pt,$,ie,rt,w,x],()=>{let e=Array.from({length:pt.value}).map((e,t)=>({accept:`camera`,index:t,lastDroppedCamera:void 0}));if(!Z.value){let t=$.value?._id,n=t?Ct(t):void 0,r=n?w.value.camview.layouts?.[n]:void 0,i=new Set(ie.value?.result.map(e=>e._id)??[]),a=!1;for(let t of $.value?.cameras||[]){if(!e[t.index])continue;let n=ie.value?.result.find(e=>e._id===t.cameraId);e[t.index].lastDroppedCamera=n;let o=r?.find(e=>e.index===t.index);o&&(!o.cameraId||i.has(o.cameraId)?(e[t.index].x=o.x,e[t.index].y=o.y,e[t.index].colSpan=o.w,e[t.index].rowSpan=o.h):a=!0)}a&&n&&w.value.camview.layouts?.[n]&&(w.value.camview.layouts[n]=w.value.camview.layouts[n].filter(e=>!e.cameraId||i.has(e.cameraId)))}Ke.value=e},{deep:!0,immediate:!0}),(e,t)=>{let i=Ge,a=tt,o=Ae,c=Qe,u=Ye,d=he,f=_e,p=de,m=He,h=ze,v=Ve,b=We,C=n,D=ke,O=l,A=K,N=Pe,P=s;return W(),F(`div`,En,[U(b,{"left-offset":T(Ze),animate:``},{left:L(()=>[!T(Z)&&T($)?(W(),M(i,{key:0,type:`dropdown`,label:T($).name,"menu-open":T(we)?.isOpen,disabled:T(Xe)||T(X),onClick:t[0]||=e=>T(we)?.toggleMenu(e)},null,8,[`label`,`menu-open`,`disabled`])):T(Z)&&T(Y).name?(W(),M(i,{key:1,label:T(Y).name,disabled:T(Xe)},null,8,[`label`,`disabled`])):R(``,!0)]),right:L(()=>[!T(rt)&&T($)?z((W(),M(i,{key:0,active:T(Q),onClick:t[1]||=e=>Q.value=!T(Q)},{icon:L(()=>[T(Q)?(W(),M(o,{key:1,width:`100%`,height:`100%`})):(W(),M(a,{key:0,width:`100%`,height:`100%`}))]),_:1},8,[`active`])),[[P,{value:T(Q)?e.$t(`views.camview.rearrange_done`):e.$t(`views.camview.rearrange`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)&&T(Q)&&!T(x)?z((W(),M(i,{key:1,onClick:t[2]||=e=>T(J)?.fitAspectRatios()},{icon:L(()=>[U(c,{width:`100%`,height:`100%`})]),_:1})),[[P,{value:e.$t(`views.camview.rearrange_fit_aspect`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)&&T(Q)&&!T(x)?z((W(),M(i,{key:2,onClick:t[3]||=e=>T(J)?.compactGrid()},{icon:L(()=>[U(u,{width:`100%`,height:`100%`})]),_:1})),[[P,{value:e.$t(`views.camview.rearrange_auto`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)?z((W(),M(i,{key:3,active:T(je),onClick:t[4]||=e=>je.value=!T(je)},{icon:L(()=>[T(je)?(W(),M(f,{key:1,width:`100%`,height:`100%`})):(W(),M(d,{key:0,width:`100%`,height:`100%`}))]),_:1},8,[`active`])),[[P,{value:T(je)?e.$t(`components.form.tooltip.hide_timeline`):e.$t(`components.form.tooltip.show_timeline`)},void 0,{bottom:!0}]]):R(``,!0),!T(rt)&&T($)?(W(),M(p,{key:4,layout:`vertical`})):R(``,!0),!T(rt)&&T($)?z((W(),M(i,{key:5,disabled:T(Q),onClick:t[5]||=e=>_t(`removeView`)},{icon:L(()=>[U(m,{width:`100%`,height:`100%`})]),_:1},8,[`disabled`])),[[P,{value:e.$t(`components.form.tooltip.delete`)},void 0,{bottom:!0}]]):R(``,!0),!T(X)&&!T(Z)&&T($)?z((W(),M(i,{key:6,disabled:T(Q),onClick:t[6]||=e=>X.value=!0},{icon:L(()=>[U(h,{width:`100%`,height:`100%`})]),_:1},8,[`disabled`])),[[P,{value:e.$t(`components.form.tooltip.edit`)},void 0,{bottom:!0}]]):R(``,!0),!T(X)&&!T(Z)?z((W(),M(i,{key:7,disabled:T(Q),onClick:T(Ee)?.toggleMenu},{icon:L(()=>[U(v,{class:_([`transform transition-transform duration-300`,{"rotate-45":T(Ee)?.isOpen}]),width:`100%`,height:`100%`},null,8,[`class`])]),_:1},8,[`disabled`,`onClick`])),[[P,{value:e.$t(`components.form.tooltip.new`)},void 0,{bottom:!0}]]):R(``,!0),T(X)||T(Z)?(W(),M(i,{key:8,label:e.$t(`components.form.button.cancel`),onClick:t[7]||=e=>T(X)?X.value=!1:Z.value=!1},null,8,[`label`])):R(``,!0),T(X)||T(Z)?(W(),M(i,{key:9,label:e.$t(`components.form.button.save`),disabled:T(Ke).every(e=>e.lastDroppedCamera===void 0),primary:``,onClick:bt},null,8,[`label`,`disabled`])):R(``,!0)]),_:1},8,[`left-offset`]),j(`div`,{class:_([`w-full h-full flex relative`,{"flex-row":T(S),"flex-col":!T(S)}]),style:E({paddingTop:`${T(55)}px`})},[j(`div`,{class:_([`flex relative z-1 camview-content-transition`,{"h-full items-center justify-center":T(S)||!T(k)?.result.length,"w-full items-start justify-start":!T(S)&&T(k)?.result.length}]),style:E(T(nt))},[T(Xe)?(W(),F(`div`,Dn,[(W(),M(C,{key:0,class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`}))])):!T($)&&!T(Z)?(W(),F(`div`,On,[j(`div`,kn,[U(D,{class:`w-12 h-12 text-muted`}),j(`span`,An,y(e.$t(`views.camview.no_views_configured`)),1)])])):T($)||T(Z)?(W(),F(`div`,{key:2,class:_([`w-full h-full`,{"p-2 pb-0":!T(x)}])},[(W(),M(Rt,{ref_key:`viewDndRef`,ref:J,key:T(w).camview.viewid+(T(Z)?`-new`:T(X)?`-edit`:`-view`),cameras:T(ie)?.result||[],"edit-mode":T(Z)||T(X),"rearrange-mode":T(Q),"view-size":T(Z)?T(Y).viewSize:T(pt),title:T(Y).name,cards:T(Ke),"camera-card-props":T(et),"camera-card-models":T(Je),onDrop:xt,onRemove:St,onChangeViewSize:t[8]||=e=>_t(`editView`),onExpand:Tt,onRearrange:wt},null,8,[`cameras`,`edit-mode`,`rearrange-mode`,`view-size`,`title`,`cards`,`camera-card-props`,`camera-card-models`]))],2)):R(``,!0)],6),U(g,{name:T(S)?`slide-left`:`slide-up`,onBeforeEnter:t[9]||=e=>Me.value=!0,onAfterEnter:t[10]||=e=>Ne.value=!1,onBeforeLeave:t[11]||=e=>Me.value=!1},{default:L(()=>[T(je)?(W(),M(T(r),{key:0,"camera-ids":T(ct),"initial-timestamp":T(dt),loading:T(Ne),type:T(S)?`vertical`:`horizontal`,"dark-mode":``,"md-breakpoint":T(re),class:_([`shrink-0 transition-[left] duration-200`,{"h-full w-[400px] pt-2 pr-2":T(S),"h-[200px] pt-2 px-2 pb-2 pb-safe-offset fixed right-safe-offset-0 z-10":!T(S),"p-0! pt-2! border-color":T(x)}]),"card-class":{"!shadow-xl":!0,"!rounded-none border-l-0! border-r-0!":T(x)},style:E(T(S)?void 0:{left:`${T(Ze)}px`,bottom:`calc(${T(ne)}px + env(safe-area-inset-bottom, 0px))`}),"locale-settings":T($e)},null,8,[`camera-ids`,`initial-timestamp`,`loading`,`type`,`md-breakpoint`,`class`,`card-class`,`style`,`locale-settings`])):R(``,!0)]),_:1},8,[`name`])],6),!T(rt)&&T($)?(W(),M(A,{key:0,model:T(ot),direction:`up`,"transition-delay":80,"tooltip-options":{position:`left`,event:void 0},class:`absolute right-2 z-11 dark-mode`,pt:{root:{style:`pointer-events: none`}},style:E({bottom:T(S)?`0`:`calc(${T(Me)?192:0}px + ${T(ne)>0?`0.5rem`:`0px`})`,right:T(S)?`calc(${T(Me)?400:0}px + 0.5rem)`:`0.5rem`,transition:`bottom 0.25s ease-out, right 0.25s ease-out`})},{button:L(({visible:e,toggleCallback:t})=>[U(O,{severity:`secondary`,class:_([`dark-mode opacity-40 hover:opacity-100 active:opacity-100 focus:opacity-100 transition pointer-events-auto`,{"opacity-100":e}]),rounded:``,loading:T(Xe),onClick:t},{icon:L(()=>[j(`div`,jn,[j(`div`,{class:_([`bg-white absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none":e}])},null,2),j(`div`,{class:_([`bg-white absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100`,{"opacity-0 scale-0":e}])},null,2),j(`div`,{class:_([`bg-white absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none":e}])},null,2)])]),_:2},1032,[`class`,`loading`,`onClick`])]),item:L(({item:e,toggleCallback:t})=>[z((W(),M(O,ee({loading:T(Xe),severity:`secondary`},e.buttonProps,{rounded:``,onClick:t}),{icon:L(()=>[(W(),M(te(e.icon)))]),_:2},1040,[`loading`,`onClick`])),[[P,{value:e.label}]])]),_:1},8,[`model`,`style`])):R(``,!0),U(N,{ref_key:`menuRef`,ref:we,items:T(mt),class:`dark-mode`,popover:{pt:{content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`]),U(N,{ref_key:`newViewMenuRef`,ref:Ee,items:T(gt),class:`dark-mode`,popover:{pt:{content:{class:`p-0! rounded-xl! overflow-hidden!`}}}},null,8,[`items`])])}}}),[[`__scopeId`,`data-v-6ee3e146`]]);export{Mn as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ace.config-BnKJ0Xjj.js","assets/rolldown-runtime-DAXXjFlN.js","assets/vendor-ace-BlP3GAWI.js","assets/ace-6JpPWRIj.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{Ar as t,Et as n,Ti as r,_n as i,pn as a,vn as o}from"./vendor-cameraui-QuTJKoXE.js";import{Tt as s}from"./api-Cea16mc8.js";import{$n as c,An as l,Cr as u,Gn as d,Ln as f,On as p,Rn as m,Sr as h,Tr as g,Wt as _,Yn as v,Zn as y,_r as b,br as ee,dn as x,fn as S,kn as C,lr as w,mn as T,mr as E,nn as D,nr as O,rn as k,rr as A,sn as te,tr as j,un as M,ur as N,xn as P,yn as F,zn as I}from"./vendor-ClrOISZp.js";import{f as L}from"./vendor-core-CCcu_nmz.js";import{o as R}from"./vendor-primevue-BdB7McKg.js";import{t as z}from"./server-C7SETTy9.js";import{n as B}from"./useServerRestart-PZhND5H_.js";import{t as ne}from"./useSharedComposables-USqd05AG.js";import{n as re}from"./ui-g5rCwxUE.js";import{t as ie}from"./useCuiDialog-yVh5UWKF.js";import{t as V}from"./CuiTopbarSlot-B6UMqYZl.js";import{t as H}from"./theme-DqbhRu7y.js";import{t as ae}from"./config-c7o4sJrQ.js";import{t as oe}from"./back-filled-LVLhJP7G.js";import{n as se,t as ce}from"./zoom-in-CKM5nWQX.js";import{n as le,t as ue}from"./CuiTopNavbarItem-nGcC2em4.js";var U={lang:`yaml`,readOnly:!1,printMargin:!1,borderRadius:!1,border:!0},W={useWorker:!0,wrap:!0,showPrintMargin:!1,tabSize:2,highlightGutterLine:!0,useSoftTabs:!0,dragEnabled:!1,showGutter:!0,scrollPastEnd:.1},de=P({__name:`CuiEditor`,props:C(p({lang:{},readOnly:{type:Boolean},printMargin:{type:[Number,Boolean]},options:{},placeholder:{},borderRadius:{type:Boolean},borderTopRightRadius:{type:Boolean},borderBottomRightRadius:{type:Boolean},borderBottomLeftRadius:{type:Boolean},borderTopLeftRadius:{type:Boolean},border:{type:Boolean}},U),{modelValue:{required:!0},modelModifiers:{}}),emits:C([`init`,`blur`,`input`,`change`,`changeSelectionStyle`,`changeSession`,`copy`,`focus`,`paste`,`update:value`],[`update:modelValue`]),async setup(t,{emit:n}){let i,a;D(e=>({v3cc736da:h(V),v66726fab:h(re),v58e243dc:h(ne),v527a6c67:h(ie),v244c42c0:h(B)})),[i,a]=j(()=>_(()=>import(`./ace.config-BnKJ0Xjj.js`),__vite__mapDeps([0,1,2]))),await i,a();let o=([i,a]=j(()=>_(()=>import(`./ace-6JpPWRIj.js`).then(t=>e(t.default,1)),__vite__mapDeps([3,2,1]))),i=await i,a(),i),s=t,l=n,u=v(t,`modelValue`),{theme:d}=L(H()),{readOnly:p,options:g,lang:x,printMargin:S,placeholder:C,borderRadius:w,borderBottomLeftRadius:O,borderTopLeftRadius:k,borderTopRightRadius:A,borderBottomRightRadius:te,border:N}=ee(s),P=y(`editorRef`),F=b(),R=E(!1),z=E(``),B=M(()=>w.value||A.value?`10px`:`0px`),ne=M(()=>w.value||te.value?`10px`:`0px`),re=M(()=>w.value||O.value?`10px`:`0px`),ie=M(()=>w.value||k.value?`10px`:`0px`),V=M(()=>N.value?`1px solid var(--border-color)`:`none`);return r(P,()=>{F.value&&F.value.resize(!0)}),c(u,e=>{if(z.value!==e){try{R.value=!0,F.value?.setValue(e,1)}finally{R.value=!1}z.value=e}}),c(x,e=>{F.value?.setOption(`mode`,`ace/mode/`+e)}),c(g,e=>{e&&F.value?.setOptions(e)}),c(C,e=>{e!==void 0&&F.value?.setOption(`placeholder`,e)}),c(p,e=>{F.value?.setReadOnly(e)}),c(S,e=>{F.value?.setOption(`printMargin`,e)}),c(d,e=>{if(F.value){let t=e===`dark`?`twilight`:`github`;F.value.setOption(`theme`,`ace/theme/`+t)}}),f(()=>{P.value&&(F.value=o.edit(P.value,{placeholder:C.value,readOnly:p.value,value:u.value,mode:`ace/mode/`+x.value,theme:d.value===`dark`?`ace/theme/twilight`:`ace/theme/github`,printMargin:S.value,fadeFoldWidgets:!0,...W,...g.value}),F.value.on(`change`,()=>{if(R.value)return;let e=F.value.getValue();z.value=e,u.value=e}),F.value.on(`blur`,e=>{l(`blur`,e)}),F.value.on(`input`,()=>{l(`input`)}),F.value.on(`change`,e=>{l(`change`,e)}),F.value.on(`changeSelectionStyle`,e=>{l(`changeSelectionStyle`,e)}),F.value.on(`changeSession`,e=>{l(`changeSession`,e)}),F.value.on(`copy`,e=>{l(`copy`,e)}),F.value.on(`focus`,e=>{l(`focus`,e)}),F.value.on(`paste`,e=>{l(`paste`,e.text)}),l(`init`,F.value))}),m(()=>{F.value?.removeAllListeners(),F.value?.destroy()}),(e,t)=>(I(),T(`div`,{ref_key:`editorRef`,ref:P,class:`h-full bg-none`},null,512))}}),G={viewBox:`0 0 20 20`,width:`1.2em`,height:`1.2em`};function K(e,t){return I(),T(`svg`,G,[...t[0]||=[x(`path`,{fill:`currentColor`,d:`m15.3 5.3l-6.8 6.8l-2.8-2.8l-1.4 1.4l4.2 4.2l8.2-8.2z`},null,-1)]])}var fe=N({name:`dashicons-saved`,render:K}),pe={class:`relative w-6 h-6`},me={class:`w-full h-full flex items-center justify-center`},q=P({__name:`Config`,props:{navbarWidth:{default:0},navbarLeft:{default:0}},setup(e){let r=new ae,p=new z,m=e,_=s(),v=ie(),{t:y}=t(),{smBreakpoint:b}=ne(),{beginServerRestart:C}=B(),{uiSettings:D}=L(re()),{navbarWidth:j,navbarLeft:N}=ee(m),P=M(()=>j.value+N.value),H=E(!1),{data:U,isBusy:W}=r.getConfigQuery(H),{data:G,isBusy:K}=r.getGo2RtcConfigQuery(H),{mutateAsync:q,isPending:he}=r.patchConfigQuery(),{mutateAsync:ge,isPending:_e}=r.patchGo2RtcConfigQuery(),{mutateAsync:ve,isPending:ye}=p.restartServerQuery(),{mutateAsync:be,isPending:xe}=p.restartGo2RtcQuery(),J=E(`camera.ui`),Y=E(``),X=E(``),Z=E(!1),Se=E([{label:y(`components.dialog.title.confirm`),icon:fe,buttonProps:{severity:`success`},command:()=>{v.openTextDialog({data:{title:y(`components.dialog.title.confirm`),contentText:y(`components.dialog.message.confirm_restart_server`),confirmText:y(`components.form.button.save_and_restart`),confirmButtonProps:{loading:Q.value},cancelButtonProps:{loading:Q.value}},onConfirm:Ce})}},{label:y(`components.form.tooltip.zoom_out`),icon:se,command:()=>{Te()}},{label:y(`components.form.tooltip.zoom_in`),icon:ce,command:()=>{we()}}]),Q=M(()=>W.value||K.value||he.value||_e.value||ye.value||xe.value),$=M(()=>({fontSize:D.value.config.zoom}));async function Ce(){try{J.value===`camera.ui`?(await q({configData:Y.value}),await n(500),C(),await ve()):(await ge({configData:X.value}),await n(500),await be())}catch(e){_.error(e)}}function we(){D.value.config.zoom!==20&&D.value.config.zoom++}function Te(){D.value.config.zoom!==8&&D.value.config.zoom--}return c(U,()=>{Y.value=U.value||``},{deep:!0,immediate:!0}),c(G,()=>{X.value=G.value||``},{deep:!0,immediate:!0}),f(async()=>{await n(100),Z.value=!0}),(e,t)=>{let n=oe,r=o,s=V,c=ue,f=le,p=R,m=de,_=i,v=a;return I(),T(`div`,null,[F(s,{position:`left`},{default:O(()=>[F(r,{severity:`secondary`,text:``,class:`cui-button p-2 text-color non-draggable-region`,onClick:t[0]||=t=>e.$router.push(`/menu`)},{icon:O(()=>[F(n,{class:`w-6 h-6`})]),_:1})]),_:1}),F(f,{"left-offset":h(P),animate:``},{left:O(()=>[F(c,{type:`button`,label:`camera.ui`,active:h(J)===`camera.ui`,onClick:t[1]||=e=>J.value=`camera.ui`},null,8,[`active`]),F(c,{type:`button`,label:`go2rtc`,active:h(J)===`go2rtc`,onClick:t[2]||=e=>J.value=`go2rtc`},null,8,[`active`])]),_:1},8,[`left-offset`]),F(p,{model:h(Se),direction:`up`,"transition-delay":80,"tooltip-options":{position:`left`,event:void 0},class:`absolute right-3 bottom-3 z-2`,pt:{root:{style:`pointer-events: none`}}},{button:O(({visible:e,toggleCallback:t})=>[F(r,{severity:`secondary`,class:u([`opacity-40 hover:opacity-100 active:opacity-100 focus:opacity-100 transition pointer-events-auto`,{"opacity-100":e}]),rounded:``,loading:h(Q),onClick:t},{icon:O(()=>[x(`div`,pe,[x(`div`,{class:u([`absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none":e}]),style:{backgroundColor:`var(--text-color)`}},null,2),x(`div`,{class:u([`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100`,{"opacity-0 scale-0":e}]),style:{backgroundColor:`var(--text-color)`}},null,2),x(`div`,{class:u([`absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none":e}]),style:{backgroundColor:`var(--text-color)`}},null,2)])]),_:2},1032,[`class`,`loading`,`onClick`])]),item:O(({item:e,toggleCallback:t})=>[A((I(),S(r,l({loading:h(Q),severity:`secondary`},e.buttonProps,{rounded:``,onClick:t}),{icon:O(()=>[(I(),S(d(e.icon)))]),_:2},1040,[`loading`,`onClick`])),[[v,{value:e.label}]])]),_:1},8,[`model`]),x(`div`,{class:`w-full h-full`,style:g({paddingTop:`${h(55)}px`})},[(I(),S(te,null,{fallback:O(()=>[x(`div`,me,[F(_,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])]),default:O(()=>[h(J)===`camera.ui`?A((I(),S(m,{key:0,modelValue:h(Y),"onUpdate:modelValue":t[3]||=e=>w(Y)?Y.value=e:null,lang:`yaml`,options:h($),"read-only":h(Q),border:!h(b),"border-bottom-left-radius":!h(b),"border-bottom-right-radius":!h(b),"border-top-right-radius":!1,"border-top-left-radius":!1},null,8,[`modelValue`,`options`,`read-only`,`border`,`border-bottom-left-radius`,`border-bottom-right-radius`])),[[k,h(Z)]]):A((I(),S(m,{key:1,modelValue:h(X),"onUpdate:modelValue":t[4]||=e=>w(X)?X.value=e:null,lang:`yaml`,options:h($),"read-only":h(Q),border:!h(b),"border-bottom-left-radius":!h(b),"border-bottom-right-radius":!h(b),"border-top-right-radius":!1,"border-top-left-radius":!1},null,8,[`modelValue`,`options`,`read-only`,`border`,`border-bottom-left-radius`,`border-bottom-right-radius`])),[[k,h(Z)]])]),_:1}))],4)])}}});export{q as default};
2
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{Ar as t,Et as n,Ti as r,_n as i,pn as a,vn as o}from"./vendor-cameraui-QuTJKoXE.js";import{Tt as s}from"./api-BLTlDTXb.js";import{$n as c,An as l,Cr as u,Gn as d,Ln as f,On as p,Rn as m,Sr as h,Tr as g,Wt as _,Yn as v,Zn as y,_r as b,br as ee,dn as x,fn as S,kn as C,lr as w,mn as T,mr as E,nn as D,nr as O,rn as k,rr as A,sn as te,tr as j,un as M,ur as N,xn as P,yn as F,zn as I}from"./vendor-ClrOISZp.js";import{f as L}from"./vendor-core-CCcu_nmz.js";import{o as R}from"./vendor-primevue-BdB7McKg.js";import{t as z}from"./server-CL_7W-Ge.js";import{n as B}from"./useServerRestart-ZFTJSxW7.js";import{t as ne}from"./useSharedComposables-USqd05AG.js";import{n as re}from"./ui-g5rCwxUE.js";import{t as ie}from"./useCuiDialog-DwpKUbrp.js";import{t as V}from"./CuiTopbarSlot-B6UMqYZl.js";import{t as H}from"./theme-DqZM6oaM.js";import{t as ae}from"./config-B7ya1VEA.js";import{t as oe}from"./back-filled-LVLhJP7G.js";import{n as se,t as ce}from"./zoom-in-CKM5nWQX.js";import{n as le,t as ue}from"./CuiTopNavbarItem-nGcC2em4.js";var U={lang:`yaml`,readOnly:!1,printMargin:!1,borderRadius:!1,border:!0},W={useWorker:!0,wrap:!0,showPrintMargin:!1,tabSize:2,highlightGutterLine:!0,useSoftTabs:!0,dragEnabled:!1,showGutter:!0,scrollPastEnd:.1},de=P({__name:`CuiEditor`,props:C(p({lang:{},readOnly:{type:Boolean},printMargin:{type:[Number,Boolean]},options:{},placeholder:{},borderRadius:{type:Boolean},borderTopRightRadius:{type:Boolean},borderBottomRightRadius:{type:Boolean},borderBottomLeftRadius:{type:Boolean},borderTopLeftRadius:{type:Boolean},border:{type:Boolean}},U),{modelValue:{required:!0},modelModifiers:{}}),emits:C([`init`,`blur`,`input`,`change`,`changeSelectionStyle`,`changeSession`,`copy`,`focus`,`paste`,`update:value`],[`update:modelValue`]),async setup(t,{emit:n}){let i,a;D(e=>({v3cc736da:h(V),v66726fab:h(re),v58e243dc:h(ne),v527a6c67:h(ie),v244c42c0:h(B)})),[i,a]=j(()=>_(()=>import(`./ace.config-BnKJ0Xjj.js`),__vite__mapDeps([0,1,2]))),await i,a();let o=([i,a]=j(()=>_(()=>import(`./ace-6JpPWRIj.js`).then(t=>e(t.default,1)),__vite__mapDeps([3,2,1]))),i=await i,a(),i),s=t,l=n,u=v(t,`modelValue`),{theme:d}=L(H()),{readOnly:p,options:g,lang:x,printMargin:S,placeholder:C,borderRadius:w,borderBottomLeftRadius:O,borderTopLeftRadius:k,borderTopRightRadius:A,borderBottomRightRadius:te,border:N}=ee(s),P=y(`editorRef`),F=b(),R=E(!1),z=E(``),B=M(()=>w.value||A.value?`10px`:`0px`),ne=M(()=>w.value||te.value?`10px`:`0px`),re=M(()=>w.value||O.value?`10px`:`0px`),ie=M(()=>w.value||k.value?`10px`:`0px`),V=M(()=>N.value?`1px solid var(--border-color)`:`none`);return r(P,()=>{F.value&&F.value.resize(!0)}),c(u,e=>{if(z.value!==e){try{R.value=!0,F.value?.setValue(e,1)}finally{R.value=!1}z.value=e}}),c(x,e=>{F.value?.setOption(`mode`,`ace/mode/`+e)}),c(g,e=>{e&&F.value?.setOptions(e)}),c(C,e=>{e!==void 0&&F.value?.setOption(`placeholder`,e)}),c(p,e=>{F.value?.setReadOnly(e)}),c(S,e=>{F.value?.setOption(`printMargin`,e)}),c(d,e=>{if(F.value){let t=e===`dark`?`twilight`:`github`;F.value.setOption(`theme`,`ace/theme/`+t)}}),f(()=>{P.value&&(F.value=o.edit(P.value,{placeholder:C.value,readOnly:p.value,value:u.value,mode:`ace/mode/`+x.value,theme:d.value===`dark`?`ace/theme/twilight`:`ace/theme/github`,printMargin:S.value,fadeFoldWidgets:!0,...W,...g.value}),F.value.on(`change`,()=>{if(R.value)return;let e=F.value.getValue();z.value=e,u.value=e}),F.value.on(`blur`,e=>{l(`blur`,e)}),F.value.on(`input`,()=>{l(`input`)}),F.value.on(`change`,e=>{l(`change`,e)}),F.value.on(`changeSelectionStyle`,e=>{l(`changeSelectionStyle`,e)}),F.value.on(`changeSession`,e=>{l(`changeSession`,e)}),F.value.on(`copy`,e=>{l(`copy`,e)}),F.value.on(`focus`,e=>{l(`focus`,e)}),F.value.on(`paste`,e=>{l(`paste`,e.text)}),l(`init`,F.value))}),m(()=>{F.value?.removeAllListeners(),F.value?.destroy()}),(e,t)=>(I(),T(`div`,{ref_key:`editorRef`,ref:P,class:`h-full bg-none`},null,512))}}),G={viewBox:`0 0 20 20`,width:`1.2em`,height:`1.2em`};function K(e,t){return I(),T(`svg`,G,[...t[0]||=[x(`path`,{fill:`currentColor`,d:`m15.3 5.3l-6.8 6.8l-2.8-2.8l-1.4 1.4l4.2 4.2l8.2-8.2z`},null,-1)]])}var fe=N({name:`dashicons-saved`,render:K}),pe={class:`relative w-6 h-6`},me={class:`w-full h-full flex items-center justify-center`},q=P({__name:`Config`,props:{navbarWidth:{default:0},navbarLeft:{default:0}},setup(e){let r=new ae,p=new z,m=e,_=s(),v=ie(),{t:y}=t(),{smBreakpoint:b}=ne(),{beginServerRestart:C}=B(),{uiSettings:D}=L(re()),{navbarWidth:j,navbarLeft:N}=ee(m),P=M(()=>j.value+N.value),H=E(!1),{data:U,isBusy:W}=r.getConfigQuery(H),{data:G,isBusy:K}=r.getGo2RtcConfigQuery(H),{mutateAsync:q,isPending:he}=r.patchConfigQuery(),{mutateAsync:ge,isPending:_e}=r.patchGo2RtcConfigQuery(),{mutateAsync:ve,isPending:ye}=p.restartServerQuery(),{mutateAsync:be,isPending:xe}=p.restartGo2RtcQuery(),J=E(`camera.ui`),Y=E(``),X=E(``),Z=E(!1),Se=E([{label:y(`components.dialog.title.confirm`),icon:fe,buttonProps:{severity:`success`},command:()=>{v.openTextDialog({data:{title:y(`components.dialog.title.confirm`),contentText:y(`components.dialog.message.confirm_restart_server`),confirmText:y(`components.form.button.save_and_restart`),confirmButtonProps:{loading:Q.value},cancelButtonProps:{loading:Q.value}},onConfirm:Ce})}},{label:y(`components.form.tooltip.zoom_out`),icon:se,command:()=>{Te()}},{label:y(`components.form.tooltip.zoom_in`),icon:ce,command:()=>{we()}}]),Q=M(()=>W.value||K.value||he.value||_e.value||ye.value||xe.value),$=M(()=>({fontSize:D.value.config.zoom}));async function Ce(){try{J.value===`camera.ui`?(await q({configData:Y.value}),await n(500),C(),await ve()):(await ge({configData:X.value}),await n(500),await be())}catch(e){_.error(e)}}function we(){D.value.config.zoom!==20&&D.value.config.zoom++}function Te(){D.value.config.zoom!==8&&D.value.config.zoom--}return c(U,()=>{Y.value=U.value||``},{deep:!0,immediate:!0}),c(G,()=>{X.value=G.value||``},{deep:!0,immediate:!0}),f(async()=>{await n(100),Z.value=!0}),(e,t)=>{let n=oe,r=o,s=V,c=ue,f=le,p=R,m=de,_=i,v=a;return I(),T(`div`,null,[F(s,{position:`left`},{default:O(()=>[F(r,{severity:`secondary`,text:``,class:`cui-button p-2 text-color non-draggable-region`,onClick:t[0]||=t=>e.$router.push(`/menu`)},{icon:O(()=>[F(n,{class:`w-6 h-6`})]),_:1})]),_:1}),F(f,{"left-offset":h(P),animate:``},{left:O(()=>[F(c,{type:`button`,label:`camera.ui`,active:h(J)===`camera.ui`,onClick:t[1]||=e=>J.value=`camera.ui`},null,8,[`active`]),F(c,{type:`button`,label:`go2rtc`,active:h(J)===`go2rtc`,onClick:t[2]||=e=>J.value=`go2rtc`},null,8,[`active`])]),_:1},8,[`left-offset`]),F(p,{model:h(Se),direction:`up`,"transition-delay":80,"tooltip-options":{position:`left`,event:void 0},class:`absolute right-3 bottom-3 z-2`,pt:{root:{style:`pointer-events: none`}}},{button:O(({visible:e,toggleCallback:t})=>[F(r,{severity:`secondary`,class:u([`opacity-40 hover:opacity-100 active:opacity-100 focus:opacity-100 transition pointer-events-auto`,{"opacity-100":e}]),rounded:``,loading:h(Q),onClick:t},{icon:O(()=>[x(`div`,pe,[x(`div`,{class:u([`absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none":e}]),style:{backgroundColor:`var(--text-color)`}},null,2),x(`div`,{class:u([`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100`,{"opacity-0 scale-0":e}]),style:{backgroundColor:`var(--text-color)`}},null,2),x(`div`,{class:u([`absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center`,{"w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none":e}]),style:{backgroundColor:`var(--text-color)`}},null,2)])]),_:2},1032,[`class`,`loading`,`onClick`])]),item:O(({item:e,toggleCallback:t})=>[A((I(),S(r,l({loading:h(Q),severity:`secondary`},e.buttonProps,{rounded:``,onClick:t}),{icon:O(()=>[(I(),S(d(e.icon)))]),_:2},1040,[`loading`,`onClick`])),[[v,{value:e.label}]])]),_:1},8,[`model`]),x(`div`,{class:`w-full h-full`,style:g({paddingTop:`${h(55)}px`})},[(I(),S(te,null,{fallback:O(()=>[x(`div`,me,[F(_,{class:`w-[30px] h-[30px] m-0`,"stroke-width":`5`})])]),default:O(()=>[h(J)===`camera.ui`?A((I(),S(m,{key:0,modelValue:h(Y),"onUpdate:modelValue":t[3]||=e=>w(Y)?Y.value=e:null,lang:`yaml`,options:h($),"read-only":h(Q),border:!h(b),"border-bottom-left-radius":!h(b),"border-bottom-right-radius":!h(b),"border-top-right-radius":!1,"border-top-left-radius":!1},null,8,[`modelValue`,`options`,`read-only`,`border`,`border-bottom-left-radius`,`border-bottom-right-radius`])),[[k,h(Z)]]):A((I(),S(m,{key:1,modelValue:h(X),"onUpdate:modelValue":t[4]||=e=>w(X)?X.value=e:null,lang:`yaml`,options:h($),"read-only":h(Q),border:!h(b),"border-bottom-left-radius":!h(b),"border-bottom-right-radius":!h(b),"border-top-right-radius":!1,"border-top-left-radius":!1},null,8,[`modelValue`,`options`,`read-only`,`border`,`border-bottom-left-radius`,`border-bottom-right-radius`])),[[k,h(Z)]])]),_:1}))],4)])}}});export{q as default};
@@ -1 +1 @@
1
- import{Ar as e}from"./vendor-cameraui-QuTJKoXE.js";import{Er as t,Sr as n,Vn as r,dn as i,fn as a,mn as o,on as s,pn as c,xn as l,yn as u,zn as d}from"./vendor-ClrOISZp.js";import{H as f,O as p,b as m,h}from"./vendor-primevue-BdB7McKg.js";import{t as g}from"./useCameraOptions-BpL2zbfV.js";import{t as _}from"./types-BxFyoO54.js";var v={class:`flex flex-col gap-4`},y={class:`flex flex-col field-gap`},b={class:`cui-label`},x={class:`flex flex-col field-gap`},S={class:`cui-label`},C={class:`text-xs text-muted`},w={class:`flex items-center gap-2`},T=[`onClick`],E={key:0,class:`pl-7`},D=l({__name:`ConfigActionCameraControl`,props:{data:{}},emits:[`update:data`],setup(l,{emit:D}){let O=l,k=D,{t:A}=e(),{cameraOptions:j}=g();function M(e){return O.data.properties.some(t=>t.property===e)}function N(e){return O.data.properties.find(t=>t.property===e)?.value??``}function P(e,t){let n=[...O.data.properties];if(t){if(!n.some(t=>t.property===e)){let t=_.find(t=>t.key===e);n.push({property:e,value:t?.defaultValue??``})}}else{let t=n.findIndex(t=>t.property===e);t>=0&&n.splice(t,1)}k(`update:data`,{properties:n})}function F(e,t){let n=O.data.properties.map(n=>n.property===e?{...n,value:t}:n);k(`update:data`,{properties:n})}function I(e,t){k(`update:data`,{[e]:t})}return(e,g)=>{let D=p,O=m,k=f,L=h;return d(),o(`div`,v,[i(`div`,y,[i(`label`,b,t(n(A)(`components.automation_nodes.camera`)),1),u(D,{"model-value":l.data.cameraId,options:n(j),"option-label":`label`,"option-value":`value`,placeholder:n(A)(`components.automation_nodes.camera_select`),class:`w-full`,"onUpdate:modelValue":g[0]||=e=>I(`cameraId`,e)},null,8,[`model-value`,`options`,`placeholder`])]),i(`div`,x,[i(`label`,S,t(n(A)(`components.automation_nodes.camera_control_properties`)),1),i(`span`,C,t(n(A)(`components.automation_nodes.camera_control_properties_hint`)),1)]),(d(!0),o(s,null,r(n(_),e=>(d(),o(`div`,{key:e.key,class:`flex flex-col gap-2`},[i(`div`,w,[u(O,{"model-value":M(e.key),binary:``,"onUpdate:modelValue":t=>P(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`]),i(`label`,{class:`cui-label-switch cursor-pointer flex-1 min-w-0 truncate`,onClick:t=>P(e.key,!M(e.key))},t(n(A)(e.labelKey)),9,T),M(e.key)&&e.inputType===`boolean`?(d(),a(k,{key:0,"model-value":N(e.key)===`true`,class:`shrink-0`,"onUpdate:modelValue":t=>F(e.key,String(t))},null,8,[`model-value`,`onUpdate:modelValue`])):c(``,!0)]),M(e.key)&&e.inputType!==`boolean`?(d(),o(`div`,E,[e.inputType===`select`?(d(),a(D,{key:0,"model-value":N(e.key),options:e.options,"option-label":`label`,"option-value":`value`,class:`w-full`,"onUpdate:modelValue":t=>F(e.key,t)},null,8,[`model-value`,`options`,`onUpdate:modelValue`])):e.inputType===`number`?(d(),a(L,{key:1,"model-value":Number(N(e.key))||e.min,min:e.min,max:e.max,step:e.step??1,"min-fraction-digits":e.step&&e.step<1?2:0,"max-fraction-digits":e.step&&e.step<1?2:0,class:`w-full`,"onUpdate:modelValue":t=>F(e.key,String(t))},null,8,[`model-value`,`min`,`max`,`step`,`min-fraction-digits`,`max-fraction-digits`,`onUpdate:modelValue`])):c(``,!0)])):c(``,!0)]))),128))])}}});export{D as default};
1
+ import{Ar as e}from"./vendor-cameraui-QuTJKoXE.js";import{Er as t,Sr as n,Vn as r,dn as i,fn as a,mn as o,on as s,pn as c,xn as l,yn as u,zn as d}from"./vendor-ClrOISZp.js";import{H as f,O as p,b as m,h}from"./vendor-primevue-BdB7McKg.js";import{t as g}from"./useCameraOptions-nvj6-uZg.js";import{t as _}from"./types-BxFyoO54.js";var v={class:`flex flex-col gap-4`},y={class:`flex flex-col field-gap`},b={class:`cui-label`},x={class:`flex flex-col field-gap`},S={class:`cui-label`},C={class:`text-xs text-muted`},w={class:`flex items-center gap-2`},T=[`onClick`],E={key:0,class:`pl-7`},D=l({__name:`ConfigActionCameraControl`,props:{data:{}},emits:[`update:data`],setup(l,{emit:D}){let O=l,k=D,{t:A}=e(),{cameraOptions:j}=g();function M(e){return O.data.properties.some(t=>t.property===e)}function N(e){return O.data.properties.find(t=>t.property===e)?.value??``}function P(e,t){let n=[...O.data.properties];if(t){if(!n.some(t=>t.property===e)){let t=_.find(t=>t.key===e);n.push({property:e,value:t?.defaultValue??``})}}else{let t=n.findIndex(t=>t.property===e);t>=0&&n.splice(t,1)}k(`update:data`,{properties:n})}function F(e,t){let n=O.data.properties.map(n=>n.property===e?{...n,value:t}:n);k(`update:data`,{properties:n})}function I(e,t){k(`update:data`,{[e]:t})}return(e,g)=>{let D=p,O=m,k=f,L=h;return d(),o(`div`,v,[i(`div`,y,[i(`label`,b,t(n(A)(`components.automation_nodes.camera`)),1),u(D,{"model-value":l.data.cameraId,options:n(j),"option-label":`label`,"option-value":`value`,placeholder:n(A)(`components.automation_nodes.camera_select`),class:`w-full`,"onUpdate:modelValue":g[0]||=e=>I(`cameraId`,e)},null,8,[`model-value`,`options`,`placeholder`])]),i(`div`,x,[i(`label`,S,t(n(A)(`components.automation_nodes.camera_control_properties`)),1),i(`span`,C,t(n(A)(`components.automation_nodes.camera_control_properties_hint`)),1)]),(d(!0),o(s,null,r(n(_),e=>(d(),o(`div`,{key:e.key,class:`flex flex-col gap-2`},[i(`div`,w,[u(O,{"model-value":M(e.key),binary:``,"onUpdate:modelValue":t=>P(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`]),i(`label`,{class:`cui-label-switch cursor-pointer flex-1 min-w-0 truncate`,onClick:t=>P(e.key,!M(e.key))},t(n(A)(e.labelKey)),9,T),M(e.key)&&e.inputType===`boolean`?(d(),a(k,{key:0,"model-value":N(e.key)===`true`,class:`shrink-0`,"onUpdate:modelValue":t=>F(e.key,String(t))},null,8,[`model-value`,`onUpdate:modelValue`])):c(``,!0)]),M(e.key)&&e.inputType!==`boolean`?(d(),o(`div`,E,[e.inputType===`select`?(d(),a(D,{key:0,"model-value":N(e.key),options:e.options,"option-label":`label`,"option-value":`value`,class:`w-full`,"onUpdate:modelValue":t=>F(e.key,t)},null,8,[`model-value`,`options`,`onUpdate:modelValue`])):e.inputType===`number`?(d(),a(L,{key:1,"model-value":Number(N(e.key))||e.min,min:e.min,max:e.max,step:e.step??1,"min-fraction-digits":e.step&&e.step<1?2:0,"max-fraction-digits":e.step&&e.step<1?2:0,class:`w-full`,"onUpdate:modelValue":t=>F(e.key,String(t))},null,8,[`model-value`,`min`,`max`,`step`,`min-fraction-digits`,`max-fraction-digits`,`onUpdate:modelValue`])):c(``,!0)])):c(``,!0)]))),128))])}}});export{D as default};
@@ -1 +1 @@
1
- import{O as e,pn as t,vn as n}from"./vendor-cameraui-QuTJKoXE.js";import{Sr as r,Zn as i,dn as a,fn as o,mn as s,nr as c,pn as l,rr as u,un as d,vn as f,xn as p,yn as m,zn as h}from"./vendor-ClrOISZp.js";import{F as g,O as _,i as v,l as y}from"./vendor-primevue-BdB7McKg.js";import{t as b}from"./notifications-sejZCb0L.js";import{t as x}from"./availableVariables-D9VhvJZ1.js";import{t as S}from"./automations-CHengR-B.js";import{t as C}from"./VariableInput-CnmqCHf7.js";import{t as w}from"./VariableSuggestions-D6IlwBqV.js";import{t as T}from"./upload-DAasFa9r.js";var E={class:`flex flex-col gap-4`},D={class:`flex flex-col field-gap`},O={class:`flex flex-col field-gap`},k={class:`flex flex-col field-gap`},A={class:`flex flex-col field-gap`},j={class:`flex gap-2`},M={key:0,class:`rounded-lg overflow-hidden border-[1px] border-color bg-black`},N=[`src`],P={class:`flex flex-col field-gap`},F={class:`flex flex-col field-gap`},I=p({__name:`ConfigActionNotification`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(p,{emit:I}){let L=new b,R=p,z=I,B=S(),{data:V,isLoading:H}=L.listDevicesQuery(),U=[{label:`Info`,value:`info`},{label:`Warning`,value:`warn`},{label:`Error`,value:`error`},{label:`Critical (DND-bypass)`,value:`critical`}],W=i(`fileInput`),G=d(()=>(V.value??[]).map(e=>({id:e.id,label:e.name}))),K=d(()=>{let e=B.draft;return x(e,R.nodeId)}),q=d(()=>{let e=R.data.image;if(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`))return e;if(e.length>100&&!e.startsWith(`{{`))return`data:image/jpeg;base64,${e}`}});function J(e,t){let n=R.data[e]??``;z(`update:data`,{[e]:n+t})}function Y(e,t){z(`update:data`,{[e]:t})}function X(){W.value?.click()}function Z(e){let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{let e=n.result.split(`,`)[1];e&&z(`update:data`,{image:e})},n.readAsDataURL(t)}return(i,d)=>{let b=e,x=v,S=_,I=T,L=n,R=g,z=y,B=t;return h(),s(`div`,E,[a(`div`,D,[d[10]||=a(`label`,{class:`cui-label`},`Title`,-1),m(b,{"model-value":p.data.title,placeholder:`Notification title`,"onUpdate:modelValue":d[0]||=e=>Y(`title`,e)},null,8,[`model-value`]),m(w,{variables:r(K),onSelect:d[1]||=e=>J(`title`,e)},null,8,[`variables`])]),a(`div`,O,[d[11]||=a(`label`,{class:`cui-label`},`Body`,-1),m(x,{"model-value":p.data.body,placeholder:`Notification body`,rows:`3`,class:`w-full`,"onUpdate:modelValue":d[2]||=e=>Y(`body`,e)},null,8,[`model-value`]),m(w,{variables:r(K),onSelect:d[3]||=e=>J(`body`,e)},null,8,[`variables`])]),a(`div`,k,[d[12]||=a(`label`,{class:`cui-label`},`Severity`,-1),m(S,{"model-value":p.data.severity??`info`,options:U,"option-label":`label`,"option-value":`value`,class:`w-full`,"onUpdate:modelValue":d[4]||=e=>Y(`severity`,e)},null,8,[`model-value`])]),a(`div`,A,[d[14]||=a(`label`,{class:`cui-label`},`Image`,-1),a(`div`,j,[m(C,{"model-value":p.data.image??``,"node-id":p.nodeId,placeholder:`{{snapshot}} or https://…`,class:`flex-1`,"onUpdate:modelValue":d[5]||=e=>Y(`image`,e)},null,8,[`model-value`,`node-id`]),u((h(),o(L,{severity:`secondary`,outlined:``,class:`shrink-0 h-[42px] w-[42px] p-0`,onClick:X},{icon:c(()=>[m(I,{class:`w-4 h-4`})]),_:1})),[[B,`Upload image`,void 0,{top:!0}]]),a(`input`,{ref_key:`fileInput`,ref:W,type:`file`,accept:`image/*`,class:`hidden`,onChange:Z},null,544)]),m(w,{variables:r(K),onSelect:d[6]||=e=>Y(`image`,(p.data.image??``)+e)},null,8,[`variables`]),m(R,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:c(()=>[...d[13]||=[f(`Reference an upstream image variable, paste a URL or upload directly. Leave empty for text-only.`,-1)]]),_:1}),r(q)?(h(),s(`div`,M,[a(`img`,{src:r(q),class:`w-full max-h-32 object-cover`},null,8,N)])):l(``,!0)]),a(`div`,P,[d[15]||=a(`label`,{class:`cui-label`},`Deep link`,-1),m(b,{"model-value":p.data.deepLink,placeholder:`/cameras/cam-1`,"onUpdate:modelValue":d[7]||=e=>Y(`deepLink`,e)},null,8,[`model-value`]),m(w,{variables:r(K),onSelect:d[8]||=e=>J(`deepLink`,e)},null,8,[`variables`])]),a(`div`,F,[d[16]||=a(`label`,{class:`cui-label`},`Targets`,-1),d[17]||=a(`span`,{class:`text-xs text-muted-color`},`Pick which devices receive this notification. Leave empty to send to all registered devices.`,-1),m(z,{"model-value":p.data.targets??[],options:r(G),"option-label":`label`,"option-value":`id`,loading:r(H),placeholder:`All devices`,display:`chip`,filter:``,class:`w-full`,"onUpdate:modelValue":d[9]||=e=>Y(`targets`,e)},null,8,[`model-value`,`options`,`loading`])])])}}});export{I as default};
1
+ import{O as e,pn as t,vn as n}from"./vendor-cameraui-QuTJKoXE.js";import{Sr as r,Zn as i,dn as a,fn as o,mn as s,nr as c,pn as l,rr as u,un as d,vn as f,xn as p,yn as m,zn as h}from"./vendor-ClrOISZp.js";import{F as g,O as _,i as v,l as y}from"./vendor-primevue-BdB7McKg.js";import{t as b}from"./notifications-CRDDcfL2.js";import{t as x}from"./availableVariables-D9VhvJZ1.js";import{t as S}from"./automations-CHengR-B.js";import{t as C}from"./VariableInput-CnmqCHf7.js";import{t as w}from"./VariableSuggestions-D6IlwBqV.js";import{t as T}from"./upload-DAasFa9r.js";var E={class:`flex flex-col gap-4`},D={class:`flex flex-col field-gap`},O={class:`flex flex-col field-gap`},k={class:`flex flex-col field-gap`},A={class:`flex flex-col field-gap`},j={class:`flex gap-2`},M={key:0,class:`rounded-lg overflow-hidden border-[1px] border-color bg-black`},N=[`src`],P={class:`flex flex-col field-gap`},F={class:`flex flex-col field-gap`},I=p({__name:`ConfigActionNotification`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(p,{emit:I}){let L=new b,R=p,z=I,B=S(),{data:V,isLoading:H}=L.listDevicesQuery(),U=[{label:`Info`,value:`info`},{label:`Warning`,value:`warn`},{label:`Error`,value:`error`},{label:`Critical (DND-bypass)`,value:`critical`}],W=i(`fileInput`),G=d(()=>(V.value??[]).map(e=>({id:e.id,label:e.name}))),K=d(()=>{let e=B.draft;return x(e,R.nodeId)}),q=d(()=>{let e=R.data.image;if(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`))return e;if(e.length>100&&!e.startsWith(`{{`))return`data:image/jpeg;base64,${e}`}});function J(e,t){let n=R.data[e]??``;z(`update:data`,{[e]:n+t})}function Y(e,t){z(`update:data`,{[e]:t})}function X(){W.value?.click()}function Z(e){let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{let e=n.result.split(`,`)[1];e&&z(`update:data`,{image:e})},n.readAsDataURL(t)}return(i,d)=>{let b=e,x=v,S=_,I=T,L=n,R=g,z=y,B=t;return h(),s(`div`,E,[a(`div`,D,[d[10]||=a(`label`,{class:`cui-label`},`Title`,-1),m(b,{"model-value":p.data.title,placeholder:`Notification title`,"onUpdate:modelValue":d[0]||=e=>Y(`title`,e)},null,8,[`model-value`]),m(w,{variables:r(K),onSelect:d[1]||=e=>J(`title`,e)},null,8,[`variables`])]),a(`div`,O,[d[11]||=a(`label`,{class:`cui-label`},`Body`,-1),m(x,{"model-value":p.data.body,placeholder:`Notification body`,rows:`3`,class:`w-full`,"onUpdate:modelValue":d[2]||=e=>Y(`body`,e)},null,8,[`model-value`]),m(w,{variables:r(K),onSelect:d[3]||=e=>J(`body`,e)},null,8,[`variables`])]),a(`div`,k,[d[12]||=a(`label`,{class:`cui-label`},`Severity`,-1),m(S,{"model-value":p.data.severity??`info`,options:U,"option-label":`label`,"option-value":`value`,class:`w-full`,"onUpdate:modelValue":d[4]||=e=>Y(`severity`,e)},null,8,[`model-value`])]),a(`div`,A,[d[14]||=a(`label`,{class:`cui-label`},`Image`,-1),a(`div`,j,[m(C,{"model-value":p.data.image??``,"node-id":p.nodeId,placeholder:`{{snapshot}} or https://…`,class:`flex-1`,"onUpdate:modelValue":d[5]||=e=>Y(`image`,e)},null,8,[`model-value`,`node-id`]),u((h(),o(L,{severity:`secondary`,outlined:``,class:`shrink-0 h-[42px] w-[42px] p-0`,onClick:X},{icon:c(()=>[m(I,{class:`w-4 h-4`})]),_:1})),[[B,`Upload image`,void 0,{top:!0}]]),a(`input`,{ref_key:`fileInput`,ref:W,type:`file`,accept:`image/*`,class:`hidden`,onChange:Z},null,544)]),m(w,{variables:r(K),onSelect:d[6]||=e=>Y(`image`,(p.data.image??``)+e)},null,8,[`variables`]),m(R,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:c(()=>[...d[13]||=[f(`Reference an upstream image variable, paste a URL or upload directly. Leave empty for text-only.`,-1)]]),_:1}),r(q)?(h(),s(`div`,M,[a(`img`,{src:r(q),class:`w-full max-h-32 object-cover`},null,8,N)])):l(``,!0)]),a(`div`,P,[d[15]||=a(`label`,{class:`cui-label`},`Deep link`,-1),m(b,{"model-value":p.data.deepLink,placeholder:`/cameras/cam-1`,"onUpdate:modelValue":d[7]||=e=>Y(`deepLink`,e)},null,8,[`model-value`]),m(w,{variables:r(K),onSelect:d[8]||=e=>J(`deepLink`,e)},null,8,[`variables`])]),a(`div`,F,[d[16]||=a(`label`,{class:`cui-label`},`Targets`,-1),d[17]||=a(`span`,{class:`text-xs text-muted-color`},`Pick which devices receive this notification. Leave empty to send to all registered devices.`,-1),m(z,{"model-value":p.data.targets??[],options:r(G),"option-label":`label`,"option-value":`id`,loading:r(H),placeholder:`All devices`,display:`chip`,filter:``,class:`w-full`,"onUpdate:modelValue":d[9]||=e=>Y(`targets`,e)},null,8,[`model-value`,`options`,`loading`])])])}}});export{I as default};
@@ -1 +1 @@
1
- import{Ar as e,gt as t}from"./vendor-cameraui-QuTJKoXE.js";import{$n as n,Er as r,Sr as i,Vn as a,_r as o,dn as s,mn as c,mr as l,on as u,pn as d,un as f,xn as p,yn as m,zn as h}from"./vendor-ClrOISZp.js";import{O as g,z as _}from"./vendor-primevue-BdB7McKg.js";import{t as v}from"./CuiSchema-CH0GXMWV.js";import{t as y}from"./plugins-CCLFcD4c.js";import{t as ee}from"./availableVariables-D9VhvJZ1.js";import{t as b}from"./automations-CHengR-B.js";import{t as x}from"./VariableInput-CnmqCHf7.js";import{t as S}from"./VariableSuggestions-D6IlwBqV.js";import{t as C}from"./automations-DhLADBhd.js";var w={class:`flex flex-col gap-4`},te={class:`flex flex-col field-gap`},T={class:`cui-label`},E={class:`flex flex-col field-gap`},D={class:`cui-label`},O={class:`flex flex-col field-gap`},k={class:`cui-label`},A={class:`cui-label`},j={class:`flex flex-col gap-3`},M={class:`text-xs font-semibold text-muted uppercase`},N=p({__name:`ConfigActionPlugin`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(p,{emit:N}){let P=new y,F=new C,I=p,L=N,{t:R}=e(),{plugin:z}=t(f(()=>I.data.pluginName)),B=b(),{data:V,isBusy:H}=P.getPluginsQuery({page:1,pageSize:-1}),{data:U}=F.getPluginMethodsQuery(),W=o(),G=l(!1),K=f(()=>ee(B.draft,I.nodeId)),q=f(()=>V.value?.result?V.value.result.filter(e=>e.contract?.interfaces?.length).map(e=>({label:e.pluginName,value:e.pluginName})):[]),J=f(()=>{if(!(!I.data.pluginName||!V.value?.result))return V.value.result.find(e=>e.pluginName===I.data.pluginName)}),Y=f(()=>(J.value?.contract?.interfaces??[]).filter(e=>Q(e).length>0).map(e=>({label:e.replace(/([A-Z])/g,` $1`).trim(),value:e}))),X=f(()=>I.data.pluginInterface?Q(I.data.pluginInterface).map(e=>({label:R(e.labelKey),value:e.id})):[]),Z=f(()=>{if(!(!I.data.pluginInterface||!I.data.method))return Q(I.data.pluginInterface).find(e=>e.id===I.data.method)});function Q(e){return U.value?.[e]??[]}async function ne(){let e=Z.value?.settingsMethod;if(!e||!z.value){W.value=void 0;return}G.value=!0;try{let t=z.value[e];W.value=t?await t():void 0}catch{W.value=void 0}finally{G.value=!1}}function re(e){L(`update:data`,{pluginName:e,pluginInterface:``,method:``,params:{},config:{}})}function ie(e){L(`update:data`,{pluginInterface:e,method:``,params:{},config:{}})}function ae(e){L(`update:data`,{method:e,params:{},config:{}})}function $(e,t){L(`update:data`,{params:{...I.data.params,[e]:t}})}function oe(e){L(`update:data`,{config:{...I.data.config,...e}})}return n([Z,z],()=>ne(),{immediate:!0}),(e,t)=>{let n=g,o=_,l=v;return h(),c(`div`,w,[s(`div`,te,[s(`label`,T,r(i(R)(`components.automation_nodes.plugin_name`)),1),m(n,{"model-value":p.data.pluginName,options:i(q),"option-label":`label`,"option-value":`value`,placeholder:i(R)(`components.automation_nodes.plugin_name_placeholder`),class:`w-full`,loading:i(H),"onUpdate:modelValue":re},null,8,[`model-value`,`options`,`placeholder`,`loading`])]),s(`div`,E,[s(`label`,D,r(i(R)(`components.automation_nodes.plugin_interface`)),1),m(n,{"model-value":p.data.pluginInterface,options:i(Y),"option-label":`label`,"option-value":`value`,placeholder:i(R)(`components.automation_nodes.plugin_interface_placeholder`),class:`w-full`,disabled:!p.data.pluginName,"onUpdate:modelValue":ie},null,8,[`model-value`,`options`,`placeholder`,`disabled`])]),s(`div`,O,[s(`label`,k,r(i(R)(`components.automation_nodes.plugin_method`)),1),m(n,{"model-value":p.data.method,options:i(X),"option-label":`label`,"option-value":`value`,placeholder:i(R)(`components.automation_nodes.plugin_method_placeholder`),class:`w-full`,disabled:!p.data.pluginInterface,"onUpdate:modelValue":ae},null,8,[`model-value`,`options`,`placeholder`,`disabled`])]),i(Z)?(h(!0),c(u,{key:0},a(i(Z).params,e=>(h(),c(`div`,{key:e.name,class:`flex flex-col field-gap`},[s(`label`,A,r(i(R)(e.labelKey)),1),m(x,{"model-value":p.data.params[e.name]??``,"node-id":p.nodeId,placeholder:e.placeholder,"onUpdate:modelValue":t=>$(e.name,String(t??``))},null,8,[`model-value`,`node-id`,`placeholder`,`onUpdate:modelValue`]),m(S,{variables:i(K),onSelect:t=>$(e.name,(p.data.params[e.name]??``)+t)},null,8,[`variables`,`onSelect`])]))),128)):d(``,!0),i(Z)?.settingsMethod&&i(W)?.length?(h(),c(u,{key:1},[m(o),s(`div`,j,[s(`span`,M,r(i(R)(`components.automation_nodes.plugin_settings`)),1),m(l,{"schema-form":{schema:i(W),config:p.data.config??{}},loading:i(G),"save-button-label":i(R)(`components.automation_nodes.plugin_apply_settings`),"show-button":``,onOnFormSubmit:oe},null,8,[`schema-form`,`loading`,`save-button-label`])])],64)):d(``,!0)])}}});export{N as default};
1
+ import{Ar as e,gt as t}from"./vendor-cameraui-QuTJKoXE.js";import{$n as n,Er as r,Sr as i,Vn as a,_r as o,dn as s,mn as c,mr as l,on as u,pn as d,un as f,xn as p,yn as m,zn as h}from"./vendor-ClrOISZp.js";import{O as g,z as _}from"./vendor-primevue-BdB7McKg.js";import{t as v}from"./CuiSchema-DQekVg-C.js";import{t as y}from"./plugins-yCjIwfVx.js";import{t as ee}from"./availableVariables-D9VhvJZ1.js";import{t as b}from"./automations-CHengR-B.js";import{t as x}from"./VariableInput-CnmqCHf7.js";import{t as S}from"./VariableSuggestions-D6IlwBqV.js";import{t as C}from"./automations-BZJH0t8U.js";var w={class:`flex flex-col gap-4`},te={class:`flex flex-col field-gap`},T={class:`cui-label`},E={class:`flex flex-col field-gap`},D={class:`cui-label`},O={class:`flex flex-col field-gap`},k={class:`cui-label`},A={class:`cui-label`},j={class:`flex flex-col gap-3`},M={class:`text-xs font-semibold text-muted uppercase`},N=p({__name:`ConfigActionPlugin`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(p,{emit:N}){let P=new y,F=new C,I=p,L=N,{t:R}=e(),{plugin:z}=t(f(()=>I.data.pluginName)),B=b(),{data:V,isBusy:H}=P.getPluginsQuery({page:1,pageSize:-1}),{data:U}=F.getPluginMethodsQuery(),W=o(),G=l(!1),K=f(()=>ee(B.draft,I.nodeId)),q=f(()=>V.value?.result?V.value.result.filter(e=>e.contract?.interfaces?.length).map(e=>({label:e.pluginName,value:e.pluginName})):[]),J=f(()=>{if(!(!I.data.pluginName||!V.value?.result))return V.value.result.find(e=>e.pluginName===I.data.pluginName)}),Y=f(()=>(J.value?.contract?.interfaces??[]).filter(e=>Q(e).length>0).map(e=>({label:e.replace(/([A-Z])/g,` $1`).trim(),value:e}))),X=f(()=>I.data.pluginInterface?Q(I.data.pluginInterface).map(e=>({label:R(e.labelKey),value:e.id})):[]),Z=f(()=>{if(!(!I.data.pluginInterface||!I.data.method))return Q(I.data.pluginInterface).find(e=>e.id===I.data.method)});function Q(e){return U.value?.[e]??[]}async function ne(){let e=Z.value?.settingsMethod;if(!e||!z.value){W.value=void 0;return}G.value=!0;try{let t=z.value[e];W.value=t?await t():void 0}catch{W.value=void 0}finally{G.value=!1}}function re(e){L(`update:data`,{pluginName:e,pluginInterface:``,method:``,params:{},config:{}})}function ie(e){L(`update:data`,{pluginInterface:e,method:``,params:{},config:{}})}function ae(e){L(`update:data`,{method:e,params:{},config:{}})}function $(e,t){L(`update:data`,{params:{...I.data.params,[e]:t}})}function oe(e){L(`update:data`,{config:{...I.data.config,...e}})}return n([Z,z],()=>ne(),{immediate:!0}),(e,t)=>{let n=g,o=_,l=v;return h(),c(`div`,w,[s(`div`,te,[s(`label`,T,r(i(R)(`components.automation_nodes.plugin_name`)),1),m(n,{"model-value":p.data.pluginName,options:i(q),"option-label":`label`,"option-value":`value`,placeholder:i(R)(`components.automation_nodes.plugin_name_placeholder`),class:`w-full`,loading:i(H),"onUpdate:modelValue":re},null,8,[`model-value`,`options`,`placeholder`,`loading`])]),s(`div`,E,[s(`label`,D,r(i(R)(`components.automation_nodes.plugin_interface`)),1),m(n,{"model-value":p.data.pluginInterface,options:i(Y),"option-label":`label`,"option-value":`value`,placeholder:i(R)(`components.automation_nodes.plugin_interface_placeholder`),class:`w-full`,disabled:!p.data.pluginName,"onUpdate:modelValue":ie},null,8,[`model-value`,`options`,`placeholder`,`disabled`])]),s(`div`,O,[s(`label`,k,r(i(R)(`components.automation_nodes.plugin_method`)),1),m(n,{"model-value":p.data.method,options:i(X),"option-label":`label`,"option-value":`value`,placeholder:i(R)(`components.automation_nodes.plugin_method_placeholder`),class:`w-full`,disabled:!p.data.pluginInterface,"onUpdate:modelValue":ae},null,8,[`model-value`,`options`,`placeholder`,`disabled`])]),i(Z)?(h(!0),c(u,{key:0},a(i(Z).params,e=>(h(),c(`div`,{key:e.name,class:`flex flex-col field-gap`},[s(`label`,A,r(i(R)(e.labelKey)),1),m(x,{"model-value":p.data.params[e.name]??``,"node-id":p.nodeId,placeholder:e.placeholder,"onUpdate:modelValue":t=>$(e.name,String(t??``))},null,8,[`model-value`,`node-id`,`placeholder`,`onUpdate:modelValue`]),m(S,{variables:i(K),onSelect:t=>$(e.name,(p.data.params[e.name]??``)+t)},null,8,[`variables`,`onSelect`])]))),128)):d(``,!0),i(Z)?.settingsMethod&&i(W)?.length?(h(),c(u,{key:1},[m(o),s(`div`,j,[s(`span`,M,r(i(R)(`components.automation_nodes.plugin_settings`)),1),m(l,{"schema-form":{schema:i(W),config:p.data.config??{}},loading:i(G),"save-button-label":i(R)(`components.automation_nodes.plugin_apply_settings`),"show-button":``,onOnFormSubmit:oe},null,8,[`schema-form`,`loading`,`save-button-label`])])],64)):d(``,!0)])}}});export{N as default};
@@ -1 +1 @@
1
- import{Ar as e,nn as t,pn as n,tn as r,w as i}from"./vendor-cameraui-QuTJKoXE.js";import{J as a}from"./api-Cea16mc8.js";import{Er as o,Gn as s,Sr as c,Vn as l,dn as u,fn as d,fr as f,mn as p,nr as m,on as h,pn as g,rr as _,un as v,xn as y,yn as b,zn as x}from"./vendor-ClrOISZp.js";import{O as ee,b as te}from"./vendor-primevue-BdB7McKg.js";import{t as ne}from"./useCameraOptions-BpL2zbfV.js";import{n as re,r as ie,t as ae}from"./ConfigSensorValueInput-CgZWxOMu.js";import{t as S}from"./variable-C2Yu30iz.js";var C={class:`flex flex-col gap-4`},w={class:`flex flex-col field-gap`},T={class:`flex flex-col field-gap`},E={class:`cui-label`},D={key:0,class:`flex flex-col field-gap`},O={class:`cui-label`},k={key:1,class:`flex flex-col gap-3`},A={class:`cui-label`},j={class:`flex items-center gap-2`},M={class:`flex items-center gap-2 cursor-pointer select-none flex-1 min-w-0`},N={class:`text-sm font-medium truncate`},P=y({__name:`ConfigActionSensor`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(y,{emit:P}){let F=y,I=P,{t:L}=e(),{cameraOptions:oe,getSensorTypes:R,useSensorInstances:z,getPropertiesForSensor:B}=ne(),V=f({}),H=[{value:`fixed`,icon:ie,tooltipKey:`components.automation_nodes.sensor_value_fixed`},{value:`variable`,icon:S,tooltipKey:`components.automation_nodes.sensor_value_variable`}],U=v(()=>F.data.cameraId?R(F.data.cameraId).filter(e=>e.meta.category===r.Control||e.meta.category===r.Trigger||e.hasVirtual&&!e.meta.isDetectionType).map(e=>({label:L(`components.camera_options.sensor_type_${e.value}`),value:e.value})):[]),{instanceOptions:W,isLoading:G}=z(v(()=>F.data.cameraId||void 0),v(()=>F.data.sensorType||t.Light)),K=v(()=>!F.data.sensorName||!F.data.sensorPluginId?``:`${F.data.sensorName}::${F.data.sensorPluginId}`),q=v(()=>{let e=F.data.sensorType?a[F.data.sensorType]?.category:void 0;return W.value.filter(t=>e===r.Control||e===r.Trigger||t.pluginId===`cameraui.virtual`).map(e=>({label:e.label,value:`${e.sensorName}::${e.pluginId}`}))}),J=v(()=>F.data.sensorType?B(F.data.sensorType):[]),Y=v(()=>{let e=new Map;for(let t of F.data.properties??[])e.set(t.property,t.value);return e});function X(e){return Y.value.has(e)}function Z(e){return Y.value.get(e)??``}function Q(e){return V[e]??/\{\{.*\}\}/.test(Z(e))}function se(e,t){V[e]=t,!t&&/\{\{.*\}\}/.test(Z(e))&&$(e,``)}function ce(e,t){let n=[...F.data.properties??[]];if(t)n.some(t=>t.property===e)||n.push({property:e,value:re(String(F.data.sensorType??``),e)});else{let t=n.findIndex(t=>t.property===e);t>=0&&n.splice(t,1)}I(`update:data`,{properties:n})}function $(e,t){let n=[...F.data.properties??[]],r=n.find(t=>t.property===e);r?r.value=t:n.push({property:e,value:t}),I(`update:data`,{properties:n})}function le(e){I(`update:data`,{cameraId:e,sensorType:``,sensorName:``,sensorPluginId:``,properties:[]})}function ue(e){I(`update:data`,{sensorType:e,sensorName:``,sensorPluginId:``,properties:[]})}function de(e){let[t,n]=String(e).split(`::`);I(`update:data`,{sensorName:t,sensorPluginId:n,properties:[]})}return(e,t)=>{let r=ee,a=te,f=i,v=n;return x(),p(`div`,C,[u(`div`,w,[t[0]||=u(`label`,{class:`cui-label`},`Camera`,-1),b(r,{"model-value":y.data.cameraId,options:c(oe),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":le},null,8,[`model-value`,`options`])]),u(`div`,T,[u(`label`,E,o(c(L)(`components.automation_nodes.sensor_type_label`)),1),b(r,{"model-value":y.data.sensorType,options:c(U),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor type`,class:`w-full`,disabled:!y.data.cameraId,"onUpdate:modelValue":ue},null,8,[`model-value`,`options`,`disabled`])]),y.data.sensorType?(x(),p(`div`,D,[u(`label`,O,o(c(L)(`components.automation_nodes.sensor_instance`)),1),b(r,{"model-value":c(K),options:c(q),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor`,class:`w-full`,loading:c(G),"onUpdate:modelValue":de},null,8,[`model-value`,`options`,`loading`])])):g(``,!0),y.data.sensorName&&c(J).length?(x(),p(`div`,k,[u(`label`,A,o(c(L)(`components.automation_nodes.sensor_properties`)),1),(x(!0),p(h,null,l(c(J),t=>(x(),p(`div`,{key:t.value,class:`flex flex-col gap-1.5 p-2 rounded-md border-color`},[u(`div`,j,[u(`label`,M,[b(a,{"model-value":X(t.value),binary:``,class:`shrink-0`,"onUpdate:modelValue":e=>ce(t.value,e)},null,8,[`model-value`,`onUpdate:modelValue`]),u(`span`,N,o(t.label),1)]),X(t.value)?(x(),d(f,{key:0,"model-value":Q(t.value)?`variable`:`fixed`,options:H,"option-value":`value`,"allow-empty":!1,class:`cui-select-button-small shrink-0`,"onUpdate:modelValue":e=>se(t.value,e===`variable`)},{option:m(({option:t})=>[_((x(),d(s(t.icon),{class:`w-3.5 h-3.5`},null,512)),[[v,e.$t(t.tooltipKey),void 0,{top:!0}]])]),_:1},8,[`model-value`,`onUpdate:modelValue`])):g(``,!0)]),X(t.value)?(x(),d(ae,{key:0,"sensor-type":y.data.sensorType,property:t.value,"model-value":Z(t.value),"variable-mode":Q(t.value),"node-id":y.nodeId,"onUpdate:modelValue":e=>$(t.value,e)},null,8,[`sensor-type`,`property`,`model-value`,`variable-mode`,`node-id`,`onUpdate:modelValue`])):g(``,!0)]))),128))])):g(``,!0)])}}});export{P as default};
1
+ import{Ar as e,nn as t,pn as n,tn as r,w as i}from"./vendor-cameraui-QuTJKoXE.js";import{J as a}from"./api-BLTlDTXb.js";import{Er as o,Gn as s,Sr as c,Vn as l,dn as u,fn as d,fr as f,mn as p,nr as m,on as h,pn as g,rr as _,un as v,xn as y,yn as b,zn as x}from"./vendor-ClrOISZp.js";import{O as ee,b as te}from"./vendor-primevue-BdB7McKg.js";import{t as ne}from"./useCameraOptions-nvj6-uZg.js";import{n as re,r as ie,t as ae}from"./ConfigSensorValueInput-CgZWxOMu.js";import{t as S}from"./variable-C2Yu30iz.js";var C={class:`flex flex-col gap-4`},w={class:`flex flex-col field-gap`},T={class:`flex flex-col field-gap`},E={class:`cui-label`},D={key:0,class:`flex flex-col field-gap`},O={class:`cui-label`},k={key:1,class:`flex flex-col gap-3`},A={class:`cui-label`},j={class:`flex items-center gap-2`},M={class:`flex items-center gap-2 cursor-pointer select-none flex-1 min-w-0`},N={class:`text-sm font-medium truncate`},P=y({__name:`ConfigActionSensor`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(y,{emit:P}){let F=y,I=P,{t:L}=e(),{cameraOptions:oe,getSensorTypes:R,useSensorInstances:z,getPropertiesForSensor:B}=ne(),V=f({}),H=[{value:`fixed`,icon:ie,tooltipKey:`components.automation_nodes.sensor_value_fixed`},{value:`variable`,icon:S,tooltipKey:`components.automation_nodes.sensor_value_variable`}],U=v(()=>F.data.cameraId?R(F.data.cameraId).filter(e=>e.meta.category===r.Control||e.meta.category===r.Trigger||e.hasVirtual&&!e.meta.isDetectionType).map(e=>({label:L(`components.camera_options.sensor_type_${e.value}`),value:e.value})):[]),{instanceOptions:W,isLoading:G}=z(v(()=>F.data.cameraId||void 0),v(()=>F.data.sensorType||t.Light)),K=v(()=>!F.data.sensorName||!F.data.sensorPluginId?``:`${F.data.sensorName}::${F.data.sensorPluginId}`),q=v(()=>{let e=F.data.sensorType?a[F.data.sensorType]?.category:void 0;return W.value.filter(t=>e===r.Control||e===r.Trigger||t.pluginId===`cameraui.virtual`).map(e=>({label:e.label,value:`${e.sensorName}::${e.pluginId}`}))}),J=v(()=>F.data.sensorType?B(F.data.sensorType):[]),Y=v(()=>{let e=new Map;for(let t of F.data.properties??[])e.set(t.property,t.value);return e});function X(e){return Y.value.has(e)}function Z(e){return Y.value.get(e)??``}function Q(e){return V[e]??/\{\{.*\}\}/.test(Z(e))}function se(e,t){V[e]=t,!t&&/\{\{.*\}\}/.test(Z(e))&&$(e,``)}function ce(e,t){let n=[...F.data.properties??[]];if(t)n.some(t=>t.property===e)||n.push({property:e,value:re(String(F.data.sensorType??``),e)});else{let t=n.findIndex(t=>t.property===e);t>=0&&n.splice(t,1)}I(`update:data`,{properties:n})}function $(e,t){let n=[...F.data.properties??[]],r=n.find(t=>t.property===e);r?r.value=t:n.push({property:e,value:t}),I(`update:data`,{properties:n})}function le(e){I(`update:data`,{cameraId:e,sensorType:``,sensorName:``,sensorPluginId:``,properties:[]})}function ue(e){I(`update:data`,{sensorType:e,sensorName:``,sensorPluginId:``,properties:[]})}function de(e){let[t,n]=String(e).split(`::`);I(`update:data`,{sensorName:t,sensorPluginId:n,properties:[]})}return(e,t)=>{let r=ee,a=te,f=i,v=n;return x(),p(`div`,C,[u(`div`,w,[t[0]||=u(`label`,{class:`cui-label`},`Camera`,-1),b(r,{"model-value":y.data.cameraId,options:c(oe),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":le},null,8,[`model-value`,`options`])]),u(`div`,T,[u(`label`,E,o(c(L)(`components.automation_nodes.sensor_type_label`)),1),b(r,{"model-value":y.data.sensorType,options:c(U),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor type`,class:`w-full`,disabled:!y.data.cameraId,"onUpdate:modelValue":ue},null,8,[`model-value`,`options`,`disabled`])]),y.data.sensorType?(x(),p(`div`,D,[u(`label`,O,o(c(L)(`components.automation_nodes.sensor_instance`)),1),b(r,{"model-value":c(K),options:c(q),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor`,class:`w-full`,loading:c(G),"onUpdate:modelValue":de},null,8,[`model-value`,`options`,`loading`])])):g(``,!0),y.data.sensorName&&c(J).length?(x(),p(`div`,k,[u(`label`,A,o(c(L)(`components.automation_nodes.sensor_properties`)),1),(x(!0),p(h,null,l(c(J),t=>(x(),p(`div`,{key:t.value,class:`flex flex-col gap-1.5 p-2 rounded-md border-color`},[u(`div`,j,[u(`label`,M,[b(a,{"model-value":X(t.value),binary:``,class:`shrink-0`,"onUpdate:modelValue":e=>ce(t.value,e)},null,8,[`model-value`,`onUpdate:modelValue`]),u(`span`,N,o(t.label),1)]),X(t.value)?(x(),d(f,{key:0,"model-value":Q(t.value)?`variable`:`fixed`,options:H,"option-value":`value`,"allow-empty":!1,class:`cui-select-button-small shrink-0`,"onUpdate:modelValue":e=>se(t.value,e===`variable`)},{option:m(({option:t})=>[_((x(),d(s(t.icon),{class:`w-3.5 h-3.5`},null,512)),[[v,e.$t(t.tooltipKey),void 0,{top:!0}]])]),_:1},8,[`model-value`,`onUpdate:modelValue`])):g(``,!0)]),X(t.value)?(x(),d(ae,{key:0,"sensor-type":y.data.sensorType,property:t.value,"model-value":Z(t.value),"variable-mode":Q(t.value),"node-id":y.nodeId,"onUpdate:modelValue":e=>$(t.value,e)},null,8,[`sensor-type`,`property`,`model-value`,`variable-mode`,`node-id`,`onUpdate:modelValue`])):g(``,!0)]))),128))])):g(``,!0)])}}});export{P as default};
@@ -1 +1 @@
1
- import{Ar as e}from"./vendor-cameraui-QuTJKoXE.js";import{Er as t,Sr as n,dn as r,mn as i,nr as a,vn as o,xn as s,yn as c,zn as l}from"./vendor-ClrOISZp.js";import{F as u,H as d,O as f}from"./vendor-primevue-BdB7McKg.js";import{t as p}from"./useCameraOptions-BpL2zbfV.js";var m={class:`flex flex-col gap-4`},h={class:`flex flex-col field-gap`},g={class:`cui-toggle-switch`},_={class:`flex items-center gap-4`},v={class:`flex flex-col field-switch-gap`},y={class:`cui-label-switch`},b=s({__name:`ConfigActionSnapshot`,props:{data:{}},emits:[`update:data`],setup(s,{emit:b}){let x=b,{t:S}=e(),{cameraOptions:C}=p();function w(e,t){x(`update:data`,{[e]:t})}return(e,p)=>{let b=f,x=u,T=d;return l(),i(`div`,m,[r(`div`,h,[p[2]||=r(`label`,{class:`cui-label`},`Camera`,-1),c(b,{"model-value":s.data.cameraId,options:n(C),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":p[0]||=e=>w(`cameraId`,e)},null,8,[`model-value`,`options`])]),r(`div`,g,[r(`div`,_,[r(`div`,v,[r(`label`,y,t(n(S)(`components.automation_nodes.snapshot_force_new`)),1),c(x,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-switch-hint`},{default:a(()=>[o(t(n(S)(`components.automation_nodes.snapshot_force_new_hint`)),1)]),_:1})]),c(T,{"model-value":s.data.forceNew,class:`ml-auto shrink-0`,"onUpdate:modelValue":p[1]||=e=>w(`forceNew`,e)},null,8,[`model-value`])])])])}}});export{b as default};
1
+ import{Ar as e}from"./vendor-cameraui-QuTJKoXE.js";import{Er as t,Sr as n,dn as r,mn as i,nr as a,vn as o,xn as s,yn as c,zn as l}from"./vendor-ClrOISZp.js";import{F as u,H as d,O as f}from"./vendor-primevue-BdB7McKg.js";import{t as p}from"./useCameraOptions-nvj6-uZg.js";var m={class:`flex flex-col gap-4`},h={class:`flex flex-col field-gap`},g={class:`cui-toggle-switch`},_={class:`flex items-center gap-4`},v={class:`flex flex-col field-switch-gap`},y={class:`cui-label-switch`},b=s({__name:`ConfigActionSnapshot`,props:{data:{}},emits:[`update:data`],setup(s,{emit:b}){let x=b,{t:S}=e(),{cameraOptions:C}=p();function w(e,t){x(`update:data`,{[e]:t})}return(e,p)=>{let b=f,x=u,T=d;return l(),i(`div`,m,[r(`div`,h,[p[2]||=r(`label`,{class:`cui-label`},`Camera`,-1),c(b,{"model-value":s.data.cameraId,options:n(C),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":p[0]||=e=>w(`cameraId`,e)},null,8,[`model-value`,`options`])]),r(`div`,g,[r(`div`,_,[r(`div`,v,[r(`label`,y,t(n(S)(`components.automation_nodes.snapshot_force_new`)),1),c(x,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-switch-hint`},{default:a(()=>[o(t(n(S)(`components.automation_nodes.snapshot_force_new_hint`)),1)]),_:1})]),c(T,{"model-value":s.data.forceNew,class:`ml-auto shrink-0`,"onUpdate:modelValue":p[1]||=e=>w(`forceNew`,e)},null,8,[`model-value`])])])])}}});export{b as default};
@@ -1 +1 @@
1
- import{Ar as e,nn as t,pn as n,vn as r,w as ee}from"./vendor-cameraui-QuTJKoXE.js";import{Er as i,Gn as a,Sr as o,Vn as s,dn as c,fn as l,fr as u,mn as d,nr as f,on as p,pn as m,rr as h,un as g,xn as _,yn as v,zn as y}from"./vendor-ClrOISZp.js";import{O as b}from"./vendor-primevue-BdB7McKg.js";import{t as x}from"./close-BTPBtoEq.js";import{t as S}from"./useCameraOptions-BpL2zbfV.js";import{n as C,r as w,t as te}from"./ConfigSensorValueInput-CgZWxOMu.js";import{t as ne}from"./variable-C2Yu30iz.js";var re={class:`flex flex-col gap-4`},T={class:`flex flex-col field-gap`},E={class:`flex flex-col field-gap`},D={class:`cui-label`},O={key:0,class:`flex flex-col field-gap`},k={class:`cui-label`},A={key:1,class:`flex items-center gap-2`},j={class:`text-xs text-muted`},M={key:2,class:`flex flex-col gap-3`},N={class:`flex items-center gap-2`},P=_({__name:`ConfigConditionSensorState`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(_,{emit:P}){let F=_,I=P,{t:L}=e(),{cameraOptions:R,getSensorTypes:z,useSensorInstances:B,getPropertiesForSensor:ie}=S(),V=[{label:`AND`,value:`AND`},{label:`OR`,value:`OR`}],H=[{value:`fixed`,icon:w,tooltipKey:`components.automation_nodes.sensor_value_fixed`},{value:`variable`,icon:ne,tooltipKey:`components.automation_nodes.sensor_value_variable`}],U=u({});function W(e){return U[e]??/\{\{.*\}\}/.test(X.value[e]?.expectedValue??``)}function G(e,t){U[e]=t,!t&&/\{\{.*\}\}/.test(X.value[e]?.expectedValue??``)&&Q(e,`expectedValue`,``)}let K=g(()=>F.data.cameraId?z(F.data.cameraId).map(e=>({label:L(`components.camera_options.sensor_type_${e.value}`),value:e.value})):[]),{instanceOptions:q,isLoading:J}=B(g(()=>F.data.cameraId||void 0),g(()=>F.data.sensorType||t.Contact)),Y=g(()=>!F.data.sensorName||!F.data.sensorPluginId?``:`${F.data.sensorName}::${F.data.sensorPluginId}`),ae=g(()=>q.value.map(e=>({label:e.label,value:`${e.sensorName}::${e.pluginId}`}))),oe=g(()=>F.data.sensorType?ie(F.data.sensorType):[]),X=g(()=>F.data.conditions??[]);function se(){let e=[...X.value,{property:``,expectedValue:``}];Z(),I(`update:data`,{conditions:e})}function ce(e){let t=[...X.value];t.splice(e,1),Z(),I(`update:data`,{conditions:t})}function Z(){for(let e of Object.keys(U))delete U[Number(e)]}function Q(e,t,n){let r=[...X.value];r[e]={...r[e],[t]:n},t===`property`&&(r[e].expectedValue=C(String(F.data.sensorType??``),n)),I(`update:data`,{conditions:r})}function le(e){I(`update:data`,{cameraId:e,sensorType:``,sensorName:``,sensorPluginId:``,conditions:[],logic:`AND`})}function $(e){I(`update:data`,{sensorType:e,sensorName:``,sensorPluginId:``,conditions:[],logic:`AND`})}function ue(e){let[t,n]=String(e).split(`::`);I(`update:data`,{sensorName:t,sensorPluginId:n,conditions:[{property:``,expectedValue:``}]})}function de(e,t){I(`update:data`,{[e]:t})}return(e,t)=>{let u=b,g=ee,S=x,C=r,w=n;return y(),d(`div`,re,[c(`div`,T,[t[1]||=c(`label`,{class:`cui-label`},`Camera`,-1),v(u,{"model-value":_.data.cameraId,options:o(R),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":le},null,8,[`model-value`,`options`])]),c(`div`,E,[c(`label`,D,i(o(L)(`components.automation_nodes.sensor_type_label`)),1),v(u,{"model-value":_.data.sensorType,options:o(K),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor type`,class:`w-full`,disabled:!_.data.cameraId,"onUpdate:modelValue":$},null,8,[`model-value`,`options`,`disabled`])]),_.data.sensorType?(y(),d(`div`,O,[c(`label`,k,i(o(L)(`components.automation_nodes.sensor_instance`)),1),v(u,{"model-value":o(Y),options:o(ae),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor`,class:`w-full`,loading:o(J),"onUpdate:modelValue":ue},null,8,[`model-value`,`options`,`loading`])])):m(``,!0),o(X).length>1?(y(),d(`div`,A,[c(`span`,j,i(o(L)(`components.automation_nodes.condition_logic`)),1),v(g,{"model-value":_.data.logic,options:V,"option-label":`label`,"option-value":`value`,"allow-empty":!1,class:`cui-select-button-small`,"onUpdate:modelValue":t[0]||=e=>de(`logic`,e)},null,8,[`model-value`])])):m(``,!0),_.data.sensorName?(y(),d(`div`,M,[(y(!0),d(p,null,s(o(X),(t,n)=>(y(),d(`div`,{key:n,class:`flex flex-col gap-1.5 p-2 rounded-md border-color`},[c(`div`,N,[v(u,{"model-value":t.property,options:o(oe),"option-label":`label`,"option-value":`value`,placeholder:`Property`,class:`flex-1 min-w-0`,"onUpdate:modelValue":e=>Q(n,`property`,e)},null,8,[`model-value`,`options`,`onUpdate:modelValue`]),t.property?(y(),l(g,{key:0,"model-value":W(n)?`variable`:`fixed`,options:H,"option-value":`value`,"allow-empty":!1,class:`cui-select-button-small shrink-0`,"onUpdate:modelValue":e=>G(n,e===`variable`)},{option:f(({option:t})=>[h((y(),l(a(t.icon),{class:`w-3.5 h-3.5`},null,512)),[[w,e.$t(t.tooltipKey),void 0,{top:!0}]])]),_:1},8,[`model-value`,`onUpdate:modelValue`])):m(``,!0),o(X).length>1?(y(),l(C,{key:1,severity:`danger`,text:``,rounded:``,class:`shrink-0 cui-icon-sm`,onClick:e=>ce(n)},{icon:f(()=>[v(S,{width:`100%`,height:`100%`})]),_:1},8,[`onClick`])):m(``,!0)]),v(te,{"sensor-type":_.data.sensorType,property:t.property,"model-value":t.expectedValue,"variable-mode":W(n),"node-id":_.nodeId,disabled:!t.property,"onUpdate:modelValue":e=>Q(n,`expectedValue`,e)},null,8,[`sensor-type`,`property`,`model-value`,`variable-mode`,`node-id`,`disabled`,`onUpdate:modelValue`])]))),128)),v(C,{severity:`secondary`,outlined:``,label:o(L)(`components.automation_nodes.condition_add`),class:`cui-button-small self-start`,onClick:se},null,8,[`label`])])):m(``,!0)])}}});export{P as default};
1
+ import{Ar as e,nn as t,pn as n,vn as r,w as ee}from"./vendor-cameraui-QuTJKoXE.js";import{Er as i,Gn as a,Sr as o,Vn as s,dn as c,fn as l,fr as u,mn as d,nr as f,on as p,pn as m,rr as h,un as g,xn as _,yn as v,zn as y}from"./vendor-ClrOISZp.js";import{O as b}from"./vendor-primevue-BdB7McKg.js";import{t as x}from"./close-BTPBtoEq.js";import{t as S}from"./useCameraOptions-nvj6-uZg.js";import{n as C,r as w,t as te}from"./ConfigSensorValueInput-CgZWxOMu.js";import{t as ne}from"./variable-C2Yu30iz.js";var re={class:`flex flex-col gap-4`},T={class:`flex flex-col field-gap`},E={class:`flex flex-col field-gap`},D={class:`cui-label`},O={key:0,class:`flex flex-col field-gap`},k={class:`cui-label`},A={key:1,class:`flex items-center gap-2`},j={class:`text-xs text-muted`},M={key:2,class:`flex flex-col gap-3`},N={class:`flex items-center gap-2`},P=_({__name:`ConfigConditionSensorState`,props:{data:{},nodeId:{}},emits:[`update:data`],setup(_,{emit:P}){let F=_,I=P,{t:L}=e(),{cameraOptions:R,getSensorTypes:z,useSensorInstances:B,getPropertiesForSensor:ie}=S(),V=[{label:`AND`,value:`AND`},{label:`OR`,value:`OR`}],H=[{value:`fixed`,icon:w,tooltipKey:`components.automation_nodes.sensor_value_fixed`},{value:`variable`,icon:ne,tooltipKey:`components.automation_nodes.sensor_value_variable`}],U=u({});function W(e){return U[e]??/\{\{.*\}\}/.test(X.value[e]?.expectedValue??``)}function G(e,t){U[e]=t,!t&&/\{\{.*\}\}/.test(X.value[e]?.expectedValue??``)&&Q(e,`expectedValue`,``)}let K=g(()=>F.data.cameraId?z(F.data.cameraId).map(e=>({label:L(`components.camera_options.sensor_type_${e.value}`),value:e.value})):[]),{instanceOptions:q,isLoading:J}=B(g(()=>F.data.cameraId||void 0),g(()=>F.data.sensorType||t.Contact)),Y=g(()=>!F.data.sensorName||!F.data.sensorPluginId?``:`${F.data.sensorName}::${F.data.sensorPluginId}`),ae=g(()=>q.value.map(e=>({label:e.label,value:`${e.sensorName}::${e.pluginId}`}))),oe=g(()=>F.data.sensorType?ie(F.data.sensorType):[]),X=g(()=>F.data.conditions??[]);function se(){let e=[...X.value,{property:``,expectedValue:``}];Z(),I(`update:data`,{conditions:e})}function ce(e){let t=[...X.value];t.splice(e,1),Z(),I(`update:data`,{conditions:t})}function Z(){for(let e of Object.keys(U))delete U[Number(e)]}function Q(e,t,n){let r=[...X.value];r[e]={...r[e],[t]:n},t===`property`&&(r[e].expectedValue=C(String(F.data.sensorType??``),n)),I(`update:data`,{conditions:r})}function le(e){I(`update:data`,{cameraId:e,sensorType:``,sensorName:``,sensorPluginId:``,conditions:[],logic:`AND`})}function $(e){I(`update:data`,{sensorType:e,sensorName:``,sensorPluginId:``,conditions:[],logic:`AND`})}function ue(e){let[t,n]=String(e).split(`::`);I(`update:data`,{sensorName:t,sensorPluginId:n,conditions:[{property:``,expectedValue:``}]})}function de(e,t){I(`update:data`,{[e]:t})}return(e,t)=>{let u=b,g=ee,S=x,C=r,w=n;return y(),d(`div`,re,[c(`div`,T,[t[1]||=c(`label`,{class:`cui-label`},`Camera`,-1),v(u,{"model-value":_.data.cameraId,options:o(R),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":le},null,8,[`model-value`,`options`])]),c(`div`,E,[c(`label`,D,i(o(L)(`components.automation_nodes.sensor_type_label`)),1),v(u,{"model-value":_.data.sensorType,options:o(K),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor type`,class:`w-full`,disabled:!_.data.cameraId,"onUpdate:modelValue":$},null,8,[`model-value`,`options`,`disabled`])]),_.data.sensorType?(y(),d(`div`,O,[c(`label`,k,i(o(L)(`components.automation_nodes.sensor_instance`)),1),v(u,{"model-value":o(Y),options:o(ae),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor`,class:`w-full`,loading:o(J),"onUpdate:modelValue":ue},null,8,[`model-value`,`options`,`loading`])])):m(``,!0),o(X).length>1?(y(),d(`div`,A,[c(`span`,j,i(o(L)(`components.automation_nodes.condition_logic`)),1),v(g,{"model-value":_.data.logic,options:V,"option-label":`label`,"option-value":`value`,"allow-empty":!1,class:`cui-select-button-small`,"onUpdate:modelValue":t[0]||=e=>de(`logic`,e)},null,8,[`model-value`])])):m(``,!0),_.data.sensorName?(y(),d(`div`,M,[(y(!0),d(p,null,s(o(X),(t,n)=>(y(),d(`div`,{key:n,class:`flex flex-col gap-1.5 p-2 rounded-md border-color`},[c(`div`,N,[v(u,{"model-value":t.property,options:o(oe),"option-label":`label`,"option-value":`value`,placeholder:`Property`,class:`flex-1 min-w-0`,"onUpdate:modelValue":e=>Q(n,`property`,e)},null,8,[`model-value`,`options`,`onUpdate:modelValue`]),t.property?(y(),l(g,{key:0,"model-value":W(n)?`variable`:`fixed`,options:H,"option-value":`value`,"allow-empty":!1,class:`cui-select-button-small shrink-0`,"onUpdate:modelValue":e=>G(n,e===`variable`)},{option:f(({option:t})=>[h((y(),l(a(t.icon),{class:`w-3.5 h-3.5`},null,512)),[[w,e.$t(t.tooltipKey),void 0,{top:!0}]])]),_:1},8,[`model-value`,`onUpdate:modelValue`])):m(``,!0),o(X).length>1?(y(),l(C,{key:1,severity:`danger`,text:``,rounded:``,class:`shrink-0 cui-icon-sm`,onClick:e=>ce(n)},{icon:f(()=>[v(S,{width:`100%`,height:`100%`})]),_:1},8,[`onClick`])):m(``,!0)]),v(te,{"sensor-type":_.data.sensorType,property:t.property,"model-value":t.expectedValue,"variable-mode":W(n),"node-id":_.nodeId,disabled:!t.property,"onUpdate:modelValue":e=>Q(n,`expectedValue`,e)},null,8,[`sensor-type`,`property`,`model-value`,`variable-mode`,`node-id`,`disabled`,`onUpdate:modelValue`])]))),128)),v(C,{severity:`secondary`,outlined:``,label:o(L)(`components.automation_nodes.condition_add`),class:`cui-button-small self-start`,onClick:se},null,8,[`label`])])):m(``,!0)])}}});export{P as default};
@@ -1 +1 @@
1
- import{Ar as e,C as t}from"./vendor-cameraui-QuTJKoXE.js";import{Er as n,Sr as r,dn as i,mn as a,nr as o,vn as s,xn as c,yn as l,zn as u}from"./vendor-ClrOISZp.js";import{F as d,O as f,l as p,x as m}from"./vendor-primevue-BdB7McKg.js";import{t as h}from"./useCameraOptions-BpL2zbfV.js";var g={class:`flex flex-col gap-4`},_={class:`flex flex-col field-gap`},v={class:`flex flex-col field-gap`},y={class:`cui-label`},b={class:`flex flex-col field-gap`},x={class:`cui-label`},S={class:`flex flex-col field-gap`},C={class:`cui-label`},w={class:`flex items-center gap-3`},T={class:`text-sm text-muted w-10 text-right`},E={class:`flex flex-col field-gap`},D={class:`cui-label`},O={class:`flex flex-col field-gap`},k={class:`cui-label`},A={class:`flex flex-col field-gap`},j={class:`cui-label`},M=c({__name:`ConfigTriggerDetection`,props:{data:{}},emits:[`update:data`],setup(c,{emit:M}){let N=M,{t:P}=e(),{cameraOptions:F}=h(),I=[{label:P(`components.automation_nodes.event_phase_start`),value:`start`},{label:P(`components.automation_nodes.event_phase_update`),value:`update`},{label:P(`components.automation_nodes.event_phase_end`),value:`end`},{label:P(`components.automation_nodes.event_phase_segment_start`),value:`segment-start`},{label:P(`components.automation_nodes.event_phase_segment_update`),value:`segment-update`},{label:P(`components.automation_nodes.event_phase_segment_end`),value:`segment-end`}],L=[{label:P(`components.automation_nodes.label_motion`),value:`motion`},{label:P(`components.automation_nodes.label_person`),value:`person`},{label:P(`components.automation_nodes.label_vehicle`),value:`vehicle`},{label:P(`components.automation_nodes.label_animal`),value:`animal`},{label:P(`components.automation_nodes.label_package`),value:`package`},{label:P(`components.automation_nodes.label_audio`),value:`audio`}],R=[{label:P(`components.automation_nodes.audio_doorbell`),value:`doorbell`},{label:P(`components.automation_nodes.audio_glass_break`),value:`glass_break`},{label:P(`components.automation_nodes.audio_scream`),value:`scream`},{label:P(`components.automation_nodes.audio_gunshot`),value:`gunshot`},{label:P(`components.automation_nodes.audio_dog_bark`),value:`dog_bark`},{label:P(`components.automation_nodes.audio_baby_cry`),value:`baby_cry`},{label:P(`components.automation_nodes.audio_alarm`),value:`alarm`},{label:P(`components.automation_nodes.audio_car_alarm`),value:`car_alarm`},{label:P(`components.automation_nodes.audio_smoke_alarm`),value:`smoke_alarm`},{label:P(`components.automation_nodes.audio_siren`),value:`siren`},{label:P(`components.automation_nodes.audio_speaking`),value:`speaking`},{label:P(`components.automation_nodes.audio_cat`),value:`cat`}];function z(e){N(`update:data`,{cameraId:e,detectionLabels:[],faceFilter:[],licensePlateFilter:[]})}function B(e,t){N(`update:data`,{[e]:t})}return(e,h)=>{let M=f,N=p,V=d,H=t,U=m;return u(),a(`div`,g,[i(`div`,_,[h[6]||=i(`label`,{class:`cui-label`},`Camera`,-1),l(M,{"model-value":c.data.cameraId,options:r(F),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":z},null,8,[`model-value`,`options`])]),i(`div`,v,[i(`label`,y,n(r(P)(`components.automation_nodes.event_phase`)),1),l(N,{"model-value":c.data.eventPhase,options:I,"option-label":`label`,"option-value":`value`,placeholder:r(P)(`components.automation_nodes.event_phase_placeholder`),class:`w-full`,"onUpdate:modelValue":h[0]||=e=>B(`eventPhase`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.event_phase_multi_hint`)),1)]),_:1})]),i(`div`,b,[i(`label`,x,n(r(P)(`components.automation_nodes.detection_labels`)),1),l(N,{"model-value":c.data.detectionLabels,options:L,"option-label":`label`,"option-value":`value`,placeholder:r(P)(`components.automation_nodes.detection_labels_placeholder`),class:`w-full`,"onUpdate:modelValue":h[1]||=e=>B(`detectionLabels`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.detection_labels_hint`)),1)]),_:1})]),i(`div`,S,[i(`label`,C,n(r(P)(`components.automation_nodes.confidence`)),1),i(`div`,w,[l(H,{"model-value":c.data.confidenceThreshold*100,min:0,max:100,class:`flex-1`,"onUpdate:modelValue":h[2]||=e=>B(`confidenceThreshold`,(Number(e)||0)/100)},null,8,[`model-value`]),i(`span`,T,n(Math.round(c.data.confidenceThreshold*100))+`%`,1)]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.confidence_hint`)),1)]),_:1})]),i(`div`,E,[i(`label`,D,n(r(P)(`components.automation_nodes.audio_labels`)),1),l(N,{"model-value":c.data.audioLabels,options:R,"option-label":`label`,"option-value":`value`,placeholder:r(P)(`components.automation_nodes.audio_labels_placeholder`),class:`w-full`,"onUpdate:modelValue":h[3]||=e=>B(`audioLabels`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.audio_labels_hint`)),1)]),_:1})]),i(`div`,O,[i(`label`,k,n(r(P)(`components.automation_nodes.face_filter`)),1),l(U,{"model-value":c.data.faceFilter,multiple:``,typeahead:!1,placeholder:r(P)(`components.automation_nodes.face_filter_placeholder`),"onUpdate:modelValue":h[4]||=e=>B(`faceFilter`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.face_filter_hint`)),1)]),_:1})]),i(`div`,A,[i(`label`,j,n(r(P)(`components.automation_nodes.license_plate_filter`)),1),l(U,{"model-value":c.data.licensePlateFilter,multiple:``,typeahead:!1,placeholder:r(P)(`components.automation_nodes.license_plate_filter_placeholder`),"onUpdate:modelValue":h[5]||=e=>B(`licensePlateFilter`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.license_plate_filter_hint`)),1)]),_:1})])])}}});export{M as default};
1
+ import{Ar as e,C as t}from"./vendor-cameraui-QuTJKoXE.js";import{Er as n,Sr as r,dn as i,mn as a,nr as o,vn as s,xn as c,yn as l,zn as u}from"./vendor-ClrOISZp.js";import{F as d,O as f,l as p,x as m}from"./vendor-primevue-BdB7McKg.js";import{t as h}from"./useCameraOptions-nvj6-uZg.js";var g={class:`flex flex-col gap-4`},_={class:`flex flex-col field-gap`},v={class:`flex flex-col field-gap`},y={class:`cui-label`},b={class:`flex flex-col field-gap`},x={class:`cui-label`},S={class:`flex flex-col field-gap`},C={class:`cui-label`},w={class:`flex items-center gap-3`},T={class:`text-sm text-muted w-10 text-right`},E={class:`flex flex-col field-gap`},D={class:`cui-label`},O={class:`flex flex-col field-gap`},k={class:`cui-label`},A={class:`flex flex-col field-gap`},j={class:`cui-label`},M=c({__name:`ConfigTriggerDetection`,props:{data:{}},emits:[`update:data`],setup(c,{emit:M}){let N=M,{t:P}=e(),{cameraOptions:F}=h(),I=[{label:P(`components.automation_nodes.event_phase_start`),value:`start`},{label:P(`components.automation_nodes.event_phase_update`),value:`update`},{label:P(`components.automation_nodes.event_phase_end`),value:`end`},{label:P(`components.automation_nodes.event_phase_segment_start`),value:`segment-start`},{label:P(`components.automation_nodes.event_phase_segment_update`),value:`segment-update`},{label:P(`components.automation_nodes.event_phase_segment_end`),value:`segment-end`}],L=[{label:P(`components.automation_nodes.label_motion`),value:`motion`},{label:P(`components.automation_nodes.label_person`),value:`person`},{label:P(`components.automation_nodes.label_vehicle`),value:`vehicle`},{label:P(`components.automation_nodes.label_animal`),value:`animal`},{label:P(`components.automation_nodes.label_package`),value:`package`},{label:P(`components.automation_nodes.label_audio`),value:`audio`}],R=[{label:P(`components.automation_nodes.audio_doorbell`),value:`doorbell`},{label:P(`components.automation_nodes.audio_glass_break`),value:`glass_break`},{label:P(`components.automation_nodes.audio_scream`),value:`scream`},{label:P(`components.automation_nodes.audio_gunshot`),value:`gunshot`},{label:P(`components.automation_nodes.audio_dog_bark`),value:`dog_bark`},{label:P(`components.automation_nodes.audio_baby_cry`),value:`baby_cry`},{label:P(`components.automation_nodes.audio_alarm`),value:`alarm`},{label:P(`components.automation_nodes.audio_car_alarm`),value:`car_alarm`},{label:P(`components.automation_nodes.audio_smoke_alarm`),value:`smoke_alarm`},{label:P(`components.automation_nodes.audio_siren`),value:`siren`},{label:P(`components.automation_nodes.audio_speaking`),value:`speaking`},{label:P(`components.automation_nodes.audio_cat`),value:`cat`}];function z(e){N(`update:data`,{cameraId:e,detectionLabels:[],faceFilter:[],licensePlateFilter:[]})}function B(e,t){N(`update:data`,{[e]:t})}return(e,h)=>{let M=f,N=p,V=d,H=t,U=m;return u(),a(`div`,g,[i(`div`,_,[h[6]||=i(`label`,{class:`cui-label`},`Camera`,-1),l(M,{"model-value":c.data.cameraId,options:r(F),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":z},null,8,[`model-value`,`options`])]),i(`div`,v,[i(`label`,y,n(r(P)(`components.automation_nodes.event_phase`)),1),l(N,{"model-value":c.data.eventPhase,options:I,"option-label":`label`,"option-value":`value`,placeholder:r(P)(`components.automation_nodes.event_phase_placeholder`),class:`w-full`,"onUpdate:modelValue":h[0]||=e=>B(`eventPhase`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.event_phase_multi_hint`)),1)]),_:1})]),i(`div`,b,[i(`label`,x,n(r(P)(`components.automation_nodes.detection_labels`)),1),l(N,{"model-value":c.data.detectionLabels,options:L,"option-label":`label`,"option-value":`value`,placeholder:r(P)(`components.automation_nodes.detection_labels_placeholder`),class:`w-full`,"onUpdate:modelValue":h[1]||=e=>B(`detectionLabels`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.detection_labels_hint`)),1)]),_:1})]),i(`div`,S,[i(`label`,C,n(r(P)(`components.automation_nodes.confidence`)),1),i(`div`,w,[l(H,{"model-value":c.data.confidenceThreshold*100,min:0,max:100,class:`flex-1`,"onUpdate:modelValue":h[2]||=e=>B(`confidenceThreshold`,(Number(e)||0)/100)},null,8,[`model-value`]),i(`span`,T,n(Math.round(c.data.confidenceThreshold*100))+`%`,1)]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.confidence_hint`)),1)]),_:1})]),i(`div`,E,[i(`label`,D,n(r(P)(`components.automation_nodes.audio_labels`)),1),l(N,{"model-value":c.data.audioLabels,options:R,"option-label":`label`,"option-value":`value`,placeholder:r(P)(`components.automation_nodes.audio_labels_placeholder`),class:`w-full`,"onUpdate:modelValue":h[3]||=e=>B(`audioLabels`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.audio_labels_hint`)),1)]),_:1})]),i(`div`,O,[i(`label`,k,n(r(P)(`components.automation_nodes.face_filter`)),1),l(U,{"model-value":c.data.faceFilter,multiple:``,typeahead:!1,placeholder:r(P)(`components.automation_nodes.face_filter_placeholder`),"onUpdate:modelValue":h[4]||=e=>B(`faceFilter`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.face_filter_hint`)),1)]),_:1})]),i(`div`,A,[i(`label`,j,n(r(P)(`components.automation_nodes.license_plate_filter`)),1),l(U,{"model-value":c.data.licensePlateFilter,multiple:``,typeahead:!1,placeholder:r(P)(`components.automation_nodes.license_plate_filter_placeholder`),"onUpdate:modelValue":h[5]||=e=>B(`licensePlateFilter`,e)},null,8,[`model-value`,`placeholder`]),l(V,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[s(n(r(P)(`components.automation_nodes.license_plate_filter_hint`)),1)]),_:1})])])}}});export{M as default};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{Ar as t,C as n,O as ee,vn as te}from"./vendor-cameraui-QuTJKoXE.js";import{D as r,i}from"./api-Cea16mc8.js";import{$n as a,Er as o,Pn as s,Sr as c,Vn as ne,Zn as l,dn as u,mn as d,nr as f,on as re,un as p,ur as m,vn as h,xn as g,yn as _,zn as v}from"./vendor-ClrOISZp.js";import{F as ie,N as ae,O as oe,P as se,h as ce,l as le}from"./vendor-primevue-BdB7McKg.js";import{t as ue}from"./CuiActionButton-WFz5I80P.js";import{t as de}from"./information-outline-BaVRQ1WL.js";import{i as y,n as b,r as x,t as S}from"./vendor-leaflet-BMMJO5Nd.js";import{t as C}from"./copy-D1B4K3K8.js";import{t as w}from"./useUserOptions-DVC4k8Zs.js";var T={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function E(e,t){return v(),d(`svg`,T,[...t[0]||=[u(`path`,{fill:`currentColor`,d:`M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7`},null,-1)]])}var fe=m({name:`mdi-crosshairs-gps`,render:E}),D=e(y(),1);function O(){return{getCurrentPosition:async()=>new Promise((e,t)=>{if(!navigator.geolocation){t(Error(`geolocation unavailable`));return}navigator.geolocation.getCurrentPosition(t=>e({latitude:t.coords.latitude,longitude:t.coords.longitude}),e=>t(e),{enableHighAccuracy:!0,timeout:1e4})})}}var k={class:`flex flex-col gap-4`},A={class:`flex flex-col field-gap`},j={class:`cui-label`},M={class:`flex flex-col field-gap`},N={class:`cui-label`},P={class:`flex flex-col field-gap`},F={class:`cui-label`},I={class:`flex flex-col field-gap`},L={class:`cui-label`},R={class:`flex flex-col gap-3`},z={class:`cui-label`},B={class:`flex flex-col field-gap`},V={class:`cui-label`},pe={class:`flex flex-col field-gap`},me={class:`cui-label`},he={class:`flex flex-col field-gap`},ge={class:`cui-label`},_e={key:0,class:`flex flex-col field-gap`},ve={class:`cui-label`},ye={class:`text-xs text-muted font-medium`},be={key:1,class:`cui-banner cui-banner-warn`},H=g({__name:`ConfigTriggerGeofence`,props:{data:{}},emits:[`update:data`],setup(e,{emit:m}){let g=e,y=m,{t:T}=t(),E=r(),{userOptions:H}=w(),{getCurrentPosition:xe}=O(),Se=[{label:T(`components.automation_nodes.geofence_event_enter`),value:`enter`},{label:T(`components.automation_nodes.geofence_event_leave`),value:`leave`},{label:T(`components.automation_nodes.geofence_event_both`),value:`both`}],U=l(`mapContainerRef`),W=null,G=null,K=null,q=p(()=>`${window.location.origin}/api/automations/location/${g.data.geofenceId||`...`}`),J=p(()=>Object.entries(g.data.geofenceUserSecrets??{}));function Ce(){if(!U.value)return;let e=g.data.latitude||51.505,t=g.data.longitude||-.09;W=D.map(U.value).setView([e,t],15),D.tileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`&copy; OpenStreetMap`}).addTo(W);let n=D.icon({iconRetinaUrl:x,iconUrl:b,shadowUrl:S,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});G=D.marker([e,t],{draggable:!0,icon:n}).addTo(W),K=D.circle([e,t],{radius:g.data.radius||200,color:`#3b82f6`,fillOpacity:.15,weight:2}).addTo(W),G.on(`dragend`,()=>{let e=G.getLatLng();y(`update:data`,{latitude:e.lat,longitude:e.lng}),K.setLatLng(e)})}function Y(e,t,n){W&&(W.setView([e,t],n??W.getZoom()),G?.setLatLng([e,t]),K?.setLatLng([e,t]))}function we(e){e!=null&&(y(`update:data`,{latitude:e}),Y(e,g.data.longitude))}function Te(e){e!=null&&(y(`update:data`,{longitude:e}),Y(g.data.latitude,e))}function X(e){e!=null&&($(`radius`,e),K?.setRadius(e))}function Z(){E.add({severity:`error`,summary:T(`components.toast.title_error`),detail:T(`components.automation_nodes.geofence_location_error`),life:4e3})}async function Ee(){try{let{latitude:e,longitude:t}=await xe();y(`update:data`,{latitude:e,longitude:t}),Y(e,t,16)}catch{Z()}}function Q(e){i(e)}function $(e,t){y(`update:data`,{[e]:t})}return a(U,e=>{e&&!W&&Ce()}),s(()=>{W?.remove(),W=null,G=null,K=null}),(t,r)=>{let i=ee,a=fe,s=te,l=ce,p=n,m=oe,g=le,y=ie,b=ue,x=ae,S=se,w=de;return v(),d(`div`,k,[u(`div`,A,[u(`label`,j,o(c(T)(`components.automation_nodes.geofence_zone_name`)),1),_(i,{"model-value":e.data.zoneName,placeholder:c(T)(`components.automation_nodes.geofence_zone_name_placeholder`),class:`w-full`,"onUpdate:modelValue":r[0]||=e=>$(`zoneName`,e)},null,8,[`model-value`,`placeholder`])]),u(`div`,M,[u(`label`,N,o(c(T)(`components.automation_nodes.geofence_map_hint`)),1),u(`div`,{ref_key:`mapContainerRef`,ref:U,class:`rounded-lg overflow-hidden border-[1px] border-color`,style:{height:`220px`}},null,512),_(s,{severity:`secondary`,outlined:``,label:c(T)(`components.automation_nodes.geofence_use_my_location`),class:`cui-button-small w-full`,onClick:Ee},{icon:f(()=>[_(a,{class:`w-4 h-4`})]),_:1},8,[`label`])]),u(`div`,P,[u(`label`,F,o(c(T)(`components.automation_nodes.geofence_latitude`)),1),_(l,{"model-value":e.data.latitude,"min-fraction-digits":4,"max-fraction-digits":6,class:`w-full`,"onUpdate:modelValue":we},null,8,[`model-value`])]),u(`div`,I,[u(`label`,L,o(c(T)(`components.automation_nodes.geofence_longitude`)),1),_(l,{"model-value":e.data.longitude,"min-fraction-digits":4,"max-fraction-digits":6,class:`w-full`,"onUpdate:modelValue":Te},null,8,[`model-value`])]),u(`div`,R,[u(`label`,z,o(c(T)(`components.automation_nodes.geofence_radius`)),1),_(p,{"model-value":e.data.radius||200,min:50,max:5e3,step:50,class:`w-full`,"onUpdate:modelValue":r[1]||=e=>X(Array.isArray(e)?e[0]:e)},null,8,[`model-value`]),_(l,{"model-value":e.data.radius||200,min:50,max:5e3,suffix:` m`,class:`w-full`,"onUpdate:modelValue":X},null,8,[`model-value`])]),u(`div`,B,[u(`label`,V,o(c(T)(`components.automation_nodes.geofence_event`)),1),_(m,{"model-value":e.data.event||`both`,options:Se,"option-label":`label`,"option-value":`value`,class:`w-full`,"onUpdate:modelValue":r[2]||=e=>$(`event`,e)},null,8,[`model-value`])]),u(`div`,pe,[u(`label`,me,o(c(T)(`components.automation_nodes.geofence_users`)),1),_(g,{"model-value":e.data.users,options:c(H),"option-label":`label`,"option-value":`value`,placeholder:c(T)(`components.automation_nodes.geofence_users_placeholder`),class:`w-full`,"onUpdate:modelValue":r[3]||=e=>$(`users`,e)},null,8,[`model-value`,`options`,`placeholder`]),_(y,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:f(()=>[h(o(c(T)(`components.automation_nodes.geofence_users_hint`)),1)]),_:1})]),u(`div`,he,[u(`label`,ge,o(c(T)(`components.automation_nodes.geofence_url`)),1),_(S,null,{default:f(()=>[_(i,{"model-value":c(q),readonly:``,class:`font-mono text-xs`},null,8,[`model-value`]),_(x,null,{default:f(()=>[_(b,{"action-text":c(T)(`components.automation_nodes.webhook_secret_copied`),icon:c(C),"button-props":{severity:`secondary`,text:!0},onAction:r[4]||=e=>Q(c(q))},null,8,[`action-text`,`icon`])]),_:1})]),_:1}),_(y,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:f(()=>[h(o(c(T)(`components.automation_nodes.geofence_url_hint`)),1)]),_:1})]),c(J).length?(v(),d(`div`,_e,[u(`label`,ve,o(c(T)(`components.automation_nodes.geofence_secret`)),1),(v(!0),d(re,null,ne(c(J),([e,t])=>(v(),d(`div`,{key:e,class:`flex flex-col gap-1`},[u(`span`,ye,o(e),1),_(S,null,{default:f(()=>[_(i,{"model-value":t,readonly:``,class:`font-mono text-xs`},null,8,[`model-value`]),_(x,null,{default:f(()=>[_(b,{"action-text":c(T)(`components.automation_nodes.webhook_secret_copied`),icon:c(C),"button-props":{severity:`secondary`,text:!0},onAction:e=>Q(t)},null,8,[`action-text`,`icon`,`onAction`])]),_:2},1024)]),_:2},1024)]))),128)),_(y,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:f(()=>[h(o(c(T)(`components.automation_nodes.geofence_secret_hint`)),1)]),_:1})])):(v(),d(`div`,be,[_(w,{class:`w-5 h-5 shrink-0`}),u(`span`,null,o(c(T)(`components.automation_nodes.geofence_secret_save_hint`)),1)]))])}}});export{H as default};
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{Ar as t,C as n,O as ee,vn as te}from"./vendor-cameraui-QuTJKoXE.js";import{D as r,i}from"./api-BLTlDTXb.js";import{$n as a,Er as o,Pn as s,Sr as c,Vn as ne,Zn as l,dn as u,mn as d,nr as f,on as re,un as p,ur as m,vn as h,xn as g,yn as _,zn as v}from"./vendor-ClrOISZp.js";import{F as ie,N as ae,O as oe,P as se,h as ce,l as le}from"./vendor-primevue-BdB7McKg.js";import{t as ue}from"./CuiActionButton-WFz5I80P.js";import{t as de}from"./information-outline-BaVRQ1WL.js";import{i as y,n as b,r as x,t as S}from"./vendor-leaflet-BMMJO5Nd.js";import{t as C}from"./copy-D1B4K3K8.js";import{t as w}from"./useUserOptions-B3MwA59K.js";var T={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function E(e,t){return v(),d(`svg`,T,[...t[0]||=[u(`path`,{fill:`currentColor`,d:`M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m-8.95 5H1v-2h2.05C3.5 6.83 6.83 3.5 11 3.05V1h2v2.05c4.17.45 7.5 3.78 7.95 7.95H23v2h-2.05c-.45 4.17-3.78 7.5-7.95 7.95V23h-2v-2.05C6.83 20.5 3.5 17.17 3.05 13M12 5a7 7 0 0 0-7 7a7 7 0 0 0 7 7a7 7 0 0 0 7-7a7 7 0 0 0-7-7`},null,-1)]])}var fe=m({name:`mdi-crosshairs-gps`,render:E}),D=e(y(),1);function O(){return{getCurrentPosition:async()=>new Promise((e,t)=>{if(!navigator.geolocation){t(Error(`geolocation unavailable`));return}navigator.geolocation.getCurrentPosition(t=>e({latitude:t.coords.latitude,longitude:t.coords.longitude}),e=>t(e),{enableHighAccuracy:!0,timeout:1e4})})}}var k={class:`flex flex-col gap-4`},A={class:`flex flex-col field-gap`},j={class:`cui-label`},M={class:`flex flex-col field-gap`},N={class:`cui-label`},P={class:`flex flex-col field-gap`},F={class:`cui-label`},I={class:`flex flex-col field-gap`},L={class:`cui-label`},R={class:`flex flex-col gap-3`},z={class:`cui-label`},B={class:`flex flex-col field-gap`},V={class:`cui-label`},pe={class:`flex flex-col field-gap`},me={class:`cui-label`},he={class:`flex flex-col field-gap`},ge={class:`cui-label`},_e={key:0,class:`flex flex-col field-gap`},ve={class:`cui-label`},ye={class:`text-xs text-muted font-medium`},be={key:1,class:`cui-banner cui-banner-warn`},H=g({__name:`ConfigTriggerGeofence`,props:{data:{}},emits:[`update:data`],setup(e,{emit:m}){let g=e,y=m,{t:T}=t(),E=r(),{userOptions:H}=w(),{getCurrentPosition:xe}=O(),Se=[{label:T(`components.automation_nodes.geofence_event_enter`),value:`enter`},{label:T(`components.automation_nodes.geofence_event_leave`),value:`leave`},{label:T(`components.automation_nodes.geofence_event_both`),value:`both`}],U=l(`mapContainerRef`),W=null,G=null,K=null,q=p(()=>`${window.location.origin}/api/automations/location/${g.data.geofenceId||`...`}`),J=p(()=>Object.entries(g.data.geofenceUserSecrets??{}));function Ce(){if(!U.value)return;let e=g.data.latitude||51.505,t=g.data.longitude||-.09;W=D.map(U.value).setView([e,t],15),D.tileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`&copy; OpenStreetMap`}).addTo(W);let n=D.icon({iconRetinaUrl:x,iconUrl:b,shadowUrl:S,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});G=D.marker([e,t],{draggable:!0,icon:n}).addTo(W),K=D.circle([e,t],{radius:g.data.radius||200,color:`#3b82f6`,fillOpacity:.15,weight:2}).addTo(W),G.on(`dragend`,()=>{let e=G.getLatLng();y(`update:data`,{latitude:e.lat,longitude:e.lng}),K.setLatLng(e)})}function Y(e,t,n){W&&(W.setView([e,t],n??W.getZoom()),G?.setLatLng([e,t]),K?.setLatLng([e,t]))}function we(e){e!=null&&(y(`update:data`,{latitude:e}),Y(e,g.data.longitude))}function Te(e){e!=null&&(y(`update:data`,{longitude:e}),Y(g.data.latitude,e))}function X(e){e!=null&&($(`radius`,e),K?.setRadius(e))}function Z(){E.add({severity:`error`,summary:T(`components.toast.title_error`),detail:T(`components.automation_nodes.geofence_location_error`),life:4e3})}async function Ee(){try{let{latitude:e,longitude:t}=await xe();y(`update:data`,{latitude:e,longitude:t}),Y(e,t,16)}catch{Z()}}function Q(e){i(e)}function $(e,t){y(`update:data`,{[e]:t})}return a(U,e=>{e&&!W&&Ce()}),s(()=>{W?.remove(),W=null,G=null,K=null}),(t,r)=>{let i=ee,a=fe,s=te,l=ce,p=n,m=oe,g=le,y=ie,b=ue,x=ae,S=se,w=de;return v(),d(`div`,k,[u(`div`,A,[u(`label`,j,o(c(T)(`components.automation_nodes.geofence_zone_name`)),1),_(i,{"model-value":e.data.zoneName,placeholder:c(T)(`components.automation_nodes.geofence_zone_name_placeholder`),class:`w-full`,"onUpdate:modelValue":r[0]||=e=>$(`zoneName`,e)},null,8,[`model-value`,`placeholder`])]),u(`div`,M,[u(`label`,N,o(c(T)(`components.automation_nodes.geofence_map_hint`)),1),u(`div`,{ref_key:`mapContainerRef`,ref:U,class:`rounded-lg overflow-hidden border-[1px] border-color`,style:{height:`220px`}},null,512),_(s,{severity:`secondary`,outlined:``,label:c(T)(`components.automation_nodes.geofence_use_my_location`),class:`cui-button-small w-full`,onClick:Ee},{icon:f(()=>[_(a,{class:`w-4 h-4`})]),_:1},8,[`label`])]),u(`div`,P,[u(`label`,F,o(c(T)(`components.automation_nodes.geofence_latitude`)),1),_(l,{"model-value":e.data.latitude,"min-fraction-digits":4,"max-fraction-digits":6,class:`w-full`,"onUpdate:modelValue":we},null,8,[`model-value`])]),u(`div`,I,[u(`label`,L,o(c(T)(`components.automation_nodes.geofence_longitude`)),1),_(l,{"model-value":e.data.longitude,"min-fraction-digits":4,"max-fraction-digits":6,class:`w-full`,"onUpdate:modelValue":Te},null,8,[`model-value`])]),u(`div`,R,[u(`label`,z,o(c(T)(`components.automation_nodes.geofence_radius`)),1),_(p,{"model-value":e.data.radius||200,min:50,max:5e3,step:50,class:`w-full`,"onUpdate:modelValue":r[1]||=e=>X(Array.isArray(e)?e[0]:e)},null,8,[`model-value`]),_(l,{"model-value":e.data.radius||200,min:50,max:5e3,suffix:` m`,class:`w-full`,"onUpdate:modelValue":X},null,8,[`model-value`])]),u(`div`,B,[u(`label`,V,o(c(T)(`components.automation_nodes.geofence_event`)),1),_(m,{"model-value":e.data.event||`both`,options:Se,"option-label":`label`,"option-value":`value`,class:`w-full`,"onUpdate:modelValue":r[2]||=e=>$(`event`,e)},null,8,[`model-value`])]),u(`div`,pe,[u(`label`,me,o(c(T)(`components.automation_nodes.geofence_users`)),1),_(g,{"model-value":e.data.users,options:c(H),"option-label":`label`,"option-value":`value`,placeholder:c(T)(`components.automation_nodes.geofence_users_placeholder`),class:`w-full`,"onUpdate:modelValue":r[3]||=e=>$(`users`,e)},null,8,[`model-value`,`options`,`placeholder`]),_(y,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:f(()=>[h(o(c(T)(`components.automation_nodes.geofence_users_hint`)),1)]),_:1})]),u(`div`,he,[u(`label`,ge,o(c(T)(`components.automation_nodes.geofence_url`)),1),_(S,null,{default:f(()=>[_(i,{"model-value":c(q),readonly:``,class:`font-mono text-xs`},null,8,[`model-value`]),_(x,null,{default:f(()=>[_(b,{"action-text":c(T)(`components.automation_nodes.webhook_secret_copied`),icon:c(C),"button-props":{severity:`secondary`,text:!0},onAction:r[4]||=e=>Q(c(q))},null,8,[`action-text`,`icon`])]),_:1})]),_:1}),_(y,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:f(()=>[h(o(c(T)(`components.automation_nodes.geofence_url_hint`)),1)]),_:1})]),c(J).length?(v(),d(`div`,_e,[u(`label`,ve,o(c(T)(`components.automation_nodes.geofence_secret`)),1),(v(!0),d(re,null,ne(c(J),([e,t])=>(v(),d(`div`,{key:e,class:`flex flex-col gap-1`},[u(`span`,ye,o(e),1),_(S,null,{default:f(()=>[_(i,{"model-value":t,readonly:``,class:`font-mono text-xs`},null,8,[`model-value`]),_(x,null,{default:f(()=>[_(b,{"action-text":c(T)(`components.automation_nodes.webhook_secret_copied`),icon:c(C),"button-props":{severity:`secondary`,text:!0},onAction:e=>Q(t)},null,8,[`action-text`,`icon`,`onAction`])]),_:2},1024)]),_:2},1024)]))),128)),_(y,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:f(()=>[h(o(c(T)(`components.automation_nodes.geofence_secret_hint`)),1)]),_:1})])):(v(),d(`div`,be,[_(w,{class:`w-5 h-5 shrink-0`}),u(`span`,null,o(c(T)(`components.automation_nodes.geofence_secret_save_hint`)),1)]))])}}});export{H as default};
@@ -1 +1 @@
1
- import{Ar as e,nn as t}from"./vendor-cameraui-QuTJKoXE.js";import{Er as n,Sr as r,dn as i,mn as a,nr as o,pn as s,un as c,vn as l,xn as u,yn as d,zn as f}from"./vendor-ClrOISZp.js";import{F as p,O as m,l as h}from"./vendor-primevue-BdB7McKg.js";import{t as g}from"./useCameraOptions-BpL2zbfV.js";var _={class:`flex flex-col gap-4`},v={class:`flex flex-col field-gap`},y={class:`flex flex-col field-gap`},b={class:`cui-label`},x={key:0,class:`flex flex-col field-gap`},S={class:`cui-label`},C={class:`flex flex-col field-gap`},w={class:`cui-label`},T=u({__name:`ConfigTriggerSensor`,props:{data:{}},emits:[`update:data`],setup(u,{emit:T}){let E=u,D=T,{t:O}=e(),{cameraOptions:k,getSensorTypes:A,useSensorInstances:j,getPropertiesForSensor:M}=g(),N=c(()=>E.data.cameraId?A(E.data.cameraId).filter(e=>!e.meta.isDetectionType).map(e=>({label:O(`components.camera_options.sensor_type_${e.value}`),value:e.value})):[]),{instanceOptions:P,isLoading:F}=j(c(()=>E.data.cameraId||void 0),c(()=>E.data.sensorType||t.Contact)),I=c(()=>!E.data.sensorName||!E.data.sensorPluginId?``:`${E.data.sensorName}::${E.data.sensorPluginId}`),L=c(()=>P.value.map(e=>({label:e.label,value:`${e.sensorName}::${e.pluginId}`}))),R=c(()=>E.data.sensorType?M(E.data.sensorType):[]);function z(e){D(`update:data`,{cameraId:e,sensorType:``,sensorName:``,sensorPluginId:``,property:``})}function B(e){D(`update:data`,{sensorType:e,sensorName:``,sensorPluginId:``,properties:[]})}function V(e){let[t,n]=String(e).split(`::`);D(`update:data`,{sensorName:t,sensorPluginId:n,properties:[]})}function H(e,t){D(`update:data`,{[e]:t})}return(e,t)=>{let c=m,g=h,T=p;return f(),a(`div`,_,[i(`div`,v,[t[1]||=i(`label`,{class:`cui-label`},`Camera`,-1),d(c,{"model-value":u.data.cameraId,options:r(k),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":z},null,8,[`model-value`,`options`])]),i(`div`,y,[i(`label`,b,n(r(O)(`components.automation_nodes.sensor_type_label`)),1),d(c,{"model-value":u.data.sensorType,options:r(N),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor type`,class:`w-full`,disabled:!u.data.cameraId,"onUpdate:modelValue":B},null,8,[`model-value`,`options`,`disabled`])]),u.data.sensorType?(f(),a(`div`,x,[i(`label`,S,n(r(O)(`components.automation_nodes.sensor_instance`)),1),d(c,{"model-value":r(I),options:r(L),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor`,class:`w-full`,loading:r(F),"onUpdate:modelValue":V},null,8,[`model-value`,`options`,`loading`])])):s(``,!0),i(`div`,C,[i(`label`,w,n(r(O)(`components.automation_nodes.sensor_properties`)),1),d(g,{"model-value":u.data.properties,options:r(R),"option-label":`label`,"option-value":`value`,placeholder:r(O)(`components.automation_nodes.sensor_properties_placeholder`),class:`w-full`,disabled:!u.data.sensorName,"onUpdate:modelValue":t[0]||=e=>H(`properties`,e)},null,8,[`model-value`,`options`,`placeholder`,`disabled`]),d(T,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[l(n(r(O)(`components.automation_nodes.sensor_properties_hint`)),1)]),_:1})])])}}});export{T as default};
1
+ import{Ar as e,nn as t}from"./vendor-cameraui-QuTJKoXE.js";import{Er as n,Sr as r,dn as i,mn as a,nr as o,pn as s,un as c,vn as l,xn as u,yn as d,zn as f}from"./vendor-ClrOISZp.js";import{F as p,O as m,l as h}from"./vendor-primevue-BdB7McKg.js";import{t as g}from"./useCameraOptions-nvj6-uZg.js";var _={class:`flex flex-col gap-4`},v={class:`flex flex-col field-gap`},y={class:`flex flex-col field-gap`},b={class:`cui-label`},x={key:0,class:`flex flex-col field-gap`},S={class:`cui-label`},C={class:`flex flex-col field-gap`},w={class:`cui-label`},T=u({__name:`ConfigTriggerSensor`,props:{data:{}},emits:[`update:data`],setup(u,{emit:T}){let E=u,D=T,{t:O}=e(),{cameraOptions:k,getSensorTypes:A,useSensorInstances:j,getPropertiesForSensor:M}=g(),N=c(()=>E.data.cameraId?A(E.data.cameraId).filter(e=>!e.meta.isDetectionType).map(e=>({label:O(`components.camera_options.sensor_type_${e.value}`),value:e.value})):[]),{instanceOptions:P,isLoading:F}=j(c(()=>E.data.cameraId||void 0),c(()=>E.data.sensorType||t.Contact)),I=c(()=>!E.data.sensorName||!E.data.sensorPluginId?``:`${E.data.sensorName}::${E.data.sensorPluginId}`),L=c(()=>P.value.map(e=>({label:e.label,value:`${e.sensorName}::${e.pluginId}`}))),R=c(()=>E.data.sensorType?M(E.data.sensorType):[]);function z(e){D(`update:data`,{cameraId:e,sensorType:``,sensorName:``,sensorPluginId:``,property:``})}function B(e){D(`update:data`,{sensorType:e,sensorName:``,sensorPluginId:``,properties:[]})}function V(e){let[t,n]=String(e).split(`::`);D(`update:data`,{sensorName:t,sensorPluginId:n,properties:[]})}function H(e,t){D(`update:data`,{[e]:t})}return(e,t)=>{let c=m,g=h,T=p;return f(),a(`div`,_,[i(`div`,v,[t[1]||=i(`label`,{class:`cui-label`},`Camera`,-1),d(c,{"model-value":u.data.cameraId,options:r(k),"option-label":`label`,"option-value":`value`,placeholder:`Select camera`,class:`w-full`,"onUpdate:modelValue":z},null,8,[`model-value`,`options`])]),i(`div`,y,[i(`label`,b,n(r(O)(`components.automation_nodes.sensor_type_label`)),1),d(c,{"model-value":u.data.sensorType,options:r(N),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor type`,class:`w-full`,disabled:!u.data.cameraId,"onUpdate:modelValue":B},null,8,[`model-value`,`options`,`disabled`])]),u.data.sensorType?(f(),a(`div`,x,[i(`label`,S,n(r(O)(`components.automation_nodes.sensor_instance`)),1),d(c,{"model-value":r(I),options:r(L),"option-label":`label`,"option-value":`value`,placeholder:`Select sensor`,class:`w-full`,loading:r(F),"onUpdate:modelValue":V},null,8,[`model-value`,`options`,`loading`])])):s(``,!0),i(`div`,C,[i(`label`,w,n(r(O)(`components.automation_nodes.sensor_properties`)),1),d(g,{"model-value":u.data.properties,options:r(R),"option-label":`label`,"option-value":`value`,placeholder:r(O)(`components.automation_nodes.sensor_properties_placeholder`),class:`w-full`,disabled:!u.data.sensorName,"onUpdate:modelValue":t[0]||=e=>H(`properties`,e)},null,8,[`model-value`,`options`,`placeholder`,`disabled`]),d(T,{severity:`secondary`,variant:`simple`,size:`small`,class:`cui-input-hint`},{default:o(()=>[l(n(r(O)(`components.automation_nodes.sensor_properties_hint`)),1)]),_:1})])])}}});export{T as default};