@microblink/camera-manager 7.2.6 → 7.3.0

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 (172) hide show
  1. package/README.md +1 -0
  2. package/dist/camera-manager.js +1316 -1185
  3. package/package.json +5 -5
  4. package/types/core/Camera.d.ts +3 -1
  5. package/types/core/Camera.d.ts.map +1 -1
  6. package/types/core/Camera.test.d.ts +1 -1
  7. package/types/core/CameraManager.d.ts +1 -1
  8. package/types/core/CameraManager.d.ts.map +1 -1
  9. package/types/core/CameraManager.test.d.ts +1 -1
  10. package/types/core/VideoFrameProcessor.d.ts +1 -1
  11. package/types/core/cameraError.d.ts +1 -1
  12. package/types/core/cameraManagerStore.d.ts +1 -1
  13. package/types/core/cameraNames.d.ts +1 -25
  14. package/types/core/cameraNames.d.ts.map +1 -1
  15. package/types/core/cameraUtils.d.ts +2 -2
  16. package/types/core/cameraUtils.d.ts.map +1 -1
  17. package/types/core/cameraUtils.test.d.ts +1 -1
  18. package/types/core/iosCameraNames.d.ts +1 -1
  19. package/types/core/utils.d.ts +2 -15
  20. package/types/core/utils.d.ts.map +1 -1
  21. package/types/index.d.ts +1 -1
  22. package/types/index.rollup.d.ts +16 -5
  23. package/types/media-mock/MediaMocker.d.ts +2 -2
  24. package/types/media-mock/MediaMocker.d.ts.map +1 -1
  25. package/types/media-mock/createInputDeviceInfo.d.ts +2 -2
  26. package/types/media-mock/createInputDeviceInfo.d.ts.map +1 -1
  27. package/types/media-mock/defineProperty.d.ts +1 -1
  28. package/types/media-mock/fake-devices.d.ts +8 -4
  29. package/types/media-mock/fake-devices.d.ts.map +1 -1
  30. package/types/media-mock/fakeDevices/DesktopSingleFrontFacing.d.ts +1 -1
  31. package/types/media-mock/fakeDevices/SamsungS21FE.d.ts +1 -1
  32. package/types/media-mock/fakeDevices/iPhone15.d.ts +1 -1
  33. package/types/media-mock/fakeDevices/iPhoneSE.d.ts +1 -1
  34. package/types/media-mock/fakeDevices/iPhoneX.d.ts +6 -0
  35. package/types/media-mock/fakeDevices/iPhoneX.d.ts.map +1 -0
  36. package/types/media-mock/utils.d.ts +1 -2
  37. package/types/media-mock/utils.d.ts.map +1 -1
  38. package/types/tests/camera-picking.test.d.ts +1 -1
  39. package/types/ui/CameraErrorModal.d.ts +1 -1
  40. package/types/ui/CameraErrorModal.d.ts.map +1 -1
  41. package/types/ui/CameraSelector.d.ts +2 -1
  42. package/types/ui/CameraSelector.d.ts.map +1 -1
  43. package/types/ui/CameraUiStoreContext.d.ts +5 -2
  44. package/types/ui/CameraUiStoreContext.d.ts.map +1 -1
  45. package/types/ui/CaptureScreen.d.ts +1 -5
  46. package/types/ui/CaptureScreen.d.ts.map +1 -1
  47. package/types/ui/Header.d.ts +1 -1
  48. package/types/ui/Header.d.ts.map +1 -1
  49. package/types/ui/LocalizationContext.d.ts +1 -1
  50. package/types/ui/RootComponent.d.ts +1 -1
  51. package/types/ui/SolidShadowRoot.d.ts +1 -1
  52. package/types/ui/createCameraManagerUi.d.ts +11 -2
  53. package/types/ui/createCameraManagerUi.d.ts.map +1 -1
  54. package/types/ui/determineFitMode.d.ts +1 -1
  55. package/types/ui/determineFitMode.test.d.ts +1 -1
  56. package/types/ui/getVisibleVideoArea.d.ts +1 -1
  57. package/types/ui/getVisibleVideoArea.test.d.ts +1 -1
  58. package/types/ui/locales/ak.d.ts +16 -13
  59. package/types/ui/locales/ak.d.ts.map +1 -1
  60. package/types/ui/locales/am.d.ts +5 -2
  61. package/types/ui/locales/am.d.ts.map +1 -1
  62. package/types/ui/locales/ar.d.ts +5 -2
  63. package/types/ui/locales/ar.d.ts.map +1 -1
  64. package/types/ui/locales/bn.d.ts +5 -2
  65. package/types/ui/locales/bn.d.ts.map +1 -1
  66. package/types/ui/locales/cs.d.ts +5 -2
  67. package/types/ui/locales/cs.d.ts.map +1 -1
  68. package/types/ui/locales/da.d.ts +5 -2
  69. package/types/ui/locales/da.d.ts.map +1 -1
  70. package/types/ui/locales/de.d.ts +5 -2
  71. package/types/ui/locales/de.d.ts.map +1 -1
  72. package/types/ui/locales/el.d.ts +6 -3
  73. package/types/ui/locales/el.d.ts.map +1 -1
  74. package/types/ui/locales/en.d.ts +3 -3
  75. package/types/ui/locales/en_GB.d.ts +5 -2
  76. package/types/ui/locales/en_GB.d.ts.map +1 -1
  77. package/types/ui/locales/es.d.ts +5 -2
  78. package/types/ui/locales/es.d.ts.map +1 -1
  79. package/types/ui/locales/es_MX.d.ts +5 -2
  80. package/types/ui/locales/es_MX.d.ts.map +1 -1
  81. package/types/ui/locales/fa-latn.d.ts +5 -2
  82. package/types/ui/locales/fa-latn.d.ts.map +1 -1
  83. package/types/ui/locales/fi.d.ts +5 -2
  84. package/types/ui/locales/fi.d.ts.map +1 -1
  85. package/types/ui/locales/fil.d.ts +5 -2
  86. package/types/ui/locales/fil.d.ts.map +1 -1
  87. package/types/ui/locales/fr.d.ts +5 -2
  88. package/types/ui/locales/fr.d.ts.map +1 -1
  89. package/types/ui/locales/fr_CA.d.ts +5 -2
  90. package/types/ui/locales/fr_CA.d.ts.map +1 -1
  91. package/types/ui/locales/ha.d.ts +5 -2
  92. package/types/ui/locales/ha.d.ts.map +1 -1
  93. package/types/ui/locales/he.d.ts +5 -2
  94. package/types/ui/locales/he.d.ts.map +1 -1
  95. package/types/ui/locales/hi.d.ts +5 -2
  96. package/types/ui/locales/hi.d.ts.map +1 -1
  97. package/types/ui/locales/hr.d.ts +6 -3
  98. package/types/ui/locales/hr.d.ts.map +1 -1
  99. package/types/ui/locales/hu.d.ts +5 -2
  100. package/types/ui/locales/hu.d.ts.map +1 -1
  101. package/types/ui/locales/id.d.ts +5 -2
  102. package/types/ui/locales/id.d.ts.map +1 -1
  103. package/types/ui/locales/index.d.ts +1 -1
  104. package/types/ui/locales/is.d.ts +5 -2
  105. package/types/ui/locales/is.d.ts.map +1 -1
  106. package/types/ui/locales/it.d.ts +5 -2
  107. package/types/ui/locales/it.d.ts.map +1 -1
  108. package/types/ui/locales/ja.d.ts +5 -2
  109. package/types/ui/locales/ja.d.ts.map +1 -1
  110. package/types/ui/locales/ka_GE.d.ts +5 -2
  111. package/types/ui/locales/ka_GE.d.ts.map +1 -1
  112. package/types/ui/locales/kk.d.ts +5 -2
  113. package/types/ui/locales/kk.d.ts.map +1 -1
  114. package/types/ui/locales/km_KH.d.ts +5 -2
  115. package/types/ui/locales/km_KH.d.ts.map +1 -1
  116. package/types/ui/locales/ko.d.ts +5 -2
  117. package/types/ui/locales/ko.d.ts.map +1 -1
  118. package/types/ui/locales/lv.d.ts +5 -2
  119. package/types/ui/locales/lv.d.ts.map +1 -1
  120. package/types/ui/locales/ms.d.ts +5 -2
  121. package/types/ui/locales/ms.d.ts.map +1 -1
  122. package/types/ui/locales/ne.d.ts +5 -2
  123. package/types/ui/locales/ne.d.ts.map +1 -1
  124. package/types/ui/locales/nl.d.ts +5 -2
  125. package/types/ui/locales/nl.d.ts.map +1 -1
  126. package/types/ui/locales/no.d.ts +5 -2
  127. package/types/ui/locales/no.d.ts.map +1 -1
  128. package/types/ui/locales/pl.d.ts +5 -2
  129. package/types/ui/locales/pl.d.ts.map +1 -1
  130. package/types/ui/locales/ps_AF.d.ts +5 -2
  131. package/types/ui/locales/ps_AF.d.ts.map +1 -1
  132. package/types/ui/locales/pt.d.ts +5 -2
  133. package/types/ui/locales/pt.d.ts.map +1 -1
  134. package/types/ui/locales/pt_BR.d.ts +5 -2
  135. package/types/ui/locales/pt_BR.d.ts.map +1 -1
  136. package/types/ui/locales/ro.d.ts +5 -2
  137. package/types/ui/locales/ro.d.ts.map +1 -1
  138. package/types/ui/locales/ru.d.ts +5 -2
  139. package/types/ui/locales/ru.d.ts.map +1 -1
  140. package/types/ui/locales/si.d.ts +5 -2
  141. package/types/ui/locales/si.d.ts.map +1 -1
  142. package/types/ui/locales/sk.d.ts +5 -2
  143. package/types/ui/locales/sk.d.ts.map +1 -1
  144. package/types/ui/locales/sl.d.ts +5 -2
  145. package/types/ui/locales/sl.d.ts.map +1 -1
  146. package/types/ui/locales/sr.d.ts +5 -2
  147. package/types/ui/locales/sr.d.ts.map +1 -1
  148. package/types/ui/locales/sv.d.ts +5 -2
  149. package/types/ui/locales/sv.d.ts.map +1 -1
  150. package/types/ui/locales/sw.d.ts +5 -2
  151. package/types/ui/locales/sw.d.ts.map +1 -1
  152. package/types/ui/locales/th.d.ts +5 -2
  153. package/types/ui/locales/th.d.ts.map +1 -1
  154. package/types/ui/locales/tr.d.ts +5 -2
  155. package/types/ui/locales/tr.d.ts.map +1 -1
  156. package/types/ui/locales/uk.d.ts +5 -2
  157. package/types/ui/locales/uk.d.ts.map +1 -1
  158. package/types/ui/locales/ur.d.ts +5 -2
  159. package/types/ui/locales/ur.d.ts.map +1 -1
  160. package/types/ui/locales/uz.d.ts +5 -2
  161. package/types/ui/locales/uz.d.ts.map +1 -1
  162. package/types/ui/locales/vi.d.ts +5 -2
  163. package/types/ui/locales/vi.d.ts.map +1 -1
  164. package/types/ui/locales/yo.d.ts +5 -2
  165. package/types/ui/locales/yo.d.ts.map +1 -1
  166. package/types/ui/locales/zh_CN.d.ts +5 -2
  167. package/types/ui/locales/zh_CN.d.ts.map +1 -1
  168. package/types/ui/locales/zh_TW.d.ts +5 -2
  169. package/types/ui/locales/zh_TW.d.ts.map +1 -1
  170. package/types/ui/zustandRefStore.d.ts +1 -1
  171. package/types/ui/debounce.d.ts +0 -14
  172. package/types/ui/debounce.d.ts.map +0 -1
