@microblink/camera-manager 7.2.4 → 7.2.6

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