@camstack/addon-admin-ui 1.2.645 → 1.2.647

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 (126) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/assets/Addons-C1rCMYSj.js +5 -0
  3. package/dist/assets/{AdminPage-CgQxV6oS.js → AdminPage-Cve4EeKX.js} +1 -1
  4. package/dist/assets/AdminSectionedPage-V0guU8PD.js +1 -0
  5. package/dist/assets/AiProfiles-COv7z6F-.js +3 -0
  6. package/dist/assets/{BootstrapSettingsForm-BoEmD1zV.js → BootstrapSettingsForm-DtS11lHd.js} +1 -1
  7. package/dist/assets/Build-D5T3SI7b.js +40 -0
  8. package/dist/assets/{Calendars-DJwzxqLu.js → Calendars-BhsUg2gV.js} +1 -1
  9. package/dist/assets/{CameraGrids-BgccN5Pj.js → CameraGrids-CM8Yxxdq.js} +1 -1
  10. package/dist/assets/{Cluster-BsENeR0i.js → Cluster-BP9fRDMS.js} +1 -1
  11. package/dist/assets/CompositionBlockEditor-xQIVx_j0.js +2 -0
  12. package/dist/assets/{CompositionEditorPage-TUBCxwY3.js → CompositionEditorPage-DHUcurin.js} +1 -1
  13. package/dist/assets/Data-DJbrnaPU.js +2 -0
  14. package/dist/assets/DeviceDetail-CaQ51F0f.js +2 -0
  15. package/dist/assets/{Devices-RQLZEgPY.js → Devices-Cf3ZTJ1J.js} +1 -1
  16. package/dist/assets/{EmbedDevicePage-ZLq8d2iA.js → EmbedDevicePage-B9J6ucMX.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-CAIQaXj7.js → EmbedPlayerPage-DP7b5VUK.js} +1 -1
  18. package/dist/assets/History-Dx7eMiJH.js +1 -0
  19. package/dist/assets/Identity-D3MJ59NJ.js +1 -0
  20. package/dist/assets/InstancesTable-bYSuSJuI.js +1 -0
  21. package/dist/assets/IntegrationDetail-c2pjtV64.js +1 -0
  22. package/dist/assets/IntegrationWizard-DpekcaJ2.js +1 -0
  23. package/dist/assets/Integrations-B4MvBXRJ.js +1 -0
  24. package/dist/assets/{Integrations-uNKI4ENy.js → Integrations-Ci8Mqya9.js} +2 -2
  25. package/dist/assets/Library-D0tz7PS_.js +1 -0
  26. package/dist/assets/Locations-BFeQBE-F.js +3 -0
  27. package/dist/assets/Logs-DtjMaCC4.js +1 -0
  28. package/dist/assets/{MaskShapeCanvas-B3zP9xT5.js → MaskShapeCanvas-DsRgL9Jd.js} +1 -1
  29. package/dist/assets/{MotionZonesSettings-DKBKT9aJ.js → MotionZonesSettings-BWECPN2p.js} +1 -1
  30. package/dist/assets/MyAccess-B83bBSQi.js +2 -0
  31. package/dist/assets/Network-BF1ofy4e.js +1 -0
  32. package/dist/assets/NodeAddonsSettingsPanel-BhNHsNDz.js +2 -0
  33. package/dist/assets/Notifications-BDmKjk8l.js +1 -0
  34. package/dist/assets/Pipeline-3BkMMjQC.js +1 -0
  35. package/dist/assets/{PrivacyMaskSettings-CK9hqTRF.js → PrivacyMaskSettings-CxsDkPmw.js} +1 -1
  36. package/dist/assets/Recordings-CdbZm7N3.js +1 -0
  37. package/dist/assets/{RemoteGrid-i8wKPofF.js → RemoteGrid-D9lQtkK4.js} +1 -1
  38. package/dist/assets/{ScanSubnetEditor-DgQG14u4.js → ScanSubnetEditor-D1wWQv5l.js} +1 -1
  39. package/dist/assets/{SceneMonitorEditor-C7BzyuY3.js → SceneMonitorEditor-Bgq5w1mw.js} +1 -1
  40. package/dist/assets/SessionsList-AtYEgm7p.js +2 -0
  41. package/dist/assets/{Showroom-v5DKHm7R.js → Showroom-BCX4Yyt6.js} +1 -1
  42. package/dist/assets/StorageLocationsTable-CInEvHND.js +1 -0
  43. package/dist/assets/{System-jjlBGk9U.js → System-DvinM4KN.js} +1 -1
  44. package/dist/assets/{Templates-DKBo80nE.js → Templates-AolwZ6TI.js} +1 -1
  45. package/dist/assets/{Terminal-CFo4OCRV.js → Terminal-DoBiePC-.js} +5 -5
  46. package/dist/assets/{TrainingProviders-LmHCsEEc.js → TrainingProviders-BKZ0teUD.js} +1 -1
  47. package/dist/assets/{Viewer-KhrX-QoU.js → Viewer-q6dKXR67.js} +1 -1
  48. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BPtmPLBq.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-M59fwoAQ.js} +1 -1
  49. package/dist/assets/{action-draft-Ct8_GVdJ.js → action-draft-DB5j6cca.js} +1 -1
  50. package/dist/assets/{ai-page.helpers-3SnxNBNh.js → ai-page.helpers-CQPhp13c.js} +1 -1
  51. package/dist/assets/{assignment-candidates-CMQomrma.js → assignment-candidates-C5pHZht5.js} +1 -1
  52. package/dist/assets/{authed-media-CS1SYJIb.js → authed-media-Q5YVSoIj.js} +1 -1
  53. package/dist/assets/{board-model-COvoDWAk.js → board-model-CpqXB5lD.js} +1 -1
  54. package/dist/assets/client-Dzzkm60X.js +1114 -0
  55. package/dist/assets/command-vocab-Dk_f6ivd.js +1 -0
  56. package/dist/assets/create-composition-k03FONcQ.js +1 -0
  57. package/dist/assets/device-detail-okAAAxvr.js +1 -0
  58. package/dist/assets/{device-integration-icon-dOu9Eloe.js → device-integration-icon-CzQF4KNa.js} +1 -1
  59. package/dist/assets/device-picker-model-DkSaYUyU.js +1 -0
  60. package/dist/assets/dist-C0Eyz4-R.js +1114 -0
  61. package/dist/assets/{dist-BSIDIvPv.js → dist-Dx1IuG2H.js} +1 -1
  62. package/dist/assets/{format-CnAMMCKO.js → format-BoPK6WDS.js} +1 -1
  63. package/dist/assets/{hostInit-5hZWUgB1.js → hostInit-JJE2ncUY.js} +1 -1
  64. package/dist/assets/i18n-DWUEvjgE.js +1 -0
  65. package/dist/assets/icons-Dhc1mBIs.js +1 -0
  66. package/dist/assets/index-DKKQtgP2.js +4 -0
  67. package/dist/assets/index-DcUA-A3F.css +2 -0
  68. package/dist/assets/{linked-devices-model-C9-KwysR.js → linked-devices-model-XNuspKgG.js} +1 -1
  69. package/dist/assets/{mf-entry-bootstrap-0-da7ca43d.js → mf-entry-bootstrap-0-0cbecd57.js} +2 -2
  70. package/dist/assets/mount-DkSaYUyU.js +1 -0
  71. package/dist/assets/{notification-rule-status-CXntp3K9.js → notification-rule-status-7H1KxBu5.js} +1 -1
  72. package/dist/assets/player-overlays-DpoShe47.js +1 -0
  73. package/dist/assets/remoteEntry-DhUUWtf1.js +1 -0
  74. package/dist/assets/src-CvlhNDJc.js +253 -0
  75. package/dist/assets/step-inspector-model-B1WjzUY-.js +1 -0
  76. package/dist/assets/{use-scenes-feed-BoR1Y-VE.js → use-scenes-feed-Dx37Wfqx.js} +1 -1
  77. package/dist/assets/{use-stationary-objects-DkXKafj7.js → use-stationary-objects-CVyIgKy4.js} +1 -1
  78. package/dist/assets/{useAdminDeviceRemoval-DkVpT6r5.js → useAdminDeviceRemoval-Dfw_WOjy.js} +1 -1
  79. package/dist/assets/useEventInvalidation-DkSaYUyU.js +1 -0
  80. package/dist/assets/{useNodeUrlSelection--lZvqvct.js → useNodeUrlSelection-C7M0t1Bu.js} +1 -1
  81. package/dist/assets/useTemplateSave-BXH2v4XY.js +1 -0
  82. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-T6WBMt1q.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BZIvKvKs.js} +2 -2
  83. package/dist/index.html +8 -8
  84. package/dist/server/addon.js +404 -58
  85. package/package.json +2 -2
  86. package/dist/assets/Addons-CWDe2ysB.js +0 -5
  87. package/dist/assets/AdminSectionedPage-CSjSmB74.js +0 -1
  88. package/dist/assets/AiProfiles-DnluoNPk.js +0 -3
  89. package/dist/assets/Build-DMVoPRyS.js +0 -40
  90. package/dist/assets/CompositionBlockEditor-DudbSZVo.js +0 -2
  91. package/dist/assets/Data-DOpOAfYo.js +0 -2
  92. package/dist/assets/DeviceDetail-CIRWTBj8.js +0 -2
  93. package/dist/assets/History-y3xgB62I.js +0 -1
  94. package/dist/assets/Identity-Dfwm4Ys2.js +0 -1
  95. package/dist/assets/InstancesTable-DB74t0Si.js +0 -1
  96. package/dist/assets/IntegrationDetail-Bg4fgH_7.js +0 -1
  97. package/dist/assets/IntegrationWizard-B_hF-vL9.js +0 -1
  98. package/dist/assets/Integrations-BzHSRaCH.js +0 -1
  99. package/dist/assets/Library-IqKySZef.js +0 -1
  100. package/dist/assets/Locations-BzytI3mX.js +0 -3
  101. package/dist/assets/Logs-BQWbxkE0.js +0 -1
  102. package/dist/assets/MyAccess-t_EwSJ61.js +0 -2
  103. package/dist/assets/Network-w5dWUXr3.js +0 -1
  104. package/dist/assets/NodeAddonsSettingsPanel-Bd8yv-Cb.js +0 -2
  105. package/dist/assets/Notifications-BZPoCLb7.js +0 -1
  106. package/dist/assets/Pipeline-AOTD3jWE.js +0 -1
  107. package/dist/assets/Recordings-Ck1Xvyur.js +0 -1
  108. package/dist/assets/SessionsList-Cg0IcV2U.js +0 -2
  109. package/dist/assets/StorageLocationsTable-Bs0wRBcX.js +0 -1
  110. package/dist/assets/client-BkrADwlo.js +0 -951
  111. package/dist/assets/command-vocab-_m2oGZgY.js +0 -1
  112. package/dist/assets/create-composition-B8m0P0Ka.js +0 -1
  113. package/dist/assets/device-detail-G-NTu_Fh.js +0 -1
  114. package/dist/assets/device-picker-model-Crk-zo39.js +0 -1
  115. package/dist/assets/dist-DD36UXJv.js +0 -951
  116. package/dist/assets/i18n-BArP6ThS.js +0 -1
  117. package/dist/assets/icons-2IlNe3Rh.js +0 -1
  118. package/dist/assets/index-0ukvsxX5.css +0 -2
  119. package/dist/assets/index-B5lClYc_.js +0 -4
  120. package/dist/assets/mount-Crk-zo39.js +0 -1
  121. package/dist/assets/player-overlays-BGlMiuNC.js +0 -1
  122. package/dist/assets/remoteEntry-Oo10s4gX.js +0 -1
  123. package/dist/assets/src-BNDWAXGm.js +0 -230
  124. package/dist/assets/step-inspector-model-DXIzeAZ0.js +0 -1
  125. package/dist/assets/useEventInvalidation-Crk-zo39.js +0 -1
  126. package/dist/assets/useTemplateSave-NBDCe0sx.js +0 -1