@@ -1,37 +1,38 @@
1
- (function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})("._dialogPositioner_15i6c_1{position:fixed;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);display:grid;height:100vh;width:100%;padding:calc(var(--mb-size)*2rem)}@supports (height:100dvh){._dialogPositioner_15i6c_1{height:100dvh}}@media (max-width: 379.9px){._dialogPositioner_15i6c_1{padding:calc(var(--mb-size)*1rem)}}._dialogBackdrop_15i6c_10{position:absolute;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);width:100%;height:100%;--un-bg-opacity:1;background-color:rgb(var(--color-black-rgb-value) / var(--un-bg-opacity));--un-bg-opacity:.5;--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}._dialogContent_15i6c_14{position:relative;max-height:calc(100dvh - 4rem);max-width:28rem;display:flex;flex-direction:column;place-self:center;border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity));padding-left:min(8%,3rem);padding-right:min(8%,3rem);padding-top:min(8%,1.5rem);padding-bottom:min(8%,1.5rem);--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._dialogContent_15i6c_14._large_15i6c_18{padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem)}._dialogContent_15i6c_14._compact_15i6c_21{padding:min(8%,1.5rem)}@media screen and (max-height: 500px){._dialogContent_15i6c_14._compact_15i6c_21{height:auto}}@media screen and (max-height: 500px){._dialogContent_15i6c_14{height:100%;max-height:calc(100dvh - 2rem);overflow:hidden;padding-left:min(8%,1.5rem);padding-right:min(8%,1.5rem);padding-top:min(8%,.5rem);padding-bottom:min(8%,.5rem)}}@media (min-width: 640px){._dialogContent_15i6c_14{max-width:36rem}}@media (min-width: 1024px){._dialogContent_15i6c_14{max-width:28rem}}._dialogTitle_15i6c_45{text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700}._contentOut_15i6c_49{height:100%}._closeButton_15i6c_53{position:absolute;top:.625rem;right:.625rem;width:calc(var(--mb-size)*2rem);height:calc(var(--mb-size)*2rem);display:flex;align-items:center;justify-content:center;border-style:none;background-color:transparent;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._closeButton_15i6c_53:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}._closeButton_15i6c_53:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}._closeButtonInner_15i6c_59{width:.875rem;height:.875rem}._primaryActionButton_15i6c_63{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;--un-bg-opacity:1;background-color:rgb(var(--color-primary) / var(--un-bg-opacity));padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._primaryActionButton_15i6c_63[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._primaryActionButton_15i6c_63[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._primaryActionButton_15i6c_63:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_15i6c_63:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_15i6c_63:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._secondaryActionButton_15i6c_67{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;background-color:transparent;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity));--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-opacity:1;--un-ring-color:rgb(var(--color-primary) / var(--un-ring-opacity)) ;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._secondaryActionButton_15i6c_67[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._secondaryActionButton_15i6c_67[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._secondaryActionButton_15i6c_67:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_15i6c_67:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_15i6c_67:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._actions_15i6c_71{display:flex;gap:calc(var(--mb-size)*1rem)}._actions_15i6c_71 ._primaryActionButton_15i6c_63,._actions_15i6c_71 ._secondaryActionButton_15i6c_67{width:50%}._alertTitle_15i6c_79{font-size:calc(var(--mb-size)*1.125rem);line-height:calc(var(--mb-size)*1.75rem);--un-text-opacity:1;color:rgb(var(--color-gray-700-rgb-value) / var(--un-text-opacity));font-weight:400}._alertText_15i6c_83{margin-top:calc(var(--mb-size)*1rem);margin-bottom:calc(var(--mb-size)*2rem);padding-left:calc(var(--mb-size)*.5rem);padding-right:calc(var(--mb-size)*.5rem);text-align:center;text-wrap:pretty;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));font-weight:300;line-height:1.5}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.btn-focus:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-4{right:calc(var(--mb-size)*1rem)}.top-0{top:calc(var(--mb-size)*0rem)}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2}.z-1{z-index:1}.grid{display:grid}.auto-cols-auto{grid-auto-columns:auto}.grid-cols-\\[1fr_auto_1fr\\]{grid-template-columns:1fr auto 1fr}.block{display:block}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-6{width:calc(var(--mb-size)*1.5rem);height:calc(var(--mb-size)*1.5rem)}.size-full{width:100%;height:100%}.h-full{height:100%}.h-vh{height:100vh}.max-w-\\[100\\%\\]{max-width:100%}.min-h-\\[300px\\]{min-height:300px}.min-w-0{min-width:calc(var(--mb-size)*0rem)}.w-full{width:100%}.flex{display:flex}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.gap-\\[1px\\]{gap:1px}.gap-2{gap:calc(var(--mb-size)*.5rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.border-2{border-width:2px}.border-transparent{border-color:transparent}.data-\\[highlighted\\]\\:border-primary[data-highlighted]{--un-border-opacity:1;border-color:rgb(var(--color-primary) / var(--un-border-opacity))}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-b-6{border-bottom-left-radius:calc(var(--mb-size)*1.5rem);border-bottom-right-radius:calc(var(--mb-size)*1.5rem)}.rounded-t-6{border-top-left-radius:calc(var(--mb-size)*1.5rem);border-top-right-radius:calc(var(--mb-size)*1.5rem)}.border-none{border-style:none}.border-solid{border-style:solid}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-gray-550\\/50{background-color:rgb(var(--color-gray-550-rgb-value) / .5)}.bg-gray-550\\/70{background-color:rgb(var(--color-gray-550-rgb-value) / .7)}.bg-gray-550\\/90{background-color:rgb(var(--color-gray-550-rgb-value) / .9)}.p-2{padding:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.py-4{padding-top:calc(var(--mb-size)*1rem);padding-bottom:calc(var(--mb-size)*1rem)}.pl-4{padding-left:calc(var(--mb-size)*1rem)}.pr-12{padding-right:calc(var(--mb-size)*3rem)}.text-align-center{text-align:center}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.color-white{--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.font-500{font-weight:500}.disabled\\:opacity-50:disabled{opacity:.5}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-md{--un-drop-shadow:drop-shadow(0 4px 3px var(--un-drop-shadow-color, rgb(0 0 0 / .07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*.75rem),calc(var(--mb-size)*.75rem) + (100vw - 380px) * .031055900621118012,calc(var(--mb-size)*2rem))}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
1
+ (function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})(".dropdown-content{border-radius:calc(var(--mb-size) * 1rem + 8px);max-height:calc(var(--available-height) - 1rem);overflow:auto}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.dialog-description{margin-top:1em;text-align:center;text-wrap:pretty;font-size:1em;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));line-height:calc(1em + .5rem)}.btn{height:2.5rem;-webkit-appearance:none;appearance:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;padding-left:calc(var(--mb-size)*1.5rem);padding-right:calc(var(--mb-size)*1.5rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}.btn:disabled{cursor:not-allowed}.btn-primary{--un-bg-opacity:1;background-color:rgb(var(--color-primary) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.btn-secondary{background-color:transparent;--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity));--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-opacity:1;--un-ring-color:rgb(var(--color-primary) / var(--un-ring-opacity)) }.btn-primary:enabled:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}.btn-secondary:enabled:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) }.btn-primary:enabled:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}.btn-secondary:enabled:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) }.btn-primary:disabled{--un-bg-opacity:1;background-color:rgb(var(--color-gray-300-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}.dialog-title{text-align:center;text-wrap:pretty;font-size:1.5em;--un-text-opacity:1;color:rgb(var(--color-gray-700-rgb-value) / var(--un-text-opacity));font-weight:700;line-height:calc(1em + .5rem)}.btn-secondary:disabled{--un-text-opacity:1;color:rgb(var(--color-gray-400-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-gray-400-rgb-value) / var(--un-ring-opacity)) }.btn:enabled:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.btn-focus:enabled:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.\\[--modal-t\\:0\\]{--modal-t:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-2\\.5{right:.625rem}.right-4{right:calc(var(--mb-size)*1rem)}.top-0{top:calc(var(--mb-size)*0rem)}.top-2\\.5{top:.625rem}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2}.z-1{z-index:1}.grid{display:grid}.auto-cols-auto{grid-auto-columns:auto}.grid-cols-\\[1fr_auto_1fr\\]{grid-template-columns:1fr auto 1fr}.block{display:block}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-6{width:calc(var(--mb-size)*1.5rem);height:calc(var(--mb-size)*1.5rem)}.size-full{width:100%;height:100%}.h-3\\.5{height:.875rem}.h-8{height:calc(var(--mb-size)*2rem)}.h-full{height:100%}.h-vh{height:100vh}.max-h-full{max-height:100%}.max-w-\\[100\\%\\]{max-width:100%}.max-w-\\[30ch\\]{max-width:30ch}.min-h-\\[300px\\]{min-height:300px}.min-h-0{min-height:calc(var(--mb-size)*0rem)}.min-w-0{min-width:calc(var(--mb-size)*0rem)}.w-\\[min\\(540px\\,100\\%\\)\\]{width:min(540px,100%)}.w-100dvw{width:100dvw}.w-3\\.5{width:.875rem}.w-8{width:calc(var(--mb-size)*2rem)}.w-full{width:100%}.flex{display:flex}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.gap-2{gap:calc(var(--mb-size)*.5rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.gap-6{gap:calc(var(--mb-size)*1.5rem)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.not-first-of-type-b-t-1:not(:first-of-type){border-top-width:1px}.not-first-of-type-b-t-gray-300\\/50:not(:first-of-type){border-top-color:rgb(var(--color-gray-300-rgb-value) / .5)}.rounded-2{border-radius:calc(var(--mb-size)*.5rem)}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.first-of-type-rounded-t-6:first-of-type{border-top-left-radius:calc(var(--mb-size)*1.5rem);border-top-right-radius:calc(var(--mb-size)*1.5rem)}.last-of-type-rounded-b-6:last-of-type{border-bottom-left-radius:calc(var(--mb-size)*1.5rem);border-bottom-right-radius:calc(var(--mb-size)*1.5rem)}.border-none{border-style:none}.not-first-of-type-b-t-solid:not(:first-of-type){border-top-style:solid}.bg-black{--un-bg-opacity:1;background-color:rgb(var(--color-black-rgb-value) / var(--un-bg-opacity))}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-gray-550\\/50{background-color:rgb(var(--color-gray-550-rgb-value) / .5)}.bg-gray-550\\/70{background-color:rgb(var(--color-gray-550-rgb-value) / .7)}.bg-gray-550\\/90{background-color:rgb(var(--color-gray-550-rgb-value) / .9)}.bg-transparent{background-color:transparent}.bg-white{--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity))}.data-\\[highlighted\\]\\:bg-gray-550\\/100[data-highlighted]{background-color:rgb(var(--color-gray-550-rgb-value) / 1)}.hover\\:bg-gray-100:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}.active\\:bg-gray-200:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}.bg-opacity-50{--un-bg-opacity:.5}.p-\\[clamp\\(1\\.5rem\\,6dvmin\\,3rem\\)\\]{padding:clamp(1.5rem,6dvmin,3rem)}.p-2{padding:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.py-4{padding-top:calc(var(--mb-size)*1rem);padding-bottom:calc(var(--mb-size)*1rem)}.pl-4{padding-left:calc(var(--mb-size)*1rem)}.pr-12{padding-right:calc(var(--mb-size)*3rem)}.text-align-center{text-align:center}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.text-\\[calc\\(0\\.875rem\\+0\\.125rem\\*var\\(--modal-t\\)\\)\\]{font-size:calc(.875rem + .125rem * var(--modal-t))}.color-dark-900{--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity))}.color-white{--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.font-500{font-weight:500}.disabled\\:opacity-50:disabled{opacity:.5}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.focus-visible\\:outline-2px:focus-visible{outline-width:2px}.focus-visible\\:outline-primary:focus-visible{--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity))}.focus-visible\\:outline-offset-4px:focus-visible{outline-offset:4px}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-solid:focus-visible{outline-style:solid}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-sm{--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-md{--un-drop-shadow:drop-shadow(0 4px 3px var(--un-drop-shadow-color, rgb(0 0 0 / .07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.transition-duration-100{transition-duration:.1s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*.75rem),calc(var(--mb-size)*.75rem) + (100vw - 380px) * .031055900621118012,calc(var(--mb-size)*2rem))}.h-100dvh{height:100dvh}@media (max-height: 639.9px){.lt-h-sm\\:gap-4{gap:calc(var(--mb-size)*1rem)}}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
2
2
  import { subscribeWithSelector as ue } from "zustand/middleware";
3
- import { createStore as de } from "zustand/vanilla";
4
3
  import { shallow as ge } from "zustand/shallow";
5
- import { createComponent as l, use as V, template as y, spread as D, mergeProps as J, insert as w, memo as Se, isServer as He, delegateEvents as We, effect as K, className as H, Portal as ye, Dynamic as Ge, render as Xe } from "solid-js/web";
6
- import { createContext as Ce, onCleanup as he, useContext as Ee, onMount as Z, createSignal as N, Show as k, Index as Qe, createRoot as Ke, getOwner as ke, splitProps as Ye, createEffect as Je } from "solid-js";
7
- import { createWithSignal as Te } from "solid-zustand";
8
- import { createStore as Ze } from "solid-js/store";
9
- import { EnvironmentProvider as et } from "@ark-ui/solid/environment";
10
- import { Dialog as $ } from "@ark-ui/solid/dialog";
11
- import { Select as A, createListCollection as tt } from "@ark-ui/solid/select";
12
- import { Tooltip as Q } from "@ark-ui/solid/tooltip";
13
- typeof HTMLVideoElement < "u" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype && (HTMLVideoElement.prototype._rvfcpolyfillmap = {}, HTMLVideoElement.prototype.requestVideoFrameCallback = function(r) {
14
- const e = performance.now(), t = this.getVideoPlaybackQuality(), a = this.mozPresentedFrames || this.mozPaintedFrames || t.totalVideoFrames - t.droppedVideoFrames, n = (o, i) => {
15
- const c = this.getVideoPlaybackQuality(), s = this.mozPresentedFrames || this.mozPaintedFrames || c.totalVideoFrames - c.droppedVideoFrames;
16
- if (s > a) {
17
- const h = this.mozFrameDelay || c.totalFrameDelay - t.totalFrameDelay || 0, f = i - o;
18
- r(i, {
19
- presentationTime: i + h * 1e3,
20
- expectedDisplayTime: i + f,
4
+ import { createStore as de } from "zustand/vanilla";
5
+ import { createComponent as c, use as V, template as w, spread as A, mergeProps as H, insert as y, memo as Ee, isServer as he, Portal as ke, effect as Te, Dynamic as Ye, render as Je } from "solid-js/web";
6
+ import { createContext as xe, onCleanup as J, useContext as Me, onMount as K, createSignal as I, Show as x, Index as Ze, splitProps as Y, createRoot as oe, getOwner as Re, createEffect as _e, createMemo as et, $TRACK as tt, untrack as rt } from "solid-js";
7
+ import { createWithSignal as Ae } from "solid-zustand";
8
+ import { createStore as at } from "solid-js/store";
9
+ import { EnvironmentProvider as nt } from "@ark-ui/solid/environment";
10
+ import { Dialog as D } from "@ark-ui/solid/dialog";
11
+ import { Select as _, createListCollection as ot } from "@ark-ui/solid/select";
12
+ import { Tooltip as X } from "@ark-ui/solid/tooltip";
13
+ import { Dialog as be } from "@ark-ui/solid";
14
+ typeof HTMLVideoElement < "u" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype && (HTMLVideoElement.prototype._rvfcpolyfillmap = {}, HTMLVideoElement.prototype.requestVideoFrameCallback = function(t) {
15
+ const e = performance.now(), r = this.getVideoPlaybackQuality(), a = this.mozPresentedFrames || this.mozPaintedFrames || r.totalVideoFrames - r.droppedVideoFrames, n = (i, o) => {
16
+ const s = this.getVideoPlaybackQuality(), l = this.mozPresentedFrames || this.mozPaintedFrames || s.totalVideoFrames - s.droppedVideoFrames;
17
+ if (l > a) {
18
+ const d = this.mozFrameDelay || s.totalFrameDelay - r.totalFrameDelay || 0, u = o - i;
19
+ t(o, {
20
+ presentationTime: o + d * 1e3,
21
+ expectedDisplayTime: o + u,
21
22
  width: this.videoWidth,
22
23
  height: this.videoHeight,
23
- mediaTime: Math.max(0, this.currentTime || 0) + f / 1e3,
24
- presentedFrames: s,
25
- processingDuration: h
24
+ mediaTime: Math.max(0, this.currentTime || 0) + u / 1e3,
25
+ presentedFrames: l,
26
+ processingDuration: d
26
27
  }), delete this._rvfcpolyfillmap[e];
27
28
  } else
28
- this._rvfcpolyfillmap[e] = requestAnimationFrame((h) => n(i, h));
29
+ this._rvfcpolyfillmap[e] = requestAnimationFrame((d) => n(o, d));
29
30
  };
30
- return this._rvfcpolyfillmap[e] = requestAnimationFrame((o) => n(e, o)), e;
31
- }, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(r) {
32
- cancelAnimationFrame(this._rvfcpolyfillmap[r]), delete this._rvfcpolyfillmap[r];
31
+ return this._rvfcpolyfillmap[e] = requestAnimationFrame((i) => n(e, i)), e;
32
+ }, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(t) {
33
+ cancelAnimationFrame(this._rvfcpolyfillmap[t]), delete this._rvfcpolyfillmap[t];
33
34
  });
34
- class U extends Error {
35
+ class B extends Error {
35
36
  code;
36
37
  /**
37
38
  * Creates a new camera error.
@@ -40,11 +41,11 @@ class U extends Error {
40
41
  * @param code - The error code.
41
42
  * @param cause - The cause of the error.
42
43
  */
43
- constructor(e, t, a) {
44
- super(e), this.code = t, this.cause = a;
44
+ constructor(e, r, a) {
45
+ super(e), this.code = r, this.cause = a;
45
46
  }
46
47
  }
47
- const rt = [
48
+ const it = [
48
49
  // English
49
50
  "back",
50
51
  "rear",
@@ -115,7 +116,7 @@ const rt = [
115
116
  "बैक",
116
117
  // Latin American Spanish
117
118
  "posterior"
118
- ], at = [
119
+ ], st = [
119
120
  // English
120
121
  "front",
121
122
  // German
@@ -182,38 +183,38 @@ const rt = [
182
183
  "फ्रंट",
183
184
  // Latin American Spanish
184
185
  "frontal"
185
- ], _e = (r, e) => e.some((t) => r.toLowerCase().includes(t)), Me = (r) => _e(r, rt), xe = (r) => _e(r, at);
186
- var nt = /* @__PURE__ */ function() {
187
- function r(e, t) {
188
- for (var a = 0; a < t.length; a++) {
189
- var n = t[a];
186
+ ], De = (t, e) => e.some((r) => t.toLowerCase().includes(r)), Ie = (t) => De(t, it), Fe = (t) => De(t, st);
187
+ var lt = /* @__PURE__ */ function() {
188
+ function t(e, r) {
189
+ for (var a = 0; a < r.length; a++) {
190
+ var n = r[a];
190
191
  n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
191
192
  }
192
193
  }
193
- return function(e, t, a) {
194
- return t && r(e.prototype, t), a && r(e, a), e;
194
+ return function(e, r, a) {
195
+ return r && t(e.prototype, r), a && t(e, a), e;
195
196
  };
196
- }(), ot = it(["", ""], ["", ""]);
197
- function it(r, e) {
198
- return Object.freeze(Object.defineProperties(r, { raw: { value: Object.freeze(e) } }));
197
+ }(), ct = ut(["", ""], ["", ""]);
198
+ function ut(t, e) {
199
+ return Object.freeze(Object.defineProperties(t, { raw: { value: Object.freeze(e) } }));
199
200
  }
200
- function st(r, e) {
201
- if (!(r instanceof e))
201
+ function dt(t, e) {
202
+ if (!(t instanceof e))
202
203
  throw new TypeError("Cannot call a class as a function");
203
204
  }
204
- var _ = function() {
205
- function r() {
206
- for (var e = this, t = arguments.length, a = Array(t), n = 0; n < t; n++)
205
+ var E = function() {
206
+ function t() {
207
+ for (var e = this, r = arguments.length, a = Array(r), n = 0; n < r; n++)
207
208
  a[n] = arguments[n];
208
- return st(this, r), this.tag = function(o) {
209
- for (var i = arguments.length, c = Array(i > 1 ? i - 1 : 0), s = 1; s < i; s++)
210
- c[s - 1] = arguments[s];
211
- return typeof o == "function" ? e.interimTag.bind(e, o) : typeof o == "string" ? e.transformEndResult(o) : (o = o.map(e.transformString.bind(e)), e.transformEndResult(o.reduce(e.processSubstitutions.bind(e, c))));
212
- }, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(o) {
213
- return typeof o == "function" ? o() : o;
209
+ return dt(this, t), this.tag = function(i) {
210
+ for (var o = arguments.length, s = Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
211
+ s[l - 1] = arguments[l];
212
+ return typeof i == "function" ? e.interimTag.bind(e, i) : typeof i == "string" ? e.transformEndResult(i) : (i = i.map(e.transformString.bind(e)), e.transformEndResult(i.reduce(e.processSubstitutions.bind(e, s))));
213
+ }, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(i) {
214
+ return typeof i == "function" ? i() : i;
214
215
  }), this.tag;
215
216
  }
216
- return nt(r, [{
217
+ return lt(t, [{
217
218
  key: "interimTag",
218
219
  /**
219
220
  * An intermediary template tag that receives a template tag and passes the result of calling the template with the received
@@ -223,10 +224,10 @@ var _ = function() {
223
224
  * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
224
225
  * @return {*} - the final processed value
225
226
  */
226
- value: function(t, a) {
227
- for (var n = arguments.length, o = Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++)
228
- o[i - 2] = arguments[i];
229
- return this.tag(ot, t.apply(void 0, [a].concat(o)));
227
+ value: function(r, a) {
228
+ for (var n = arguments.length, i = Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++)
229
+ i[o - 2] = arguments[o];
230
+ return this.tag(ct, r.apply(void 0, [a].concat(i)));
230
231
  }
231
232
  /**
232
233
  * Performs bulk processing on the tagged template, transforming each substitution and then
@@ -238,9 +239,9 @@ var _ = function() {
238
239
  */
239
240
  }, {
240
241
  key: "processSubstitutions",
241
- value: function(t, a, n) {
242
- var o = this.transformSubstitution(t.shift(), a);
243
- return "".concat(a, o, n);
242
+ value: function(r, a, n) {
243
+ var i = this.transformSubstitution(r.shift(), a);
244
+ return "".concat(a, i, n);
244
245
  }
245
246
  /**
246
247
  * Iterate through each transformer, applying the transformer's `onString` method to the template
@@ -250,11 +251,11 @@ var _ = function() {
250
251
  */
251
252
  }, {
252
253
  key: "transformString",
253
- value: function(t) {
254
- var a = function(o, i) {
255
- return i.onString ? i.onString(o) : o;
254
+ value: function(r) {
255
+ var a = function(i, o) {
256
+ return o.onString ? o.onString(i) : i;
256
257
  };
257
- return this.transformers.reduce(a, t);
258
+ return this.transformers.reduce(a, r);
258
259
  }
259
260
  /**
260
261
  * When a substitution is encountered, iterates through each transformer and applies the transformer's
@@ -265,11 +266,11 @@ var _ = function() {
265
266
  */
266
267
  }, {
267
268
  key: "transformSubstitution",
268
- value: function(t, a) {
269
- var n = function(i, c) {
270
- return c.onSubstitution ? c.onSubstitution(i, a) : i;
269
+ value: function(r, a) {
270
+ var n = function(o, s) {
271
+ return s.onSubstitution ? s.onSubstitution(o, a) : o;
271
272
  };
272
- return this.transformers.reduce(n, t);
273
+ return this.transformers.reduce(n, r);
273
274
  }
274
275
  /**
275
276
  * Iterates through each transformer, applying the transformer's `onEndResult` method to the
@@ -279,14 +280,14 @@ var _ = function() {
279
280
  */
280
281
  }, {
281
282
  key: "transformEndResult",
282
- value: function(t) {
283
- var a = function(o, i) {
284
- return i.onEndResult ? i.onEndResult(o) : o;
283
+ value: function(r) {
284
+ var a = function(i, o) {
285
+ return o.onEndResult ? o.onEndResult(i) : i;
285
286
  };
286
- return this.transformers.reduce(a, t);
287
+ return this.transformers.reduce(a, r);
287
288
  }
288
- }]), r;
289
- }(), M = function() {
289
+ }]), t;
290
+ }(), k = function() {
290
291
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
291
292
  return {
292
293
  onEndResult: function(a) {
@@ -300,25 +301,25 @@ var _ = function() {
300
301
  }
301
302
  };
302
303
  };
303
- function lt(r) {
304
- if (Array.isArray(r)) {
305
- for (var e = 0, t = Array(r.length); e < r.length; e++)
306
- t[e] = r[e];
307
- return t;
304
+ function ht(t) {
305
+ if (Array.isArray(t)) {
306
+ for (var e = 0, r = Array(t.length); e < t.length; e++)
307
+ r[e] = t[e];
308
+ return r;
308
309
  } else
309
- return Array.from(r);
310
+ return Array.from(t);
310
311
  }
311
- var L = function() {
312
+ var N = function() {
312
313
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
313
314
  return {
314
315
  onEndResult: function(a) {
315
316
  if (e === "initial") {
316
- var n = a.match(/^[^\S\n]*(?=\S)/gm), o = n && Math.min.apply(Math, lt(n.map(function(c) {
317
- return c.length;
317
+ var n = a.match(/^[^\S\n]*(?=\S)/gm), i = n && Math.min.apply(Math, ht(n.map(function(s) {
318
+ return s.length;
318
319
  })));
319
- if (o) {
320
- var i = new RegExp("^.{" + o + "}", "gm");
321
- return a.replace(i, "");
320
+ if (i) {
321
+ var o = new RegExp("^.{" + i + "}", "gm");
322
+ return a.replace(o, "");
322
323
  }
323
324
  return a;
324
325
  }
@@ -327,72 +328,72 @@ var L = function() {
327
328
  throw new Error("Unknown type: " + e);
328
329
  }
329
330
  };
330
- }, q = function(e, t) {
331
+ }, U = function(e, r) {
331
332
  return {
332
333
  onEndResult: function(n) {
333
- if (e == null || t == null)
334
+ if (e == null || r == null)
334
335
  throw new Error("replaceResultTransformer requires at least 2 arguments.");
335
- return n.replace(e, t);
336
+ return n.replace(e, r);
336
337
  }
337
338
  };
338
- }, O = function(e, t) {
339
+ }, $ = function(e, r) {
339
340
  return {
340
- onSubstitution: function(n, o) {
341
- if (e == null || t == null)
341
+ onSubstitution: function(n, i) {
342
+ if (e == null || r == null)
342
343
  throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");
343
- return n == null ? n : n.toString().replace(e, t);
344
+ return n == null ? n : n.toString().replace(e, r);
344
345
  }
345
346
  };
346
- }, ct = {
347
+ }, ft = {
347
348
  separator: "",
348
349
  conjunction: "",
349
350
  serial: !1
350
- }, I = function() {
351
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ct;
351
+ }, F = function() {
352
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ft;
352
353
  return {
353
354
  onSubstitution: function(a, n) {
354
355
  if (Array.isArray(a)) {
355
- var o = a.length, i = e.separator, c = e.conjunction, s = e.serial, h = n.match(/(\n?[^\S\n]+)$/);
356
- if (h ? a = a.join(i + h[1]) : a = a.join(i + " "), c && o > 1) {
357
- var f = a.lastIndexOf(i);
358
- a = a.slice(0, f) + (s ? i : "") + " " + c + a.slice(f + 1);
356
+ var i = a.length, o = e.separator, s = e.conjunction, l = e.serial, d = n.match(/(\n?[^\S\n]+)$/);
357
+ if (d ? a = a.join(o + d[1]) : a = a.join(o + " "), s && i > 1) {
358
+ var u = a.lastIndexOf(o);
359
+ a = a.slice(0, u) + (l ? o : "") + " " + s + a.slice(u + 1);
359
360
  }
360
361
  }
361
362
  return a;
362
363
  }
363
364
  };
364
- }, Re = function(e) {
365
+ }, Le = function(e) {
365
366
  return {
366
367
  onSubstitution: function(a, n) {
367
368
  return typeof a == "string" && a.includes(e) && (a = a.split(e)), a;
368
369
  }
369
370
  };
370
- }, fe = function(e) {
371
+ }, pe = function(e) {
371
372
  return e != null && !Number.isNaN(e) && typeof e != "boolean";
372
- }, ut = function() {
373
+ }, mt = function() {
373
374
  return {
374
- onSubstitution: function(t) {
375
- return Array.isArray(t) ? t.filter(fe) : fe(t) ? t : "";
375
+ onSubstitution: function(r) {
376
+ return Array.isArray(r) ? r.filter(pe) : pe(r) ? r : "";
376
377
  }
377
378
  };
378
379
  };
379
- new _(I({ separator: "," }), L, M);
380
- new _(I({ separator: ",", conjunction: "and" }), L, M);
381
- new _(I({ separator: ",", conjunction: "or" }), L, M);
382
- new _(Re(`
383
- `), ut, I, L, M);
384
- new _(Re(`
385
- `), I, L, M, O(/&/g, "&amp;"), O(/</g, "&lt;"), O(/>/g, "&gt;"), O(/"/g, "&quot;"), O(/'/g, "&#x27;"), O(/`/g, "&#x60;"));
386
- new _(q(/(?:\n(?:\s*))+/g, " "), M);
387
- new _(q(/(?:\n\s*)/g, ""), M);
388
- new _(I({ separator: "," }), q(/(?:\s+)/g, " "), M);
389
- new _(I({ separator: ",", conjunction: "or" }), q(/(?:\s+)/g, " "), M);
390
- new _(I({ separator: ",", conjunction: "and" }), q(/(?:\s+)/g, " "), M);
391
- new _(I, L, M);
392
- new _(I, q(/(?:\s+)/g, " "), M);
393
- new _(L, M);
394
- var Ae = new _(L("all"), M);
395
- const dt = [
380
+ new E(F({ separator: "," }), N, k);
381
+ new E(F({ separator: ",", conjunction: "and" }), N, k);
382
+ new E(F({ separator: ",", conjunction: "or" }), N, k);
383
+ new E(Le(`
384
+ `), mt, F, N, k);
385
+ new E(Le(`
386
+ `), F, N, k, $(/&/g, "&amp;"), $(/</g, "&lt;"), $(/>/g, "&gt;"), $(/"/g, "&quot;"), $(/'/g, "&#x27;"), $(/`/g, "&#x60;"));
387
+ new E(U(/(?:\n(?:\s*))+/g, " "), k);
388
+ new E(U(/(?:\n\s*)/g, ""), k);
389
+ new E(F({ separator: "," }), U(/(?:\s+)/g, " "), k);
390
+ new E(F({ separator: ",", conjunction: "or" }), U(/(?:\s+)/g, " "), k);
391
+ new E(F({ separator: ",", conjunction: "and" }), U(/(?:\s+)/g, " "), k);
392
+ new E(F, N, k);
393
+ new E(F, U(/(?:\s+)/g, " "), k);
394
+ new E(N, k);
395
+ var Ne = new E(N("all"), k);
396
+ const gt = [
396
397
  "Cameră dublă cu obiectiv superangular spate",
397
398
  "מצלמה כפולה רחבה אחורית",
398
399
  "Артқы қос кең бұрышты камера",
@@ -430,107 +431,117 @@ const dt = [
430
431
  "Cámara trasera dual con gran angular",
431
432
  "背面デュアル広角カメラ",
432
433
  "Stražnja dvostruka široka kamera"
433
- ], Y = (r) => {
434
- if (r instanceof Error) return r;
434
+ ], Q = (t) => {
435
+ if (t instanceof Error) return t;
435
436
  try {
436
- return new Error(JSON.stringify(r));
437
+ return new Error(JSON.stringify(t));
437
438
  } catch {
438
- return new Error(String(r));
439
+ return new Error(String(t));
439
440
  }
440
- }, $e = async () => {
441
+ };
442
+ function bt() {
443
+ const t = self.navigator.userAgent.toLowerCase();
444
+ return /iphone|ipad|ipod/.test(t);
445
+ }
446
+ const ze = async () => {
441
447
  try {
442
- const r = await navigator.mediaDevices.getUserMedia({
448
+ const t = await navigator.mediaDevices.getUserMedia({
443
449
  video: !0
444
450
  });
445
- De(r);
446
- } catch (r) {
447
- throw new U(
451
+ Pe(t);
452
+ } catch (t) {
453
+ throw new B(
448
454
  "Camera permission not given",
449
455
  "PERMISSION_DENIED",
450
- Y(r)
456
+ Q(t)
451
457
  );
452
458
  }
453
- }, ht = async () => {
459
+ }, pt = async () => {
454
460
  if (!isSecureContext)
455
- throw new Error(Ae`
461
+ throw new Error(Ne`
456
462
  Cameras can only be used in a secure context:
457
463
  https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
458
464
  `);
459
- return await $e(), (await navigator.mediaDevices.enumerateDevices()).filter((t) => t.kind === "videoinput");
460
- }, De = (r) => {
461
- const e = r.getTracks();
462
- for (const t of e)
463
- t.stop();
464
- }, mt = (r, e, t) => ({
465
+ return await ze(), (await navigator.mediaDevices.enumerateDevices()).filter((r) => r.kind === "videoinput");
466
+ }, Pe = (t) => {
467
+ const e = t.getTracks();
468
+ for (const r of e)
469
+ r.stop();
470
+ }, vt = (t, e, r) => ({
465
471
  video: {
466
- deviceId: t ? { exact: t } : void 0,
472
+ deviceId: r ? { exact: r } : void 0,
467
473
  frameRate: 30,
468
474
  aspectRatio: {
469
- exact: P[r].width / P[r].height
475
+ exact: P[t].width / P[t].height
470
476
  },
471
477
  width: {
472
- ideal: P[r].width
478
+ ideal: P[t].width
473
479
  },
474
480
  height: {
475
- ideal: P[r].height
481
+ ideal: P[t].height
476
482
  },
477
483
  facingMode: e
478
484
  },
479
485
  audio: !1
480
486
  });
481
- function gt(r) {
487
+ function wt(t) {
482
488
  let e = 0;
483
- return r.torchSupported && (e += 1), r.singleShotSupported && (e += 1), e;
489
+ return t.torchSupported && (e += 1), t.singleShotSupported && (e += 1), e;
484
490
  }
485
- function ft(r, e) {
486
- return r.filter((t) => e === "back" || e === void 0 ? Me(t.name) : xe(t.name));
491
+ function yt(t, e) {
492
+ return t.filter((r) => e === "back" ? Ie(r.name) : e === "front" ? Fe(r.name) : !0);
487
493
  }
488
- const bt = async (r, e = "4k", t = "back") => {
489
- if (r.length === 0)
490
- throw new Error("No cameras found");
491
- if (r.length === 1)
492
- return await r[0].startStream(e), r[0];
493
- let a = ft(r, t);
494
+ const St = async (t, e, r) => {
495
+ if (t.length === 0)
496
+ throw new Error("No cameras found on device");
497
+ if (t.length === 1)
498
+ return await t[0].startStream(e), t[0];
499
+ let a = yt(t, r);
494
500
  if (a.length === 1)
495
501
  return await a[0].startStream(e), a[0];
496
- if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a = r), t === "back") {
502
+ if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a = t), r === "back") {
497
503
  const s = a.find(
498
- (h) => dt.includes(h.name)
504
+ (l) => gt.includes(l.name)
499
505
  );
500
506
  if (s)
501
507
  return await s.startStream(e), s;
502
508
  }
503
- if (t === "front") {
509
+ if (r === "front") {
504
510
  const s = a[a.length - 1];
505
511
  return await s.startStream(e), s;
506
512
  }
507
513
  const n = /* @__PURE__ */ new Map();
508
- let o, i = -1 / 0;
509
- for (let s = a.length - 1; s >= 0; s--) {
510
- const h = a[s];
514
+ let i, o = -1 / 0;
515
+ bt() || a.reverse();
516
+ for (const s of a)
511
517
  try {
512
- await h.startStream(e);
513
- const f = gt(h);
514
- if (n.set(h, f), f > i ? (o && o !== h && o.stopStream(), i = f, o = h) : h.stopStream(), f === 2)
515
- return console.debug("Found camera with all capabilities, returning early"), h;
516
- } catch (f) {
517
- console.warn(`Failed to test camera ${h.name}:`, f), h.stopStream();
518
+ await s.startStream(e);
519
+ const l = wt(s);
520
+ if (n.set(s, l), l > o)
521
+ o = l, i = s;
522
+ else {
523
+ s.stopStream();
524
+ continue;
525
+ }
526
+ if (l === 2)
527
+ return s;
528
+ s.stopStream();
529
+ } catch (l) {
530
+ console.warn(`Failed to test camera ${s.name}:`, l), s.stopStream();
518
531
  }
519
- }
520
- if (o)
521
- return o;
522
- const c = a[0];
523
- return await c.startStream(e), c;
532
+ if (!i)
533
+ throw new Error("No suitable camera found, should not happen!");
534
+ return i;
524
535
  };
525
- function pt(r) {
536
+ function Ct(t) {
526
537
  const e = [];
527
- for (const t of r) {
528
- const a = new Ie(t);
538
+ for (const r of t) {
539
+ const a = new $e(r);
529
540
  a !== null && e.push(a);
530
541
  }
531
542
  return e;
532
543
  }
533
- const vt = {
544
+ const Et = {
534
545
  deviceInfo: {},
535
546
  name: "",
536
547
  facingMode: void 0,
@@ -540,14 +551,15 @@ const vt = {
540
551
  singleShotSupported: !1,
541
552
  maxSupportedResolution: void 0,
542
553
  streamCapabilities: void 0,
554
+ deviceCapabilities: void 0,
543
555
  error: void 0
544
556
  };
545
- class Ie {
557
+ class $e {
546
558
  /**
547
559
  * The internal state of the camera, implemented as a Zustand store.
548
560
  */
549
561
  store = de()(
550
- ue(() => vt)
562
+ ue(() => Et)
551
563
  );
552
564
  #e = /* @__PURE__ */ new Set();
553
565
  /**
@@ -568,7 +580,11 @@ class Ie {
568
580
  return this.store.getState().streamCapabilities;
569
581
  }
570
582
  get activeStream() {
571
- return this.store.getState().activeStream;
583
+ return this.store.getState().activeStream?.active === !1 && (console.warn(
584
+ "Detected inactive stream on camera:",
585
+ this.name,
586
+ this.store.getState().activeStream
587
+ ), this.store.setState({ activeStream: void 0 })), this.store.getState().activeStream;
572
588
  }
573
589
  get name() {
574
590
  return this.store.getState().name;
@@ -596,19 +612,18 @@ class Ie {
596
612
  constructor(e) {
597
613
  if (e.kind !== "videoinput")
598
614
  throw new Error("Device is not a video input device");
599
- let t;
600
- xe(e.label) && (t = "front"), Me(e.label) && (t = "back"), this.store.setState({
615
+ let r;
616
+ Fe(e.label) && (r = "front"), Ie(e.label) && (r = "back"), this.store.setState({
601
617
  deviceInfo: e,
602
618
  name: e.label || "Unknown Camera",
603
- facingMode: t
619
+ facingMode: r
604
620
  });
605
621
  }
606
- subscribe(e, t, a) {
607
- console.debug(`Creating subscription for camera: ${this.name}`);
622
+ subscribe(e, r, a) {
608
623
  let n;
609
- return t ? n = this.store.subscribe(
624
+ return r ? n = this.store.subscribe(
610
625
  e,
611
- t,
626
+ r,
612
627
  a
613
628
  ) : n = this.store.subscribe(
614
629
  e
@@ -627,17 +642,18 @@ class Ie {
627
642
  if (this.activeStream)
628
643
  return this.activeStream;
629
644
  this.maxSupportedResolution && (e = this.maxSupportedResolution);
630
- const t = await this.acquireStreamWithFallback(e);
631
- this.populateCapabilities(t), this.store.setState({ activeStream: t });
632
- const a = t.getVideoTracks()[0];
645
+ const r = await this.acquireStreamWithFallback(e);
646
+ this.populateCapabilities(r), this.store.setState({ activeStream: r });
647
+ const a = r.getVideoTracks()[0];
633
648
  return a.onended = () => {
634
- this.store.setState({
635
- error: new U(
636
- "Camera stream ended unexpectedly",
637
- "STREAM_ENDED_UNEXPECTEDLY"
638
- )
639
- }), this.stopStream();
640
- }, t;
649
+ const n = new B(
650
+ "Camera stream ended unexpectedly",
651
+ "STREAM_ENDED_UNEXPECTEDLY"
652
+ );
653
+ throw this.store.setState({
654
+ error: n
655
+ }), this.stopStream(), n;
656
+ }, r;
641
657
  }
642
658
  /**
643
659
  * Acquires a camera stream with the specified resolution.
@@ -648,16 +664,16 @@ class Ie {
648
664
  */
649
665
  async acquireStreamWithFallback(e) {
650
666
  try {
651
- const t = mt(
667
+ const r = vt(
652
668
  e,
653
669
  this.facingMode,
654
670
  this.deviceInfo.deviceId
655
671
  );
656
- return await navigator.mediaDevices.getUserMedia(t);
657
- } catch (t) {
672
+ return await navigator.mediaDevices.getUserMedia(r);
673
+ } catch (r) {
658
674
  console.warn(
659
675
  `Can't get camera stream for ${this.name} at ${e}`,
660
- t
676
+ r
661
677
  );
662
678
  const a = Object.keys(P).indexOf(e);
663
679
  if (a === 0)
@@ -672,18 +688,22 @@ class Ie {
672
688
  * @param stream - The stream to populate the capabilities from.
673
689
  */
674
690
  populateCapabilities(e) {
675
- const t = e.getVideoTracks()[0].getCapabilities();
676
- ge(t, this.streamCapabilities) || this.store.setState({ streamCapabilities: t });
677
- const o = e.getVideoTracks()[0].getSettings();
678
- if (!o.width || !o.height)
691
+ const r = e.getVideoTracks()[0].getCapabilities();
692
+ if ("getCapabilities" in this.deviceInfo) {
693
+ const u = this.deviceInfo.getCapabilities();
694
+ this.store.setState({ deviceCapabilities: u });
695
+ }
696
+ ge(r, this.streamCapabilities) || this.store.setState({ streamCapabilities: r });
697
+ const i = e.getVideoTracks()[0].getSettings();
698
+ if (!i.width || !i.height)
679
699
  throw new Error(
680
700
  "Video track resolution not available. Should not happen."
681
701
  );
682
- const i = {
683
- width: o.width,
684
- height: o.height
685
- }, c = Ct(i), s = {};
686
- !this.maxSupportedResolution && c && (s.maxSupportedResolution = c), "torch" in t && (s.torchSupported = !0), "focusMode" in t && t.focusMode?.includes("single-shot") && (s.singleShotSupported = !0), this.facingMode === "front" && t.facingMode?.includes("environment") && (s.facingMode = "back", console.warn("Front camera selected, but facingMode is environment")), this.facingMode === "back" && t.facingMode?.includes("user") && (s.facingMode = "front", console.warn("Back camera selected, but facingMode is user")), this.facingMode || (t.facingMode?.includes("environment") && (s.facingMode = "back"), t.facingMode?.includes("user") && (s.facingMode = "front")), ge(s, this.store.getState()) || this.store.setState(s);
702
+ const o = {
703
+ width: i.width,
704
+ height: i.height
705
+ }, s = Mt(o), l = {};
706
+ !this.maxSupportedResolution && s && (l.maxSupportedResolution = s), "torch" in r && (l.torchSupported = !0), "focusMode" in r && r.focusMode?.includes("single-shot") && (l.singleShotSupported = !0), this.facingMode === "front" && r.facingMode?.includes("environment") && (l.facingMode = "back", console.warn("Front camera selected, but facingMode is environment")), this.facingMode === "back" && r.facingMode?.includes("user") && (l.facingMode = "front", console.warn("Back camera selected, but facingMode is user")), this.facingMode || (r.facingMode?.includes("environment") && (l.facingMode = "back"), r.facingMode?.includes("user") && (l.facingMode = "front")), ge(l, this.store.getState()) || this.store.setState(l);
687
707
  }
688
708
  /**
689
709
  * Toggles the torch on the camera.
@@ -704,8 +724,8 @@ class Ie {
704
724
  }
705
725
  ]
706
726
  }), this.store.setState({ torchEnabled: !this.torchEnabled });
707
- } catch (t) {
708
- throw console.error("Failed to toggle torch", t), this.store.setState({ torchEnabled: !1, torchSupported: !1 }), new Error("Failed to toggle torch", { cause: t });
727
+ } catch (r) {
728
+ throw console.error("Failed to toggle torch", r), this.store.setState({ torchEnabled: !1, torchSupported: !1 }), new Error("Failed to toggle torch", { cause: r });
709
729
  }
710
730
  return this.torchEnabled;
711
731
  }
@@ -713,7 +733,7 @@ class Ie {
713
733
  * Stops the stream on the camera.
714
734
  */
715
735
  stopStream() {
716
- this.activeStream && (console.debug(`Stopping active stream on ${this.name}`), De(this.activeStream), this.store.setState({
736
+ this.activeStream && (console.debug(`Stopping active stream on ${this.name}`), Pe(this.activeStream), this.store.setState({
717
737
  activeStream: void 0,
718
738
  streamCapabilities: void 0,
719
739
  torchEnabled: !1
@@ -737,37 +757,37 @@ const P = {
737
757
  "1080p": { width: 1920, height: 1080 },
738
758
  "4k": { width: 3840, height: 2160 }
739
759
  };
740
- function wt(r) {
741
- return Math.max(r.width, r.height);
760
+ function kt(t) {
761
+ return Math.max(t.width, t.height);
742
762
  }
743
- function St(r) {
763
+ function Tt(t) {
744
764
  const e = {
745
- width: Math.max(r.width, r.height),
746
- height: Math.min(r.width, r.height)
765
+ width: Math.max(t.width, t.height),
766
+ height: Math.min(t.width, t.height)
747
767
  };
748
768
  return Math.abs(e.width / e.height - 16 / 9) > 1e-4 && console.warn(
749
769
  `Resolution ${JSON.stringify(
750
- r
770
+ t
751
771
  )} is not 16:9, may cause issues with some video players.`
752
772
  ), e;
753
773
  }
754
- function yt(r) {
755
- const e = wt(r);
774
+ function xt(t) {
775
+ const e = kt(t);
756
776
  return e > 1920 ? "4k" : e > 1280 ? "1080p" : "720p";
757
777
  }
758
- function Ct(r) {
759
- const e = St(r), t = Object.entries(P).find(
760
- ([n, o]) => o.width === e.width && o.height === e.height
778
+ function Mt(t) {
779
+ const e = Tt(t), r = Object.entries(P).find(
780
+ ([n, i]) => i.width === e.width && i.height === e.height
761
781
  );
762
- if (!t) {
763
- const n = yt(r);
782
+ if (!r) {
783
+ const n = xt(t);
764
784
  return console.warn(
765
- `No exact resolution match found for ${JSON.stringify(r)}, categorizing as ${n}`
785
+ `No exact resolution match found for ${JSON.stringify(t)}, categorizing as ${n}`
766
786
  ), n;
767
787
  }
768
- return t[0];
788
+ return r[0];
769
789
  }
770
- const Fe = {
790
+ const Oe = {
771
791
  cameras: [],
772
792
  facingFilter: void 0,
773
793
  videoElement: void 0,
@@ -780,40 +800,40 @@ const Fe = {
780
800
  cameraPermission: void 0,
781
801
  mirrorX: !1,
782
802
  errorState: void 0
783
- }, u = de()(
803
+ }, f = de()(
784
804
  // this is important! Otherwise solid-zustand will start mutating the initial state
785
- ue(() => structuredClone(Fe))
786
- ), Et = () => {
787
- console.debug("Stopping all cameras and resetting the `cameraManagerStore`."), u.getState().cameras.forEach((r) => {
788
- r.stopStream();
789
- }), u.setState(structuredClone(Fe));
790
- }, be = Element.prototype.attachShadow;
791
- function me() {
805
+ ue(() => structuredClone(Oe))
806
+ ), Rt = () => {
807
+ console.debug("Stopping all cameras and resetting the `cameraManagerStore`."), f.getState().cameras.forEach((t) => {
808
+ t.stopStream();
809
+ }), f.setState(structuredClone(Oe));
810
+ }, ve = Element.prototype.attachShadow;
811
+ function fe() {
792
812
  return typeof window.ShadyDOM < "u" && typeof ShadowRoot < "u";
793
813
  }
794
- function kt() {
814
+ function _t() {
795
815
  return typeof ShadowRoot < "u";
796
816
  }
797
- function Tt(r) {
798
- be == null || me() || (Element.prototype.attachShadow = function(e) {
799
- const t = be.call(this, e);
800
- return r(t), t;
817
+ function At(t) {
818
+ ve == null || fe() || (Element.prototype.attachShadow = function(e) {
819
+ const r = ve.call(this, e);
820
+ return t(r), r;
801
821
  });
802
822
  }
803
- function _t(r, ...e) {
804
- const t = new Set(e);
823
+ function Dt(t, ...e) {
824
+ const r = new Set(e);
805
825
  let a = !1;
806
826
  const n = () => {
807
- for (const o of t)
808
- r(o);
809
- t.clear();
827
+ for (const i of r)
828
+ t(i);
829
+ r.clear();
810
830
  };
811
831
  return {
812
832
  isRunning() {
813
833
  return a;
814
834
  },
815
- schedule(o) {
816
- t.add(o), a && n();
835
+ schedule(i) {
836
+ r.add(i), a && n();
817
837
  },
818
838
  stop() {
819
839
  a = !1;
@@ -823,98 +843,98 @@ function _t(r, ...e) {
823
843
  }
824
844
  };
825
845
  }
826
- const Mt = {
846
+ const It = {
827
847
  childList: !0,
828
848
  subtree: !0
829
- }, xt = (r) => {
830
- typeof queueMicrotask < "u" ? queueMicrotask(r) : typeof Promise < "u" ? Promise.resolve().then(() => r()) : setTimeout(() => r(), 0);
849
+ }, Ft = (t) => {
850
+ typeof queueMicrotask < "u" ? queueMicrotask(t) : typeof Promise < "u" ? Promise.resolve().then(() => t()) : setTimeout(() => t(), 0);
831
851
  };
832
- function pe(r) {
833
- if (typeof Symbol < "u" && r[Symbol.iterator] != null)
834
- return [...r];
852
+ function we(t) {
853
+ if (typeof Symbol < "u" && t[Symbol.iterator] != null)
854
+ return [...t];
835
855
  {
836
856
  const e = [];
837
- for (let t = 0; t < r.length; t++)
838
- e[t] = r[t];
857
+ for (let r = 0; r < t.length; r++)
858
+ e[r] = t[r];
839
859
  return e;
840
860
  }
841
861
  }
842
- function Rt(r, e) {
843
- return me() ? new Set(pe(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, e))) : new Set("querySelectorAll" in r ? pe(r.querySelectorAll(e)) : []);
862
+ function Lt(t, e) {
863
+ return fe() ? new Set(we(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, e))) : new Set("querySelectorAll" in t ? we(t.querySelectorAll(e)) : []);
844
864
  }
845
- function At(r, e) {
846
- return /* @__PURE__ */ new Set([...r ?? [], ...e ?? []]);
865
+ function Nt(t, e) {
866
+ return /* @__PURE__ */ new Set([...t ?? [], ...e ?? []]);
847
867
  }
848
- function $t(r) {
849
- return "activeElement" in r;
868
+ function zt(t) {
869
+ return "activeElement" in t;
850
870
  }
851
- function Le(r = document.documentElement) {
852
- if ($t(r) && ze(r), me() && r instanceof ShadowRoot || !kt())
871
+ function Ve(t = document.documentElement) {
872
+ if (zt(t) && Be(t), fe() && t instanceof ShadowRoot || !_t())
853
873
  return;
854
- const e = r.childNodes, t = "shadowRoot" in r && r.shadowRoot != null ? [r.shadowRoot] : [];
855
- for (const a of [...e, ...t])
856
- Le(a);
874
+ const e = t.childNodes, r = "shadowRoot" in t && t.shadowRoot != null ? [t.shadowRoot] : [];
875
+ for (const a of [...e, ...r])
876
+ Ve(a);
857
877
  }
858
- function Dt(r) {
859
- return "isConnected" in Node.prototype ? r.isConnected : r.ownerDocument == null || !(r.ownerDocument.compareDocumentPosition(r) & r.DOCUMENT_POSITION_DISCONNECTED);
878
+ function Pt(t) {
879
+ return "isConnected" in Node.prototype ? t.isConnected : t.ownerDocument == null || !(t.ownerDocument.compareDocumentPosition(t) & t.DOCUMENT_POSITION_DISCONNECTED);
860
880
  }
861
- const W = /* @__PURE__ */ new Map();
862
- function It(r, e) {
863
- const t = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap();
864
- let i = !1, c = !1, s = !1;
865
- const h = () => {
866
- c = !0;
867
- const b = [...t];
868
- b.length > 0 && e(b, r), t.clear(), i = !1, c = !1;
869
- }, f = () => {
870
- i || (i = !0, xt(h));
871
- }, p = (b) => {
872
- t.add(b), c || f();
873
- }, S = () => {
874
- const b = [...t];
875
- return t.clear(), b;
876
- }, g = () => {
881
+ const j = /* @__PURE__ */ new Map();
882
+ function $t(t, e) {
883
+ const r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new WeakMap();
884
+ let o = !1, s = !1, l = !1;
885
+ const d = () => {
886
+ s = !0;
887
+ const v = [...r];
888
+ v.length > 0 && e(v, t), r.clear(), o = !1, s = !1;
889
+ }, u = () => {
890
+ o || (o = !0, Ft(d));
891
+ }, b = (v) => {
892
+ r.add(v), s || u();
893
+ }, p = () => {
894
+ const v = [...r];
895
+ return r.clear(), v;
896
+ }, h = () => {
877
897
  a.clear();
878
- }, d = (b, E) => {
879
- let x = n.get(b);
880
- const F = Rt(b, E), G = x?.get(E), X = At(F, G);
881
- m(X), x == null && (x = /* @__PURE__ */ new Map(), n.set(b, x)), x.set(E, F);
882
- }, m = (b) => {
883
- for (const E of b) {
884
- const x = o.get(E), F = Dt(E);
885
- x !== F && (o.set(E, F), p({
886
- connected: F,
887
- target: E
898
+ }, m = (v, C) => {
899
+ let M = n.get(v);
900
+ const L = Lt(v, C), W = M?.get(C), G = Nt(L, W);
901
+ g(G), M == null && (M = /* @__PURE__ */ new Map(), n.set(v, M)), M.set(C, L);
902
+ }, g = (v) => {
903
+ for (const C of v) {
904
+ const M = i.get(C), L = Pt(C);
905
+ M !== L && (i.set(C, L), b({
906
+ connected: L,
907
+ target: C
888
908
  }));
889
909
  }
890
- }, v = {
910
+ }, T = {
891
911
  observedTargets: a,
892
- queryRootAndHandleMutationChanges: d,
893
- handleMutationChange: m,
894
- addObservedTarget: (b) => {
895
- if (se.run(), s || (s = !0, Le()), a.add(b), typeof b != "string")
896
- m([b]);
912
+ queryRootAndHandleMutationChanges: m,
913
+ handleMutationChange: g,
914
+ addObservedTarget: (v) => {
915
+ if (se.run(), l || (l = !0, Ve()), a.add(v), typeof v != "string")
916
+ g([v]);
897
917
  else
898
- for (const E of ie)
899
- d(E, b);
918
+ for (const C of ie)
919
+ m(C, v);
900
920
  },
901
- clearObservedTargets: g,
902
- clearQueue: S
921
+ clearObservedTargets: h,
922
+ clearQueue: p
903
923
  };
904
- W.set(r, v);
924
+ j.set(t, T);
905
925
  }
906
- const Ft = (r) => {
907
- for (const e of r)
926
+ const Ot = (t) => {
927
+ for (const e of t)
908
928
  if (e.type === "childList")
909
- for (const t of W.values())
910
- for (const a of t.observedTargets)
911
- typeof a == "string" ? t.queryRootAndHandleMutationChanges(e.target, a) : t.handleMutationChange([a]);
912
- }, ie = /* @__PURE__ */ new Set(), ze = /* @__PURE__ */ (() => {
913
- let r;
929
+ for (const r of j.values())
930
+ for (const a of r.observedTargets)
931
+ typeof a == "string" ? r.queryRootAndHandleMutationChanges(e.target, a) : r.handleMutationChange([a]);
932
+ }, ie = /* @__PURE__ */ new Set(), Be = /* @__PURE__ */ (() => {
933
+ let t;
914
934
  return function(e) {
915
- ie.has(e) || (ie.add(e), r == null && (r = new MutationObserver(Ft)), r.observe(e, Mt));
935
+ ie.has(e) || (ie.add(e), t == null && (t = new MutationObserver(Ot)), t.observe(e, It));
916
936
  };
917
- })(), se = _t(ze, document.documentElement);
937
+ })(), se = Dt(Be, document.documentElement);
918
938
  class z {
919
939
  constructor(e) {
920
940
  if (new.target === void 0)
@@ -923,7 +943,7 @@ class z {
923
943
  throw new ReferenceError(`Failed to construct '${z.name}': 1 argument required, but only 0 present.`);
924
944
  if (typeof e != "function")
925
945
  throw new TypeError(`Failed to construct '${z.name}': The callback provided as parameter 1 is not a function.`);
926
- It(this, e);
946
+ $t(this, e);
927
947
  }
928
948
  /**
929
949
  * The Symbol.@@toStringTag value
@@ -942,32 +962,32 @@ class z {
942
962
  throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${z.name}': 1 argument required, but only 0 present.`);
943
963
  if (typeof e != "string" && !(e instanceof Node))
944
964
  throw new TypeError(`Failed to execute '${this.observe.name}' on '${z.name}': parameter 1 is not of type 'Node' or a DOMString.`);
945
- const t = W.get(this);
946
- t?.addObservedTarget(e);
965
+ const r = j.get(this);
966
+ r?.addObservedTarget(e);
947
967
  }
948
968
  /**
949
969
  * Takes the records immediately (instead of waiting for the next flush)
950
970
  */
951
971
  takeRecords() {
952
- const e = W.get(this);
972
+ const e = j.get(this);
953
973
  return e == null ? [] : e.clearQueue();
954
974
  }
955
975
  /**
956
976
  * Disconnects the ConnectionObserver such that none of its callbacks will be invoked any longer
957
977
  */
958
978
  disconnect() {
959
- const e = W.get(this);
979
+ const e = j.get(this);
960
980
  e?.clearObservedTargets();
961
981
  }
962
982
  }
963
- Tt(se.schedule.bind(se));
964
- function ve(r, ...e) {
965
- return r.addEventListener(...e), () => {
966
- r.removeEventListener(...e);
983
+ At(se.schedule.bind(se));
984
+ function ye(t, ...e) {
985
+ return t.addEventListener(...e), () => {
986
+ t.removeEventListener(...e);
967
987
  };
968
988
  }
969
- function le(r) {
970
- const e = Ne(r);
989
+ function le(t) {
990
+ const e = Ue(t);
971
991
  if ("detached" in e)
972
992
  return e.detached;
973
993
  try {
@@ -976,57 +996,57 @@ function le(r) {
976
996
  return !0;
977
997
  }
978
998
  }
979
- class Lt {
999
+ class Vt {
980
1000
  #e;
981
- #n = null;
1001
+ #o = null;
982
1002
  #r = null;
983
1003
  #a = null;
984
- #i = null;
1004
+ #n = null;
985
1005
  #t = null;
986
- #s = 0;
987
- #o = 0;
988
- #l;
989
- #c = 4;
1006
+ #l = 0;
1007
+ #i = 0;
1008
+ #c;
1009
+ #u = 4;
990
1010
  /**
991
1011
  * Creates a new VideoFrameProcessor.
992
1012
  *
993
1013
  * @param options - The options for the VideoFrameProcessor.
994
1014
  */
995
1015
  constructor(e = {}) {
996
- const { canvasRenderingMode: t = "webgl2", fallbackWebGlTo2d: a = !0 } = e;
997
- if (this.#l = t, this.#e = document.createElement("canvas"), t === "2d")
998
- this.#d();
999
- else if (t === "webgl2")
1016
+ const { canvasRenderingMode: r = "webgl2", fallbackWebGlTo2d: a = !0 } = e;
1017
+ if (this.#c = r, this.#e = document.createElement("canvas"), r === "2d")
1018
+ this.#s();
1019
+ else if (r === "webgl2")
1000
1020
  try {
1001
- this.#m();
1021
+ this.#h();
1002
1022
  } catch (n) {
1003
1023
  if (a)
1004
1024
  console.warn(
1005
1025
  "Failed to create WebGL2 context, falling back to 2D canvas"
1006
- ), this.#l = "2d", this.#d();
1026
+ ), this.#c = "2d", this.#s();
1007
1027
  else
1008
1028
  throw n;
1009
1029
  }
1010
1030
  else
1011
1031
  throw new Error(
1012
- `Unsupported rendering context: ${t}`
1032
+ `Unsupported rendering context: ${r}`
1013
1033
  );
1014
1034
  }
1015
1035
  /**
1016
1036
  * Initializes the 2D canvas context.
1017
1037
  */
1018
- #d() {
1038
+ #s() {
1019
1039
  const e = this.#e.getContext("2d", {
1020
1040
  alpha: !1,
1021
1041
  willReadFrequently: !0
1022
1042
  });
1023
1043
  if (!e) throw new Error("CanvasRenderingContext2D is missing!");
1024
- this.#n = e;
1044
+ this.#o = e;
1025
1045
  }
1026
1046
  /**
1027
1047
  * Initializes the WebGL2 context and resources.
1028
1048
  */
1029
- #m() {
1049
+ #h() {
1030
1050
  const e = this.#e.getContext("webgl2", {
1031
1051
  alpha: !1,
1032
1052
  depth: !1,
@@ -1039,16 +1059,16 @@ class Lt {
1039
1059
  });
1040
1060
  if (!e) throw new Error("WebGL2RenderingContext is missing!");
1041
1061
  this.#r = e;
1042
- const t = e.createTexture();
1043
- if (!t) throw new Error("Failed to create WebGL texture");
1044
- this.#a = t, e.bindTexture(e.TEXTURE_2D, t), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST);
1062
+ const r = e.createTexture();
1063
+ if (!r) throw new Error("Failed to create WebGL texture");
1064
+ this.#a = r, e.bindTexture(e.TEXTURE_2D, r), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST);
1045
1065
  const a = e.createFramebuffer();
1046
1066
  if (!a) throw new Error("Failed to create framebuffer");
1047
- this.#i = a, e.bindFramebuffer(e.FRAMEBUFFER, a), e.framebufferTexture2D(
1067
+ this.#n = a, e.bindFramebuffer(e.FRAMEBUFFER, a), e.framebufferTexture2D(
1048
1068
  e.FRAMEBUFFER,
1049
1069
  e.COLOR_ATTACHMENT0,
1050
1070
  e.TEXTURE_2D,
1051
- t,
1071
+ r,
1052
1072
  0
1053
1073
  );
1054
1074
  }
@@ -1061,15 +1081,15 @@ class Lt {
1061
1081
  * @param arrayBuffer - The array buffer to reattach.
1062
1082
  */
1063
1083
  reattachArrayBuffer(e) {
1064
- const t = Ne(e);
1065
- if (le(t))
1084
+ const r = Ue(e);
1085
+ if (le(r))
1066
1086
  throw new Error("Can't use a detached array buffer!");
1067
- const a = this.#s * this.#o * 4;
1068
- if (t.byteLength === a)
1069
- this.#t = new Uint8ClampedArray(t);
1087
+ const a = this.#l * this.#i * 4;
1088
+ if (r.byteLength === a)
1089
+ this.#t = new Uint8ClampedArray(r);
1070
1090
  else
1071
1091
  throw new Error(
1072
- `ArrayBuffer size mismatch: expected ${a}, got ${t.byteLength}`
1092
+ `ArrayBuffer size mismatch: expected ${a}, got ${r.byteLength}`
1073
1093
  );
1074
1094
  }
1075
1095
  /**
@@ -1089,8 +1109,8 @@ class Lt {
1089
1109
  * @param area - The extraction area.
1090
1110
  * @returns The image data.
1091
1111
  */
1092
- getImageData(e, t) {
1093
- return this.#l === "2d" ? this.#g(e, t) : this.#u(e, t);
1112
+ getImageData(e, r) {
1113
+ return this.#c === "2d" ? this.#f(e, r) : this.#m(e, r);
1094
1114
  }
1095
1115
  /**
1096
1116
  * Used to get the current ImageData object with the current buffer. Useful
@@ -1102,7 +1122,7 @@ class Lt {
1102
1122
  getCurrentImageData() {
1103
1123
  if (!this.#t)
1104
1124
  throw new Error("Buffer is missing!");
1105
- return new ImageData(this.#t, this.#s, this.#o);
1125
+ return new ImageData(this.#t, this.#l, this.#i);
1106
1126
  }
1107
1127
  /**
1108
1128
  * Extract image data using 2D canvas.
@@ -1111,11 +1131,11 @@ class Lt {
1111
1131
  * @param area - The extraction area.
1112
1132
  * @returns The image data.
1113
1133
  */
1114
- #g(e, t) {
1115
- if (!this.#n)
1134
+ #f(e, r) {
1135
+ if (!this.#o)
1116
1136
  throw new Error("CanvasRenderingContext2D is missing!");
1117
- const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = t?.x ?? 0, i = t?.y ?? 0, c = t?.width ?? a, s = t?.height ?? n;
1118
- return this.#h(c, s), this.#n.drawImage(e, o, i, c, s), this.#n.getImageData(0, 0, c, s);
1137
+ const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, i = r?.x ?? 0, o = r?.y ?? 0, s = r?.width ?? a, l = r?.height ?? n;
1138
+ return this.#d(s, l), this.#o.drawImage(e, i, o, s, l), this.#o.getImageData(0, 0, s, l);
1119
1139
  }
1120
1140
  /**
1121
1141
  * Extract image data using WebGL2.
@@ -1124,26 +1144,26 @@ class Lt {
1124
1144
  * @param area - The extraction area.
1125
1145
  * @returns The image data.
1126
1146
  */
1127
- #u(e, t) {
1128
- if (!this.#r || !this.#a || !this.#i)
1147
+ #m(e, r) {
1148
+ if (!this.#r || !this.#a || !this.#n)
1129
1149
  throw new Error("WebGL2 context or resources are missing!");
1130
- const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = t?.x ?? 0, i = t?.y ?? 0, c = t?.width ?? a, s = t?.height ?? n, h = c * s * 4;
1131
- if (this.#h(c, s), this.isBufferDetached())
1150
+ const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, i = r?.x ?? 0, o = r?.y ?? 0, s = r?.width ?? a, l = r?.height ?? n, d = s * l * 4;
1151
+ if (this.#d(s, l), this.isBufferDetached())
1132
1152
  throw new Error("Buffer is detached!");
1133
- (!this.#t || this.#t.length !== h) && (this.#t = new Uint8ClampedArray(h));
1134
- const f = this.#r;
1135
- f.bindTexture(f.TEXTURE_2D, this.#a), f.texImage2D(f.TEXTURE_2D, 0, f.RGBA, f.RGBA, f.UNSIGNED_BYTE, e), f.bindFramebuffer(f.FRAMEBUFFER, this.#i);
1153
+ (!this.#t || this.#t.length !== d) && (this.#t = new Uint8ClampedArray(d));
1154
+ const u = this.#r;
1155
+ u.bindTexture(u.TEXTURE_2D, this.#a), u.texImage2D(u.TEXTURE_2D, 0, u.RGBA, u.RGBA, u.UNSIGNED_BYTE, e), u.bindFramebuffer(u.FRAMEBUFFER, this.#n);
1136
1156
  try {
1137
- f.pixelStorei(f.PACK_ALIGNMENT, this.#c), f.readPixels(o, i, c, s, f.RGBA, f.UNSIGNED_BYTE, this.#t);
1138
- } catch (p) {
1139
- if (this.#c !== 1) {
1140
- this.#c = 1, f.pixelStorei(f.PACK_ALIGNMENT, 1);
1141
- const S = new Uint8ClampedArray(h);
1142
- return f.readPixels(0, 0, c, s, f.RGBA, f.UNSIGNED_BYTE, S), this.#t = S, new ImageData(S, c, s);
1157
+ u.pixelStorei(u.PACK_ALIGNMENT, this.#u), u.readPixels(i, o, s, l, u.RGBA, u.UNSIGNED_BYTE, this.#t);
1158
+ } catch (b) {
1159
+ if (this.#u !== 1) {
1160
+ this.#u = 1, u.pixelStorei(u.PACK_ALIGNMENT, 1);
1161
+ const p = new Uint8ClampedArray(d);
1162
+ return u.readPixels(0, 0, s, l, u.RGBA, u.UNSIGNED_BYTE, p), this.#t = p, new ImageData(p, s, l);
1143
1163
  }
1144
- throw p;
1164
+ throw b;
1145
1165
  }
1146
- return new ImageData(this.#t, c, s);
1166
+ return new ImageData(this.#t, s, l);
1147
1167
  }
1148
1168
  /**
1149
1169
  * Update canvas dimensions if needed.
@@ -1153,10 +1173,10 @@ class Lt {
1153
1173
  * @param width - The width of the canvas.
1154
1174
  * @param height - The height of the canvas.
1155
1175
  */
1156
- #h(e, t) {
1157
- if (this.#s !== e || this.#o !== t) {
1158
- this.#e.width = e, this.#e.height = t, this.#s = e, this.#o = t;
1159
- const a = e * t * 4;
1176
+ #d(e, r) {
1177
+ if (this.#l !== e || this.#i !== r) {
1178
+ this.#e.width = e, this.#e.height = r, this.#l = e, this.#i = r;
1179
+ const a = e * r * 4;
1160
1180
  this.#t = new Uint8ClampedArray(a);
1161
1181
  }
1162
1182
  }
@@ -1164,12 +1184,13 @@ class Lt {
1164
1184
  * Clean up resources.
1165
1185
  */
1166
1186
  dispose() {
1167
- this.#r && (this.#a && (this.#r.deleteTexture(this.#a), this.#a = null), this.#i && (this.#r.deleteFramebuffer(this.#i), this.#i = null)), this.#n = null, this.#r = null, this.#t = null;
1187
+ this.#r && (this.#a && (this.#r.deleteTexture(this.#a), this.#a = null), this.#n && (this.#r.deleteFramebuffer(this.#n), this.#n = null)), this.#o = null, this.#r = null, this.#t = null;
1168
1188
  }
1169
1189
  }
1170
- const Ne = (r) => ArrayBuffer.isView(r) ? r.buffer : r;
1190
+ const Ue = (t) => ArrayBuffer.isView(t) ? t.buffer : t;
1171
1191
  class aa {
1172
1192
  #e;
1193
+ #o;
1173
1194
  /**
1174
1195
  * The desired video resolution for camera streams. This is used as the ideal resolution
1175
1196
  * when starting camera streams. If a camera doesn't support the specified resolution,
@@ -1177,25 +1198,31 @@ class aa {
1177
1198
  * 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
1178
1199
  * camera capabilities and system constraints.
1179
1200
  */
1180
- #n;
1181
1201
  #r;
1182
1202
  #a;
1183
- #i;
1203
+ #n;
1184
1204
  #t;
1205
+ #l;
1206
+ #i() {
1207
+ return typeof document > "u" ? !1 : document.visibilityState === "hidden";
1208
+ }
1209
+ #c(e) {
1210
+ this.#o !== "capturing" && (this.#o = e);
1211
+ }
1185
1212
  /**
1186
1213
  * If true, the user has initiated an abort. This will prevent the
1187
1214
  * CameraManager from throwing errors when the user interrupts the process.
1188
1215
  */
1189
- #s = !1;
1216
+ #u = !1;
1190
1217
  /**
1191
1218
  * If true, the user has initiated an abort. This will prevent the
1192
1219
  * CameraManager from throwing errors when the user interrupts the process.
1193
1220
  */
1194
1221
  get userInitiatedAbort() {
1195
- return this.#s;
1222
+ return this.#u;
1196
1223
  }
1197
1224
  set userInitiatedAbort(e) {
1198
- this.#s = e;
1225
+ this.#u = e;
1199
1226
  }
1200
1227
  /**
1201
1228
  * Sets the area of the video frame that will be extracted.
@@ -1203,8 +1230,8 @@ class aa {
1203
1230
  * @param extractionArea The area of the video frame that will be extracted.
1204
1231
  */
1205
1232
  setExtractionArea(e) {
1206
- const t = u.getState().extractionArea;
1207
- t && t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height || u.setState({
1233
+ const r = f.getState().extractionArea;
1234
+ r && r.x === e.x && r.y === e.y && r.width === e.width && r.height === e.height || f.setState({
1208
1235
  extractionArea: e
1209
1236
  });
1210
1237
  }
@@ -1214,27 +1241,27 @@ class aa {
1214
1241
  * @returns The area of the video frame that will be extracted.
1215
1242
  */
1216
1243
  get extractionArea() {
1217
- return u.getState().extractionArea;
1244
+ return f.getState().extractionArea;
1218
1245
  }
1219
1246
  /**
1220
1247
  * Callbacks that will be triggered on each frame when the playback state is
1221
1248
  * "capturing".
1222
1249
  */
1223
- #o = /* @__PURE__ */ new Set();
1250
+ #s = /* @__PURE__ */ new Set();
1224
1251
  /**
1225
1252
  * Creates a new CameraManager instance.
1226
1253
  *
1227
1254
  * @param options - The options for the CameraManager.
1228
1255
  * @param videoFrameProcessorOptions - The options for the VideoFrameProcessor.
1229
1256
  */
1230
- constructor(e = {}, t) {
1257
+ constructor(e = {}, r) {
1231
1258
  const { mirrorFrontCameras: a, preferredResolution: n } = {
1232
- ...zt,
1259
+ ...Bt,
1233
1260
  ...e
1234
1261
  };
1235
- this.#n = n, this.#a = new Lt(
1236
- t
1237
- ), this.#i = a;
1262
+ this.#r = n, this.#n = new Vt(
1263
+ r
1264
+ ), this.#t = a;
1238
1265
  }
1239
1266
  /**
1240
1267
  * Sets the desired video resolution for camera streams. This is used as the ideal resolution
@@ -1245,9 +1272,9 @@ class aa {
1245
1272
  * @param resolution - The ideal resolution to set for camera streams.
1246
1273
  */
1247
1274
  setResolution = async (e) => {
1248
- this.#n = e;
1249
- const t = this.getState().playbackState;
1250
- t !== "idle" && (this.#e = t, this.stopStream(), await this.startCameraStream());
1275
+ this.#r = e;
1276
+ const r = this.getState().playbackState;
1277
+ r !== "idle" && (this.#e = r, this.stopStream(), await this.startCameraStream());
1251
1278
  };
1252
1279
  /**
1253
1280
  * The desired video resolution for camera streams. This is used as the ideal resolution
@@ -1257,7 +1284,7 @@ class aa {
1257
1284
  * camera capabilities and system constraints.
1258
1285
  */
1259
1286
  get resolution() {
1260
- return this.#n;
1287
+ return this.#r;
1261
1288
  }
1262
1289
  /**
1263
1290
  * True if there is a video playing or capturing
@@ -1265,7 +1292,7 @@ class aa {
1265
1292
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState for more details.
1266
1293
  */
1267
1294
  get isActive() {
1268
- return u.getState().playbackState !== "idle";
1295
+ return f.getState().playbackState !== "idle";
1269
1296
  }
1270
1297
  /**
1271
1298
  * Sets the facing filter.
@@ -1273,7 +1300,7 @@ class aa {
1273
1300
  * @param facingFilter - The facing filter.
1274
1301
  */
1275
1302
  setFacingFilter(e) {
1276
- u.setState({
1303
+ f.setState({
1277
1304
  facingFilter: e
1278
1305
  });
1279
1306
  }
@@ -1284,21 +1311,21 @@ class aa {
1284
1311
  * @returns The cameras that are available to the user, filtered by the facing mode.
1285
1312
  */
1286
1313
  async getCameraDevices() {
1287
- let e = u.getState().cameras;
1288
- const t = u.getState().facingFilter;
1289
- return e.length || await this.refreshCameraDevices(), e = u.getState().cameras, t ? e.filter(
1290
- (n) => t.includes(n.facingMode)
1314
+ let e = f.getState().cameras;
1315
+ const r = f.getState().facingFilter;
1316
+ return e.length || await this.refreshCameraDevices(), e = f.getState().cameras, r ? e.filter(
1317
+ (n) => r.includes(n.facingMode)
1291
1318
  ) : e;
1292
1319
  }
1293
1320
  get selectedCamera() {
1294
- return u.getState().selectedCamera;
1321
+ return f.getState().selectedCamera;
1295
1322
  }
1296
1323
  /**
1297
1324
  * Single-time setup for a video element.
1298
1325
  *
1299
1326
  * @param videoElement - The video element to initialize.
1300
1327
  */
1301
- #l(e) {
1328
+ #h(e) {
1302
1329
  if (!(e instanceof HTMLVideoElement))
1303
1330
  throw new Error(
1304
1331
  `Expected an HTMLVideoElement, got ${typeof e}`,
@@ -1306,35 +1333,36 @@ class aa {
1306
1333
  cause: e
1307
1334
  }
1308
1335
  );
1309
- u.setState({
1336
+ f.setState({
1310
1337
  videoElement: e
1311
1338
  });
1312
- const t = ve(
1339
+ const r = ye(
1313
1340
  e,
1314
1341
  "resize",
1315
1342
  () => {
1316
- const i = u.getState().videoResolution;
1317
- i?.width === e.videoWidth && i?.height === e.videoHeight || u.setState({
1343
+ const o = f.getState().videoResolution;
1344
+ o?.width === e.videoWidth && o?.height === e.videoHeight || f.setState({
1318
1345
  videoResolution: {
1319
1346
  width: e.videoWidth,
1320
1347
  height: e.videoHeight
1321
1348
  }
1322
1349
  });
1323
1350
  }
1324
- ), a = new z((i) => {
1325
- i[0].connected || this.releaseVideoElement();
1351
+ ), a = new z((o) => {
1352
+ o[0].connected || this.releaseVideoElement();
1326
1353
  });
1327
1354
  a.observe(e), e.setAttribute("playsInline", ""), e.setAttribute("muted", ""), e.controls = !1;
1328
1355
  let n = "idle";
1329
- const o = ve(
1356
+ const i = ye(
1330
1357
  document,
1331
1358
  "visibilitychange",
1332
1359
  async () => {
1333
1360
  if (document.hidden) {
1334
- n = u.getState().playbackState, this.stopStream();
1361
+ n = f.getState().playbackState, this.stopStream();
1335
1362
  return;
1336
1363
  }
1337
- switch (n) {
1364
+ const s = this.#o ?? n;
1365
+ switch (this.#o = void 0, s) {
1338
1366
  case "playback":
1339
1367
  await this.startCameraStream(), await this.startPlayback();
1340
1368
  break;
@@ -1344,8 +1372,8 @@ class aa {
1344
1372
  }
1345
1373
  }
1346
1374
  );
1347
- this.#t = () => {
1348
- o(), t(), a.disconnect();
1375
+ this.#l = () => {
1376
+ i(), r(), a.disconnect();
1349
1377
  };
1350
1378
  }
1351
1379
  /**
@@ -1355,12 +1383,12 @@ class aa {
1355
1383
  */
1356
1384
  initVideoElement(e) {
1357
1385
  try {
1358
- this.#l(e);
1359
- } catch (t) {
1386
+ this.#h(e);
1387
+ } catch (r) {
1360
1388
  if (this.userInitiatedAbort)
1361
1389
  this.reset();
1362
1390
  else
1363
- throw t;
1391
+ throw r;
1364
1392
  }
1365
1393
  }
1366
1394
  /**
@@ -1371,13 +1399,13 @@ class aa {
1371
1399
  * @returns a cleanup function to remove the callback
1372
1400
  */
1373
1401
  addFrameCaptureCallback(e) {
1374
- return this.#o.add(e), () => this.#o.delete(e);
1402
+ return this.#s.add(e), () => this.#s.delete(e);
1375
1403
  }
1376
1404
  /**
1377
1405
  * Cleans up the video element, and stops the stream.
1378
1406
  */
1379
1407
  releaseVideoElement() {
1380
- this.#t?.(), u.setState({
1408
+ this.#l?.(), f.setState({
1381
1409
  videoElement: void 0
1382
1410
  }), this.stopStream();
1383
1411
  }
@@ -1388,9 +1416,9 @@ class aa {
1388
1416
  * @param camera - The camera to select.
1389
1417
  */
1390
1418
  async selectCamera(e) {
1391
- const t = u.getState().playbackState;
1392
- t !== "idle" && (this.#e = t);
1393
- const a = u.getState();
1419
+ const r = f.getState().playbackState;
1420
+ r !== "idle" && (this.#e = r);
1421
+ const a = f.getState();
1394
1422
  if (a.selectedCamera === e) {
1395
1423
  console.debug("Already selected");
1396
1424
  return;
@@ -1399,9 +1427,9 @@ class aa {
1399
1427
  console.debug("Already swapping");
1400
1428
  return;
1401
1429
  }
1402
- u.setState({
1430
+ f.setState({
1403
1431
  isSwappingCamera: !0
1404
- }), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), u.setState({
1432
+ }), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), f.setState({
1405
1433
  selectedCamera: e,
1406
1434
  isSwappingCamera: !1
1407
1435
  }), this.#e === "playback" && (console.debug("Starting new stream"), await this.startPlayback()), this.#e === "capturing" && (console.debug("Resuming frame capture"), await this.startFrameCapture()), this.#e = void 0;
@@ -1412,50 +1440,50 @@ class aa {
1412
1440
  * @returns resolves when the camera devices are refreshed
1413
1441
  */
1414
1442
  async refreshCameraDevices() {
1415
- if (u.getState().isQueryingCameras || u.getState().isSwappingCamera) {
1443
+ if (f.getState().isQueryingCameras || f.getState().isSwappingCamera) {
1416
1444
  console.debug("Already querying cameras");
1417
1445
  return;
1418
1446
  }
1419
- if (u.getState().cameraPermission === "prompt") {
1447
+ if (f.getState().cameraPermission === "prompt") {
1420
1448
  console.debug("Still waiting for user to respond");
1421
1449
  return;
1422
1450
  }
1423
- u.setState({
1451
+ f.setState({
1424
1452
  isQueryingCameras: !0
1425
1453
  }), window.setTimeout(() => {
1426
- const a = u.getState();
1427
- a.isQueryingCameras && u.setState({
1454
+ const a = f.getState();
1455
+ a.isQueryingCameras && f.setState({
1428
1456
  cameraPermission: "prompt"
1429
- }), !a.isQueryingCameras && a.cameraPermission === "denied" && u.setState({
1457
+ }), !a.isQueryingCameras && a.cameraPermission === "denied" && f.setState({
1430
1458
  cameraPermission: "blocked"
1431
1459
  });
1432
1460
  }, 100);
1433
- const e = await ht().catch((a) => {
1434
- throw a instanceof U && a.code === "PERMISSION_DENIED" && u.setState({
1435
- errorState: Y(a),
1461
+ const e = await pt().catch((a) => {
1462
+ throw a instanceof B && a.code === "PERMISSION_DENIED" && f.setState({
1463
+ errorState: Q(a),
1436
1464
  cameraPermission: "denied",
1437
1465
  isQueryingCameras: !1
1438
1466
  }), a;
1439
1467
  });
1440
- u.setState({
1468
+ f.setState({
1441
1469
  cameraPermission: "granted"
1442
1470
  });
1443
- const t = pt(e);
1444
- t.forEach((a) => {
1471
+ const r = Ct(e);
1472
+ r.forEach((a) => {
1445
1473
  a.unsubscribeAll(), a.subscribe((n) => {
1446
1474
  window.queueMicrotask(() => {
1447
- const i = u.getState().selectedCamera;
1448
- a === i && u.setState({
1475
+ const o = f.getState().selectedCamera;
1476
+ a === o && f.setState({
1449
1477
  selectedCamera: a
1450
1478
  });
1451
- let c = !1, s;
1452
- n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" && $e().catch((h) => {
1453
- h instanceof U && h.code === "PERMISSION_DENIED" && (c = !0, s = h);
1479
+ let s = !1, l;
1480
+ n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" && ze().catch((d) => {
1481
+ d instanceof B && d.code === "PERMISSION_DENIED" && (s = !0, l = d);
1454
1482
  }).finally(() => {
1455
- u.setState({
1456
- errorState: s,
1483
+ f.setState({
1484
+ errorState: l,
1457
1485
  playbackState: "idle",
1458
- cameraPermission: c ? "denied" : "granted"
1486
+ cameraPermission: s ? "denied" : "granted"
1459
1487
  });
1460
1488
  });
1461
1489
  });
@@ -1464,25 +1492,25 @@ class aa {
1464
1492
  (n) => n,
1465
1493
  () => {
1466
1494
  window.queueMicrotask(() => {
1467
- u.setState({
1468
- cameras: [...u.getState().cameras]
1495
+ f.setState({
1496
+ cameras: [...f.getState().cameras]
1469
1497
  });
1470
1498
  });
1471
1499
  },
1472
1500
  // Use a custom equality function to prevent updating all cameras list for
1473
1501
  // every minor change in camera state
1474
1502
  {
1475
- equalityFn: (n, o) => [
1503
+ equalityFn: (n, i) => [
1476
1504
  "torchSupported",
1477
1505
  "singleShotSupported",
1478
1506
  "facingMode",
1479
1507
  "maxSupportedResolution",
1480
1508
  "name"
1481
- ].every((c) => n[c] === o[c])
1509
+ ].every((s) => n[s] === i[s])
1482
1510
  }
1483
1511
  );
1484
- }), u.setState({
1485
- cameras: t,
1512
+ }), f.setState({
1513
+ cameras: r,
1486
1514
  isQueryingCameras: !1
1487
1515
  });
1488
1516
  }
@@ -1492,7 +1520,11 @@ class aa {
1492
1520
  * @returns resolves when playback starts
1493
1521
  */
1494
1522
  async startPlayback() {
1495
- const e = u.getState();
1523
+ if (this.#i()) {
1524
+ this.#c("playback"), console.warn("Can't start playback while document is hidden");
1525
+ return;
1526
+ }
1527
+ const e = f.getState();
1496
1528
  if (!(this.isActive && !this.#e)) {
1497
1529
  if (!e.videoElement) {
1498
1530
  console.warn("Starting playback - no video element present.");
@@ -1503,17 +1535,17 @@ class aa {
1503
1535
  return;
1504
1536
  }
1505
1537
  if (!e.selectedCamera.activeStream) {
1506
- const t = await e.selectedCamera.startStream(this.resolution);
1507
- e.videoElement.srcObject = t;
1538
+ const r = await e.selectedCamera.startStream(this.resolution);
1539
+ e.videoElement.srcObject = r;
1508
1540
  }
1509
1541
  try {
1510
- this.#h(), await e.videoElement.play(), u.setState({
1542
+ this.#v(), await e.videoElement.play(), f.setState({
1511
1543
  playbackState: "playback"
1512
1544
  });
1513
- } catch (t) {
1514
- throw console.error("Failed to start playback", t), u.setState({
1515
- errorState: Y(t)
1516
- }), t;
1545
+ } catch (r) {
1546
+ throw console.error("Failed to start playback", r), f.setState({
1547
+ errorState: Q(r)
1548
+ }), r;
1517
1549
  }
1518
1550
  }
1519
1551
  }
@@ -1522,24 +1554,30 @@ class aa {
1522
1554
  *
1523
1555
  * @returns resolves when frame capture starts
1524
1556
  */
1525
- async #c() {
1526
- const e = u.getState();
1527
- if (!this.userInitiatedAbort && !(e.playbackState === "capturing" && this.#e !== "capturing")) {
1528
- if (!e.videoElement) {
1529
- console.warn(
1530
- "Missing video element. Setup a video element first using `initVideoElement`"
1531
- );
1557
+ async #f() {
1558
+ const e = f.getState();
1559
+ if (!this.userInitiatedAbort) {
1560
+ if (this.#i()) {
1561
+ this.#c("capturing");
1532
1562
  return;
1533
1563
  }
1534
- if (!e.selectedCamera) {
1535
- console.warn(
1536
- "No active camera! Select a camera first, or use `startCameraStream`"
1537
- );
1538
- return;
1564
+ if (!(e.playbackState === "capturing" && this.#e !== "capturing")) {
1565
+ if (!e.videoElement) {
1566
+ console.warn(
1567
+ "Missing video element. Setup a video element first using `initVideoElement`"
1568
+ );
1569
+ return;
1570
+ }
1571
+ if (!e.selectedCamera) {
1572
+ console.warn(
1573
+ "No active camera! Select a camera first, or use `startCameraStream`"
1574
+ );
1575
+ return;
1576
+ }
1577
+ await this.startPlayback(), f.getState().playbackState === "playback" && (f.setState({
1578
+ playbackState: "capturing"
1579
+ }), this.#g(), this.#e = void 0);
1539
1580
  }
1540
- await this.startPlayback(), u.setState({
1541
- playbackState: "capturing"
1542
- }), this.#u(), this.#e = void 0;
1543
1581
  }
1544
1582
  }
1545
1583
  /**
@@ -1549,7 +1587,7 @@ class aa {
1549
1587
  */
1550
1588
  startFrameCapture = async () => {
1551
1589
  try {
1552
- await this.#c();
1590
+ await this.#f();
1553
1591
  } catch (e) {
1554
1592
  if (this.userInitiatedAbort)
1555
1593
  this.reset();
@@ -1563,12 +1601,16 @@ class aa {
1563
1601
  * @param params - The parameters for the camera stream.
1564
1602
  * @returns resolves when the camera stream starts
1565
1603
  */
1566
- async #d({
1604
+ async #m({
1567
1605
  autoplay: e = !0,
1568
- preferredCamera: t,
1569
- preferredFacing: a
1606
+ preferredCamera: r,
1607
+ preferredFacing: a = "back"
1570
1608
  } = {}) {
1571
- const n = u.getState().videoElement;
1609
+ if (this.#i()) {
1610
+ e && this.#c("playback"), console.warn("Can't start stream while document is hidden");
1611
+ return;
1612
+ }
1613
+ const n = f.getState().videoElement;
1572
1614
  if (!n) {
1573
1615
  console.warn("Can't start stream without a video element");
1574
1616
  return;
@@ -1577,39 +1619,43 @@ class aa {
1577
1619
  console.warn("Already streaming");
1578
1620
  return;
1579
1621
  }
1580
- if (t instanceof Ie && await this.selectCamera(t), !u.getState().selectedCamera)
1622
+ if (r instanceof $e && await this.selectCamera(r), !f.getState().selectedCamera)
1581
1623
  try {
1582
- const c = await this.getCameraDevices();
1583
- let s;
1584
- if (!c.length)
1624
+ const s = await this.getCameraDevices();
1625
+ let l;
1626
+ if (!s.length)
1585
1627
  throw console.warn("Camera list is empty"), new Error(
1586
1628
  `No cameras found matching the filter ${a}`
1587
1629
  );
1588
- if (typeof t == "function" && (s = t(c), s || console.warn(
1630
+ if (typeof r == "function" && (l = r(s), l || console.warn(
1589
1631
  "No camera found matching the preferred camera function, falling back to facing mode"
1590
- )), s || (s = await bt(
1591
- c,
1632
+ )), l || (l = await St(
1633
+ s,
1592
1634
  this.resolution,
1593
1635
  a
1594
- )), !s)
1636
+ )), !l)
1595
1637
  throw new Error(
1596
1638
  `No cameras found matching the filter ${a}`
1597
1639
  );
1598
- await this.selectCamera(s), this.#m() && u.setState({
1640
+ await this.selectCamera(l), this.#d() && f.setState({
1599
1641
  errorState: void 0
1600
1642
  });
1601
- } catch (c) {
1602
- throw u.setState({
1603
- errorState: Y(c)
1604
- }), c;
1643
+ } catch (s) {
1644
+ throw f.setState({
1645
+ errorState: Q(s)
1646
+ }), s;
1605
1647
  }
1606
- const o = u.getState().selectedCamera;
1607
- if (!o)
1648
+ const i = f.getState().selectedCamera;
1649
+ if (!i)
1608
1650
  throw console.warn("No selected camera!"), new Error("No selected camera");
1609
- const i = await o.startStream(this.#n);
1651
+ if (this.#i()) {
1652
+ console.warn("Can't start stream while document is hidden");
1653
+ return;
1654
+ }
1655
+ const o = await i.startStream(this.#r);
1610
1656
  if (!n.isConnected)
1611
1657
  throw new Error("Video element needs to be in the document!");
1612
- n.srcObject = i, u.setState({
1658
+ n.srcObject = o, f.setState({
1613
1659
  videoElement: n
1614
1660
  }), e && await this.startPlayback(), this.#e === "capturing" && (console.debug("Resuming frame capture"), await this.startFrameCapture()), this.#e === "playback" && (console.debug("Resuming playback"), await this.startPlayback());
1615
1661
  }
@@ -1622,12 +1668,12 @@ class aa {
1622
1668
  */
1623
1669
  async startCameraStream(e = {}) {
1624
1670
  try {
1625
- await this.#d(e);
1626
- } catch (t) {
1671
+ await this.#m(e);
1672
+ } catch (r) {
1627
1673
  if (this.userInitiatedAbort)
1628
1674
  this.reset();
1629
1675
  else
1630
- throw t;
1676
+ throw r;
1631
1677
  }
1632
1678
  }
1633
1679
  /**
@@ -1635,15 +1681,15 @@ class aa {
1635
1681
  *
1636
1682
  * @returns true if the error state is a permission error
1637
1683
  */
1638
- #m = () => {
1639
- const e = u.getState().errorState;
1640
- return e instanceof U && e.code === "PERMISSION_DENIED";
1684
+ #d = () => {
1685
+ const e = f.getState().errorState;
1686
+ return e instanceof B && e.code === "PERMISSION_DENIED";
1641
1687
  };
1642
1688
  /**
1643
1689
  * Pauses capturing frames, without stopping playback.
1644
1690
  */
1645
1691
  stopFrameCapture() {
1646
- u.setState({
1692
+ this.#b(), f.setState({
1647
1693
  playbackState: "playback"
1648
1694
  });
1649
1695
  }
@@ -1652,7 +1698,7 @@ class aa {
1652
1698
  */
1653
1699
  stopStream() {
1654
1700
  console.debug("stopStream called");
1655
- const e = u.getState();
1701
+ const e = f.getState();
1656
1702
  this.pausePlayback(), e.selectedCamera?.stopStream(), e.videoElement && (e.videoElement.srcObject = null);
1657
1703
  }
1658
1704
  /**
@@ -1660,17 +1706,17 @@ class aa {
1660
1706
  */
1661
1707
  pausePlayback() {
1662
1708
  console.debug("pausePlayback called");
1663
- const e = u.getState().videoElement;
1664
- u.setState({
1709
+ const e = f.getState();
1710
+ this.#b(), f.setState({
1665
1711
  playbackState: "idle"
1666
- }), e && (this.#r && e.cancelVideoFrameCallback(this.#r), e.pause());
1712
+ }), e.videoElement?.pause();
1667
1713
  }
1668
1714
  /**
1669
1715
  * The main recognition loop. Do not call this method directly, use `#queueFrame` instead.
1670
1716
  */
1671
- async #g() {
1672
- const e = u.getState();
1673
- if (this.#r === void 0) {
1717
+ async #p() {
1718
+ const e = f.getState();
1719
+ if (this.#a === void 0) {
1674
1720
  console.error("Missing request ID");
1675
1721
  return;
1676
1722
  }
@@ -1685,40 +1731,40 @@ class aa {
1685
1731
  return;
1686
1732
  }
1687
1733
  if (!(e.videoElement.videoHeight >= e.videoElement.videoWidth == e.extractionArea.height >= e.extractionArea.width))
1688
- return this.#u();
1689
- if (this.#o.size !== 0) {
1690
- const a = this.#a.getImageData(
1734
+ return this.#g();
1735
+ if (this.#s.size !== 0) {
1736
+ const a = this.#n.getImageData(
1691
1737
  e.videoElement,
1692
1738
  e.extractionArea
1693
1739
  );
1694
- for (const n of this.#o) {
1695
- const o = le(a.data.buffer) ? this.#a.getCurrentImageData() : a, i = await n(o);
1696
- if (i) {
1697
- if (!(i instanceof ArrayBuffer))
1740
+ for (const n of this.#s) {
1741
+ const i = le(a.data.buffer) ? this.#n.getCurrentImageData() : a, o = await n(i);
1742
+ if (o) {
1743
+ if (!(o instanceof ArrayBuffer))
1698
1744
  throw new Error(
1699
- Ae`
1745
+ Ne`
1700
1746
  Frame capture callback did not return an ArrayBuffer.
1701
1747
  Make sure to return the underlying buffer, not the view.
1702
1748
  `
1703
1749
  );
1704
- this.#a.reattachArrayBuffer(i);
1750
+ this.#n.reattachArrayBuffer(o);
1705
1751
  }
1706
1752
  }
1707
1753
  }
1708
- this.#u();
1754
+ this.#g();
1709
1755
  }
1710
1756
  /**
1711
1757
  * Queues the next frame to be processed.
1712
1758
  */
1713
- #u() {
1714
- const e = u.getState();
1759
+ #g() {
1760
+ const e = f.getState();
1715
1761
  if (e.playbackState === "capturing") {
1716
1762
  if (!e.videoElement) {
1717
1763
  console.warn("Missing video element, should not happen");
1718
1764
  return;
1719
1765
  }
1720
- this.#r && e.videoElement.cancelVideoFrameCallback(this.#r), this.#r = e.videoElement.requestVideoFrameCallback(
1721
- () => void this.#g()
1766
+ this.#b(), this.#a = e.videoElement.requestVideoFrameCallback(
1767
+ () => void this.#p()
1722
1768
  );
1723
1769
  }
1724
1770
  }
@@ -1726,13 +1772,22 @@ class aa {
1726
1772
  * Applies a mirror effect to the video if the camera is front-facing.
1727
1773
  * Assumes that desktop devices don't return a facing mode and that they are front-facing.
1728
1774
  */
1729
- #h() {
1730
- const e = u.getState().selectedCamera;
1775
+ #v() {
1776
+ const e = f.getState().selectedCamera;
1731
1777
  if (!e) {
1732
1778
  console.warn("No camera selected");
1733
1779
  return;
1734
1780
  }
1735
- this.#i && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
1781
+ this.#t && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
1782
+ }
1783
+ /**
1784
+ * Cancels any pending video frame callback and optionally clears the request ID.
1785
+ *
1786
+ * @param clearRequestId - Whether to clear the request ID after canceling
1787
+ */
1788
+ #b() {
1789
+ const e = f.getState();
1790
+ this.#a && e.videoElement && (e.videoElement.cancelVideoFrameCallback(this.#a), this.#a = void 0);
1736
1791
  }
1737
1792
  /**
1738
1793
  * If true, the video and captured frames will be mirrored horizontally.
@@ -1740,12 +1795,12 @@ class aa {
1740
1795
  * @param mirrorX - If true, the video and captured frames will be mirrored horizontally.
1741
1796
  */
1742
1797
  setCameraMirrorX(e) {
1743
- const t = u.getState(), a = t.videoElement;
1798
+ const r = f.getState(), a = r.videoElement;
1744
1799
  if (!a) {
1745
1800
  console.warn("Mirror video - no video element present.");
1746
1801
  return;
1747
1802
  }
1748
- t.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), u.setState({ mirrorX: e }));
1803
+ r.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), f.setState({ mirrorX: e }));
1749
1804
  }
1750
1805
  // The "typeof" is necessary to avoid a circular dependency when resolving types
1751
1806
  /**
@@ -1755,304 +1810,291 @@ class aa {
1755
1810
  *
1756
1811
  * @returns a cleanup function to remove the subscription
1757
1812
  */
1758
- subscribe = u.subscribe;
1813
+ subscribe = f.subscribe;
1759
1814
  /**
1760
1815
  * Gets the current internal state of the CameraManager.
1761
1816
  *
1762
1817
  * @returns the current state of the CameraManager
1763
1818
  */
1764
- getState = u.getState;
1819
+ getState = f.getState;
1765
1820
  /**
1766
1821
  * Resets the CameraManager and stops all streams.
1767
1822
  */
1768
1823
  reset() {
1769
- console.debug("Resetting camera manager"), this.#o.clear(), this.userInitiatedAbort = !1, this.stopStream(), Et();
1824
+ console.debug("Resetting camera manager"), this.#s.clear(), this.userInitiatedAbort = !1, this.stopStream(), Rt();
1770
1825
  }
1771
1826
  }
1772
- const zt = {
1827
+ const Bt = {
1773
1828
  mirrorFrontCameras: !0,
1774
1829
  preferredResolution: "1080p"
1775
- }, Pe = Ce();
1776
- function Nt() {
1777
- return Te(u);
1830
+ }, qe = xe();
1831
+ function Ut() {
1832
+ return Ae(f);
1778
1833
  }
1779
- const Pt = (r) => {
1834
+ const qt = (t) => {
1780
1835
  const e = {
1781
- cameraManagerSolidStore: Nt(),
1836
+ cameraManagerSolidStore: Ut(),
1782
1837
  // eslint-disable-next-line solid/reactivity
1783
- cameraManager: r.cameraManager,
1838
+ cameraManager: t.cameraManager,
1784
1839
  // eslint-disable-next-line solid/reactivity
1785
1840
  dismountCameraUi: () => {
1786
- r.cameraManager.userInitiatedAbort = !0, r.dismountCameraUi();
1841
+ t.cameraManager.userInitiatedAbort = !0, t.dismountCameraUi();
1787
1842
  },
1788
1843
  // eslint-disable-next-line solid/reactivity
1789
- addOnDismountCallback: r.addOnDismountCallback,
1844
+ addOnDismountCallback: t.addOnDismountCallback,
1845
+ // eslint-disable-next-line solid/reactivity
1846
+ mountTarget: t.mountTarget,
1790
1847
  // eslint-disable-next-line solid/reactivity
1791
- mountTarget: r.mountTarget,
1848
+ showMirrorCameraButton: t.showMirrorCameraButton,
1792
1849
  // eslint-disable-next-line solid/reactivity
1793
- showMirrorCameraButton: r.showMirrorCameraButton,
1850
+ showTorchButton: t.showTorchButton,
1794
1851
  // eslint-disable-next-line solid/reactivity
1795
- showTorchButton: r.showTorchButton,
1852
+ showCloseButton: t.showCloseButton,
1796
1853
  // eslint-disable-next-line solid/reactivity
1797
- showCloseButton: r.showCloseButton,
1854
+ showCameraErrorModal: t.showCameraErrorModal,
1798
1855
  // eslint-disable-next-line solid/reactivity
1799
- showCameraErrorModal: r.showCameraErrorModal
1856
+ zIndex: t.zIndex
1800
1857
  };
1801
- return he(() => {
1858
+ return J(() => {
1802
1859
  console.debug("CameraUiStoreProvider cleanup");
1803
- }), l(Pe.Provider, {
1860
+ }), c(qe.Provider, {
1804
1861
  value: e,
1805
1862
  get children() {
1806
- return r.children;
1863
+ return t.children;
1807
1864
  }
1808
1865
  });
1809
1866
  };
1810
- function j() {
1811
- const r = Ee(Pe);
1812
- if (!r)
1867
+ function q() {
1868
+ const t = Me(qe);
1869
+ if (!t)
1813
1870
  throw new Error("StoreContext.Provider not in scope");
1814
- return r;
1871
+ return t;
1815
1872
  }
1816
- const Ot = {
1873
+ const jt = {
1817
1874
  camera_error_cancel_btn: "Cancel",
1818
1875
  camera_error_details: "Please allow camera access in your browser and try again.",
1819
1876
  camera_error_primary_btn: "Retry",
1820
1877
  camera_error_title: "Camera permission required",
1821
1878
  close: "Close",
1879
+ dialog_title: "Scan a document",
1822
1880
  loading_cameras: "Loading cameras...",
1823
1881
  mirror_camera: "Mirror camera",
1824
- scan_document: "Scan a document",
1825
1882
  select_a_camera: "Select a camera",
1826
1883
  select_camera: "Select camera",
1827
1884
  selected_camera: "Selected camera",
1828
1885
  torch: "Torch"
1829
- }, Oe = Ce(), Bt = (r) => {
1830
- const [e, t] = Ze(
1886
+ }, je = xe(), Ht = (t) => {
1887
+ const [e, r] = at(
1831
1888
  // we structure clone to avoid proxying to the original object
1832
1889
  structuredClone({
1833
- ...Ot,
1890
+ ...jt,
1834
1891
  // we don't care on init
1835
1892
  // eslint-disable-next-line solid/reactivity
1836
- ...r.userStrings
1893
+ ...t.userStrings
1837
1894
  })
1838
1895
  );
1839
- Z(() => {
1840
- r.setLocalizationRef(t);
1896
+ K(() => {
1897
+ t.setLocalizationRef(r);
1841
1898
  });
1842
1899
  const a = {
1843
1900
  t: e,
1844
- updateLocalization: t
1901
+ updateLocalization: r
1845
1902
  };
1846
- return l(Oe.Provider, {
1903
+ return c(je.Provider, {
1847
1904
  value: a,
1848
1905
  get children() {
1849
- return r.children;
1906
+ return t.children;
1850
1907
  }
1851
1908
  });
1852
1909
  };
1853
- function ee() {
1854
- const r = Ee(Oe);
1855
- if (!r)
1910
+ function Z() {
1911
+ const t = Me(je);
1912
+ if (!t)
1856
1913
  throw new Error("LocalizationContext.Provider not in scope.");
1857
- return r;
1914
+ return t;
1858
1915
  }
1859
- var Vt = /* @__PURE__ */ y("<span>");
1860
- const te = (r) => {
1861
- const [e, t] = N(), [a, n] = N();
1862
- return Z(() => {
1863
- const o = a();
1864
- o && t(o.getRootNode());
1865
- }), l(k, {
1916
+ var Wt = /* @__PURE__ */ w("<span>");
1917
+ const ee = (t) => {
1918
+ const [e, r] = I(), [a, n] = I();
1919
+ return K(() => {
1920
+ const i = a();
1921
+ i && r(i.getRootNode());
1922
+ }), c(x, {
1866
1923
  get when() {
1867
1924
  return e();
1868
1925
  },
1869
1926
  get fallback() {
1870
1927
  return (() => {
1871
- var o = Vt();
1872
- return V(n, o), o;
1928
+ var i = Wt();
1929
+ return V(n, i), i;
1873
1930
  })();
1874
1931
  },
1875
- children: (o) => l(et, {
1876
- value: () => o(),
1932
+ children: (i) => c(nt, {
1933
+ value: () => i(),
1877
1934
  get children() {
1878
- return r.children(o());
1935
+ return t.children(i());
1879
1936
  }
1880
1937
  })
1881
1938
  });
1882
1939
  };
1883
- var Ut = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z">');
1884
- const qt = (r = {}) => (() => {
1885
- var e = Ut();
1886
- return D(e, r, !0, !0), e;
1940
+ var Gt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z">');
1941
+ const Xt = (t = {}) => (() => {
1942
+ var e = Gt();
1943
+ return A(e, t, !0, !0), e;
1887
1944
  })();
1888
- var jt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M7 2h10l-2 7h4l-2.925 4.225L7 4.15zm3 20v-8H7V9.85L1.375 4.225L2.8 2.8l18.4 18.4l-1.425 1.425L13.75 16.6z">');
1889
- const Ht = (r = {}) => (() => {
1890
- var e = jt();
1891
- return D(e, r, !0, !0), e;
1945
+ var Qt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M7 2h10l-2 7h4l-2.925 4.225L7 4.15zm3 20v-8H7V9.85L1.375 4.225L2.8 2.8l18.4 18.4l-1.425 1.425L13.75 16.6z">');
1946
+ const Kt = (t = {}) => (() => {
1947
+ var e = Qt();
1948
+ return A(e, t, !0, !0), e;
1892
1949
  })();
1893
- var Wt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
1894
- const Gt = (r = {}) => (() => {
1895
- var e = Wt();
1896
- return D(e, r, !0, !0), e;
1950
+ var Yt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
1951
+ const Jt = (t = {}) => (() => {
1952
+ var e = Yt();
1953
+ return A(e, t, !0, !0), e;
1897
1954
  })();
1898
- var Xt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M9 21H5q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4v2H5v14h4zm2 2V1h2v22zm4-2v-2h2v2zm0-16V3h2v2zm4 16v-2h2q0 .825-.587 1.413T19 21m0-4v-2h2v2zm0-4v-2h2v2zm0-4V7h2v2zm0-4V3q.825 0 1.413.588T21 5z">');
1899
- const Qt = (r = {}) => (() => {
1900
- var e = Xt();
1901
- return D(e, r, !0, !0), e;
1955
+ var Zt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M9 21H5q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4v2H5v14h4zm2 2V1h2v22zm4-2v-2h2v2zm0-16V3h2v2zm4 16v-2h2q0 .825-.587 1.413T19 21m0-4v-2h2v2zm0-4v-2h2v2zm0-4V7h2v2zm0-4V3q.825 0 1.413.588T21 5z">');
1956
+ const er = (t = {}) => (() => {
1957
+ var e = Zt();
1958
+ return A(e, t, !0, !0), e;
1902
1959
  })();
1903
- function Be(r) {
1960
+ function He(t) {
1904
1961
  const e = {};
1905
- return Object.entries(r).forEach(([t, a]) => {
1906
- const n = t.toLowerCase();
1907
- let o = n;
1962
+ return Object.entries(t).forEach(([r, a]) => {
1963
+ const n = r.toLowerCase();
1964
+ let i = n;
1908
1965
  if (n.startsWith("on")) {
1909
- o = n.slice(2);
1910
- const i = `on:${o}`;
1911
- e[i] = a;
1912
- } else
1966
+ i = n.slice(2);
1967
+ const o = `on:${i}`;
1913
1968
  e[o] = a;
1969
+ } else
1970
+ e[i] = a;
1914
1971
  }), e;
1915
1972
  }
1916
- var Kt = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><g fill=#fff fill-rule=evenodd clip-rule=evenodd><path d="M6.322 2.988A1.67 1.67 0 0 1 7.5 2.5h5a1.667 1.667 0 0 1 1.667 1.667A.833.833 0 0 0 15 5h.833a2.5 2.5 0 0 1 2.5 2.5V15a2.5 2.5 0 0 1-2.5 2.5H4.167a2.5 2.5 0 0 1-2.5-2.5V7.5a2.5 2.5 0 0 1 2.5-2.5H5a.833.833 0 0 0 .833-.833c0-.442.176-.866.489-1.179M4.167 6.667a.833.833 0 0 0-.834.833V15a.833.833 0 0 0 .834.833h11.666a.834.834 0 0 0 .834-.833V7.5a.833.833 0 0 0-.834-.833H15a2.5 2.5 0 0 1-2.5-2.5h-5a2.5 2.5 0 0 1-2.5 2.5z"></path><path d="M10 9.167a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333m-3.333 1.666a3.333 3.333 0 1 1 6.666 0 3.333 3.333 0 0 1-6.666 0">');
1917
- const Yt = (r = {}) => (() => {
1918
- var e = Kt();
1919
- return D(e, r, !0, !0), e;
1973
+ var tr = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><g fill=#fff fill-rule=evenodd clip-rule=evenodd><path d="M6.322 2.988A1.67 1.67 0 0 1 7.5 2.5h5a1.667 1.667 0 0 1 1.667 1.667A.833.833 0 0 0 15 5h.833a2.5 2.5 0 0 1 2.5 2.5V15a2.5 2.5 0 0 1-2.5 2.5H4.167a2.5 2.5 0 0 1-2.5-2.5V7.5a2.5 2.5 0 0 1 2.5-2.5H5a.833.833 0 0 0 .833-.833c0-.442.176-.866.489-1.179M4.167 6.667a.833.833 0 0 0-.834.833V15a.833.833 0 0 0 .834.833h11.666a.834.834 0 0 0 .834-.833V7.5a.833.833 0 0 0-.834-.833H15a2.5 2.5 0 0 1-2.5-2.5h-5a2.5 2.5 0 0 1-2.5 2.5z"></path><path d="M10 9.167a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333m-3.333 1.666a3.333 3.333 0 1 1 6.666 0 3.333 3.333 0 0 1-6.666 0">');
1974
+ const rr = (t = {}) => (() => {
1975
+ var e = tr();
1976
+ return A(e, t, !0, !0), e;
1920
1977
  })();
1921
- var Jt = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path stroke=#fff stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4.167 10.833 7.5 14.167l8.333-8.334">');
1922
- const Zt = (r = {}) => (() => {
1923
- var e = Jt();
1924
- return D(e, r, !0, !0), e;
1978
+ var ar = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path stroke=#fff stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4.167 10.833 7.5 14.167l8.333-8.334">');
1979
+ const nr = (t = {}) => (() => {
1980
+ var e = ar();
1981
+ return A(e, t, !0, !0), e;
1925
1982
  })();
1926
- var er = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path fill=#fff fill-rule=evenodd d="M4.41 6.91a.833.833 0 0 1 1.18 0L10 11.323l4.41-4.411a.833.833 0 1 1 1.18 1.178l-5 5a.833.833 0 0 1-1.18 0l-5-5a.833.833 0 0 1 0-1.178"clip-rule=evenodd>');
1927
- const tr = (r = {}) => (() => {
1928
- var e = er();
1929
- return D(e, r, !0, !0), e;
1983
+ var or = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path fill=#fff fill-rule=evenodd d="M4.41 6.91a.833.833 0 0 1 1.18 0L10 11.323l4.41-4.411a.833.833 0 1 1 1.18 1.178l-5 5a.833.833 0 0 1-1.18 0l-5-5a.833.833 0 0 1 0-1.178"clip-rule=evenodd>');
1984
+ const ir = (t = {}) => (() => {
1985
+ var e = or();
1986
+ return A(e, t, !0, !0), e;
1930
1987
  })();
1931
- var rr = /* @__PURE__ */ y("<button>");
1932
- const ar = () => {
1988
+ var sr = /* @__PURE__ */ w("<button>");
1989
+ const lr = () => {
1933
1990
  const {
1934
- cameraManagerSolidStore: r,
1991
+ cameraManagerSolidStore: t,
1935
1992
  cameraManager: e
1936
- } = j(), {
1937
- t
1938
- } = ee(), a = r((d) => d.cameras), n = r((d) => d.selectedCamera), o = r((d) => d.facingFilter), i = r((d) => d.isQueryingCameras), c = r((d) => d.isSwappingCamera), s = () => i() || c(), h = () => {
1939
- const d = o();
1940
- return d ? a().filter((m) => d.includes(m.facingMode)) : a();
1941
- }, f = () => [...h().map((d) => ({
1942
- value: d.deviceInfo.deviceId,
1943
- label: d.name
1944
- }))], p = () => tt({
1945
- items: [...f()]
1946
- }), S = () => {
1947
- const d = n();
1948
- if (!d)
1993
+ } = q(), {
1994
+ t: r
1995
+ } = Z(), a = t((m) => m.cameras), n = t((m) => m.selectedCamera), i = t((m) => m.facingFilter), o = t((m) => m.isQueryingCameras), s = t((m) => m.isSwappingCamera), l = () => o() || s(), d = () => {
1996
+ const m = i();
1997
+ return m ? a().filter((g) => m.includes(g.facingMode)) : a();
1998
+ }, u = () => [...d().map((m) => ({
1999
+ value: m.deviceInfo.deviceId,
2000
+ label: m.name
2001
+ }))], b = () => ot({
2002
+ items: [...u()]
2003
+ }), p = () => {
2004
+ const m = n();
2005
+ if (!m)
1949
2006
  return;
1950
- const m = p().find(d.deviceInfo.deviceId);
1951
- if (m)
1952
- return [m.value];
1953
- }, g = async (d) => {
1954
- const m = a().find((C) => C.deviceInfo.deviceId === d);
1955
- if (!m) {
2007
+ const g = b().find(m.deviceInfo.deviceId);
2008
+ if (g)
2009
+ return [g.value];
2010
+ }, h = async (m) => {
2011
+ const g = a().find((S) => S.deviceInfo.deviceId === m);
2012
+ if (!g) {
1956
2013
  console.warn("No camera");
1957
2014
  return;
1958
2015
  }
1959
- await e.selectCamera(m);
2016
+ await e.selectCamera(g);
1960
2017
  };
1961
- return l(te, {
1962
- children: () => l(A.Root, {
2018
+ return c(ee, {
2019
+ children: () => c(_.Root, {
1963
2020
  part: "camera-select-part",
1964
2021
  get collection() {
1965
- return p();
2022
+ return b();
1966
2023
  },
1967
2024
  get value() {
1968
- return S();
2025
+ return p();
1969
2026
  },
1970
2027
  positioning: {
1971
2028
  placement: "top"
1972
2029
  },
1973
2030
  lazyMount: !0,
1974
2031
  get disabled() {
1975
- return s();
2032
+ return l();
1976
2033
  },
1977
- onValueChange: (d) => {
1978
- g(d.value[0]);
2034
+ onValueChange: (m) => {
2035
+ h(m.value[0]);
1979
2036
  },
1980
2037
  get children() {
1981
- return [l(A.Label, {
2038
+ return [c(_.Label, {
1982
2039
  class: "sr-only",
1983
2040
  get children() {
1984
- return t.selected_camera;
2041
+ return r.selected_camera;
1985
2042
  }
1986
- }), l(A.Trigger, {
1987
- asChild: (d) => (() => {
1988
- var m = rr();
1989
- return D(m, J(() => Be(d()), {
1990
- class: `flex px-4 py-2 items-center gap-2 rounded-full
1991
- bg-gray-550/90 backdrop-blur-xl whitespace-nowrap text-base
1992
- color-white font-500 cursor-pointer appearance-none
1993
- border-none disabled:opacity-50 disabled:cursor-not-allowed
1994
- max-w-[100%] btn-focus`
1995
- }), !1, !0), w(m, l(Yt, {
2043
+ }), c(_.Trigger, {
2044
+ asChild: (m) => (() => {
2045
+ var g = sr();
2046
+ return A(g, H(() => He(m()), {
2047
+ class: "flex px-4 py-2 items-center gap-2 rounded-full bg-gray-550/90 backdrop-blur-xl whitespace-nowrap text-base color-white font-500 cursor-pointer appearance-none border-none disabled:opacity-50 disabled:cursor-not-allowed max-w-[100%] btn-focus"
2048
+ }), !1, !0), y(g, c(rr, {
1996
2049
  class: "size-6 shrink-0",
1997
- "aria-hidden": !0
1998
- }), null), w(m, l(A.ValueText, {
2050
+ "aria-hidden": "true"
2051
+ }), null), y(g, c(_.ValueText, {
1999
2052
  class: "truncate",
2000
2053
  get placeholder() {
2001
- return i() ? t.loading_cameras : t.select_a_camera;
2054
+ return o() ? r.loading_cameras : r.select_a_camera;
2002
2055
  }
2003
- }), null), w(m, l(A.Indicator, {
2056
+ }), null), y(g, c(_.Indicator, {
2004
2057
  class: "shrink-0 data-[state=open]:scale-y-[-1]",
2005
2058
  get children() {
2006
- return l(tr, {
2059
+ return c(ir, {
2007
2060
  class: "size-6 shrink-0"
2008
2061
  });
2009
2062
  }
2010
- }), null), m;
2063
+ }), null), g;
2011
2064
  })()
2012
- }), l(A.Positioner, {
2013
- class: "focus-visible:outline-none",
2065
+ }), c(_.Positioner, {
2014
2066
  get children() {
2015
- return l(A.Content, {
2016
- class: "focus-visible:outline-none outline-none",
2067
+ return c(_.Content, {
2068
+ class: "dropdown-content focus-visible:outline focus-visible:outline-2px focus-visible:outline-solid focus-visible:outline-primary focus-visible:outline-offset-4px",
2017
2069
  get children() {
2018
- return l(A.ItemGroup, {
2019
- class: `rounded-4 overflow-hidden text-base color-white
2020
- focus-visible:outline-none flex flex-col gap-[1px]`,
2070
+ return c(_.ItemGroup, {
2071
+ class: "rounded-4 overflow-hidden text-base color-white flex flex-col",
2021
2072
  get children() {
2022
- return l(Qe, {
2073
+ return c(Ze, {
2023
2074
  get each() {
2024
- return p().items;
2075
+ return b().items;
2025
2076
  },
2026
- children: (d, m) => {
2027
- const C = m === 0, v = m === p().items.length - 1;
2028
- return l(A.Item, {
2029
- get item() {
2030
- return d();
2031
- },
2032
- class: `flex py-3 pl-4 pr-12 cursor-pointer
2033
- select-none bg-gray-550/50 backdrop-blur-xl
2034
- focus-visible:outline-none outline-none border-2
2035
- border-solid border-transparent
2036
- data-[highlighted]:border-primary relative
2037
- ${C ? "rounded-t-6" : ""}
2038
- ${v ? "rounded-b-6" : ""}`,
2039
- get children() {
2040
- return [l(A.ItemText, {
2041
- class: "truncate",
2042
- get children() {
2043
- return d().label;
2044
- }
2045
- }), l(A.ItemIndicator, {
2046
- class: "absolute right-4",
2047
- get children() {
2048
- return l(Zt, {
2049
- class: "size-6 shrink-0"
2050
- });
2051
- }
2052
- })];
2053
- }
2054
- });
2055
- }
2077
+ children: (m) => c(_.Item, {
2078
+ get item() {
2079
+ return m();
2080
+ },
2081
+ class: "flex py-3 pl-4 pr-12 cursor-pointer select-none bg-gray-550/50 backdrop-blur-xl data-[highlighted]:bg-gray-550/100 relative first-of-type-rounded-t-6 last-of-type-rounded-b-6 not-first-of-type-b-t-gray-300/50 not-first-of-type-b-t-1 not-first-of-type-b-t-solid",
2082
+ get children() {
2083
+ return [c(_.ItemText, {
2084
+ class: "truncate",
2085
+ get children() {
2086
+ return m().label;
2087
+ }
2088
+ }), c(_.ItemIndicator, {
2089
+ class: "absolute right-4",
2090
+ get children() {
2091
+ return c(nr, {
2092
+ class: "size-6 shrink-0"
2093
+ });
2094
+ }
2095
+ })];
2096
+ }
2097
+ })
2056
2098
  });
2057
2099
  }
2058
2100
  });
@@ -2064,83 +2106,85 @@ const ar = () => {
2064
2106
  })
2065
2107
  });
2066
2108
  };
2067
- var ae = /* @__PURE__ */ y("<span class=sr-only>"), nr = /* @__PURE__ */ y("<div class=justify-self-end>"), or = /* @__PURE__ */ y('<div class="z-2 relative gap-2 grid justify-between items-center grid-cols-[1fr_auto_1fr] py-4 color-white lerp:px-3@xs,8@lg"><div class="justify-self-start flex flex-nowrap gap-4 auto-cols-auto"></div><div class="justify-self-center min-w-0 w-full">'), ir = /* @__PURE__ */ y("<button>");
2068
- const sr = () => {
2109
+ var cr = /* @__PURE__ */ w("<div class=justify-self-end>"), ur = /* @__PURE__ */ w('<div class="z-2 relative gap-2 grid justify-between items-center grid-cols-[1fr_auto_1fr] py-4 color-white lerp:px-3@xs,8@lg"><div class="justify-self-start flex flex-nowrap gap-4 auto-cols-auto"></div><div class="justify-self-center min-w-0 w-full">'), dr = /* @__PURE__ */ w("<button>");
2110
+ const hr = () => {
2069
2111
  const {
2070
- dismountCameraUi: r,
2112
+ dismountCameraUi: t,
2071
2113
  cameraManagerSolidStore: e,
2072
- cameraManager: t,
2114
+ cameraManager: r,
2073
2115
  showMirrorCameraButton: a,
2074
2116
  showTorchButton: n,
2075
- showCloseButton: o
2076
- } = j(), {
2077
- t: i
2078
- } = ee(), c = e((m) => m.mirrorX), s = e((m) => m.selectedCamera), h = e((m) => m.cameras), f = e((m) => m.playbackState !== "idle"), p = e((m) => m.selectedCamera?.torchEnabled), S = () => s()?.torchSupported, g = () => {
2079
- const m = s();
2080
- m && m.toggleTorch();
2081
- }, d = () => {
2082
- t.setCameraMirrorX(!e.getState().mirrorX);
2117
+ showCloseButton: i
2118
+ } = q(), {
2119
+ t: o
2120
+ } = Z(), s = e((g) => g.mirrorX), l = e((g) => g.selectedCamera), d = e((g) => g.cameras), u = e((g) => g.playbackState !== "idle"), b = e((g) => g.selectedCamera?.torchEnabled), p = () => l()?.torchSupported, h = () => {
2121
+ const g = l();
2122
+ g && g.toggleTorch();
2123
+ }, m = () => {
2124
+ r.setCameraMirrorX(!e.getState().mirrorX);
2083
2125
  };
2084
- return l(te, {
2126
+ return c(ee, {
2085
2127
  children: () => (() => {
2086
- var m = or(), C = m.firstChild, v = C.nextSibling;
2087
- return w(C, l(k, {
2128
+ var g = ur(), S = g.firstChild, T = S.nextSibling;
2129
+ return y(S, c(x, {
2088
2130
  get when() {
2089
- return a && f();
2131
+ return a && u();
2090
2132
  },
2091
2133
  get children() {
2092
- return l(ne, {
2134
+ return c(re, {
2093
2135
  part: "mirror-camera-button-part",
2094
2136
  get tooltipLabel() {
2095
- return i.mirror_camera;
2137
+ return o.mirror_camera;
2138
+ },
2139
+ onClick: () => m(),
2140
+ get "aria-pressed"() {
2141
+ return s() ? "true" : "false";
2096
2142
  },
2097
- onClick: () => d(),
2098
2143
  get children() {
2099
- return [(() => {
2100
- var b = ae();
2101
- return w(b, () => i.mirror_camera), b;
2102
- })(), l(Qt, {
2103
- class: `size-6 shrink-0 transition-transform duration-300
2104
- ease-in-out`,
2144
+ return c(er, {
2145
+ "aria-hidden": "true",
2146
+ class: "size-6 shrink-0 transition-transform duration-300 ease-in-out",
2105
2147
  get style() {
2106
2148
  return {
2107
- transform: c() ? "scaleX(-1)" : "scaleX(1)"
2149
+ transform: s() ? "scaleX(-1)" : "scaleX(1)"
2108
2150
  };
2109
2151
  }
2110
- })];
2152
+ });
2111
2153
  }
2112
2154
  });
2113
2155
  }
2114
- }), null), w(C, l(k, {
2156
+ }), null), y(S, c(x, {
2115
2157
  get when() {
2116
- return Se(() => !!(n && S()))() && f();
2158
+ return Ee(() => !!(n && p()))() && u();
2117
2159
  },
2118
2160
  get children() {
2119
- return l(ne, {
2161
+ return c(re, {
2120
2162
  part: "torch-button-part",
2121
- onClick: () => g(),
2163
+ onClick: () => h(),
2122
2164
  get tooltipLabel() {
2123
- return i.torch;
2165
+ return o.torch;
2166
+ },
2167
+ get "aria-pressed"() {
2168
+ return b() ? "true" : "false";
2124
2169
  },
2125
2170
  get children() {
2126
- return [l(k, {
2171
+ return [c(x, {
2127
2172
  get when() {
2128
- return !p();
2173
+ return !b();
2129
2174
  },
2130
2175
  get children() {
2131
- return [(() => {
2132
- var b = ae();
2133
- return w(b, () => i.torch), b;
2134
- })(), l(Gt, {
2176
+ return c(Jt, {
2177
+ "aria-hidden": "true",
2135
2178
  class: "size-6 shrink-0"
2136
- })];
2179
+ });
2137
2180
  }
2138
- }), l(k, {
2181
+ }), c(x, {
2139
2182
  get when() {
2140
- return p();
2183
+ return b();
2141
2184
  },
2142
2185
  get children() {
2143
- return l(Ht, {
2186
+ return c(Kt, {
2187
+ "aria-hidden": "true",
2144
2188
  class: "size-6 shrink-0"
2145
2189
  });
2146
2190
  }
@@ -2148,468 +2192,553 @@ const sr = () => {
2148
2192
  }
2149
2193
  });
2150
2194
  }
2151
- }), null), w(v, l(k, {
2195
+ }), null), y(T, c(x, {
2152
2196
  get when() {
2153
- return h().length > 1;
2197
+ return d().length > 1;
2154
2198
  },
2155
2199
  get children() {
2156
- return l(ar, {});
2200
+ return c(lr, {});
2157
2201
  }
2158
- })), w(m, l(k, {
2159
- when: o,
2202
+ })), y(g, c(x, {
2203
+ when: i,
2160
2204
  get children() {
2161
- var b = nr();
2162
- return w(b, l(ne, {
2163
- part: "close-button-part",
2164
- onClick: () => r(),
2165
- get tooltipLabel() {
2166
- return i.close;
2167
- },
2168
- get children() {
2169
- return [(() => {
2170
- var E = ae();
2171
- return w(E, () => i.close), E;
2172
- })(), l(qt, {
2173
- class: "size-6 shrink-0"
2174
- })];
2205
+ var v = cr();
2206
+ return y(v, c(
2207
+ re,
2208
+ {
2209
+ part: "close-button-part",
2210
+ onClick: () => t(),
2211
+ get tooltipLabel() {
2212
+ return o.close;
2213
+ },
2214
+ get children() {
2215
+ return c(Xt, {
2216
+ class: "size-6 shrink-0",
2217
+ "aria-hidden": "true"
2218
+ });
2219
+ }
2175
2220
  }
2176
- })), b;
2221
+ )), v;
2177
2222
  }
2178
- }), null), m;
2223
+ }), null), g;
2179
2224
  })()
2180
2225
  });
2181
- }, ne = (r) => l(Q.Root, {
2182
- get children() {
2183
- return [l(Q.Trigger, J(r, {
2184
- asChild: (e) => (() => {
2185
- var t = ir();
2186
- return D(t, J(() => Be(e()), {
2187
- class: `btn-focus rounded-full bg-gray-550/70 backdrop-blur grid
2188
- place-items-center size-12 appearance-none border-none
2189
- cursor-pointer`
2190
- }), !1, !0), w(t, () => r.children), t;
2191
- })()
2192
- })), l(Q.Positioner, {
2193
- get children() {
2194
- return l(Q.Content, {
2195
- class: `bg-gray-550/70 backdrop-blur color-white text-align-center p-2
2196
- rounded-md text-sm drop-shadow-md`,
2197
- get children() {
2198
- return r.tooltipLabel;
2199
- }
2200
- });
2201
- }
2202
- })];
2203
- }
2204
- }), lr = (r, e, t) => Ke((a) => (w(e, r(), e.firstChild ? null : void 0), () => {
2205
- a(), e.textContent = "";
2206
- }), t);
2207
- var cr = /* @__PURE__ */ y("<div>");
2208
- const ur = (r) => {
2209
- const e = ke(), [t, a] = Ye(r, ["children", "disableShadowRoot", "getRef"]);
2226
+ }, re = (t) => {
2227
+ const [e, r] = Y(t, ["tooltipLabel", "children"]);
2228
+ return c(X.Root, {
2229
+ get children() {
2230
+ return [c(X.Trigger, {
2231
+ asChild: (a) => {
2232
+ const [, n] = Y(a(), ["aria-describedby"]);
2233
+ return (() => {
2234
+ var i = dr();
2235
+ return A(i, H({
2236
+ get "aria-label"() {
2237
+ return e.tooltipLabel;
2238
+ }
2239
+ }, r, () => He(n), {
2240
+ class: "btn-focus rounded-full bg-gray-550/70 backdrop-blur grid place-items-center size-12 appearance-none border-none cursor-pointer"
2241
+ }), !1, !0), y(i, () => e.children), i;
2242
+ })();
2243
+ }
2244
+ }), c(X.Positioner, {
2245
+ get children() {
2246
+ return c(X.Content, {
2247
+ class: "bg-gray-550/70 backdrop-blur color-white text-align-center p-2 rounded-md text-sm drop-shadow-md",
2248
+ "aria-hidden": "true",
2249
+ get children() {
2250
+ return e.tooltipLabel;
2251
+ }
2252
+ });
2253
+ }
2254
+ })];
2255
+ }
2256
+ });
2257
+ }, fr = (t, e, r) => oe((a) => (y(e, t(), e.firstChild ? null : void 0), () => {
2258
+ a(), e instanceof Document || (e.textContent = "");
2259
+ }), r);
2260
+ var mr = /* @__PURE__ */ w("<div>");
2261
+ const gr = (t) => {
2262
+ const e = Re(), [r, a] = Y(t, ["children", "disableShadowRoot", "getRef"]);
2210
2263
  return (() => {
2211
- var n = cr();
2212
- return V((o) => {
2213
- if (t.disableShadowRoot)
2264
+ var n = mr();
2265
+ return V((i) => {
2266
+ if (r.disableShadowRoot)
2214
2267
  return;
2215
- const i = o.attachShadow({
2268
+ const o = i.attachShadow({
2216
2269
  mode: "open"
2217
2270
  });
2218
- lr(() => Se(() => t.children), i, e);
2219
- }, n), D(n, a, !1, !0), w(n, l(k, {
2271
+ fr(() => Ee(() => r.children), o, e);
2272
+ }, n), A(n, a, !1, !0), y(n, c(x, {
2220
2273
  get when() {
2221
- return t.disableShadowRoot;
2274
+ return r.disableShadowRoot;
2222
2275
  },
2223
2276
  get children() {
2224
- return t.children;
2277
+ return r.children;
2225
2278
  }
2226
2279
  })), n;
2227
2280
  })();
2228
- }, dr = ":where(html){line-height:1.15;-webkit-text-size-adjust:100%;text-size-adjust:100%}:where(h1){font-size:2em;margin-block-end:.67em;margin-block-start:.67em}:where(dl,ol,ul) :where(dl,ol,ul){margin-block-end:0;margin-block-start:0}:where(hr){box-sizing:content-box;color:inherit;height:0}:where(abbr[title]){text-decoration:underline;text-decoration:underline dotted}:where(b,strong){font-weight:bolder}:where(code,kbd,pre,samp){font-family:monospace,monospace;font-size:1em}:where(small){font-size:80%}:where(table){border-color:currentColor;text-indent:0}:where(button,input,select){margin:0}:where(button){text-transform:none}:where(button,input:is([type=button i],[type=reset i],[type=submit i])){-webkit-appearance:button}:where(progress){vertical-align:baseline}:where(select){text-transform:none}:where(textarea){margin:0}:where(input[type=search i]){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focus-inner{border-style:none;padding:0}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focusring{outline:1px dotted ButtonText}:where(:-moz-ui-invalid){box-shadow:none}:where(dialog){background-color:#fff;border:solid;color:#000;height:-moz-fit-content;height:fit-content;left:0;margin:auto;padding:1em;position:absolute;right:0;width:-moz-fit-content;width:fit-content}:where(dialog:not([open])){display:none}:where(summary){display:list-item}", hr = ":host{font-family:var(--mb-ui-font);line-height:1.15;isolation:isolate;box-sizing:border-box}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}code,pre{font-family:var(--mb-monospace-font-stack)}svg path{pointer-events:none}img,picture,video,canvas,svg{display:block;max-width:100%}img{pointer-events:none;user-select:none}:where(input,button,textarea,select){font:inherit}:where(button,select){cursor:pointer;color:inherit;font:inherit}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}", mr = ':host{--mb-system-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--mb-monospace-font-stack: Menlo, Consolas, "Ubuntu Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;--mb-ui-font: var(--mb-system-font-stack);--mb-size: 1;--color-accent-25-rgb-value: 242 247 255;--color-accent-50-rgb-value: 231 240 255;--color-accent-100-rgb-value: 220 234 255;--color-accent-200-rgb-value: 198 221 255;--color-accent-300-rgb-value: 158 197 255;--color-accent-400-rgb-value: 111 169 255;--color-accent-500-rgb-value: 58 137 253;--color-accent-600-rgb-value: 0 98 242;--color-accent-700-rgb-value: 0 80 197;--color-accent-800-rgb-value: 0 64 157;--color-accent-900-rgb-value: 0 54 133;--color-error-25-rgb-value: 255 248 249;--color-error-50-rgb-value: 255 241 242;--color-error-100-rgb-value: 255 228 230;--color-error-200-rgb-value: 254 205 211;--color-error-300-rgb-value: 253 164 175;--color-error-400-rgb-value: 251 113 133;--color-error-500-rgb-value: 244 63 94;--color-error-600-rgb-value: 225 29 72;--color-error-700-rgb-value: 190 18 60;--color-error-800-rgb-value: 136 19 39;--color-error-900-rgb-value: 89 13 40;--color-success-25-rgb-value: 245 254 250;--color-success-50-rgb-value: 236 253 245;--color-success-100-rgb-value: 209 250 229;--color-success-200-rgb-value: 167 243 208;--color-success-300-rgb-value: 110 231 183;--color-success-400-rgb-value: 52 211 153;--color-success-500-rgb-value: 16 185 144;--color-success-600-rgb-value: 22 163 138;--color-success-700-rgb-value: 39 121 106;--color-success-800-rgb-value: 23 92 79;--color-success-900-rgb-value: 12 59 50;--color-warning-25-rgb-value: 255 253 243;--color-warning-50-rgb-value: 254 252 232;--color-warning-100-rgb-value: 254 249 195;--color-warning-200-rgb-value: 254 240 138;--color-warning-300-rgb-value: 253 229 99;--color-warning-400-rgb-value: 252 218 59;--color-warning-500-rgb-value: 250 204 21;--color-warning-600-rgb-value: 234 179 8;--color-warning-700-rgb-value: 190 142 48;--color-warning-800-rgb-value: 132 83 28;--color-warning-900-rgb-value: 80 29 10;--color-deep-blue-25-rgb-value: 249 252 255;--color-deep-blue-50-rgb-value: 243 249 254;--color-deep-blue-100-rgb-value: 231 242 251;--color-deep-blue-200-rgb-value: 201 218 241;--color-deep-blue-300-rgb-value: 162 185 216;--color-deep-blue-400-rgb-value: 93 128 182;--color-deep-blue-500-rgb-value: 60 100 161;--color-deep-blue-600-rgb-value: 28 68 129;--color-deep-blue-700-rgb-value: 24 53 97;--color-deep-blue-800-rgb-value: 20 38 65;--color-deep-blue-900-rgb-value: 6 23 49;--color-light-blue-25-rgb-value: 248 251 253;--color-light-blue-50-rgb-value: 240 247 251;--color-light-blue-100-rgb-value: 228 238 244;--color-light-blue-200-rgb-value: 215 229 238;--color-light-blue-300-rgb-value: 190 218 237;--color-light-blue-400-rgb-value: 159 202 232;--color-light-blue-500-rgb-value: 135 180 211;--color-light-blue-600-rgb-value: 104 157 193;--color-light-blue-700-rgb-value: 78 129 164;--color-light-blue-800-rgb-value: 67 109 138;--color-light-blue-900-rgb-value: 55 84 104;--color-gray-50-rgb-value: 249 250 251;--color-gray-100-rgb-value: 243 244 246;--color-gray-200-rgb-value: 229 231 235;--color-gray-300-rgb-value: 209 213 219;--color-gray-400-rgb-value: 156 163 175;--color-gray-500-rgb-value: 107 114 128;--color-gray-550-rgb-value: 102 102 102;--color-gray-600-rgb-value: 75 85 99;--color-gray-700-rgb-value: 55 65 81;--color-gray-800-rgb-value: 31 41 55;--color-blue-gray-50-rgb-value: 74 74 74;--color-blue-gray-100-rgb-value: 60 60 60;--color-blue-gray-200-rgb-value: 50 50 50;--color-blue-gray-300-rgb-value: 45 45 45;--color-blue-gray-400-rgb-value: 34 34 34;--color-blue-gray-500-rgb-value: 31 31 31;--color-blue-gray-600-rgb-value: 28 28 30;--color-blue-gray-700-rgb-value: 27 27 27;--color-blue-gray-800-rgb-value: 24 24 24;--color-blue-gray-900-rgb-value: 15 15 15;--color-black-rgb-value: 0 0 0;--color-white-rgb-value: 255 255 255;--color-primary: var(--color-accent-600-rgb-value);--color-error: var(--color-error-500-rgb-value);--color-success: var(--color-success-500-rgb-value);--color-warning: var(--color-warning-500-rgb-value);--color-deep-blue: var(--color-deep-blue-800-rgb-value);--color-light-blue: var(--color-light-blue-200-rgb-value);accent-color:var(--color-primary);caret-color:red}', gr = {
2281
+ }, br = ":where(html){line-height:1.15;-webkit-text-size-adjust:100%;text-size-adjust:100%}:where(h1){font-size:2em;margin-block-end:.67em;margin-block-start:.67em}:where(dl,ol,ul) :where(dl,ol,ul){margin-block-end:0;margin-block-start:0}:where(hr){box-sizing:content-box;color:inherit;height:0}:where(abbr[title]){text-decoration:underline;text-decoration:underline dotted}:where(b,strong){font-weight:bolder}:where(code,kbd,pre,samp){font-family:monospace,monospace;font-size:1em}:where(small){font-size:80%}:where(table){border-color:currentColor;text-indent:0}:where(button,input,select){margin:0}:where(button){text-transform:none}:where(button,input:is([type=button i],[type=reset i],[type=submit i])){-webkit-appearance:button}:where(progress){vertical-align:baseline}:where(select){text-transform:none}:where(textarea){margin:0}:where(input[type=search i]){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focus-inner{border-style:none;padding:0}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focusring{outline:1px dotted ButtonText}:where(:-moz-ui-invalid){box-shadow:none}:where(dialog){background-color:#fff;border:solid;color:#000;height:-moz-fit-content;height:fit-content;left:0;margin:auto;padding:1em;position:absolute;right:0;width:-moz-fit-content;width:fit-content}:where(dialog:not([open])){display:none}:where(summary){display:list-item}", pr = ":host{font-family:var(--mb-ui-font);line-height:1.15;isolation:isolate;box-sizing:border-box}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}code,pre{font-family:var(--mb-monospace-font-stack)}svg path{pointer-events:none}img,picture,video,canvas,svg{display:block;max-width:100%}img{pointer-events:none;user-select:none}:where(input,button,textarea,select){font:inherit}:where(button,select){cursor:pointer;color:inherit;font:inherit;touch-action:manipulation}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}", vr = ':host{--mb-system-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--mb-monospace-font-stack: Menlo, Consolas, "Ubuntu Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;--mb-ui-font: var(--mb-system-font-stack);--mb-size: 1;--color-accent-25-rgb-value: 242 247 255;--color-accent-50-rgb-value: 231 240 255;--color-accent-100-rgb-value: 220 234 255;--color-accent-200-rgb-value: 198 221 255;--color-accent-300-rgb-value: 158 197 255;--color-accent-400-rgb-value: 111 169 255;--color-accent-500-rgb-value: 58 137 253;--color-accent-600-rgb-value: 0 98 242;--color-accent-700-rgb-value: 0 80 197;--color-accent-800-rgb-value: 0 64 157;--color-accent-900-rgb-value: 0 54 133;--color-error-25-rgb-value: 255 248 249;--color-error-50-rgb-value: 255 241 242;--color-error-100-rgb-value: 255 228 230;--color-error-200-rgb-value: 254 205 211;--color-error-300-rgb-value: 253 164 175;--color-error-400-rgb-value: 251 113 133;--color-error-500-rgb-value: 244 63 94;--color-error-600-rgb-value: 225 29 72;--color-error-700-rgb-value: 190 18 60;--color-error-800-rgb-value: 136 19 39;--color-error-900-rgb-value: 89 13 40;--color-success-25-rgb-value: 245 254 250;--color-success-50-rgb-value: 236 253 245;--color-success-100-rgb-value: 209 250 229;--color-success-200-rgb-value: 167 243 208;--color-success-300-rgb-value: 110 231 183;--color-success-400-rgb-value: 52 211 153;--color-success-500-rgb-value: 16 185 144;--color-success-600-rgb-value: 22 163 138;--color-success-700-rgb-value: 39 121 106;--color-success-800-rgb-value: 23 92 79;--color-success-900-rgb-value: 12 59 50;--color-warning-25-rgb-value: 255 253 243;--color-warning-50-rgb-value: 254 252 232;--color-warning-100-rgb-value: 254 249 195;--color-warning-200-rgb-value: 254 240 138;--color-warning-300-rgb-value: 253 229 99;--color-warning-400-rgb-value: 252 218 59;--color-warning-500-rgb-value: 250 204 21;--color-warning-600-rgb-value: 234 179 8;--color-warning-700-rgb-value: 190 142 48;--color-warning-800-rgb-value: 132 83 28;--color-warning-900-rgb-value: 80 29 10;--color-deep-blue-25-rgb-value: 249 252 255;--color-deep-blue-50-rgb-value: 243 249 254;--color-deep-blue-100-rgb-value: 231 242 251;--color-deep-blue-200-rgb-value: 201 218 241;--color-deep-blue-300-rgb-value: 162 185 216;--color-deep-blue-400-rgb-value: 93 128 182;--color-deep-blue-500-rgb-value: 60 100 161;--color-deep-blue-600-rgb-value: 28 68 129;--color-deep-blue-700-rgb-value: 24 53 97;--color-deep-blue-800-rgb-value: 20 38 65;--color-deep-blue-900-rgb-value: 6 23 49;--color-light-blue-25-rgb-value: 248 251 253;--color-light-blue-50-rgb-value: 240 247 251;--color-light-blue-100-rgb-value: 228 238 244;--color-light-blue-200-rgb-value: 215 229 238;--color-light-blue-300-rgb-value: 190 218 237;--color-light-blue-400-rgb-value: 159 202 232;--color-light-blue-500-rgb-value: 135 180 211;--color-light-blue-600-rgb-value: 104 157 193;--color-light-blue-700-rgb-value: 78 129 164;--color-light-blue-800-rgb-value: 67 109 138;--color-light-blue-900-rgb-value: 55 84 104;--color-gray-50-rgb-value: 249 250 251;--color-gray-100-rgb-value: 243 244 246;--color-gray-200-rgb-value: 229 231 235;--color-gray-300-rgb-value: 209 213 219;--color-gray-400-rgb-value: 156 163 175;--color-gray-500-rgb-value: 107 114 128;--color-gray-550-rgb-value: 102 102 102;--color-gray-600-rgb-value: 75 85 99;--color-gray-700-rgb-value: 55 65 81;--color-gray-800-rgb-value: 31 41 55;--color-blue-gray-50-rgb-value: 74 74 74;--color-blue-gray-100-rgb-value: 60 60 60;--color-blue-gray-200-rgb-value: 50 50 50;--color-blue-gray-300-rgb-value: 45 45 45;--color-blue-gray-400-rgb-value: 34 34 34;--color-blue-gray-500-rgb-value: 31 31 31;--color-blue-gray-600-rgb-value: 28 28 30;--color-blue-gray-700-rgb-value: 27 27 27;--color-blue-gray-800-rgb-value: 24 24 24;--color-blue-gray-900-rgb-value: 15 15 15;--color-black-rgb-value: 0 0 0;--color-white-rgb-value: 255 255 255;--color-primary: var(--color-accent-600-rgb-value);--color-error: var(--color-error-500-rgb-value);--color-success: var(--color-success-500-rgb-value);--color-warning: var(--color-warning-500-rgb-value);--color-deep-blue: var(--color-deep-blue-800-rgb-value);--color-light-blue: var(--color-light-blue-200-rgb-value);accent-color:var(--color-primary);caret-color:red}', wr = {
2229
2282
  feedbackLayer: null,
2230
2283
  overlayLayer: null,
2231
2284
  owner: null
2232
- }, B = de()(
2285
+ }, O = de()(
2233
2286
  // this is important! Otherwise, solid-zustand will start mutating the initial state
2234
- ue(() => structuredClone(gr))
2235
- ), ce = Te(B), we = () => {
2236
- };
2237
- function fr(r, e) {
2238
- if (He)
2239
- return { observe: we, unobserve: we };
2240
- const t = new ResizeObserver(r);
2241
- return he(t.disconnect.bind(t)), {
2242
- observe: (a) => t.observe(a, e),
2243
- unobserve: t.unobserve.bind(t)
2287
+ ue(() => structuredClone(wr))
2288
+ ), ce = Ae(O), Se = () => {
2289
+ }, yr = (t) => t != null, Sr = (t) => t.filter(yr), Cr = (t) => typeof t == "function" && !t.length ? t() : t, Er = (t) => Array.isArray(t) ? t : t ? [t] : [];
2290
+ function kr(t, e, r, a) {
2291
+ const n = t.length, i = e.length;
2292
+ let o = 0;
2293
+ if (!i) {
2294
+ for (; o < n; o++)
2295
+ r(t[o]);
2296
+ return;
2297
+ }
2298
+ if (!n) {
2299
+ for (; o < i; o++)
2300
+ a(e[o]);
2301
+ return;
2302
+ }
2303
+ for (; o < i && e[o] === t[o]; o++)
2304
+ ;
2305
+ let s, l;
2306
+ e = e.slice(o), t = t.slice(o);
2307
+ for (s of e)
2308
+ t.includes(s) || a(s);
2309
+ for (l of t)
2310
+ e.includes(l) || r(l);
2311
+ }
2312
+ function We(t, e) {
2313
+ if (he)
2314
+ return { observe: Se, unobserve: Se };
2315
+ const r = new ResizeObserver(t);
2316
+ return J(r.disconnect.bind(r)), {
2317
+ observe: (a) => r.observe(a, e),
2318
+ unobserve: r.unobserve.bind(r)
2244
2319
  };
2245
2320
  }
2246
- var br = /* @__PURE__ */ y('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 14 14"><path fill=#000 fill-rule=evenodd d="M13.707 1.707A1 1 0 0 0 12.293.293L7 5.586 1.707.293A1 1 0 0 0 .293 1.707L5.586 7 .293 12.293a1 1 0 1 0 1.414 1.414L7 8.414l5.293 5.293a1 1 0 0 0 1.414-1.414L8.414 7z"clip-rule=evenodd>');
2247
- const pr = (r = {}) => (() => {
2248
- var e = br();
2249
- return D(e, r, !0, !0), e;
2250
- })(), vr = "_dialogPositioner_15i6c_1", wr = "_dialogBackdrop_15i6c_10", Sr = "_dialogContent_15i6c_14", yr = "_large_15i6c_18", Cr = "_compact_15i6c_21", Er = "_dialogTitle_15i6c_45", kr = "_contentOut_15i6c_49", Tr = "_closeButton_15i6c_53", _r = "_closeButtonInner_15i6c_59", Mr = "_primaryActionButton_15i6c_63", xr = "_secondaryActionButton_15i6c_67", Rr = "_actions_15i6c_71", Ar = "_alertTitle_15i6c_79", $r = "_alertText_15i6c_83", T = {
2251
- dialogPositioner: vr,
2252
- dialogBackdrop: wr,
2253
- dialogContent: Sr,
2254
- large: yr,
2255
- compact: Cr,
2256
- dialogTitle: Er,
2257
- contentOut: kr,
2258
- closeButton: Tr,
2259
- closeButtonInner: _r,
2260
- primaryActionButton: Mr,
2261
- secondaryActionButton: xr,
2262
- actions: Rr,
2263
- alertTitle: Ar,
2264
- alertText: $r
2265
- };
2266
- var Dr = /* @__PURE__ */ y("<div>"), Ir = /* @__PURE__ */ y("<p>"), Fr = /* @__PURE__ */ y("<span>"), Lr = /* @__PURE__ */ y("<div><button></button><button>");
2267
- const zr = (r) => {
2268
- const e = () => {
2269
- switch (r.modalStyle) {
2270
- case "compact":
2271
- return T.compact;
2272
- case "large":
2273
- return T.compact;
2274
- case "default":
2275
- default:
2276
- return;
2321
+ function Tr(t, e, r) {
2322
+ if (he)
2323
+ return;
2324
+ const a = /* @__PURE__ */ new WeakMap(), { observe: n, unobserve: i } = We((o) => {
2325
+ for (const s of o) {
2326
+ const { contentRect: l, target: d } = s, u = Math.round(l.width), b = Math.round(l.height), p = a.get(d);
2327
+ (!p || p.width !== u || p.height !== b) && (e(l, d, s), a.set(d, { width: u, height: b }));
2277
2328
  }
2329
+ }, r);
2330
+ _e((o) => {
2331
+ const s = Sr(Er(Cr(t)));
2332
+ return kr(s, o, n, i), s;
2333
+ }, []);
2334
+ }
2335
+ var xr = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 14 14"><path fill=#000 fill-rule=evenodd d="M13.707 1.707A1 1 0 0 0 12.293.293L7 5.586 1.707.293A1 1 0 0 0 .293 1.707L5.586 7 .293 12.293a1 1 0 1 0 1.414 1.414L7 8.414l5.293 5.293a1 1 0 0 0 1.414-1.414L8.414 7z"clip-rule=evenodd>');
2336
+ const Mr = (t = {}) => (() => {
2337
+ var e = xr();
2338
+ return A(e, t, !0, !0), e;
2339
+ })(), ae = Symbol("fallback");
2340
+ function Ce(t) {
2341
+ for (const e of t)
2342
+ e.dispose();
2343
+ }
2344
+ function Rr(t, e, r, a = {}) {
2345
+ if (he) {
2346
+ const o = t();
2347
+ let s = [];
2348
+ if (o && o.length)
2349
+ for (let l = 0, d = o.length; l < d; l++)
2350
+ s.push(r(() => o[l], () => l));
2351
+ else a.fallback && (s = [a.fallback()]);
2352
+ return () => s;
2353
+ }
2354
+ const n = /* @__PURE__ */ new Map();
2355
+ return J(() => Ce(n.values())), () => {
2356
+ const o = t() || [];
2357
+ return o[tt], rt(() => {
2358
+ if (!o.length)
2359
+ return Ce(n.values()), n.clear(), a.fallback ? [oe((b) => (n.set(ae, { dispose: b }), a.fallback()))] : [];
2360
+ const s = new Array(o.length), l = n.get(ae);
2361
+ if (!n.size || l) {
2362
+ l?.dispose(), n.delete(ae);
2363
+ for (let u = 0; u < o.length; u++) {
2364
+ const b = o[u], p = e(b, u);
2365
+ i(s, b, u, p);
2366
+ }
2367
+ return s;
2368
+ }
2369
+ const d = new Set(n.keys());
2370
+ for (let u = 0; u < o.length; u++) {
2371
+ const b = o[u], p = e(b, u);
2372
+ d.delete(p);
2373
+ const h = n.get(p);
2374
+ h ? (s[u] = h.mapped, h.setIndex?.(u), h.setItem(() => b)) : i(s, b, u, p);
2375
+ }
2376
+ for (const u of d)
2377
+ n.get(u)?.dispose(), n.delete(u);
2378
+ return s;
2379
+ });
2278
2380
  };
2279
- return l(te, {
2280
- children: (t) => l($.Root, J({
2281
- onFocusOutside: (a) => a.preventDefault(),
2282
- onInteractOutside: (a) => a.preventDefault(),
2283
- initialFocusEl: () => t.querySelector('[role="dialog"]'),
2284
- restoreFocus: !0,
2285
- unmountOnExit: !0,
2286
- lazyMount: !0
2287
- }, r, {
2288
- get children() {
2289
- return l(k, {
2290
- get when() {
2291
- return r.open;
2292
- },
2293
- get children() {
2294
- return l(ye, {
2295
- get mount() {
2296
- return r.mountTarget;
2297
- },
2298
- get children() {
2299
- return l($.Positioner, {
2300
- get class() {
2301
- return T.dialogPositioner;
2302
- },
2303
- get children() {
2304
- return [l($.Backdrop, {
2305
- get class() {
2306
- return T.dialogBackdrop;
2307
- }
2308
- }), l($.Content, {
2309
- get class() {
2310
- return `${T.dialogContent} ${e()}`;
2311
- },
2312
- get children() {
2313
- return [l(k, {
2314
- get when() {
2315
- return r.showCloseButton;
2316
- },
2317
- get children() {
2318
- return l($.CloseTrigger, {
2319
- "aria-label": "Close",
2320
- get class() {
2321
- return T.closeButton;
2322
- },
2323
- get onClick() {
2324
- return r.onCloseClicked;
2325
- },
2326
- get children() {
2327
- return l(pr, {
2328
- get class() {
2329
- return T.closeButtonInner;
2330
- }
2331
- });
2332
- }
2333
- });
2334
- }
2335
- }), l(k, {
2336
- get when() {
2337
- return r.headerImage;
2338
- },
2339
- get children() {
2340
- return r.headerImage;
2341
- }
2342
- }), l(k, {
2343
- get when() {
2344
- return r.header;
2345
- },
2346
- children: (a) => l($.Title, {
2347
- get class() {
2348
- return T.dialogTitle;
2381
+ function i(o, s, l, d) {
2382
+ oe((u) => {
2383
+ const [b, p] = I(s), h = { setItem: p, dispose: u };
2384
+ if (r.length > 1) {
2385
+ const [m, g] = I(l);
2386
+ h.setIndex = g, h.mapped = r(b, m);
2387
+ } else
2388
+ h.mapped = r(b);
2389
+ n.set(d, h), o[l] = h.mapped;
2390
+ });
2391
+ }
2392
+ }
2393
+ function _r(t) {
2394
+ const { by: e } = t;
2395
+ return et(Rr(() => t.each, typeof e == "function" ? e : (r) => r[e], t.children, "fallback" in t ? { fallback: () => t.fallback } : void 0));
2396
+ }
2397
+ var Ar = /* @__PURE__ */ w('<div class="grid min-h-0">'), Dr = /* @__PURE__ */ w('<div class="flex justify-center gap-2 w-full shrink-0">');
2398
+ const Ir = (t) => {
2399
+ const [e, r] = Y(t, ["initialFocusEl", "role"]), [a, n] = I();
2400
+ Tr(a, (o, s) => {
2401
+ const l = Math.min(s.clientWidth, s.clientHeight), d = Math.min(1, Math.max(0, (l - 300) / 240));
2402
+ s.style.setProperty("--modal-t", d.toFixed(4));
2403
+ });
2404
+ const i = () => {
2405
+ const o = [];
2406
+ return t.actions?.secondary && o.push({
2407
+ type: "secondary",
2408
+ action: t.actions.secondary
2409
+ }), t.actions?.primary && o.push({
2410
+ type: "primary",
2411
+ action: t.actions.primary
2412
+ }), o;
2413
+ };
2414
+ return c(ee, {
2415
+ children: (o) => {
2416
+ const s = t.initialFocusEl ? {
2417
+ initialFocusEl: () => t.initialFocusEl(o)
2418
+ } : {};
2419
+ return c(D.Root, H({
2420
+ onFocusOutside: (l) => l.preventDefault(),
2421
+ onInteractOutside: (l) => l.preventDefault()
2422
+ }, s, r, {
2423
+ get children() {
2424
+ return c(x, {
2425
+ get when() {
2426
+ return t.open;
2427
+ },
2428
+ get children() {
2429
+ return c(ke, {
2430
+ get mount() {
2431
+ return t.mountTarget;
2432
+ },
2433
+ get children() {
2434
+ return c(D.Positioner, {
2435
+ class: "h-100dvh w-100dvw top-0 left-0 fixed grid place-items-center p-[clamp(1.5rem,6dvmin,3rem)]",
2436
+ get children() {
2437
+ return [c(D.Backdrop, {
2438
+ class: "absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-blur-sm"
2439
+ }), c(D.Content, {
2440
+ ref: n,
2441
+ get role() {
2442
+ return e.role;
2443
+ },
2444
+ class: "bg-white color-dark-900 rounded-2 shadow-lg relative flex flex-col min-h-0 [--modal-t:0] text-[calc(0.875rem+0.125rem*var(--modal-t))] max-h-full w-[min(540px,100%)] p-[clamp(1.5rem,6dvmin,3rem)] gap-6 lt-h-sm:gap-4",
2445
+ get children() {
2446
+ return [c(x, {
2447
+ get when() {
2448
+ return t.showCloseButton;
2349
2449
  },
2350
2450
  get children() {
2351
- return a();
2451
+ return c(D.CloseTrigger, {
2452
+ "aria-label": "Close",
2453
+ class: "absolute top-2.5 right-2.5 w-8 h-8 flex items-center justify-center bg-transparent border-none transition-colors transition-duration-100 hover:bg-gray-100 active:bg-gray-200",
2454
+ get onClick() {
2455
+ return t.onCloseClicked;
2456
+ },
2457
+ get children() {
2458
+ return c(Mr, {
2459
+ class: "w-3.5 h-3.5"
2460
+ });
2461
+ }
2462
+ });
2352
2463
  }
2353
- })
2354
- }), l($.Description, {
2355
- get class() {
2356
- return T.contentOut;
2357
- },
2358
- get children() {
2359
- return r.children;
2360
- }
2361
- }), l(k, {
2362
- get when() {
2363
- return r.actions;
2364
- },
2365
- get children() {
2366
- var a = Dr();
2367
- return w(a, () => r.actions), a;
2368
- }
2369
- })];
2370
- }
2371
- })];
2372
- }
2373
- });
2374
- }
2375
- });
2376
- }
2377
- });
2378
- }
2379
- }))
2464
+ }), (() => {
2465
+ var l = Ar();
2466
+ return y(l, () => t.children), Te((d) => {
2467
+ var u = t.scrollable !== !1, b = t.scrollable === !1;
2468
+ return u !== d.e && l.classList.toggle("overflow-y-auto", d.e = u), b !== d.t && l.classList.toggle("overflow-hidden", d.t = b), d;
2469
+ }, {
2470
+ e: void 0,
2471
+ t: void 0
2472
+ }), l;
2473
+ })(), c(x, {
2474
+ get when() {
2475
+ return t.actions;
2476
+ },
2477
+ get children() {
2478
+ var l = Dr();
2479
+ return y(l, c(_r, {
2480
+ get each() {
2481
+ return i();
2482
+ },
2483
+ by: "type",
2484
+ children: (d) => {
2485
+ const u = () => {
2486
+ const {
2487
+ label: p,
2488
+ ...h
2489
+ } = d().action;
2490
+ return h;
2491
+ }, b = d().type === "primary" ? "btn-primary" : "btn-secondary";
2492
+ return c(D.CloseTrigger, H({
2493
+ class: `btn ${b} max-w-[30ch] flex-1 min-w-0`
2494
+ }, u, {
2495
+ get children() {
2496
+ return d().action.label;
2497
+ }
2498
+ }));
2499
+ }
2500
+ })), l;
2501
+ }
2502
+ })];
2503
+ }
2504
+ })];
2505
+ }
2506
+ });
2507
+ }
2508
+ });
2509
+ }
2510
+ });
2511
+ }
2512
+ }));
2513
+ }
2380
2514
  });
2381
- }, Nr = ({
2382
- mountTarget: r,
2383
- header: e,
2384
- text: t,
2385
- open: a,
2386
- onPrimaryClick: n,
2387
- onSecondaryClick: o,
2388
- primaryButtonText: i = "Retry",
2389
- secondaryButtonText: c = "Cancel"
2390
- }) => l(zr, {
2391
- mountTarget: r,
2392
- get header() {
2393
- return (() => {
2394
- var s = Fr();
2395
- return w(s, e), K(() => H(s, T.alertTitle)), s;
2396
- })();
2397
- },
2398
- open: a,
2399
- get actions() {
2400
- return (() => {
2401
- var s = Lr(), h = s.firstChild, f = h.nextSibling;
2402
- return h.$$click = () => o(), w(h, c), f.$$click = () => n(), w(f, i), K((p) => {
2403
- var S = T.actions, g = T.secondaryActionButton, d = T.primaryActionButton;
2404
- return S !== p.e && H(s, p.e = S), g !== p.t && H(h, p.t = g), d !== p.a && H(f, p.a = d), p;
2405
- }, {
2406
- e: void 0,
2407
- t: void 0,
2408
- a: void 0
2409
- }), s;
2410
- })();
2411
- },
2412
- modalStyle: "compact",
2413
- get children() {
2414
- var s = Ir();
2415
- return w(s, t), K(() => H(s, T.alertText)), s;
2416
- }
2417
- });
2418
- We(["click"]);
2419
- const Pr = () => {
2515
+ }, Fr = (t) => c(Ir, H({
2516
+ role: "alertdialog"
2517
+ }, t));
2518
+ var Lr = /* @__PURE__ */ w("<p>");
2519
+ const Nr = () => {
2420
2520
  const {
2421
- t: r
2422
- } = ee(), {
2521
+ t
2522
+ } = Z(), {
2423
2523
  cameraManagerSolidStore: e,
2424
- cameraManager: t,
2524
+ cameraManager: r,
2425
2525
  dismountCameraUi: a
2426
- } = j(), n = e((h) => h.errorState), o = ce((h) => h.overlayLayer), i = () => {
2427
- const h = n();
2428
- return h instanceof U && h.code === "PERMISSION_DENIED";
2429
- }, c = () => i() ? r.camera_error_title : n() ? n().name : "", s = () => i() ? r.camera_error_details : n() ? n().name : "";
2430
- return l(k, {
2431
- get when() {
2526
+ } = q(), n = e((d) => d.errorState), i = ce((d) => d.overlayLayer), o = () => {
2527
+ const d = n();
2528
+ return d instanceof B && d.code === "PERMISSION_DENIED";
2529
+ }, s = () => o() ? t.camera_error_title : n() ? n().name : "", l = () => o() ? t.camera_error_details : n() ? n().name : "";
2530
+ return c(Fr, {
2531
+ get mountTarget() {
2432
2532
  return i();
2433
2533
  },
2434
- get children() {
2435
- return l(Nr, {
2436
- get mountTarget() {
2437
- return o();
2438
- },
2439
- get header() {
2440
- return c();
2534
+ get open() {
2535
+ return o();
2536
+ },
2537
+ get actions() {
2538
+ return {
2539
+ primary: {
2540
+ label: t.camera_error_primary_btn,
2541
+ onclick: () => void r.startCameraStream()
2441
2542
  },
2442
- get text() {
2543
+ secondary: {
2544
+ label: t.camera_error_cancel_btn,
2545
+ onclick: () => a()
2546
+ }
2547
+ };
2548
+ },
2549
+ get children() {
2550
+ return [c(be.Title, {
2551
+ class: "dialog-title",
2552
+ get children() {
2443
2553
  return s();
2444
- },
2445
- open: !0,
2446
- onPrimaryClick: () => void t.startCameraStream(),
2447
- onSecondaryClick: () => a(),
2448
- get primaryButtonText() {
2449
- return r.camera_error_primary_btn;
2450
- },
2451
- get secondaryButtonText() {
2452
- return r.camera_error_cancel_btn;
2453
2554
  }
2454
- });
2555
+ }), c(be.Description, {
2556
+ class: "dialog-description",
2557
+ get children() {
2558
+ var d = Lr();
2559
+ return y(d, l), d;
2560
+ }
2561
+ })];
2455
2562
  }
2456
2563
  });
2457
- };
2458
- function Or(r, e) {
2459
- let t;
2460
- return function(...a) {
2461
- const n = this;
2462
- clearTimeout(t), t = setTimeout(() => {
2463
- t = void 0, r.apply(n, a);
2464
- }, e);
2564
+ }, zr = { trailing: !0 };
2565
+ function Pr(t, e = 25, r = {}) {
2566
+ if (r = {
2567
+ ...zr,
2568
+ ...r
2569
+ }, !Number.isFinite(e)) throw new TypeError("Expected `wait` to be a finite number");
2570
+ let a, n, i = [], o, s;
2571
+ const l = (b, p) => (o = $r(t, b, p), o.finally(() => {
2572
+ if (o = null, r.trailing && s && !n) {
2573
+ const h = l(b, s);
2574
+ return s = null, h;
2575
+ }
2576
+ }), o), d = function(...b) {
2577
+ return r.trailing && (s = b), o || new Promise((p) => {
2578
+ const h = !n && r.leading;
2579
+ clearTimeout(n), n = setTimeout(() => {
2580
+ n = null;
2581
+ const m = r.leading ? a : l(this, b);
2582
+ s = null;
2583
+ for (const g of i) g(m);
2584
+ i = [];
2585
+ }, e), h ? (a = l(this, b), p(a)) : i.push(p);
2586
+ });
2587
+ }, u = (b) => {
2588
+ b && (clearTimeout(b), n = null);
2465
2589
  };
2590
+ return d.isPending = () => !!n, d.cancel = () => {
2591
+ u(n), i = [], s = null;
2592
+ }, d.flush = () => {
2593
+ if (u(n), !s || o) return;
2594
+ const b = s;
2595
+ return s = null, l(this, b);
2596
+ }, d;
2466
2597
  }
2467
- const Br = (r, e, t, a) => {
2468
- const n = Math.max(r / t, e / a);
2469
- let o = 0;
2470
- if (r / t > e / a) {
2471
- const i = n * a;
2472
- o = 1 - e / i;
2598
+ async function $r(t, e, r) {
2599
+ return await t.apply(e, r);
2600
+ }
2601
+ const Or = (t, e, r, a) => {
2602
+ const n = Math.max(t / r, e / a);
2603
+ let i = 0;
2604
+ if (t / r > e / a) {
2605
+ const o = n * a;
2606
+ i = 1 - e / o;
2473
2607
  } else {
2474
- const i = n * t;
2475
- o = 1 - r / i;
2608
+ const o = n * r;
2609
+ i = 1 - t / o;
2476
2610
  }
2477
- return o < 0.1 ? "cover" : "contain";
2611
+ return i < 0.1 ? "cover" : "contain";
2478
2612
  };
2479
- function Vr(r, e, t, a) {
2480
- const n = r / t, o = e / a, i = Math.max(n, o);
2481
- if (n >= o) {
2482
- const c = Math.round(e / i);
2483
- return { x: 0, y: Math.round((a - c) / 2), width: t, height: c };
2613
+ function Vr(t, e, r, a) {
2614
+ const n = t / r, i = e / a, o = Math.max(n, i);
2615
+ if (n >= i) {
2616
+ const s = Math.round(e / o);
2617
+ return { x: 0, y: Math.round((a - s) / 2), width: r, height: s };
2484
2618
  } else {
2485
- const c = Math.round(r / i);
2486
- return { x: Math.round((t - c) / 2), y: 0, width: c, height: a };
2619
+ const s = Math.round(t / o);
2620
+ return { x: Math.round((r - s) / 2), y: 0, width: s, height: a };
2487
2621
  }
2488
2622
  }
2489
- var oe = /* @__PURE__ */ y("<style>"), Ur = /* @__PURE__ */ y("<style id=camera-manager-style>"), qr = /* @__PURE__ */ y('<div class="bg-dark-500 color-white size-full relative min-h-[300px]"part=capture-screen-part><video part=video-element-part class="block absolute top-0 left-0 size-full"></video><div class="absolute top-0 left-0 w-full h-full z-1"id=feedback-layer></div><div class="absolute top-0 left-0 w-full h-full has-[[data-scope]]:z-2"id=overlay-layer>');
2490
- const Ve = "capture-screen-host", Ue = () => {
2623
+ var ne = /* @__PURE__ */ w("<style>"), Br = /* @__PURE__ */ w("<style id=camera-manager-style>"), Ur = /* @__PURE__ */ w('<div class="bg-dark-500 color-white size-full relative min-h-[300px]"part=capture-screen-part><video part=video-element-part class="block absolute top-0 left-0 size-full"aria-hidden=true tabindex=-1></video><div class="absolute top-0 left-0 w-full h-full z-1"id=feedback-layer></div><div class="absolute top-0 left-0 w-full h-full has-[[data-scope]]:z-2"id=overlay-layer>');
2624
+ const Ge = "capture-screen-host", Xe = () => {
2491
2625
  const {
2492
- cameraManager: r,
2626
+ cameraManager: t,
2493
2627
  mountTarget: e,
2494
- showCameraErrorModal: t
2495
- } = j(), [a, n] = N(), [o, i] = N(), [c, s] = N(), h = () => e.parentNode === document.body, [f, p] = N("contain");
2496
- function S() {
2497
- const g = a();
2498
- if (!g)
2628
+ showCameraErrorModal: r
2629
+ } = q(), [a, n] = I(), [i, o] = I(), [s, l] = I(), d = () => e.parentNode === document.body, [u, b] = I("contain");
2630
+ function p() {
2631
+ const h = a();
2632
+ if (!h)
2499
2633
  return;
2500
- const d = g.clientWidth, m = g.clientHeight, C = g.videoWidth, v = g.videoHeight;
2501
- if (C === 0 || v === 0)
2634
+ const m = h.clientWidth, g = h.clientHeight, S = h.videoWidth, T = h.videoHeight;
2635
+ if (S === 0 || T === 0)
2502
2636
  return;
2503
- const b = Br(d, m, C, v);
2504
- if (p(b), b === "cover") {
2505
- const E = Vr(d, m, C, v);
2506
- r.setExtractionArea(E);
2637
+ const v = Or(m, g, S, T);
2638
+ if (b(v), v === "cover") {
2639
+ const C = Vr(m, g, S, T);
2640
+ t.setExtractionArea(C);
2507
2641
  } else
2508
- r.setExtractionArea({
2642
+ t.setExtractionArea({
2509
2643
  x: 0,
2510
2644
  y: 0,
2511
- width: C,
2512
- height: v
2645
+ width: S,
2646
+ height: T
2513
2647
  });
2514
2648
  }
2515
- return Z(() => {
2516
- const g = a();
2517
- if (!g)
2649
+ return K(() => {
2650
+ const h = a();
2651
+ if (!h)
2518
2652
  return;
2519
- const d = Or(S, 100), {
2520
- observe: m,
2521
- unobserve: C
2522
- } = fr(d);
2523
- m(g), g.addEventListener("resize", S), g.addEventListener("loadedmetadata", S), he(() => {
2524
- C(g), g.removeEventListener("resize", S), g.removeEventListener("loadedmetadata", S);
2653
+ const m = Pr(p, 100), {
2654
+ observe: g,
2655
+ unobserve: S
2656
+ } = We(() => void m());
2657
+ g(h), h.addEventListener("resize", p), h.addEventListener("loadedmetadata", p), J(() => {
2658
+ m.cancel(), S(h), h.removeEventListener("resize", p), h.removeEventListener("loadedmetadata", p);
2525
2659
  });
2526
- }), Z(() => {
2527
- const g = ke();
2528
- g && ce.setState({
2529
- owner: g
2660
+ }), K(() => {
2661
+ const h = Re();
2662
+ h && ce.setState({
2663
+ owner: h
2530
2664
  });
2531
- }), Je(() => {
2532
- const g = a(), d = o(), m = c();
2533
- !g || !d || !m || (ce.setState({
2534
- feedbackLayer: d,
2535
- overlayLayer: m
2536
- }), r.initVideoElement(g));
2537
- }), l(ur, {
2665
+ }), _e(() => {
2666
+ const h = a(), m = i(), g = s();
2667
+ !h || !m || !g || (ce.setState({
2668
+ feedbackLayer: m,
2669
+ overlayLayer: g
2670
+ }), t.initVideoElement(h));
2671
+ }), c(gr, {
2538
2672
  get id() {
2539
- return h() ? void 0 : Ve;
2673
+ return d() ? void 0 : Ge;
2540
2674
  },
2541
2675
  get disableShadowRoot() {
2542
- return h();
2676
+ return d();
2543
2677
  },
2544
2678
  get style() {
2545
- return h() ? {
2679
+ return d() ? {
2546
2680
  height: "100%"
2547
2681
  } : void 0;
2548
2682
  },
2549
2683
  get children() {
2550
2684
  return [(() => {
2551
- var g = oe();
2552
- return w(g, mr), g;
2685
+ var h = ne();
2686
+ return y(h, vr), h;
2553
2687
  })(), (() => {
2554
- var g = oe();
2555
- return w(g, dr), g;
2688
+ var h = ne();
2689
+ return y(h, br), h;
2556
2690
  })(), (() => {
2557
- var g = oe();
2558
- return w(g, hr), g;
2691
+ var h = ne();
2692
+ return y(h, pr), h;
2559
2693
  })(), (() => {
2560
- var g = Ur();
2561
- return V((d) => {
2562
- window.__mbCameraManagerCssCode && (d.innerHTML = window.__mbCameraManagerCssCode);
2563
- }, g), g;
2694
+ var h = Br();
2695
+ return V((m) => {
2696
+ window.__mbCameraManagerCssCode && (m.innerHTML = window.__mbCameraManagerCssCode);
2697
+ }, h), h;
2564
2698
  })(), (() => {
2565
- var g = qr(), d = g.firstChild, m = d.nextSibling, C = m.nextSibling;
2566
- return w(g, l(sr, {}), d), V(n, d), V(i, m), V(s, C), w(g, l(k, {
2567
- when: t,
2699
+ var h = Ur(), m = h.firstChild, g = m.nextSibling, S = g.nextSibling;
2700
+ return y(h, c(hr, {}), m), V(n, m), V(o, g), V(l, S), y(h, c(x, {
2701
+ when: r,
2568
2702
  get children() {
2569
- return l(Pr, {});
2703
+ return c(Nr, {});
2570
2704
  }
2571
- }), null), K((v) => (v = f()) != null ? d.style.setProperty("object-fit", v) : d.style.removeProperty("object-fit")), g;
2705
+ }), null), Te((T) => (T = u()) != null ? m.style.setProperty("object-fit", T) : m.style.removeProperty("object-fit")), h;
2572
2706
  })()];
2573
2707
  }
2574
2708
  });
2575
- }, jr = () => {
2709
+ }, qr = () => {
2576
2710
  const {
2577
- t: r
2578
- } = ee(), [e, t] = N(!0), {
2579
- addOnDismountCallback: a
2580
- } = j();
2711
+ t
2712
+ } = Z(), [e, r] = I(!0), {
2713
+ addOnDismountCallback: a,
2714
+ zIndex: n
2715
+ } = q();
2581
2716
  return a(() => {
2582
- t(!1);
2583
- }), l(ye, {
2717
+ r(!1);
2718
+ }), c(ke, {
2584
2719
  useShadow: !0,
2585
2720
  get mount() {
2586
- return document.getElementById(qe);
2721
+ return document.getElementById(Qe);
2587
2722
  },
2588
- ref: (n) => (n.id = Ve, n.style.zIndex = "1000", n.style.position = "fixed", n.id = "mb-camera-host", n),
2723
+ ref: (i) => (i.id = Ge, i.style.zIndex = n !== void 0 ? String(n) : "calc(infinity)", i.style.position = "fixed", i.id = "mb-camera-host", i),
2589
2724
  get children() {
2590
- return l(te, {
2591
- children: (n) => l($.Root, {
2725
+ return c(ee, {
2726
+ children: () => c(D.Root, {
2592
2727
  get open() {
2593
2728
  return e();
2594
2729
  },
2595
- lazyMount: !0,
2596
- unmountOnExit: !0,
2597
- initialFocusEl: () => n.querySelector('[role="dialog"]'),
2598
2730
  get children() {
2599
- return l($.Positioner, {
2731
+ return c(D.Positioner, {
2600
2732
  get children() {
2601
- return l($.Content, {
2602
- "aria-labelledby": "dialog-title",
2603
- class: `h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full
2604
- fixed`,
2733
+ return c(D.Content, {
2734
+ class: "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed",
2605
2735
  get children() {
2606
- return [l($.Title, {
2736
+ return [c(D.Title, {
2607
2737
  class: "sr-only",
2608
- id: "dialog-title",
2609
2738
  get children() {
2610
- return r.scan_document;
2739
+ return t.dialog_title;
2611
2740
  }
2612
- }), l(Ue, {})];
2741
+ }), c(Xe, {})];
2613
2742
  }
2614
2743
  });
2615
2744
  }
@@ -2619,71 +2748,73 @@ const Ve = "capture-screen-host", Ue = () => {
2619
2748
  });
2620
2749
  }
2621
2750
  });
2622
- }, Hr = () => {
2751
+ }, jr = () => {
2623
2752
  const {
2624
- mountTarget: r
2625
- } = j();
2626
- return l(Ge, {
2753
+ mountTarget: t
2754
+ } = q();
2755
+ return c(Ye, {
2627
2756
  get component() {
2628
- return r.parentNode === document.body ? jr : Ue;
2757
+ return t.parentNode === document.body ? qr : Xe;
2629
2758
  }
2630
2759
  });
2631
- }, qe = "camera-manager-mount-point";
2632
- function na(r, e, {
2633
- localizationStrings: t,
2760
+ }, Qe = "camera-manager-mount-point";
2761
+ function na(t, e, {
2762
+ localizationStrings: r,
2634
2763
  showMirrorCameraButton: a = !1,
2635
2764
  showTorchButton: n = !0,
2636
- showCloseButton: o = !0,
2637
- showCameraErrorModal: i = !0
2765
+ showCloseButton: i = !0,
2766
+ showCameraErrorModal: o = !0,
2767
+ zIndex: s
2638
2768
  } = {}) {
2639
- let c;
2640
- const s = /* @__PURE__ */ new Set();
2641
- let h;
2642
- const f = (v) => {
2643
- h = v;
2769
+ let l;
2770
+ const d = /* @__PURE__ */ new Set();
2771
+ let u;
2772
+ const b = (v) => {
2773
+ u = v;
2644
2774
  }, p = () => {
2645
- r.reset();
2775
+ t.reset();
2646
2776
  };
2647
- let S;
2648
- const g = () => {
2777
+ let h;
2778
+ const m = () => {
2649
2779
  try {
2650
2780
  console.debug("🧱 Dismounting camera manager UI");
2651
- for (const v of s)
2781
+ for (const v of d)
2652
2782
  v();
2653
- s.clear(), p(), requestAnimationFrame(() => {
2783
+ d.clear(), p(), requestAnimationFrame(() => {
2654
2784
  requestAnimationFrame(() => {
2655
- S && S(), c.remove(), p();
2785
+ h && h(), l.remove(), p();
2656
2786
  });
2657
2787
  });
2658
2788
  } catch (v) {
2659
2789
  console.warn("Error while dismounting camera manager UI", v);
2660
2790
  }
2661
- }, d = document.createElement("div");
2662
- d.id = qe, c = d, e ? e.appendChild(d) : document.body.appendChild(d);
2663
- const m = (v) => (s.add(v), () => {
2664
- s.delete(v);
2791
+ }, g = document.createElement("div");
2792
+ g.id = Qe, l = g, e ? e.appendChild(g) : document.body.appendChild(g);
2793
+ const S = (v) => (d.add(v), () => {
2794
+ d.delete(v);
2665
2795
  });
2666
- S = Xe(() => l(Bt, {
2667
- userStrings: t,
2668
- setLocalizationRef: f,
2796
+ h = Je(() => c(Ht, {
2797
+ userStrings: r,
2798
+ setLocalizationRef: b,
2669
2799
  get children() {
2670
- return l(Pt, {
2671
- addOnDismountCallback: m,
2672
- dismountCameraUi: g,
2673
- cameraManager: r,
2800
+ return c(qt, {
2801
+ addOnDismountCallback: S,
2802
+ dismountCameraUi: m,
2803
+ cameraManager: t,
2674
2804
  showMirrorCameraButton: a,
2675
2805
  showTorchButton: n,
2676
- showCloseButton: o,
2677
- showCameraErrorModal: i,
2678
- mountTarget: c,
2806
+ showCloseButton: i,
2807
+ showCameraErrorModal: o,
2808
+ zIndex: s,
2809
+ mountTarget: l,
2679
2810
  get children() {
2680
- return l(Hr, {});
2811
+ return c(jr, {});
2681
2812
  }
2682
2813
  });
2683
2814
  }
2684
- }), c);
2685
- const C = {
2686
- updateLocalization: h,
2815
+ }), l);
2816
+ const T = {
2817
+ updateLocalization: u,
2687
2818
  /**
2688
2819
  * Adds a callback to be called when the component is unmounted.
2689
2820
  * Returns a cleanup function that removes the callback when called.
@@ -2691,65 +2822,65 @@ function na(r, e, {
2691
2822
  * @param fn - The callback function to be called when the component is unmounted
2692
2823
  * @returns A cleanup function that removes the callback when called
2693
2824
  */
2694
- addOnDismountCallback: m,
2695
- cameraManager: r,
2825
+ addOnDismountCallback: S,
2826
+ cameraManager: t,
2696
2827
  // we know these are defined because `createCameraManagerUi` resolves when they are defined
2697
2828
  // TODO: maybe don't use getters but make sure they are defined
2698
2829
  get feedbackLayerNode() {
2699
- return B.getState().feedbackLayer;
2830
+ return O.getState().feedbackLayer;
2700
2831
  },
2701
2832
  get overlayLayerNode() {
2702
- return B.getState().overlayLayer;
2833
+ return O.getState().overlayLayer;
2703
2834
  },
2704
2835
  get owner() {
2705
- return B.getState().owner;
2836
+ return O.getState().owner;
2706
2837
  },
2707
- dismount: g
2838
+ dismount: m
2708
2839
  };
2709
2840
  return new Promise((v) => {
2710
- let b = !1, E = !1, x = !1, F = () => {
2841
+ let C = !1, M = !1, L = !1, W = () => {
2711
2842
  }, G = () => {
2712
- }, X = () => {
2843
+ }, me = () => {
2713
2844
  };
2714
- const re = () => {
2715
- b && E && x && (F(), G(), X(), v(C));
2845
+ const te = () => {
2846
+ C && M && L && (W(), G(), me(), v(T));
2716
2847
  };
2717
- F = B.subscribe((R) => R.feedbackLayer, (R) => {
2718
- R && (E = !0), re();
2848
+ W = O.subscribe((R) => R.feedbackLayer, (R) => {
2849
+ R && (M = !0), te();
2719
2850
  }, {
2720
2851
  fireImmediately: !0
2721
- }), G = B.subscribe((R) => R.overlayLayer, (R) => {
2722
- R && (x = !0), re();
2852
+ }), G = O.subscribe((R) => R.overlayLayer, (R) => {
2853
+ R && (L = !0), te();
2723
2854
  }, {
2724
2855
  fireImmediately: !0
2725
- }), X = r.subscribe((R) => R.videoElement, (R) => {
2726
- R && (b = !0, re());
2856
+ }), me = t.subscribe((R) => R.videoElement, (R) => {
2857
+ R && (C = !0, te());
2727
2858
  }, {
2728
2859
  fireImmediately: !0
2729
2860
  });
2730
2861
  });
2731
2862
  }
2732
- const je = Symbol();
2733
- globalThis.__CAMERA_MANAGER__ ||= je;
2734
- globalThis.__CAMERA_MANAGER__ !== je && console.warn(
2863
+ const Ke = Symbol();
2864
+ globalThis.__CAMERA_MANAGER__ ||= Ke;
2865
+ globalThis.__CAMERA_MANAGER__ !== Ke && console.warn(
2735
2866
  "Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
2736
2867
  );
2737
2868
  export {
2738
- Ie as Camera,
2739
- U as CameraError,
2869
+ $e as Camera,
2870
+ B as CameraError,
2740
2871
  aa as CameraManager,
2741
- qe as MOUNT_POINT_ID,
2742
- Lt as VideoFrameProcessor,
2743
- u as cameraManagerStore,
2744
- B as cameraUiRefStore,
2872
+ Qe as MOUNT_POINT_ID,
2873
+ Vt as VideoFrameProcessor,
2874
+ f as cameraManagerStore,
2875
+ O as cameraUiRefStore,
2745
2876
  na as createCameraManagerUi,
2746
- zt as defaultCameraManagerOptions,
2747
- Ct as findResolutionKey,
2748
- Ne as getBuffer,
2749
- St as getNormalizedResolution,
2877
+ Bt as defaultCameraManagerOptions,
2878
+ Mt as findResolutionKey,
2879
+ Ue as getBuffer,
2880
+ Tt as getNormalizedResolution,
2750
2881
  le as isBufferDetached,
2751
- yt as matchClosestResolution,
2752
- Et as resetCameraManagerStore,
2753
- wt as returnLongerSide,
2882
+ xt as matchClosestResolution,
2883
+ Rt as resetCameraManagerStore,
2884
+ kt as returnLongerSide,
2754
2885
  P as videoResolutions
2755
2886
  };