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