text: (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{310:function(e,t,r){"use strict";r.d(t,"c",(function(){return F})),r.d(t,"a",(function(){return T})),r.d(t,"b",(function(){return W}));r(176),r(69),r(9);var n,a,i,o=r(371),c=(r(97),r(42)),s=(r(188),r(179),r(178),r(34)),u=r(95),d=(r(68),r(28)),l=r(168),f=r(171),h=r(409),m=function(e){Object(l.a)(r,e);var t=Object(f.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this,"can't process cross-origin image")).name="DropImageFetchError",e}return r}(Object(h.a)(Error)),p=function(e){Object(l.a)(r,e);var t=Object(f.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this,"this browser has no Stream API support")).name="StreamApiNotSupportedError",e}return r}(Object(h.a)(Error)),v=function(e){Object(l.a)(r,e);var t=Object(f.a)(r);function r(){var e;return Object(d.a)(this,r),(e=t.call(this,"camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.")).name="InsecureContextError",e}return r}(Object(h.a)(Error)),b=r(357),g=function(e){if(e.length>0){var t=Object(u.a)(e,1)[0],r=Object(u.a)(t.cornerPoints,4),n=r[0],a=r[1],i=r[2],o=r[3];return{content:t.rawValue,location:{topLeftCorner:n,topRightCorner:a,bottomRightCorner:i,bottomLeftCorner:o,topLeftFinderPattern:{},topRightFinderPattern:{},bottomLeftFinderPattern:{}},imageData:null}}return{content:null,location:null,imageData:null}},w=function(){var e=Object(c.a)(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.startsWith("http")||!1!==t.includes(location.host)){e.next=2;break}throw new m;case 2:return(r=document.createElement("img")).src=t,e.next=6,Object(b.a)(r,"load");case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),x=function(){var e=Object(c.a)(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new BarcodeDetector({formats:["qr_code"]}),e.next=3,r.detect(t);case 3:return n=e.sent,e.abrupt("return",g(n));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=Object(c.a)(regeneratorRuntime.mark((function e(t){var r,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new BarcodeDetector({formats:["qr_code"]}),e.next=3,w(t);case 3:return n=e.sent,e.next=6,r.detect(n);case 6:return a=e.sent,e.abrupt("return",g(a));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=(r(24),r(98),r(25),r(99),r(30),r(397),r(64)),y=r(401),k=r(402),R=r(403),D=r(404),C=r(325),S=(n=function(){switch(Object(C.c)(window).browser){case"chrome":Object(y.a)(window);break;case"firefox":Object(R.a)(window);break;case"edge":Object(k.a)(window);break;case"safari":Object(D.a)(window);break;default:throw new p}},a=!1,i=void 0,function(){return a||(i=n.apply(void 0,arguments),a=!0),i}),I=function(){function e(t,r){Object(d.a)(this,e),this.videoEl=t,this.stream=r}return Object(j.a)(e,[{key:"stop",value:function(){var e=this;this.videoEl.srcObject=null,this.stream.getTracks().forEach((function(t){e.stream.removeTrack(t),t.stop()}))}},{key:"getCapabilities",value:function(){var e,t,r=this.stream.getVideoTracks(),n=Object(u.a)(r,1)[0];return null!==(e=null==n||null===(t=n.getCapabilities)||void 0===t?void 0:t.call(n))&&void 0!==e?e:{}}}]),e}(),q=function(){var e=Object(c.a)(regeneratorRuntime.mark((function e(t){var r,n,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=["OBS Virtual Camera","OBS-Camera"],e.next=3,navigator.mediaDevices.enumerateDevices();case 3:if(!((n=e.sent.filter((function(e){return"videoinput"===e.kind})).filter((function(e){var t=e.label;return!r.includes(t)})).filter((function(e){return!e.label.includes("infrared")}))).length>2)){e.next=16;break}a=n[0],i=n[n.length-1],e.t0=t,e.next="auto"===e.t0?10:"rear"===e.t0?11:"front"===e.t0?12:13;break;case 10:case 11:return e.abrupt("return",{deviceId:{exact:i.deviceId}});case 12:return e.abrupt("return",{deviceId:{exact:a.deviceId}});case 13:return e.abrupt("return",void 0);case 14:e.next=23;break;case 16:e.t1=t,e.next="auto"===e.t1?19:"rear"===e.t1?20:"front"===e.t1?21:22;break;case 19:return e.abrupt("return",{facingMode:{ideal:"environment"}});case 20:return e.abrupt("return",{facingMode:{exact:"environment"}});case 21:return e.abrupt("return",{facingMode:{exact:"user"}});case 22:return e.abrupt("return",void 0);case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),L=function(e,t){return B.apply(this,arguments)};function B(){return(B=Object(c.a)(regeneratorRuntime.mark((function e(t,r){var n,a,i,c,s,d,l,f,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.camera,c=r.torch,!0===window.isSecureContext){e.next=3;break}throw new v;case 3:if(void 0!==(null===(n=navigator)||void 0===n||null===(a=n.mediaDevices)||void 0===a?void 0:a.getUserMedia)){e.next=5;break}throw new p;case 5:return e.next=7,S();case 7:return e.t0=o.a,e.t1={width:{min:360,ideal:640,max:1920},height:{min:240,ideal:480,max:1080}},e.next=11,q(i);case 11:return e.t2=e.sent,e.t3=(0,e.t0)(e.t1,e.t2),s={audio:!1,video:e.t3},e.next=16,navigator.mediaDevices.getUserMedia(s);case 16:return d=e.sent,void 0!==t.srcObject?t.srcObject=d:void 0!==t.mozSrcObject?t.mozSrcObject=d:window.URL.createObjectURL?t.src=window.URL.createObjectURL(d):window.webkitURL?t.src=window.webkitURL.createObjectURL(d):t.src=d,e.next=20,Object(b.a)(t,"loadeddata");case 20:return e.next=22,Object(b.b)(500);case 22:return c&&(l=d.getVideoTracks(),f=Object(u.a)(l,1),h=f[0],h.getCapabilities().torch?h.applyConstraints({advanced:[{torch:!0}]}):console.warn("device does not support torch capability")),e.abrupt("return",new I(t,d));case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var E=r(405),P={beforeMount:function(){window.BarcodeDetector=E.a},methods:{onDetect:function(e){var t=this;return Object(c.a)(regeneratorRuntime.mark((function r(){var n,a;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t.$emit("detect",e),r.prev=1,r.next=4,e;case 4:n=r.sent,null!==(a=n.content)&&t.$emit("decode",a),r.next=11;break;case 9:r.prev=9,r.t0=r.catch(1);case 11:case"end":return r.stop()}}),r,null,[[1,9]])})))()}}},$=r(41),H=Object($.a)(P,void 0,void 0,!1,null,null,null).exports,_={name:"qrcode-stream",mixins:[H],props:{camera:{type:String,default:"auto",validator:function(e){return["auto","rear","front","off"].includes(e)}},torch:{type:Boolean,default:!1},track:{type:Function},inverted:{type:Boolean,default:!1}},data:function(){return{cameraInstance:null,destroyed:!1}},computed:{shouldStream:function(){return!1===this.destroyed&&"off"!==this.camera},shouldScan:function(){return!0===this.shouldStream&&null!==this.cameraInstance},scanInterval:function(){return void 0===this.track?500:40}},watch:{shouldStream:function(e){if(!e){var t=this.$refs.pauseFrame,r=t.getContext("2d"),n=this.$refs.video;t.width=n.videoWidth,t.height=n.videoHeight,r.drawImage(n,0,0,n.videoWidth,n.videoHeight)}},shouldScan:function(e){e&&(this.clearCanvas(this.$refs.pauseFrame),this.clearCanvas(this.$refs.trackingLayer),this.startScanning())},torch:function(){this.init()},camera:function(){this.init()}},mounted:function(){this.init()},beforeDestroy:function(){this.beforeResetCamera(),this.destroyed=!0},methods:{init:function(){var e=this,t=Object(c.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.beforeResetCamera(),"off"!==e.camera){t.next=6;break}return e.cameraInstance=null,t.abrupt("return",{capabilities:{}});case 6:return t.next=8,L(e.$refs.video,{camera:e.camera,torch:e.torch});case 8:return e.cameraInstance=t.sent,r=e.cameraInstance.getCapabilities(),e.destroyed&&e.cameraInstance.stop(),t.abrupt("return",{capabilities:r});case 12:case"end":return t.stop()}}),t)})))();this.$emit("init",t)},startScanning:function(){var e=this;!function(e,t){var r=new BarcodeDetector({formats:["qr_code"]}),n=document.createElement("canvas"),a=n.getContext("2d"),i=t.detectHandler,o=t.locateHandler,u=t.minDelay,d=t.inverted,l=function(){var e=Object(c.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.width===t.videoWidth&&n.height===t.videoHeight||(n.width=t.videoWidth,n.height=t.videoHeight),a.save(),a.drawImage(t,0,0,n.width,n.height),a.globalCompositeOperation="difference",a.fillStyle="white",a.fillRect(0,0,n.width,n.height),a.restore(),e.next=9,r.detect(a.getImageData(0,0,n.width,n.height));case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();!function t(n){return function(){var a=Object(c.a)(regeneratorRuntime.mark((function a(c){var f,h,m,p,v,b,w,x;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(e.readyState>1)){a.next=27;break}if(f=n.lastScanned,h=n.contentBefore,m=n.locationBefore,!(c-f>=u)){a.next=26;break}return a.t0=[],a.t1=s.a,a.next=7,r.detect(e);case 7:if(a.t2=a.sent,a.t3=(0,a.t1)(a.t2),a.t4=s.a,!d){a.next=16;break}return a.next=13,l(e);case 13:a.t5=a.sent,a.next=17;break;case 16:a.t5=[];case 17:a.t6=a.t5,a.t7=(0,a.t4)(a.t6),p=a.t0.concat.call(a.t0,a.t3,a.t7),v=g(p),b=v.content,w=v.location,x=v.imageData,null!==b&&b!==h&&i({content:b,location:w,imageData:x}),null===w&&null===m||o(p),window.requestAnimationFrame(t({lastScanned:c,contentBefore:null!=b?b:h,locationBefore:w})),a.next=27;break;case 26:window.requestAnimationFrame(t(n));case 27:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}({contentBefore:null,locationBefore:null,lastScanned:performance.now()})()}(this.$refs.video,{detectHandler:function(t){e.onDetect(Promise.resolve(t))},locateHandler:this.onLocate,minDelay:this.scanInterval,inverted:this.inverted})},beforeResetCamera:function(){null!==this.cameraInstance&&(this.cameraInstance.stop(),this.cameraInstance=null)},onLocate:function(e){var t=this.$refs.trackingLayer,r=this.$refs.video;if(void 0!==t)if(e.length>0&&void 0!==this.track&&void 0!==r){var n=r.offsetWidth,a=r.offsetHeight,i=r.videoWidth,c=r.videoHeight,s=Math.max(n/i,a/c),u=i*s,d=c*s,l=u/i,f=d/c,h=(n-u)/2,m=(a-d)/2,p=function(e){var t=e.x,r=e.y;return{x:Math.floor(t*l),y:Math.floor(r*f)}},v=function(e){var t=e.x,r=e.y;return{x:Math.floor(t+h),y:Math.floor(r+m)}},b=e.map((function(e){var t=e.boundingBox,r=e.cornerPoints,n=v(p({x:t.x,y:t.y})),a=n.x,i=n.y,c=p({x:t.width,y:t.height}),s=c.x,u=c.y;return Object(o.a)(Object(o.a)({},e),{},{cornerPoints:r.map((function(e){return v(p(e))})),boundingBox:DOMRectReadOnly.fromRect({x:a,y:i,width:s,height:u})})}));t.width=r.offsetWidth,t.height=r.offsetHeight;var g=t.getContext("2d");this.track(b,g)}else this.clearCanvas(t)},repaintTrackingLayer:function(e,t,r){var n=this,a=t.getContext("2d");window.requestAnimationFrame((function(){t.width=displayWidth,t.height=displayHeight,n.trackRepaintFunction(coordinatesAdjusted,a)}))},clearCanvas:function(e){e.getContext("2d").clearRect(0,0,e.width,e.height)}}},F=(r(406),Object($.a)(_,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"qrcode-stream-wrapper"},[t("video",{ref:"video",staticClass:"qrcode-stream-camera",class:{"qrcode-stream-camera--hidden":!this.shouldScan},attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0}}),this._v(" "),t("canvas",{directives:[{name:"show",rawName:"v-show",value:!this.shouldScan,expression:"!shouldScan"}],ref:"pauseFrame",staticClass:"qrcode-stream-camera"}),this._v(" "),t("canvas",{ref:"trackingLayer",staticClass:"qrcode-stream-overlay"}),this._v(" "),t("div",{staticClass:"qrcode-stream-overlay"},[this._t("default")],2)])}),[],!1,null,"5dc0e6a8",null).exports),M={name:"qrcode-capture",mixins:[H],methods:{onChangeInput:function(e){Object(s.a)(e.target.files).map(x).forEach(this.onDetect)}}},T=Object($.a)(M,(function(){var e=this.$createElement;return(this._self._c||e)("input",{attrs:{type:"file",name:"image",accept:"image/*",capture:"environment",multiple:""},on:{change:this.onChangeInput}})}),[],!1,null,null,null).exports,U={name:"qrcode-drop-zone",mixins:[H],methods:{onDragOver:function(e){this.$emit("dragover",e)},onDrop:function(e){var t=this,r=e.dataTransfer;this.onDragOver(!1);var n=Object(s.a)(r.files),a=r.getData("text/uri-list");n.forEach((function(e){t.onDetect(x(e))})),""!==a&&this.onDetect(O(a))}}},W=Object($.a)(U,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{on:{drop:function(t){return t.preventDefault(),t.stopPropagation(),e.onDrop(t)},dragenter:function(t){return t.preventDefault(),t.stopPropagation(),e.onDragOver(!0)},dragleave:function(t){return t.preventDefault(),t.stopPropagation(),e.onDragOver(!1)},dragover:function(e){e.preventDefault(),e.stopPropagation()}}},[e._t("default")],2)}),[],!1,null,null,null).exports;var A={install:function(e){e.component("qrcode-stream",F),e.component("qrcode-capture",T),e.component("qrcode-drop-zone",W)}},V=null;"undefined"!=typeof window?V=window.Vue:"undefined"!=typeof global&&(V=global.Vue),V&&V.use(A)},341:function(e,t,r){},406:function(e,t,r){"use strict";var n=r(341);r.n(n).a}}]);