Files
doneit-web/_platforms/browser/www/8206-es5.e2a4bb4d52a5a9a90742.js
T

1 line
22 KiB
JavaScript
Raw Normal View History

2021-08-18 18:58:02 +01:00
!function(){function e(e,t,i,n,a,r,o){try{var s=e[r](o),c=s.value}catch(h){return void i(h)}s.done?t(c):Promise.resolve(c).then(n,a)}function t(t){return function(){var i=this,n=arguments;return new Promise(function(a,r){var o=t.apply(i,n);function s(t){e(o,a,r,s,c,"next",t)}function c(t){e(o,a,r,s,c,"throw",t)}s(void 0)})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}(self.webpackChunkgabinete_digital=self.webpackChunkgabinete_digital||[]).push([[8206],{58206:function(e,n,r){"use strict";r.r(n),r.d(n,{pwa_camera:function(){return c}});var o=r(75485),s=window.ImageCapture;void 0===s&&(s=function(){function e(t){var n=this;if(i(this,e),"video"!==t.kind)throw new DOMException("NotSupportedError");this._videoStreamTrack=t,"readyState"in this._videoStreamTrack||(this._videoStreamTrack.readyState="live"),this._previewStream=new MediaStream([t]),this.videoElement=document.createElement("video"),this.videoElementPlaying=new Promise(function(e){n.videoElement.addEventListener("playing",e)}),HTMLMediaElement?this.videoElement.srcObject=this._previewStream:this.videoElement.src=URL.createObjectURL(this._previewStream),this.videoElement.muted=!0,this.videoElement.setAttribute("playsinline",""),this.videoElement.play(),this.canvasElement=document.createElement("canvas"),this.canvas2dContext=this.canvasElement.getContext("2d")}return a(e,[{key:"videoStreamTrack",get:function(){return this._videoStreamTrack}},{key:"getPhotoCapabilities",value:function(){return new Promise(function(e,t){var i={current:0,min:0,max:0};e({exposureCompensation:i,exposureMode:"none",fillLightMode:["none"],focusMode:"none",imageHeight:i,imageWidth:i,iso:i,redEyeReduction:!1,whiteBalanceMode:"none",zoom:i}),t(new DOMException("OperationError"))})}},{key:"setOptions",value:function(){return new Promise(function(e,t){})}},{key:"takePhoto",value:function(){var e=this;return new Promise(function(t,i){if("live"!==e._videoStreamTrack.readyState)return i(new DOMException("InvalidStateError"));e.videoElementPlaying.then(function(){try{e.canvasElement.width=e.videoElement.videoWidth,e.canvasElement.height=e.videoElement.videoHeight,e.canvas2dContext.drawImage(e.videoElement,0,0),e.canvasElement.toBlob(t)}catch(n){i(new DOMException("UnknownError"))}})})}},{key:"grabFrame",value:function(){var e=this;return new Promise(function(t,i){if("live"!==e._videoStreamTrack.readyState)return i(new DOMException("InvalidStateError"));e.videoElementPlaying.then(function(){try{e.canvasElement.width=e.videoElement.videoWidth,e.canvasElement.height=e.videoElement.videoHeight,e.canvas2dContext.drawImage(e.videoElement,0,0),t(window.createImageBitmap(e.canvasElement))}catch(n){i(new DOMException("UnknownError"))}})})}}]),e}()),window.ImageCapture=s;var c=function(){function e(n){var a=this;i(this,e),(0,o.r)(this,n),this.facingMode="user",this.noDevicesText="No camera found",this.noDevicesButtonText="Choose image",this.showShutterOverlay=!1,this.flashIndex=0,this.hasCamera=null,this.rotation=0,this.deviceError=null,this.hasMultipleCameras=!1,this.hasFlash=!1,this.flashModes=[],this.flashMode="off",this.handlePickFile=function(e){},this.handleShutterClick=function(e){console.log(),a.capture()},this.handleRotateClick=function(e){a.rotate()},this.handleClose=function(e){a.handlePhoto&&a.handlePhoto(null)},this.handleFlashClick=function(e){a.cycleFlash()},this.handleCancelPhoto=function(e){var t=a.stream&&a.stream.getTracks()[0],i=t&&t.getConstraints();a.photo=null,i?a.initCamera({video:{facingMode:i.facingMode}}):a.initCamera()},this.handleAcceptPhoto=function(e){a.handlePhoto&&a.handlePhoto(a.photo)},this.handleFileInputChange=function(){var e=t(regeneratorRuntime.mark(function e(t){var i,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.target.files[0],e.prev=1,e.next=4,a.getOrie