@@ -1 +0,0 @@
1
- function e(e){return typeof e.deviceId==`number`?e.deviceId:e.target?.kind===`devices`&&e.target.ids.length===1?e.target.ids[0]??null:null}function t(e){if(e.deviceId!==void 0)return e.deviceId;let t=e.target;return t?.kind===`devices`?t.ids.length===1?t.ids[0]??[]:t.ids:t?.kind===`var`?{$var:t.name}:[]}var n=/(\{[A-Za-z0-9_]+\})/;function r(e){return e.toLowerCase().startsWith(`it`)?`it`:`en`}function i(e){return`${e.cap}:${e.id}`}function a(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length===1&&t[0]===`$var`&&typeof Reflect.get(e,`$var`)==`string`}function o(e){let t=[];for(let r of e.split(n))r!==``&&(r.startsWith(`{`)&&r.endsWith(`}`)?t.push({kind:`slot`,key:r.slice(1,-1)}):t.push({kind:`text`,text:r}));return t}function s(e){let t=e.offer;switch(t.kind){case`number`:return{kind:`fixed`,value:t.min??0,...t.quantity===void 0||t.unit===void 0?{}:{unit:t.unit}};case`enum`:{let e=t.values[0];return{kind:`fixed`,value:e===void 0?``:e.value}}case`boolean`:return{kind:`fixed`,value:!1};default:return{kind:`fixed`,value:``}}}function c(e){return Object.fromEntries(e.openArgs.map(e=>[e.key,s(e)]))}function l(e,t,n){if(a(e))return{kind:`var`,name:e.$var};let r=u(t);return typeof e==`number`&&r!==void 0?{kind:`fixed`,value:e,unit:n??r.unit}:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?{kind:`fixed`,value:e}:s(t)}function u(e){let t=e.offer;if(!(t.kind!==`number`||t.quantity===void 0||t.unit===void 0))return{quantity:t.quantity,unit:t.unit,min:t.min,max:t.max}}function d(e,t){return JSON.stringify(e)===JSON.stringify(t)}function f(t,n){if(e(n)===null)return null;let r=n.args??{},i=null,a=-1;for(let e of t){if(e.cap!==n.cap||e.method!==n.method)continue;let t=Object.entries(e.args);t.every(([e,t])=>d(r[e],t))&&t.length>a&&(i=e,a=t.length)}if(i===null)return null;let o=Object.fromEntries(i.openArgs.map(e=>[e.key,l(r[e.key],e,n.argUnits?.[e.key])]));return{action:i,values:o}}function p(e){return e.kind===`var`?{$var:e.name}:e.value}function m(e){return e.kind===`fixed`&&e.value===``}function h(e,t,n){let r={},i={};for(let t of e.openArgs){let e=n[t.key]??s(t);t.optional===!0&&m(e)||(r[t.key]=p(e),e.kind===`fixed`&&e.unit!==void 0&&u(t)!==void 0&&(i[t.key]=e.unit))}let a={...e.args,...r};return{kind:`cap`,deviceId:t,cap:e.cap,method:e.method,...Object.keys(a).length===0?{}:{args:a},...Object.keys(i).length===0?{}:{argUnits:i}}}function g(e,t){if(t.kind===`var`)return null;let n=e.offer;return n.kind===`number`?typeof t.value!=`number`||!Number.isFinite(t.value)?`empty`:n.min!==void 0&&t.value<n.min?`below`:n.max!==void 0&&t.value>n.max?`above`:null:n.kind===`text`||n.kind===`dynamic`?e.optional===!0||t.value!==``?null:`empty`:null}export{c as a,t as c,o as d,r as f,s as i,u as l,h as n,a as o,i as r,f as s,g as t,e as u};
@@ -1 +0,0 @@
1
- import{C as e,K as t,S as n,Y as r,a as i,et as a,x as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{gt as s,ut as c}from"./player-overlays-BGlMiuNC.js";import{Cn as l,Sn as u,Tn as d,_n as f,bn as p,vn as m,wn as h,xn as g,yn as _}from"./client-BkrADwlo.js";import{t as v}from"./boxes-k5PsZ3NR.js";import{Ai as y,Bi as b,C as x,Ci as S,D as C,Oi as w,Pi as T,Ri as E,S as D,Vi as O,af as k,g as A,nt as j,qo as M,to as N,w as P,zi as F}from"./src-BNDWAXGm.js";import{t as I}from"./i18n-BArP6ThS.js";import{t as L}from"./useTranslation-BJr-n0es.js";import"./index-B5lClYc_.js";import{Dt as ee,Et as R,t as te}from"./CompositionBlockEditor-DudbSZVo.js";import{a as ne,c as re,d as ie,f as ae,i as oe,l as z,n as B,r as V,s as se,t as ce,u as le}from"./command-vocab-_m2oGZgY.js";a();var H=`mt-1 w-full rounded border border-border bg-background px-2 py-1 text-xs`,U=`block text-[11px] font-medium text-foreground`,W=`deviceId`;function ue(e,t){return t.length===0?0:t.length===1?t[0]:t.find(t=>!e.includes(t))??t[t.length-1]}function de(e,t,n){if(t.length===0)return[];if(t.length===1)return t;let r=t.find(t=>!e.includes(t));if(r===void 0)return t;let i=n(r);if(i===void 0)return[r];let a=e[0]??t.find(e=>e!==r);if(a===void 0)return[r];let o=n(a);return o===void 0||!d(o,i)?[r]:t.filter(e=>{let t=n(e);return t!==void 0&&d(o,t)})}function G(e){return e.length===0?0:e.length===1?e[0]:[...e]}function fe(e){return typeof e==`number`?e>0?[e]:[]:Array.isArray(e)?e.filter(e=>e>0):[]}function pe(e,t){return{deviceId:e,cap:t.cap,method:t.method,...t.args===void 0?{}:{args:{...t.args}}}}function me(e,t){return I.t(`deviceDoAction.customLabel`,{name:`${e}.${t}`})}function he({value:r,onChange:i,devices:a,listState:o,fleet:s,allowTriggerDevice:f=!1,allowMultiSameFamily:v=!1,testId:y=`device-do-action`}){let{t:b}=L(),x=typeof r.deviceId!=`number`&&!Array.isArray(r.deviceId),S=fe(r.deviceId),w=t(()=>a.filter(e=>l(String(e.type??``))),[a]),T=t(()=>{let e=new Map;for(let t of w)t.type!==void 0&&t.type!==null&&e.set(t.id,String(t.type));return e},[w]),E=t(()=>{if(!v||S.length===0)return w;let e=T.get(S[0]);return e===void 0?w:w.filter(t=>{if(S.includes(t.id))return!0;let n=t.type!==void 0&&t.type!==null?String(t.type):void 0;return n!==void 0&&d(e,n)})},[v,S,w,T]),D=R(!v&&S.length===1?S[0]:0),O=ee(v?S:[]),A=t(()=>x?g():S.length===0?[]:v?O.isLoading&&O.data===void 0?[]:p(S.map(e=>({boundCaps:O.data?.get(e),deviceType:T.get(e)}))):D.data===void 0&&D.isLoading?[]:_({boundCaps:D.data,deviceType:T.get(S[0])}),[x,S,v,O.data,O.isLoading,D.data,D.isLoading,T]),j=u(r.cap,r.method,r.args),M=h(r.cap,r.method,r.args),N=r.cap!==``&&r.method!==``&&M===null&&(x||S.length>0),P=v?O.isLoading:D.isLoading,F=v?O.isError:D.isError,I=e=>{if(e.startsWith(`custom:`))return;let t=m.find(t=>t.id===e);t!==void 0&&i(pe(x?r.deviceId:S.length>0?G(S):w[0]?.id??0,t))};return e(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,"data-testid":y,children:[f&&e(`div`,{className:`w-full max-w-xs`,children:[n(`label`,{className:U,children:b(`deviceDoAction.deviceDoActionFields.target`,`Target`)}),e(c,{wrapperClassName:`inline-block w-auto`,className:H,"data-testid":`${y}-target`,value:x?`trigger`:`device`,onChange:e=>{if(e.target.value===`trigger`){i({deviceId:{$var:W},cap:``,method:``});return}i({deviceId:w[0]?.id??0,cap:``,method:``})},children:[n(`option`,{value:`device`,children:b(`deviceDoAction.deviceDoActionFields.specificDevice`,`Specific device`)}),n(`option`,{value:`trigger`,children:b(`deviceDoAction.deviceDoActionFields.theDeviceThatTriggeredThis`,`The device that triggered this run`)})]})]}),!x&&e(`div`,{"data-testid":`${y}-device`,children:[n(`label`,{className:U,children:b(`deviceDoAction.deviceLabel`,{count:v?2:1})}),n(C,{devices:E,listState:o,...s===void 0?{}:{fleet:s},value:[...S],onChange:e=>{i({deviceId:G(v?de(S,e,e=>T.get(e)):(()=>{let t=ue(S,e);return t>0?[t]:[]})()),cap:``,method:``})},emptyLabel:v?`No devices selected`:`No device selected`,noun:`device`,testId:`${y}-device-picker`}),v&&S.length>1&&n(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:b(`deviceDoAction.deviceDoActionFields.sameFamilyOnlyTheAction`,`Same family only — the action runs on each selected device.`)})]}),e(`div`,{className:`w-full max-w-sm`,children:[n(`label`,{className:U,children:b(`deviceDoAction.deviceDoActionFields.action`,`Action`)}),e(c,{wrapperClassName:`inline-block w-auto`,className:H,"data-testid":`${y}-action`,value:j===`custom:${r.cap}.${r.method}`?j:M?.id??``,disabled:!x&&(S.length===0||P),onChange:e=>I(e.target.value),children:[n(`option`,{value:``,children:!x&&S.length===0?b(`deviceDoAction.deviceDoActionFields.pickADeviceFirst`,`Pick a device first`):P?b(`deviceDoAction.deviceDoActionFields.loadingActions`,`Loading actions…`):A.length===0?b(`deviceDoAction.deviceDoActionFields.noActionsForThisDevice`,`No actions for this device`):b(`deviceDoAction.deviceDoActionFields.selectAnAction`,`Select an action…`)}),N&&n(`option`,{value:j,children:me(r.cap,r.method)}),A.map(e=>n(`option`,{value:e.id,children:e.label},e.id))]}),F&&n(`p`,{className:`mt-1 text-[11px] text-warning`,children:b(`deviceDoAction.deviceDoActionFields.couldNotReadThisDevice`,`Could not read this device’s capabilities.`)})]}),M?.openArgs!==void 0&&M.openArgs.length>0&&n(`div`,{className:`flex flex-col gap-2`,children:M.openArgs.map(t=>{let a=r.args?.[t.key],o=typeof a==`string`||typeof a==`number`?String(a):``;return e(`div`,{className:`w-full max-w-sm`,children:[n(`label`,{className:U,htmlFor:`${y}-${t.key}`,children:t.label}),n(k,{id:`${y}-${t.key}`,className:H,"data-testid":`${y}-${t.key}`,type:t.kind===`number`?`number`:`text`,value:o,onChange:e=>{let n=e.target.value,a=r.args===void 0?{}:{...r.args};if(n===``)delete a[t.key];else if(t.kind===`number`){let e=Number(n);Number.isNaN(e)?delete a[t.key]:a[t.key]=e}else a[t.key]=n;i(Object.keys(a).length>0?{...r,args:a}:{deviceId:r.deviceId,cap:r.cap,method:r.method})}})]},t.key)})})]})}a();function K({devices:e,value:r,onChange:i,selection:a,noun:o=`device`,listState:s=`answered`,emptyLabel:c,testId:l}){return n(C,{devices:t(()=>e.map(e=>({id:e.id,name:e.name,...e.type===void 0?{}:{type:e.type},location:e.location??null})),[e]),listState:s,value:[...r],onChange:e=>i(e),selection:a,noun:o,groupBy:`location`,...c===void 0?{}:{emptyLabel:c},testId:l})}a();function ge(e){return e===void 0||!Number.isFinite(e)?``:String(e)}function q({value:e,onValue:t,onBrace:i,onBlur:a,...o}){let[s,c]=r(null);return n(k,{...o,inputMode:`decimal`,value:s??ge(e),onChange:e=>{let n=e.target.value;if(n.includes(`{`)){i?.();return}c(n);let r=n.trim()===``?NaN:Number(n);t(Number.isFinite(r)?r:null)},onBlur:e=>{c(null),a?.(e)}})}function J(e){return e.kind===`dynamic`}function _e(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function ve(e){return e.from===`method`?e.method:`getStatus`}function Y(e,t){return typeof e==`object`&&e?Reflect.get(e,t):void 0}function X(e){return typeof e==`string`||typeof e==`number`}function ye(e,t){let n=t.from===`status`?Y(e,t.field):e;if(!Array.isArray(n))return[];let r=[];for(let e of n){if(t.where!==void 0&&Y(e,t.where.key)!==t.where.equals)continue;let n=t.valueKey===void 0?e:Y(e,t.valueKey);if(!X(n))continue;let i=t.labelKey===void 0?n:Y(e,t.labelKey);r.push({value:n,label:X(i)?String(i):String(n)})}return r}function Z({widthClass:e,...t}){return n(`span`,{className:`block max-w-full ${e}`,children:n(c,{...t})})}a();function Q(e){return e.kind===`fixed`?String(e.value):``}function be({arg:t,locale:i,variables:a,value:o,onChange:s,choices:c}){let{t:l}=L(),[u,d]=r(!1),f=t.label[i],p=ce(t,o),m=o.kind===`var`?n(y,{label:o.name,onRemove:()=>s(oe(t))}):n(xe,{arg:t,locale:i,value:o,onChange:s,onBrace:()=>d(!0),choices:c});return e(`span`,{className:`inline-flex flex-col gap-0.5 align-top`,"data-testid":`arg-${t.key}`,children:[e(`span`,{className:`inline-flex items-center gap-1`,children:[m,a.length>0&&e(E,{open:u,onOpenChange:d,children:[n(O,{"aria-label":l(`flow.arg.useVariable`,`Use a variable for {{label}}`,{label:f}),className:`h-8 rounded-md border border-border bg-surface px-2 font-mono text-xs text-foreground hover:bg-surface-hover`,children:`{x}`}),n(F,{children:a.map(e=>n(b,{onClick:()=>s({kind:`var`,name:e.name}),children:`${e.name} · ${e.hint}`},e.name))})]})]}),n(Ce,{arg:t,value:o,issue:p})]})}function xe({arg:e,locale:t,value:r,onChange:i,onBrace:a,choices:o}){let{t:s}=L(),c=e.offer,l=e.label[t];if(J(c)&&o?.state===`ready`){let t=o.choices.some(e=>e.value===r.value);return n(Z,{widthClass:`w-48`,"aria-label":l,"data-testid":`dynamic-${e.key}`,value:String(r.value),onChange:e=>{let t=o.choices.find(t=>String(t.value)===e.target.value);t!==void 0&&i({kind:`fixed`,value:t.value})},options:[...t?[]:[{value:String(r.value),label:r.value===``?s(`flow.arg.choose`,`Choose…`):String(r.value)}],...o.choices.map(e=>({value:String(e.value),label:e.label}))]})}if(c.kind===`enum`)return n(Z,{widthClass:`w-40`,"aria-label":l,value:String(r.value),onChange:e=>{let t=c.values.find(t=>String(t.value)===e.target.value);t!==void 0&&i({kind:`fixed`,value:t.value})},options:c.values.map(e=>({value:String(e.value),label:e.label[t]}))});if(c.kind===`boolean`)return n(Z,{widthClass:`w-28`,"aria-label":l,value:r.value===!0?`yes`:`no`,onChange:e=>i({kind:`fixed`,value:e.target.value===`yes`}),options:[{value:`yes`,label:s(`common.yes`,`Yes`)},{value:`no`,label:s(`common.no`,`No`)}]});let u=z(e);return u===void 0?c.kind===`number`?n(Se,{label:l,unit:c.unit,value:r,onChange:i,onBrace:a}):c.kind===`text`&&c.secret===!0?n(k,{"aria-label":l,type:`password`,className:`w-40`,value:Q(r),onChange:e=>i({kind:`fixed`,value:e.target.value})}):n(A,{label:l,className:`flex w-56 flex-col gap-1`,testId:`arg-text-${e.key}`,value:Q(r),onChange:e=>i({kind:`fixed`,value:e})}):n(D,{quantity:u.quantity,storedUnit:u.unit,value:typeof r.value==`number`?r.value:void 0,unit:r.unit,min:u.min,max:u.max,"aria-label":l,onBrace:a,onChange:e=>{let t=P(e,u.unit);i({kind:`fixed`,value:t.value,unit:t.unit})}})}function Se({label:t,unit:r,value:i,onChange:a,onBrace:s}){return e(o,{children:[n(q,{"aria-label":t,className:`w-20`,value:typeof i.value==`number`?i.value:void 0,onValue:e=>a({kind:`fixed`,value:e??NaN}),onBrace:s}),r!==void 0&&n(`span`,{className:`text-sm text-foreground-muted`,children:r})]})}function Ce({arg:e,value:t,issue:r}){let{t:i}=L(),a=e.offer;if(t.kind!==`fixed`||a.kind!==`number`||a.min===void 0&&a.max===void 0)return null;let o=z(e),s=o===void 0?a.unit:t.unit??o.unit,c=o===void 0?{min:a.min,max:a.max}:x({min:a.min,max:a.max},o.unit,s??o.unit),l=s??``,u=e=>e===void 0||o===void 0?e:Number(e.toPrecision(4)),d={min:u(c.min),max:u(c.max)},f=d.min!==void 0&&d.max!==void 0?i(`flow.arg.range`,`{{min}} to {{max}} {{unit}}`,{min:d.min,max:d.max,unit:l}):d.min===void 0?i(`flow.arg.atMost`,`at most {{max}} {{unit}}`,{max:d.max,unit:l}):i(`flow.arg.atLeast`,`at least {{min}} {{unit}}`,{min:d.min,unit:l});return n(`span`,{className:`text-[11px] ${r===null?`text-foreground-subtle`:`text-danger`}`,role:r===null?void 0:`alert`,children:f.trim()})}var we=3e4;function Te(e){return typeof e==`object`&&!!e&&typeof Reflect.get(e,`query`)==`function`}function Ee(e,t,n){let r=s(),a=n===null?``:ve(n),o=i({queryKey:[`build`,`dynamic-offer`,e,t,a],enabled:e!==null&&e>0&&n!==null,staleTime:we,retry:!1,queryFn:async()=>{let n=Reflect.get(r.trpcClient,_e(t)),i=typeof n==`object`&&n?Reflect.get(n,a):void 0;if(!Te(i)||e===null)throw Error(`no readable ${t}.${a}`);return i.query({deviceId:e})}});if(n===null||e===null)return{state:`unavailable`};if(o.isPending)return{state:`loading`};if(o.isError)return{state:`unavailable`};let c=ye(o.data,n);return c.length===0?{state:`unavailable`}:{state:`ready`,choices:c}}function De({deviceId:e,cap:t,arg:r,...i}){return n(be,{arg:r,choices:Ee(e,t,J(r.offer)?r.offer:null),...i})}a();function $(e){return typeof e==`number`?e:typeof e==`object`&&e&&`$var`in e?{$var:e.$var}:[...e]}function Oe(e,t,n){return e.map(e=>({value:V(e),label:e.label[t],description:e.phrase[t].replace(`{device}`,n)}))}function ke({step:i,devices:a,devicesState:o=`answered`,variables:s,onChange:c}){let{t:u,i18n:d}=L(),p=ae(d.language),[m,h]=r(!1),g=le(i),_=g!==null,v=g??0,y=a.find(e=>e.id===v),b=R(_?v:0),x=t(()=>b.data===void 0?[]:f(b.data,y?.type),[b.data,y?.type]),C=t(()=>se(x,i),[x,i]),E=i.cap===``,D=_&&v>0&&b.data===void 0&&!b.isError;if(!(_&&!m&&(E||C!==null||D)))return n(je,{step:i,devices:a,devicesState:o,onChange:c,onBack:_&&!E&&C!==null?()=>h(!1):null});let O=a.filter(e=>l(e.type??``));return e(`div`,{className:`space-y-2`,"data-testid":`command-step`,children:[e(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y?.type!==void 0&&n(w,{variant:`neutral`,children:y.type}),n(T,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:()=>h(!0),"data-testid":`command-step-advanced`,children:u(`flow.command.advanced`,`Advanced`)})]}),e(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[n(K,{devices:O,selection:`single`,listState:o,value:v>0?[v]:[],testId:`command-step-device`,onChange:e=>{let t=e[0]??0;t!==v&&c({kind:`cap`,deviceId:t,cap:``,method:``})}}),n(S,{mode:`single`,singleDisplay:`field`,options:Oe(x,p,y?.name??``),value:C===null?``:V(C.action),placeholder:v===0?u(`flow.command.pickDeviceFirst`,`Pick a device first`):u(`flow.command.pickCommand`,`Pick a command`),disabled:v===0||D,searchable:x.length>=8,emptyMessage:u(`flow.command.noCommands`,`This device has no commands to offer.`),onChange:e=>{let t=x.find(t=>V(t)===e);t!==void 0&&c(B(t,v,ne(t)))}})]}),C!==null&&n(Ae,{action:C.action,deviceId:v,values:C.values,deviceName:y?.name??``,locale:p,variables:s,onChange:e=>c(B(C.action,v,e))})]})}function Ae({action:e,deviceId:t,values:r,deviceName:i,locale:a,variables:o,onChange:s}){let c=[];return ie(e.phrase[a]).forEach((l,u)=>{if(l.kind===`text`){c.push(n(`span`,{children:l.text},`t${String(u)}`));return}if(l.key===`device`){c.push(n(`span`,{className:`font-medium`,children:i},`device`));return}let d=e.openArgs.find(e=>e.key===l.key),f=r[l.key];d===void 0||f===void 0||c.push(n(De,{deviceId:t,cap:e.cap,arg:d,locale:a,variables:o,value:f,onChange:e=>s({...r,[l.key]:e})},l.key))}),n(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-sm`,children:c})}function je({step:t,devices:r,devicesState:i,onChange:a,onBack:o}){let{t:s}=L();return e(`div`,{className:`space-y-2`,"data-testid":`command-step-generic`,children:[o!==null&&n(T,{variant:`ghost`,size:`sm`,onClick:o,children:s(`flow.command.backToSentence`,`Back to the sentence`)}),n(he,{value:{...t,deviceId:re(t)},allowTriggerDevice:!0,allowMultiSameFamily:!0,devices:r,listState:i,onChange:e=>a({kind:`cap`,deviceId:$(e.deviceId),cap:e.cap,method:e.method,...e.args===void 0?{}:{args:{...e.args}}})})]})}a();var Me=6e4;function Ne(){let e=M({projection:`slim`});return t(()=>{let t=new Map((e.data??[]).map(e=>[e.id,e.name]));return(e.data??[]).filter(e=>l(String(e.type))).map(e=>({id:e.id,name:e.name,stableId:e.stableId,addonId:e.addonId,type:String(e.type),location:e.location??null,parentName:e.parentDeviceId===null?null:t.get(e.parentDeviceId)??null})).toSorted((e,t)=>e.name.localeCompare(t.name))},[e.data])}function Pe(e){let t=s();return i({queryKey:[`automation`,`wireable-fields`,e],enabled:e>0,staleTime:Me,queryFn:async()=>(await t.trpcClient.deviceManager.getWireableFields.query({deviceId:e})).caps})}function Fe(e,t){return e.find(e=>e.cap===t)?.fields??[]}function Ie({blockId:e,onClose:t}){let{t:r}=L();return n(j,{open:e!==null,onClose:t,title:r(`build.customDeviceTab.editComposedDevice`,`Edit composed device`),icon:v,width:`xl`,testId:`composed-device-editor`,fill:!0,children:e!==null&&n(te,{blockId:e,fillHeight:!0})})}function Le(){return N()}export{Pe as a,q as c,Ne as i,K as l,Ie as n,ke as o,Fe as r,Z as s,Le as t};
@@ -1 +0,0 @@
1
- import{A as e,C as t,K as n,R as r,S as i,V as a,Y as o,d as s,et as c,k as l,u,x as d}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Da as f,Wt as p,it as m,ka as h,mt as g}from"./player-overlays-BGlMiuNC.js";import{Af as _,At as v,Br as y,Ed as b,Ei as x,Fu as S,Gr as C,Gt as w,Hr as T,If as ee,Iu as E,Kr as D,Kt as O,Lu as k,Mu as te,Nu as ne,Pi as A,Vr as j,Zt as M,jt as N,ki as P,pf as F,qt as I,xn as L}from"./src-BNDWAXGm.js";import{t as R}from"./i18n-BArP6ThS.js";import{n as z,t as B}from"./useTranslation-BJr-n0es.js";import{C as V,q as H}from"./index-B5lClYc_.js";import{n as U,r as W,t as G,v as K}from"./RemoteGrid-i8wKPofF.js";c();function q({i18n:t,defaultNS:r,children:i}){let a=n(()=>({i18n:t,defaultNS:r}),[t,r]);return e(z.Provider,{value:a},i)}c();function J({deviceId:e,button:n,sources:r,current:a,placement:s}){let{t:c}=B(),l=k(),[u,m]=o(!1),[h,g]=o(null);if(r.length===0)return null;let _=a===``?c(`remote.sourceSelect.label`):a,v=r.filter(e=>e.kind===`digits`),b=r.filter(e=>e.kind!==`digits`),x=async t=>{g(null);try{let n=await l.mutateAsync({deviceId:e,command:`selectSource`,source:t.name,repeat:1});if(n.status===`refused`){g(c(`remote.test.refused.${n.reason}`,{detail:n.detail??``}));return}if(n.status===`not-routed`){g(c(`remote.sourceSelect.notRouted`));return}m(!1)}catch(e){g(e instanceof Error?e.message:String(e))}};return t(d,{children:[t(A,{type:`button`,size:`sm`,variant:`secondary`,"aria-label":_,title:_,"data-testid":`remote-grid-button-${n.id}`,"data-widget":`source_select`,className:f(`z-10 h-full min-w-0 overflow-hidden border border-border px-2`,U(n.shape),W(n.tone)),style:s,onClick:()=>{g(null),m(!0)},children:[i(p,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),i(`span`,{className:`min-w-0 truncate text-xs`,children:_})]}),u&&i(y,{open:!0,onOpenChange:e=>!e&&m(!1),children:t(T,{width:`sm`,placement:`sheet-on-mobile`,scroll:`body`,children:[i(C,{children:i(D,{children:c(`remote.sourceSelect.title`)})}),t(j,{className:`space-y-3`,"data-testid":`source-picker`,children:[i(Y,{title:c(`remote.sourceSelect.channels`),sources:v,current:a,busy:l.isPending,onPick:e=>void x(e)}),i(Y,{title:c(`remote.sourceSelect.inputs`),sources:b,current:a,busy:l.isPending,onPick:e=>void x(e)}),h!==null&&i(`p`,{role:`alert`,className:`text-xs text-danger`,"data-testid":`source-picker-failure`,children:h})]})]})})]})}function Y({title:e,sources:n,current:r,busy:a,onPick:o}){return n.length===0?null:t(`section`,{className:`space-y-1`,children:[i(`h3`,{className:`text-xs font-medium uppercase tracking-wide text-foreground-muted`,children:e}),i(`ul`,{className:`space-y-1`,children:n.map(e=>i(`li`,{children:t(A,{type:`button`,variant:e.name===r?`secondary`:`ghost`,size:`sm`,disabled:a,className:`w-full justify-start gap-2`,"data-testid":`source-pick-${e.id}`,onClick:()=>o(e),children:[e.kind===`digits`&&i(`span`,{className:`w-10 shrink-0 text-right tabular-nums text-foreground-muted`,children:e.number}),i(`span`,{className:`min-w-0 truncate`,children:e.name})]})},e.id))})]})}c();function X({deviceId:e,deviceName:n}){let{t:r}=B(),a=_(`remote`),s=S({deviceId:e},{enabled:a===`present`}),[c,l]=o(!1);return a!==`present`||(s.data?.commands.length??0)===0&&(s.data?.sources.length??0)===0?null:t(`div`,{className:`flex flex-wrap items-center justify-center gap-1`,children:[t(A,{size:`sm`,variant:`outline`,onClick:()=>l(!0),"data-testid":`hero-remote`,children:[i(L,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),r(`remote.hero.open`)]}),c&&i(re,{deviceId:e,deviceName:n,onClose:()=>l(!1)})]})}function re({deviceId:e,deviceName:n,onClose:r}){let{t:a}=B(),s=ne({deviceId:e}),c=b({kind:`remote`}),l=S({deviceId:e}),u=E(),d=te({deviceId:e}),[f,p]=o(null),m=s.data?.layoutTemplateId??null,h=(c.data??[]).find(e=>e.id===m),g=h===void 0?null:K(h.payload),_=new Set((l.data?.commands??[]).map(e=>e.role)),v=async t=>{let n=g?.buttons.find(e=>e.id===t)?.role;if(!(n===void 0||!_.has(n))){p(null);try{let t=await u.mutateAsync({deviceId:e,role:n,repeat:1});t.status===`refused`&&p(a(`remote.test.refused.${t.reason}`,{detail:t.detail??``}))}catch(e){p(e instanceof Error?e.message:String(e))}}};return i(y,{open:!0,onOpenChange:e=>!e&&r(),children:t(T,{width:`md`,placement:`sheet-on-mobile`,scroll:`body`,children:[i(C,{children:i(D,{children:a(`remote.hero.title`,{name:n})})}),t(j,{className:`space-y-3`,children:[s.status===`error`?i(x,{title:a(`remote.dialog.unreadable`),message:s.error?.message??``,onRetry:()=>void s.refetch()}):g===null?i(`p`,{className:`text-xs text-foreground-muted`,children:a(`remote.hero.noLayout`)}):i(`div`,{className:`mx-auto w-full max-w-xs`,"data-testid":`remote-press`,children:i(G,{grid:g,label:a(`remote.hero.title`,{name:n}),boundRoles:_,onSelect:e=>void v(e),renderWidget:(t,n)=>i(J,{deviceId:e,button:t,sources:l.data?.sources??[],current:d.data?.source??``,placement:n})})}),f!==null&&i(`p`,{role:`alert`,className:`text-xs text-danger`,children:f})]})]})})}c();var ie=l({});function ae({value:e,children:t}){return i(ie.Provider,{value:e,children:t})}c();var Z={"off-while-running":{title:`Turn off while running?`,message:`The device is running. Cutting its power now interrupts what it is doing.`,confirm:`Turn off`},unlock:{title:`Unlock?`,message:`The lock will open.`,confirm:`Unlock`},install:{title:`Install the update?`,message:`The device may restart and be unavailable for a while.`,confirm:`Install`},press:{title:`Run it now?`,message:`The device acts as soon as you confirm.`,confirm:`Run`}},Q=e=>e===`off-while-running`?`deviceHero.model.confirmOff`:`deviceHero.model.confirm.${e}`;function oe(){let{t:e,i18n:t}=B(),r=t.language;return n(()=>{let t=t=>({title:e(`${Q(t)}.title`,Z[t].title),message:e(`${Q(t)}.message`,Z[t].message),confirm:e(`${Q(t)}.confirm`,Z[t].confirm)});return{noValue:e(`deviceHero.model.noValue`,`–`),callFailed:e(`deviceHero.model.callFailed`,`The device did not accept the command`),historyTooltip:e(`deviceHero.utility.history.tooltip`,`Opens the history of this device.`),consumables:{label:e(`deviceHero.utility.consumables.label`,`Consumables`),low:t=>e(`deviceHero.utility.consumables.low`,`{{count}} low`,{count:t}),ok:e(`deviceHero.utility.consumables.ok`,`OK`),tooltip:e(`deviceHero.utility.consumables.tooltip`,`Shows the level of each consumable and which ones need attention.`)},power:{label:e(`deviceHero.utility.power.label`,`Power source`),on:e(`deviceHero.utility.power.on`,`On`),off:e(`deviceHero.utility.power.off`,`Off`),tooltip:e(`deviceHero.utility.power.tooltip`,`Opens a menu to cut or restore the power feeding this device, or to restart it.`),tooltipReadOnly:e(`deviceHero.utility.power.tooltipReadOnly`,`Whether the power source feeding this device is on. Your session cannot change it.`)},confirm:{"off-while-running":t(`off-while-running`),unlock:t(`unlock`),install:t(`install`),press:t(`press`)}}},[e,r])}c();function $(e){let[t]=o(()=>new s({defaultOptions:{queries:{retry:!1,staleTime:5e3}}}));return e??t}function se({deviceId:e,kind:t,canActuate:n,onDrawn:r,showName:o}){let s=F();return a(()=>{r?.(!0)},[r]),i(`div`,{className:`flex justify-center`,children:i(w,{kind:t,deviceId:e,canActuate:n,orientation:s?`vertical`:`horizontal`,showName:o!==!1})})}function ce(e){let t=O(e.deviceId);return t===`pending`?i(P,{className:`h-72 w-full`}):t===null?i(le,{...e}):i(se,{deviceId:e.deviceId,kind:t,canActuate:e.canActuate,onDrawn:e.onDrawn,showName:e.showName})}function le({deviceId:e,canActuate:n,fallback:a,onDrawn:s,defaultHistoryOpen:c,showName:l}){let{t:u,i18n:f}=B(),p=oe(),[m,h]=o(c===!0),g=M(e),_=H(g.presence,g.list),b=r(()=>h(!0),[]);return t(d,{children:[i(v,{deviceId:e,canActuate:n,lang:N(f.language),labels:p,renderRemote:t=>i(X,{deviceId:e,deviceName:t}),fallback:a??null,showName:l!==!1,..._?{onOpenHistory:b}:{},...s===void 0?{}:{onDrawn:s}}),m?i(y,{open:!0,onOpenChange:e=>!e&&h(!1),children:t(T,{width:`xl`,scroll:`body`,children:[i(C,{children:i(D,{children:u(`deviceModule.history`,`History`)})}),i(j,{className:`mt-3`,children:i(I,{deviceId:e})})]})}):null]})}function ue({deviceId:e,trpcClient:t,theme:r,locale:a,canActuate:o=!1,defaultHistoryOpen:s,queryClient:c,fallback:l,onDrawn:d,onOpenDevice:f,onOpenCamera:p,onClose:_,onNavigate:v,showName:y}){let b=$(c),x=n(()=>R.cloneInstance({lng:a}),[a]),S=n(()=>V(x.t.bind(x)),[x]),C=n(()=>({onOpenDevice:f,onOpenCamera:p,onClose:_,onNavigate:v}),[f,p,_,v]);return i(`div`,{className:r,"data-theme":r,"data-testid":`device-detail-module`,children:i(q,{i18n:x,children:i(h,{t:S,children:i(g,{client:t,children:i(ee.Provider,{client:t,queryClient:b,children:i(u,{client:b,children:i(m,{children:i(ae,{value:C,children:i(ce,{deviceId:e,canActuate:o,fallback:l,onDrawn:d,defaultHistoryOpen:s,showName:y})})})})})})})})})}export{X as n,ue as t};
@@ -1 +0,0 @@
1
- import"./src-BNDWAXGm.js";