1?i[t-1]:ee,a=t>2?i[2]:ee;for(o=e.length>3&&"function"==typeof o?(t--,o):ee,a&&jo(i[0],i[1],a)&&(o=t<3?ee:o,t=1),r=ul(r);++n-1?t[o?r[a]:a]:ee}}function Kt(e){return ko(function(r){var i=r.length,n=i,t=_.prototype.thru;for(e&&r.reverse();n--;){var o=r[n];if("function"!=typeof o)throw new cl(te);if(t&&!a&&"wrapper"==vo(o))var a=new _([],(!0))}for(n=a?n:i;++n1&&v.reverse(),c&&uf))return!1;var s=o.get(e);if(s&&o.get(r))return s==r;var l=-1,c=!0,d=i&de?new bi:ee;for(o.set(e,r),o.set(r,e);++l1?"& ":"")+r[n],r=r.join(i>2?", ":" "),e.replace(Lr,"{\n/* [wrapped with "+r+"] */\n")}function To(e){return pd(e)||_d(e)||!!(Tl&&e&&e[Tl])}function Po(e,r){var i=typeof e;return r=null==r?Fe:r,!!r&&("number"==i||"symbol"!=i&&Yr.test(e))&&e>-1&&e%1==0&&e0){if(++r>=xe)return arguments[0]}else r=0;return e.apply(ee,arguments)}}function Zo(e,r){var i=-1,n=e.length,t=n-1;for(r=r===ee?n:r;++i=this.__values__.length,r=e?ee:this.__values__[this.__index__++];return{done:e,value:r}}function nf(){return this}function tf(e){for(var r,n=this;n instanceof i;){var t=ia(n);t.__index__=0,t.__values__=ee,r?o.__wrapped__=t:r=t;var o=t;n=n.__wrapped__}return o.__wrapped__=e,r}function of(){var e=this.__wrapped__;if(e instanceof x){var r=e;return this.__actions__.length&&(r=new x(this)),r=r.reverse(),r.__actions__.push({func:Za,args:[Aa],thisArg:ee}),new _(r,this.__chain__)}return this.thru(Aa)}function af(){return vt(this.__wrapped__,this.__actions__)}function ff(e,r,i){var n=pd(e)?f:zi;return i&&jo(e,r,i)&&(r=ee),n(e,mo(r,3))}function uf(e,r){var i=pd(e)?u:Ki;return i(e,mo(r,3))}function sf(e,r){return Ji(kf(e,r),1)}function lf(e,r){return Ji(kf(e,r),Re)}function cf(e,r,i){return i=i===ee?1:Eu(i),Ji(kf(e,r),i)}function df(e,r){var i=pd(e)?o:kc;return i(e,mo(r,3))}function bf(e,r){var i=pd(e)?a:_c;return i(e,mo(r,3))}function hf(e,r,i,n){e=qf(e)?e:es(e),i=i&&!n?Eu(i):0;var t=e.length;return i<0&&(i=Yl(t+i,0)),_u(e)?i<=t&&e.indexOf(r,i)>-1:!!t&&m(e,r,i)>-1}function kf(e,r){var i=pd(e)?c:Hn;return i(e,mo(r,3))}function _f(e,r,i,n){return null==e?[]:(pd(r)||(r=null==r?[]:[r]),i=n?ee:i,pd(i)||(i=null==i?[]:[i]),qn(e,r,i))}function pf(e,r,i){var n=pd(e)?b:O,t=arguments.length<3;return n(e,mo(r,4),i,t,kc)}function vf(e,r,i){var n=pd(e)?h:O,t=arguments.length<3;return n(e,mo(r,4),i,t,_c)}function wf(e,r){var i=pd(e)?u:Ki;return i(e,Pf(mo(r,3)))}function mf(e){var r=pd(e)?Ei:nt;return r(e)}function gf(e,r,i){r=(i?jo(e,r,i):r===ee)?1:Eu(r);var n=pd(e)?Si:tt;return n(e,r)}function yf(e){var r=pd(e)?xi:at;return r(e)}function Ef(e){if(null==e)return 0;if(qf(e))return _u(e)?K(e):e.length;var r=Cc(e);return r==qe||r==er?e.size:In(e).length}function Sf(e,r,i){var n=pd(e)?k:ut;return i&&jo(e,r,i)&&(r=ee),n(e,mo(r,3))}function xf(e,r){if("function"!=typeof r)throw new cl(te);return e=Eu(e),function(){if(--e<1)return r.apply(this,arguments)}}function Of(e,r,i){return r=i?ee:r,r=e&&null==r?e.length:r,fo(e,me,ee,ee,ee,ee,r)}function Cf(e,r){var i;if("function"!=typeof r)throw new cl(te);return e=Eu(e),function(){return--e>0&&(i=r.apply(this,arguments)),e<=1&&(r=ee),i}}function Af(e,r,i){r=i?ee:r;var n=fo(e,_e,ee,ee,ee,ee,ee,r);return n.placeholder=Af.placeholder,
+n}function Mf(e,r,i){r=i?ee:r;var n=fo(e,pe,ee,ee,ee,ee,ee,r);return n.placeholder=Mf.placeholder,n}function Rf(e,r,i){function n(r){var i=d,n=b;return d=b=ee,v=r,k=e.apply(n,i)}function t(e){return v=e,_=Rc(f,r),w?n(e):k}function o(e){var i=e-p,n=e-v,t=r-i;return m?ql(t,h-n):t}function a(e){var i=e-p,n=e-v;return p===ee||i>=r||i<0||m&&n>=h}function f(){var e=od();return a(e)?u(e):void(_=Rc(f,o(e)))}function u(e){return _=ee,g&&d?n(e):(d=b=ee,k)}function s(){_!==ee&&yc(_),v=0,d=p=b=_=ee}function l(){return _===ee?k:u(od())}function c(){var e=od(),i=a(e);if(d=arguments,b=this,p=e,i){if(_===ee)return t(p);if(m)return _=Rc(f,r),n(p)}return _===ee&&(_=Rc(f,r)),k}var d,b,h,k,_,p,v=0,w=!1,m=!1,g=!0;if("function"!=typeof e)throw new cl(te);return r=xu(r)||0,ou(i)&&(w=!!i.leading,m="maxWait"in i,h=m?Yl(xu(i.maxWait)||0,r):h,g="trailing"in i?!!i.trailing:g),c.cancel=s,c.flush=l,c}function Ff(e){return fo(e,ye)}function Tf(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new cl(te);var i=function(){var n=arguments,t=r?r.apply(this,n):n[0],o=i.cache;if(o.has(t))return o.get(t);var a=e.apply(this,n);return i.cache=o.set(t,a)||o,a};return i.cache=new(Tf.Cache||fi),i}function Pf(e){if("function"!=typeof e)throw new cl(te);return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}function jf(e){return Cf(2,e)}function Lf(e,r){if("function"!=typeof e)throw new cl(te);return r=r===ee?r:Eu(r),it(e,r)}function Df(e,r){if("function"!=typeof e)throw new cl(te);return r=null==r?0:Yl(Eu(r),0),it(function(i){var t=i[r],o=St(i,0,r);return t&&d(o,t),n(e,this,o)})}function Nf(e,r,i){var n=!0,t=!0;if("function"!=typeof e)throw new cl(te);return ou(i)&&(n="leading"in i?!!i.leading:n,t="trailing"in i?!!i.trailing:t),Rf(e,r,{leading:n,maxWait:r,trailing:t})}function If(e){return Of(e,1)}function Bf(e,r){return cd(yt(r),e)}function Uf(){if(!arguments.length)return[];var e=arguments[0];return pd(e)?e:[e]}function Hf(e){return Li(e,le)}function zf(e,r){return r="function"==typeof r?r:ee,Li(e,le,r)}function Gf(e){return Li(e,ue|le)}function Vf(e,r){return r="function"==typeof r?r:ee,Li(e,ue|le,r)}function Wf(e,r){return null==r||Bi(e,r,Hu(r))}function Yf(e,r){return e===r||e!==e&&r!==r}function qf(e){return null!=e&&tu(e.length)&&!iu(e)}function Xf(e){return au(e)&&qf(e)}function Kf(e){return e===!0||e===!1||au(e)&&fn(e)==He}function Jf(e){return au(e)&&1===e.nodeType&&!hu(e)}function $f(e){if(null==e)return!0;if(qf(e)&&(pd(e)||"string"==typeof e||"function"==typeof e.splice||wd(e)||Sd(e)||_d(e)))return!e.length;var r=Cc(e);if(r==qe||r==er)return!e.size;if(Bo(e))return!In(e).length;for(var i in e)if(pl.call(e,i))return!1;return!0}function Zf(e,r){return Mn(e,r)}function Qf(e,r,i){i="function"==typeof i?i:ee;var n=i?i(e,r):ee;return n===ee?Mn(e,r,ee,i):!!n}function eu(e){if(!au(e))return!1;var r=fn(e);return r==Ve||r==Ge||"string"==typeof e.message&&"string"==typeof e.name&&!hu(e)}function ru(e){return"number"==typeof e&&Gl(e)}function iu(e){if(!ou(e))return!1;var r=fn(e);return r==We||r==Ye||r==Ue||r==Ze}function nu(e){return"number"==typeof e&&e==Eu(e)}function tu(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Fe}function ou(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)}function au(e){return null!=e&&"object"==typeof e}function fu(e,r){return e===r||Tn(e,r,yo(r))}function uu(e,r,i){return i="function"==typeof i?i:ee,Tn(e,r,yo(r),i)}function su(e){return bu(e)&&e!=+e}function lu(e){if(Ac(e))throw new ol(ne);return Pn(e)}function cu(e){return null===e}function du(e){return null==e}function bu(e){return"number"==typeof e||au(e)&&fn(e)==Xe}function hu(e){if(!au(e)||fn(e)!=Je)return!1;var r=Al(e);if(null===r)return!0;var i=pl.call(r,"constructor")&&r.constructor;return"function"==typeof i&&i instanceof i&&_l.call(i)==gl}function ku(e){return nu(e)&&e>=-Fe&&e<=Fe}function _u(e){return"string"==typeof e||!pd(e)&&au(e)&&fn(e)==rr}function pu(e){return"symbol"==typeof e||au(e)&&fn(e)==ir}function vu(e){return e===ee}function wu(e){return au(e)&&Cc(e)==tr}function mu(e){return au(e)&&fn(e)==or}function gu(e){if(!e)return[];if(qf(e))return _u(e)?J(e):Lt(e);if(Pl&&e[Pl])return H(e[Pl]());var r=Cc(e),i=r==qe?z:r==er?W:es;return i(e)}function yu(e){if(!e)return 0===e?e:0;if(e=xu(e),e===Re||e===-Re){var r=e<0?-1:1;return r*Te}return e===e?e:0}function Eu(e){var r=yu(e),i=r%1;return r===r?i?r-i:r:0}function Su(e){return e?ji(Eu(e),0,je):0}function xu(e){if("number"==typeof e)return e;if(pu(e))return Pe;if(ou(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=ou(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Tr,"");var i=Gr.test(e);return i||Wr.test(e)?Zi(e.slice(2),i?2:8):zr.test(e)?Pe:+e}function Ou(e){return Dt(e,zu(e))}function Cu(e){return e?ji(Eu(e),-Fe,Fe):0===e?e:0}function Au(e){return null==e?"":bt(e)}function Mu(e,r){var i=hc(e);return null==r?i:Ri(i,r)}function Ru(e,r){return v(e,mo(r,3),Qi)}function Fu(e,r){return v(e,mo(r,3),en)}function Tu(e,r){return null==e?e:pc(e,mo(r,3),zu)}function Pu(e,r){return null==e?e:vc(e,mo(r,3),zu)}function ju(e,r){return e&&Qi(e,mo(r,3))}function Lu(e,r){return e&&en(e,mo(r,3))}function Du(e){return null==e?[]:nn(e,Hu(e))}function Nu(e){return null==e?[]:nn(e,zu(e))}function Iu(e,r,i){var n=null==e?ee:tn(e,r);return n===ee?i:n}function Bu(e,r){return null!=e&&Co(e,r,vn)}function Uu(e,r){return null!=e&&Co(e,r,gn)}function Hu(e){return qf(e)?yi(e):In(e)}function zu(e){return qf(e)?yi(e,!0):Bn(e)}function Gu(e,r){var i={};return r=mo(r,3),Qi(e,function(e,n,t){Ti(i,r(e,n,t),e)}),i}function Vu(e,r){var i={};return r=mo(r,3),Qi(e,function(e,n,t){Ti(i,n,r(e,n,t))}),i}function Wu(e,r){return Yu(e,Pf(mo(r)))}function Yu(e,r){if(null==e)return{};var i=c(po(e),function(e){return[e]});return r=mo(r),Kn(e,i,function(e,i){return r(e,i[0])})}function qu(e,r,i){r=Et(r,e);var n=-1,t=r.length;for(t||(t=1,e=ee);++nr){var n=e;e=r,r=n}if(i||e%1||r%1){var t=Jl();return ql(e+t*(r-e+$i("1e-"+((t+"").length-1))),r)}return Qn(e,r)}function os(e){return Jd(Au(e).toLowerCase())}function as(e){return e=Au(e),e&&e.replace(qr,kn).replace(Ii,"")}function fs(e,r,i){e=Au(e),r=bt(r);var n=e.length;i=i===ee?n:ji(Eu(i),0,n);var t=i;return i-=r.length,i>=0&&e.slice(i,t)==r}function us(e){return e=Au(e),e&&Er.test(e)?e.replace(gr,_n):e}function ss(e){return e=Au(e),e&&Fr.test(e)?e.replace(Rr,"\\$&"):e}function ls(e,r,i){e=Au(e),r=Eu(r);var n=r?K(e):0;if(!r||n>=r)return e;var t=(r-n)/2;return eo(Ul(t),i)+e+eo(Bl(t),i)}function cs(e,r,i){e=Au(e),r=Eu(r);var n=r?K(e):0;return r&&n>>0)?(e=Au(e),e&&("string"==typeof r||null!=r&&!yd(r))&&(r=bt(r),!r&&B(e))?St(J(e),0,i):e.split(r,i)):[]}function ps(e,r,i){return e=Au(e),i=null==i?0:ji(Eu(i),0,e.length),r=bt(r),e.slice(i,i+r.length)==r}function vs(e,i,n){var t=r.templateSettings;n&&jo(e,i,n)&&(i=ee),e=Au(e),i=Md({},i,t,uo);var o,a,f=Md({},i.imports,t.imports,uo),u=Hu(f),s=T(f,u),l=0,c=i.interpolate||Xr,d="__p += '",b=sl((i.escape||Xr).source+"|"+c.source+"|"+(c===Or?Ur:Xr).source+"|"+(i.evaluate||Xr).source+"|$","g"),h="//# sourceURL="+("sourceURL"in i?i.sourceURL:"lodash.templateSources["+ ++Vi+"]")+"\n";e.replace(b,function(r,i,n,t,f,u){return n||(n=t),d+=e.slice(l,u).replace(Kr,N),i&&(o=!0,d+="' +\n__e("+i+") +\n'"),f&&(a=!0,d+="';\n"+f+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+r.length,r}),d+="';\n";var k=i.variable;k||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(pr,""):d).replace(vr,"$1").replace(wr,"$1;"),d="function("+(k||"obj")+") {\n"+(k?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var _=$d(function(){return al(u,h+"return "+d).apply(ee,s)});if(_.source=d,eu(_))throw _;return _}function ws(e){return Au(e).toLowerCase()}function ms(e){return Au(e).toUpperCase()}function gs(e,r,i){if(e=Au(e),e&&(i||r===ee))return e.replace(Tr,"");if(!e||!(r=bt(r)))return e;var n=J(e),t=J(r),o=j(n,t),a=L(n,t)+1;return St(n,o,a).join("")}function ys(e,r,i){if(e=Au(e),e&&(i||r===ee))return e.replace(jr,"");if(!e||!(r=bt(r)))return e;var n=J(e),t=L(n,J(r))+1;return St(n,0,t).join("")}function Es(e,r,i){if(e=Au(e),e&&(i||r===ee))return e.replace(Pr,"");if(!e||!(r=bt(r)))return e;var n=J(e),t=j(n,J(r));return St(n,t).join("")}function Ss(e,r){var i=Ee,n=Se;if(ou(r)){var t="separator"in r?r.separator:t;i="length"in r?Eu(r.length):i,n="omission"in r?bt(r.omission):n}e=Au(e);var o=e.length;if(B(e)){var a=J(e);o=a.length}if(i>=o)return e;var f=i-K(n);if(f<1)return n;var u=a?St(a,0,f).join(""):e.slice(0,f);if(t===ee)return u+n;if(a&&(f+=u.length-f),yd(t)){if(e.slice(f).search(t)){var s,l=u;for(t.global||(t=sl(t.source,Au(Hr.exec(t))+"g")),t.lastIndex=0;s=t.exec(l);)var c=s.index;u=u.slice(0,c===ee?f:c)}}else if(e.indexOf(bt(t),f)!=f){var d=u.lastIndexOf(t);d>-1&&(u=u.slice(0,d))}return u+n}function xs(e){return e=Au(e),e&&yr.test(e)?e.replace(mr,pn):e}function Os(e,r,i){return e=Au(e),r=i?ee:r,r===ee?U(e)?Q(e):p(e):e.match(r)||[]}function Cs(e){var r=null==e?0:e.length,i=mo();return e=r?c(e,function(e){if("function"!=typeof e[1])throw new cl(te);return[i(e[0]),e[1]]}):[],it(function(i){for(var t=-1;++tFe)return[];var i=je,n=ql(e,je);r=mo(r),e-=je;for(var t=M(n,r);++i1?e[r-1]:ee;return i="function"==typeof i?(e.pop(),i):ee,qa(e,i)}),Jc=ko(function(e){var r=e.length,i=r?e[0]:0,n=this.__wrapped__,t=function(r){return Pi(r,e)};return!(r>1||this.__actions__.length)&&n instanceof x&&Po(i)?(n=n.slice(i,+i+(r?1:0)),n.__actions__.push({func:Za,args:[t],thisArg:ee}),new _(n,this.__chain__).thru(function(e){return r&&!e.length&&e.push(ee),e})):this.thru(t)}),$c=Bt(function(e,r,i){pl.call(e,i)?++e[i]:Ti(e,i,1)}),Zc=Xt(ca),Qc=Xt(da),ed=Bt(function(e,r,i){pl.call(e,i)?e[i].push(r):Ti(e,i,[r])}),rd=it(function(e,r,i){var t=-1,o="function"==typeof r,a=qf(e)?nl(e.length):[];return kc(e,function(e){a[++t]=o?n(r,e,i):xn(e,r,i)}),a}),id=Bt(function(e,r,i){Ti(e,i,r)}),nd=Bt(function(e,r,i){e[i?0:1].push(r)},function(){return[[],[]]}),td=it(function(e,r){if(null==e)return[];var i=r.length;return i>1&&jo(e,r[0],r[1])?r=[]:i>2&&jo(r[0],r[1],r[2])&&(r=[r[0]]),qn(e,Ji(r,1),[])}),od=Nl||function(){return rn.Date.now()},ad=it(function(e,r,i){var n=be;if(i.length){var t=V(i,wo(ad));n|=ve}return fo(e,n,r,i,t)}),fd=it(function(e,r,i){var n=be|he;if(i.length){var t=V(i,wo(fd));n|=ve}return fo(r,n,e,i,t)}),ud=it(function(e,r){return Ui(e,1,r)}),sd=it(function(e,r,i){return Ui(e,xu(r)||0,i)});Tf.Cache=fi;var ld=gc(function(e,r){r=1==r.length&&pd(r[0])?c(r[0],F(mo())):c(Ji(r,1),F(mo()));var i=r.length;return it(function(t){for(var o=-1,a=ql(t.length,i);++o=r}),_d=On(function(){return arguments}())?On:function(e){return au(e)&&pl.call(e,"callee")&&!Rl.call(e,"callee")},pd=nl.isArray,vd=un?F(un):Cn,wd=zl||zs,md=sn?F(sn):An,gd=ln?F(ln):Fn,yd=cn?F(cn):jn,Ed=dn?F(dn):Ln,Sd=bn?F(bn):Dn,xd=no(Un),Od=no(function(e,r){return e<=r}),Cd=Ut(function(e,r){if(Bo(r)||qf(r))return void Dt(r,Hu(r),e);for(var i in r)pl.call(r,i)&&Ci(e,i,r[i])}),Ad=Ut(function(e,r){Dt(r,zu(r),e)}),Md=Ut(function(e,r,i,n){Dt(r,zu(r),e,n)}),Rd=Ut(function(e,r,i,n){Dt(r,Hu(r),e,n)}),Fd=ko(Pi),Td=it(function(e,r){e=ul(e);var i=-1,n=r.length,t=n>2?r[2]:ee;for(t&&jo(r[0],r[1],t)&&(n=1);++i1),r}),Dt(e,po(e),i),n&&(i=Li(i,ue|se|le,lo));for(var t=r.length;t--;)kt(i,r[t]);return i}),Ud=ko(function(e,r){return null==e?{}:Xn(e,r)}),Hd=ao(Hu),zd=ao(zu),Gd=Wt(function(e,r,i){return r=r.toLowerCase(),e+(i?os(r):r)}),Vd=Wt(function(e,r,i){return e+(i?"-":"")+r.toLowerCase()}),Wd=Wt(function(e,r,i){return e+(i?" ":"")+r.toLowerCase()}),Yd=Vt("toLowerCase"),qd=Wt(function(e,r,i){return e+(i?"_":"")+r.toLowerCase()}),Xd=Wt(function(e,r,i){return e+(i?" ":"")+Jd(r)}),Kd=Wt(function(e,r,i){return e+(i?" ":"")+r.toUpperCase()}),Jd=Vt("toUpperCase"),$d=it(function(e,r){try{return n(e,ee,r)}catch(i){return eu(i)?i:new ol(i)}}),Zd=ko(function(e,r){return o(r,function(r){r=Qo(r),Ti(e,r,ad(e[r],e))}),e}),Qd=Kt(),eb=Kt(!0),rb=it(function(e,r){return function(i){return xn(i,e,r)}}),ib=it(function(e,r){return function(i){return xn(e,i,r)}}),nb=Qt(c),tb=Qt(f),ob=Qt(k),ab=io(),fb=io(!0),ub=Zt(function(e,r){return e+r},0),sb=oo("ceil"),lb=Zt(function(e,r){return e/r},1),cb=oo("floor"),db=Zt(function(e,r){return e*r},1),bb=oo("round"),hb=Zt(function(e,r){return e-r},0);return r.after=xf,r.ary=Of,r.assign=Cd,r.assignIn=Ad,r.assignInWith=Md,r.assignWith=Rd,r.at=Fd,r.before=Cf,r.bind=ad,r.bindAll=Zd,r.bindKey=fd,r.castArray=Uf,r.chain=Ja,r.chunk=na,r.compact=ta,r.concat=oa,r.cond=Cs,r.conforms=As,r.constant=Ms,r.countBy=$c,r.create=Mu,r.curry=Af,r.curryRight=Mf,r.debounce=Rf,r.defaults=Td,r.defaultsDeep=Pd,r.defer=ud,r.delay=sd,r.difference=Pc,r.differenceBy=jc,r.differenceWith=Lc,r.drop=aa,r.dropRight=fa,r.dropRightWhile=ua,r.dropWhile=sa,r.fill=la,r.filter=uf,r.flatMap=sf,r.flatMapDeep=lf,r.flatMapDepth=cf,r.flatten=ba,r.flattenDeep=ha,r.flattenDepth=ka,r.flip=Ff,r.flow=Qd,r.flowRight=eb,r.fromPairs=_a,r.functions=Du,r.functionsIn=Nu,r.groupBy=ed,r.initial=wa,r.intersection=Dc,r.intersectionBy=Nc,r.intersectionWith=Ic,r.invert=jd,r.invertBy=Ld,r.invokeMap=rd,r.iteratee=Ts,r.keyBy=id,r.keys=Hu,r.keysIn=zu,r.map=kf,r.mapKeys=Gu,r.mapValues=Vu,r.matches=Ps,r.matchesProperty=js,r.memoize=Tf,r.merge=Nd,r.mergeWith=Id,r.method=rb,r.methodOf=ib,r.mixin=Ls,r.negate=Pf,r.nthArg=Is,r.omit=Bd,r.omitBy=Wu,r.once=jf,r.orderBy=_f,r.over=nb,r.overArgs=ld,r.overEvery=tb,r.overSome=ob,r.partial=cd,r.partialRight=dd,r.partition=nd,r.pick=Ud,r.pickBy=Yu,r.property=Bs,r.propertyOf=Us,r.pull=Bc,r.pullAll=Sa,r.pullAllBy=xa,r.pullAllWith=Oa,r.pullAt=Uc,r.range=ab,r.rangeRight=fb,r.rearg=bd,r.reject=wf,r.remove=Ca,r.rest=Lf,r.reverse=Aa,r.sampleSize=gf,r.set=Xu,r.setWith=Ku,r.shuffle=yf,r.slice=Ma,r.sortBy=td,r.sortedUniq=Da,r.sortedUniqBy=Na,r.split=_s,r.spread=Df,r.tail=Ia,r.take=Ba,r.takeRight=Ua,r.takeRightWhile=Ha,r.takeWhile=za,r.tap=$a,r.throttle=Nf,r.thru=Za,r.toArray=gu,r.toPairs=Hd,r.toPairsIn=zd,r.toPath=qs,r.toPlainObject=Ou,r.transform=Ju,r.unary=If,r.union=Hc,r.unionBy=zc,r.unionWith=Gc,r.uniq=Ga,r.uniqBy=Va,r.uniqWith=Wa,r.unset=$u,r.unzip=Ya,r.unzipWith=qa,r.update=Zu,r.updateWith=Qu,r.values=es,r.valuesIn=rs,r.without=Vc,r.words=Os,r.wrap=Bf,r.xor=Wc,r.xorBy=Yc,r.xorWith=qc,r.zip=Xc,r.zipObject=Xa,r.zipObjectDeep=Ka,r.zipWith=Kc,r.entries=Hd,r.entriesIn=zd,r.extend=Ad,r.extendWith=Md,Ls(r,r),r.add=ub,r.attempt=$d,r.camelCase=Gd,r.capitalize=os,r.ceil=sb,r.clamp=is,r.clone=Hf,r.cloneDeep=Gf,r.cloneDeepWith=Vf,r.cloneWith=zf,r.conformsTo=Wf,r.deburr=as,r.defaultTo=Rs,r.divide=lb,r.endsWith=fs,r.eq=Yf,r.escape=us,r.escapeRegExp=ss,r.every=ff,r.find=Zc,r.findIndex=ca,r.findKey=Ru,r.findLast=Qc,r.findLastIndex=da,r.findLastKey=Fu,r.floor=cb,r.forEach=df,r.forEachRight=bf,r.forIn=Tu,r.forInRight=Pu,r.forOwn=ju,r.forOwnRight=Lu,r.get=Iu,r.gt=hd,r.gte=kd,r.has=Bu,r.hasIn=Uu,r.head=pa,r.identity=Fs,r.includes=hf,r.indexOf=va,r.inRange=ns,r.invoke=Dd,r.isArguments=_d,r.isArray=pd,r.isArrayBuffer=vd,r.isArrayLike=qf,r.isArrayLikeObject=Xf,r.isBoolean=Kf,r.isBuffer=wd,r.isDate=md,r.isElement=Jf,r.isEmpty=$f,r.isEqual=Zf,r.isEqualWith=Qf,r.isError=eu,r.isFinite=ru,r.isFunction=iu,r.isInteger=nu,r.isLength=tu,r.isMap=gd,r.isMatch=fu,r.isMatchWith=uu,r.isNaN=su,r.isNative=lu,r.isNil=du,r.isNull=cu,r.isNumber=bu,r.isObject=ou,r.isObjectLike=au,r.isPlainObject=hu,r.isRegExp=yd,r.isSafeInteger=ku,r.isSet=Ed,r.isString=_u,r.isSymbol=pu,r.isTypedArray=Sd,r.isUndefined=vu,r.isWeakMap=wu,r.isWeakSet=mu,r.join=ma,r.kebabCase=Vd,r.last=ga,r.lastIndexOf=ya,r.lowerCase=Wd,r.lowerFirst=Yd,r.lt=xd,r.lte=Od,r.max=Ks,r.maxBy=Js,r.mean=$s,r.meanBy=Zs,r.min=Qs,r.minBy=el,r.stubArray=Hs,r.stubFalse=zs,r.stubObject=Gs,r.stubString=Vs,r.stubTrue=Ws,r.multiply=db,r.nth=Ea,r.noConflict=Ds,r.noop=Ns,r.now=od,r.pad=ls,r.padEnd=cs,r.padStart=ds,r.parseInt=bs,r.random=ts,r.reduce=pf,r.reduceRight=vf,r.repeat=hs,r.replace=ks,r.result=qu,r.round=bb,r.runInContext=mn,r.sample=mf,r.size=Ef,r.snakeCase=qd,r.some=Sf,r.sortedIndex=Ra,r.sortedIndexBy=Fa,r.sortedIndexOf=Ta,r.sortedLastIndex=Pa,r.sortedLastIndexBy=ja,r.sortedLastIndexOf=La,r.startCase=Xd,r.startsWith=ps,r.subtract=hb,r.sum=rl,r.sumBy=il,r.template=vs,r.times=Ys,r.toFinite=yu,r.toInteger=Eu,r.toLength=Su,r.toLower=ws,r.toNumber=xu,r.toSafeInteger=Cu,r.toString=Au,r.toUpper=ms,r.trim=gs,r.trimEnd=ys,r.trimStart=Es,r.truncate=Ss,r.unescape=xs,r.uniqueId=Xs,r.upperCase=Kd,r.upperFirst=Jd,r.each=df,r.eachRight=bf,r.first=pa,Ls(r,function(){var e={};return Qi(r,function(i,n){pl.call(r.prototype,n)||(e[n]=i)}),e}(),{chain:!1}),r.VERSION=re,o(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){r[e].placeholder=r}),o(["drop","take"],function(e,r){x.prototype[e]=function(i){i=i===ee?1:Yl(Eu(i),0);var n=this.__filtered__&&!r?new x(this):this.clone();return n.__filtered__?n.__takeCount__=ql(i,n.__takeCount__):n.__views__.push({size:ql(i,je),type:e+(n.__dir__<0?"Right":"")}),n},x.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),o(["filter","map","takeWhile"],function(e,r){var i=r+1,n=i==Ce||i==Me;x.prototype[e]=function(e){var r=this.clone();return r.__iteratees__.push({iteratee:mo(e,3),type:i}),r.__filtered__=r.__filtered__||n,r}}),o(["head","last"],function(e,r){var i="take"+(r?"Right":"");x.prototype[e]=function(){return this[i](1).value()[0]}}),o(["initial","tail"],function(e,r){var i="drop"+(r?"":"Right");x.prototype[e]=function(){return this.__filtered__?new x(this):this[i](1)}}),x.prototype.compact=function(){return this.filter(Fs)},x.prototype.find=function(e){return this.filter(e).head()},x.prototype.findLast=function(e){return this.reverse().find(e)},x.prototype.invokeMap=it(function(e,r){return"function"==typeof e?new x(this):this.map(function(i){return xn(i,e,r)})}),x.prototype.reject=function(e){return this.filter(Pf(mo(e)))},x.prototype.slice=function(e,r){e=Eu(e);var i=this;return i.__filtered__&&(e>0||r<0)?new x(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),r!==ee&&(r=Eu(r),i=r<0?i.dropRight(-r):i.take(r-e)),i)},x.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},x.prototype.toArray=function(){return this.take(je)},Qi(x.prototype,function(e,i){var n=/^(?:filter|find|map|reject)|While$/.test(i),t=/^(?:head|last)$/.test(i),o=r[t?"take"+("last"==i?"Right":""):i],a=t||/^find/.test(i);o&&(r.prototype[i]=function(){var i=this.__wrapped__,f=t?[1]:arguments,u=i instanceof x,s=f[0],l=u||pd(i),c=function(e){var i=o.apply(r,d([e],f));return t&&b?i[0]:i};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var b=this.__chain__,h=!!this.__actions__.length,k=a&&!b,p=u&&!h;if(!a&&l){i=p?i:new x(this);var v=e.apply(i,f);return v.__actions__.push({func:Za,args:[c],thisArg:ee}),new _(v,b)}return k&&p?e.apply(this,f):(v=this.thru(c),k?t?v.value()[0]:v.value():v)})}),o(["pop","push","shift","sort","splice","unshift"],function(e){var i=dl[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",t=/^(?:pop|shift)$/.test(e);r.prototype[e]=function(){var e=arguments;if(t&&!this.__chain__){var r=this.value();return i.apply(pd(r)?r:[],e)}return this[n](function(r){return i.apply(pd(r)?r:[],e)})}}),Qi(x.prototype,function(e,i){var n=r[i];if(n){var t=n.name+"",o=oc[t]||(oc[t]=[]);o.push({name:i,func:n})}}),oc[Jt(ee,he).name]=[{name:"wrapper",func:ee}],x.prototype.clone=q,x.prototype.reverse=$,x.prototype.value=Z,r.prototype.at=Jc,r.prototype.chain=Qa,r.prototype.commit=ef,r.prototype.next=rf,r.prototype.plant=tf,r.prototype.reverse=of,r.prototype.toJSON=r.prototype.valueOf=r.prototype.value=af,r.prototype.first=r.prototype.head,Pl&&(r.prototype[Pl]=nf),r},wn=vn();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(rn._=wn,define(function(){return wn})):tn?((tn.exports=wn)._=wn,nn._=wn):rn._=wn}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],337:[function(e,r,i){function n(){throw new Error("setTimeout has not been defined")}function t(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(r){try{return c.call(null,e,0)}catch(r){return c.call(this,e,0)}}}function a(e){if(d===clearTimeout)return clearTimeout(e);if((d===t||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(r){try{return d.call(null,e)}catch(r){return d.call(this,e)}}}function f(){_&&h&&(_=!1,h.length?k=h.concat(k):p=-1,k.length&&u())}function u(){if(!_){var e=o(f);_=!0;for(var r=k.length;r;){for(h=k,k=[];++p1)for(var i=1;i=0;--n){var t=this.tryEntries[n],o=t.completion;if("root"===t.tryLoc)return r("end");if(t.tryLoc<=this.prev){var a=v.call(t,"catchLoc"),f=v.call(t,"finallyLoc");if(a&&f){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),d(i),M}},"catch":function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var t=n.arg;d(i)}return t}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,i){return this.delegate={iterator:h(e),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=_),M}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,r,i){"use strict";var n={};n.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},n.splitSections=function(e){var r=e.split("\nm=");return r.map(function(e,r){return(r>0?"m="+e:e).trim()+"\r\n"})},n.matchPrefix=function(e,r){return n.splitLines(e).filter(function(e){return 0===e.indexOf(r)})},n.parseCandidate=function(e){var r;r=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");for(var i={foundation:r[0],component:r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],port:parseInt(r[5],10),type:r[7]},n=8;n0?r[0].split("/")[1]:"sendrecv",uri:r[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var r,i={},n=e.substr(e.indexOf(" ")+1).split(";"),t=0;t-1?(i.attribute=e.substr(r+1,n-r-1),i.value=e.substr(n+1)):i.attribute=e.substr(r+1),i},n.getMid=function(e){var r=n.matchPrefix(e,"a=mid:")[0];if(r)return r.substr(6)},n.parseFingerprint=function(e){var r=e.substr(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1]}},n.getDtlsParameters=function(e,r){var i=n.matchPrefix(e+r,"a=fingerprint:");return{role:"auto",fingerprints:i.map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,r){var i="a=setup:"+r+"\r\n";return e.fingerprints.forEach(function(e){i+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),i},n.getIceParameters=function(e,r){var i=n.splitLines(e);i=i.concat(n.splitLines(r));var t={usernameFragment:i.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:i.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return t},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=n.splitLines(e),t=i[0].split(" "),o=3;o0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=r.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach(function(e){i+=n.writeRtpMap(e),i+=n.writeFmtp(e),i+=n.writeRtcpFb(e)});var t=0;return r.codecs.forEach(function(e){e.maxptime>t&&(t=e.maxptime)}),t>0&&(i+="a=maxptime:"+t+"\r\n"),i+="a=rtcp-mux\r\n",r.headerExtensions.forEach(function(e){i+=n.writeExtmap(e)}),i},n.parseRtpEncodingParameters=function(e){var r,i=[],t=n.parseRtpParameters(e),o=t.fecMechanisms.indexOf("RED")!==-1,a=t.fecMechanisms.indexOf("ULPFEC")!==-1,f=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),u=f.length>0&&f[0].ssrc,s=n.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var r=e.split(" ");return r.shift(),r.map(function(e){return parseInt(e,10)})});s.length>0&&s[0].length>1&&s[0][0]===u&&(r=s[0][1]),t.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{ssrc:r}};i.push(n),o&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:r,mechanism:a?"red+ulpfec":"red"},i.push(n))}}),0===i.length&&u&&i.push({ssrc:u});var l=n.matchPrefix(e,"b=");return l.length&&(0===l[0].indexOf("b=TIAS:")?l=parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")&&(l=parseInt(l[0].substr(5),10)),i.forEach(function(e){e.maxBitrate=l})),i},n.parseRtcpParameters=function(e){var r={},i=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);var t=n.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=t.length>0,r.compound=0===t.length;var o=n.matchPrefix(e,"a=rtcp-mux");return r.mux=o.length>0,r},n.parseMsid=function(e){var r,i=n.matchPrefix(e,"a=msid:");if(1===i.length)return r=i[0].substr(7).split(" "),{stream:r[0],track:r[1]};var t=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return t.length>0?(r=t[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},n.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,r,i,t){var o=n.writeRtpDescription(e.kind,r);if(o+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===i?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",o+=e.direction?"a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?"a=sendrecv\r\n":e.rtpSender?"a=sendonly\r\n":e.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",e.rtpSender){var a="msid:"+t.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),o},n.getDirection=function(e,r){for(var i=n.splitLines(e),t=0;t0;)n[o]=arguments[o+1];var a=Object.create(e.methods||null);if(g(a,e.deepProperties),y(a,e.properties),Object.defineProperties(a,e.propertyDescriptors||{}),!e.initializers||0===e.initializers.length)return a;void 0===i&&(i={});for(var f=e.initializers,u=f.length,s=0;s0){for(var f=[],u=0;u0;)r[i]=arguments[i+1];return r.reduce(n,e)},y=Object.assign||function(e){for(var r=arguments,i=1;iu?o.delay=setTimeout(function(){o.id=setInterval(a,t),a()},t-u):(o.id=setInterval(a,t),a())}else o.id=setInterval(a,t)},e._stop=function(r){var i=e._timers[r];clearInterval(i.id),clearTimeout(i.delay),delete i.id,delete i.delay},e._stopRun=function(r){var i=e.hidden(),n=e._wasHidden;if(i&&!n||!i&&n)for(var t in e._timers)e._stop(t),e._run(t,!i)},e};"undefined"!=typeof r&&r.exports?r.exports=t(e("./visibility.core")):t(i.Visibility||e("./visibility.core"))}(window)},{"./visibility.core":342}],344:[function(e,r,i){"use strict";!function(){var i=e("./utils").log,n=e("./utils").browserDetails;r.exports.browserDetails=n,r.exports.extractVersion=e("./utils").extractVersion,r.exports.disableLog=e("./utils").disableLog;var t=e("./chrome/chrome_shim")||null,o=e("./edge/edge_shim")||null,a=e("./firefox/firefox_shim")||null,f=e("./safari/safari_shim")||null;switch(n.browser){case"opera":case"chrome":if(!t||!t.shimPeerConnection)return void i("Chrome shim is not included in this adapter release.");i("adapter.js shimming chrome."),r.exports.browserShim=t,t.shimGetUserMedia(),t.shimMediaStream(),t.shimSourceObject(),t.shimPeerConnection(),t.shimOnTrack();break;case"firefox":if(!a||!a.shimPeerConnection)return void i("Firefox shim is not included in this adapter release.");i("adapter.js shimming firefox."),r.exports.browserShim=a,a.shimGetUserMedia(),a.shimSourceObject(),a.shimPeerConnection(),a.shimOnTrack();break;case"edge":if(!o||!o.shimPeerConnection)return void i("MS edge shim is not included in this adapter release.");i("adapter.js shimming edge."),r.exports.browserShim=o,o.shimGetUserMedia(),o.shimPeerConnection();break;case"safari":if(!f)return void i("Safari shim is not included in this adapter release.");i("adapter.js shimming safari."),r.exports.browserShim=f,f.shimGetUserMedia();break;default:i("Unsupported browser!")}}()},{"./chrome/chrome_shim":345,"./edge/edge_shim":347,"./firefox/firefox_shim":349,"./safari/safari_shim":351,"./utils":352}],345:[function(e,r,i){"use strict";var n=e("../utils.js").log,t=e("../utils.js").browserDetails,o={shimMediaStream:function(){window.MediaStream=window.MediaStream||window.webkitMediaStream},shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){var r=this;this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",function(i){var n=new Event("track");n.track=i.track,n.receiver={track:i.track},n.streams=[e.stream],r.dispatchEvent(n)}),e.stream.getTracks().forEach(function(r){var i=new Event("track");i.track=r,i.receiver={track:r},i.streams=[e.stream],this.dispatchEvent(i)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var r=this;return this._srcObject=e,this.src&&URL.revokeObjectURL(this.src),e?(this.src=URL.createObjectURL(e),e.addEventListener("addtrack",function(){r.src&&URL.revokeObjectURL(r.src),r.src=URL.createObjectURL(e)}),void e.addEventListener("removetrack",function(){r.src&&URL.revokeObjectURL(r.src),r.src=URL.createObjectURL(e)})):void(this.src="")}}))},shimPeerConnection:function(){window.RTCPeerConnection=function(e,r){n("PeerConnection"),e&&e.iceTransportPolicy&&(e.iceTransports=e.iceTransportPolicy);var i=new webkitRTCPeerConnection(e,r),t=i.getStats.bind(i);return i.getStats=function(e,r,i){var n=this,o=arguments;if(arguments.length>0&&"function"==typeof e)return t(e,r);var a=function(e){var r={},i=e.result();return i.forEach(function(e){var i={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(r){i[r]=e.stat(r)}),r[i.id]=i}),r},f=function(e,r){var i=new Map(Object.keys(e).map(function(r){return[r,e[r]]}));return r=r||e,Object.keys(r).forEach(function(e){i[e]=r[e]}),i};if(arguments.length>=2){var u=function(e){o[1](f(a(e)))};return t.apply(this,[u,arguments[0]])}return new Promise(function(r,i){1===o.length&&"object"==typeof e?t.apply(n,[function(e){r(f(a(e)))},i]):t.apply(n,[function(e){r(f(a(e),e.result()))},i])}).then(r,i)},i},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var r=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var i=1===arguments.length?arguments[0]:void 0;return new Promise(function(n,t){r.apply(e,[n,t,i])})}return r.apply(this,arguments)}}),t.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var r=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,i=this,n=new Promise(function(n,t){r.apply(i,[e[0],n,t])});return e.length<2?n:n.then(function(){e[1].apply(null,[])},function(r){e.length>=3&&e[2].apply(null,[r])})}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)},["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var r=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}})},attachMediaStream:function(e,r){n("DEPRECATED, attachMediaStream will soon be removed."),t.version>=43?e.srcObject=r:"undefined"!=typeof e.src?e.src=URL.createObjectURL(r):n("Error attaching stream to element.")},reattachMediaStream:function(e,r){n("DEPRECATED, reattachMediaStream will soon be removed."),t.version>=43?e.srcObject=r.srcObject:e.src=r.src}};r.exports={shimMediaStream:o.shimMediaStream,shimOnTrack:o.shimOnTrack,shimSourceObject:o.shimSourceObject,shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},{"../utils.js":352,"./getusermedia":346}],346:[function(e,r,i){"use strict";var n=e("../utils.js").log;r.exports=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var r={};return Object.keys(e).forEach(function(i){if("require"!==i&&"advanced"!==i&&"mediaSource"!==i){var n="object"==typeof e[i]?e[i]:{ideal:e[i]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var t=function(e,r){return e?e+r.charAt(0).toUpperCase()+r.slice(1):"deviceId"===r?"sourceId":r};if(void 0!==n.ideal){r.optional=r.optional||[];var o={};"number"==typeof n.ideal?(o[t("min",i)]=n.ideal,r.optional.push(o),o={},o[t("max",i)]=n.ideal,r.optional.push(o)):(o[t("",i)]=n.ideal,r.optional.push(o))}void 0!==n.exact&&"number"!=typeof n.exact?(r.mandatory=r.mandatory||{},r.mandatory[t("",i)]=n.exact):["min","max"].forEach(function(e){void 0!==n[e]&&(r.mandatory=r.mandatory||{},r.mandatory[t(e,i)]=n[e])})}}),e.advanced&&(r.optional=(r.optional||[]).concat(e.advanced)),r},r=function(r,i){if(r=JSON.parse(JSON.stringify(r)),r&&r.audio&&(r.audio=e(r.audio)),r&&"object"==typeof r.video){var t=r.video.facingMode;if(t=t&&("object"==typeof t?t:{ideal:t}),t&&("user"===t.exact||"environment"===t.exact||"user"===t.ideal||"environment"===t.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete r.video.facingMode,"environment"===t.exact||"environment"===t.ideal))return navigator.mediaDevices.enumerateDevices().then(function(o){o=o.filter(function(e){return"videoinput"===e.kind});var a=o.find(function(e){return e.label.toLowerCase().indexOf("back")!==-1})||o.length&&o[o.length-1];return a&&(r.video.deviceId=t.exact?{exact:a.deviceId}:{ideal:a.deviceId}),r.video=e(r.video),n("chrome: "+JSON.stringify(r)),i(r)});r.video=e(r.video)}return n("chrome: "+JSON.stringify(r)),i(r)},i=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},t=function(e,n,t){r(e,function(e){navigator.webkitGetUserMedia(e,n,function(e){t(i(e))})})};navigator.getUserMedia=t;var o=function(e){return new Promise(function(r,i){navigator.getUserMedia(e,r,i)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:o,enumerateDevices:function(){return new Promise(function(e){var r={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(i){e(i.map(function(e){return{label:e.label,kind:r[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var a=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return r(e,function(e){return a(e)["catch"](function(e){return Promise.reject(i(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return o(e)};"undefined"==typeof navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){n("Dummy mediaDevices.addEventListener called.")}),"undefined"==typeof navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){n("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":352}],347:[function(e,r,i){"use strict";var n=e("sdp"),t=e("../utils").log,o={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var r=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){r[e]=i[e].bind(i)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return r.localStreams},this.getRemoteStreams=function(){return r.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var n=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=n.filter(function(e){if(e&&e.urls){var r=e.urls;return"string"==typeof r&&(r=[r]),r=r.filter(function(e){return 0===e.indexOf("turn:")&&e.indexOf("transport=udp")!==-1})[0],!!r}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,r=n.splitSections(e.localDescription.sdp);
+this._localIceCandidatesBuffer.forEach(function(i){var n=!i.candidate||0===Object.keys(i.candidate).length;if(n)for(var t=1;t-1&&(this.localStreams.splice(r,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,r){var i={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var n=0;n0;r.forEach(function(e,r){var a=t.transceivers[r],f=a.iceGatherer,u=a.iceTransport,s=a.dtlsTransport,l=a.localCapabilities,c=a.remoteCapabilities,d="0"===e.split("\n",1)[0].split(" ",2)[1];if(!d){var b=n.getIceParameters(e,i);if(o){var h=n.matchPrefix(e,"a=candidate:").map(function(e){return n.parseCandidate(e)}).filter(function(e){return"1"===e.component});h.length&&u.setRemoteCandidates(h)}var k=n.getDtlsParameters(e,i);o&&(k.role="server"),t.usingBundle&&0!==r||(u.start(f,b,o?"controlling":"controlled"),s.start(k));var _=t._getCommonCapabilities(l,c);t._transceive(a,_.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var a=arguments.length>1&&"function"==typeof arguments[1];if(a){var f=arguments[1];window.setTimeout(function(){f(),"new"===t.iceGatheringState&&(t.iceGatheringState="gathering"),t._emitBufferedCandidates()},0)}var u=Promise.resolve();return u.then(function(){a||("new"===t.iceGatheringState&&(t.iceGatheringState="gathering"),window.setTimeout(t._emitBufferedCandidates.bind(t),500))}),u},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var r=this,i=new MediaStream,t=[],o=n.splitSections(e.sdp),a=o.shift(),f=n.matchPrefix(a,"a=ice-lite").length>0;switch(this.usingBundle=n.matchPrefix(a,"a=group:BUNDLE ").length>0,o.forEach(function(o,u){var s,l,c,d,b,h,k,_,p,v,w,m,g=n.splitLines(o),y=g[0].substr(2).split(" "),E=y[0],S="0"===y[1],x=n.getDirection(o,a),O=n.parseRtpParameters(o);S||(w=n.getIceParameters(o,a),m=n.getDtlsParameters(o,a),m.role="client"),_=n.parseRtpEncodingParameters(o);var C=n.matchPrefix(o,"a=mid:");C=C.length?C[0].substr(6):n.generateIdentifier();var A,M=n.matchPrefix(o,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];M&&(A=M.value);var R=n.matchPrefix(o,"a=end-of-candidates").length>0,F=n.matchPrefix(o,"a=candidate:").map(function(e){return n.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||S)"answer"!==e.type||S||(s=r.transceivers[u],l=s.iceGatherer,c=s.iceTransport,d=s.dtlsTransport,b=s.rtpSender,h=s.rtpReceiver,k=s.sendEncodingParameters,p=s.localCapabilities,r.transceivers[u].recvEncodingParameters=_,r.transceivers[u].remoteCapabilities=O,r.transceivers[u].cname=A,(f||R)&&F.length&&c.setRemoteCandidates(F),r.usingBundle&&0!==u||(c.start(l,w,"controlling"),d.start(m)),r._transceive(s,"sendrecv"===x||"recvonly"===x,"sendrecv"===x||"sendonly"===x),!h||"sendrecv"!==x&&"sendonly"!==x?delete s.rtpReceiver:(v=h.track,t.push([v,h]),i.addTrack(v)));else{var T=r.usingBundle&&u>0?{iceGatherer:r.transceivers[0].iceGatherer,iceTransport:r.transceivers[0].iceTransport,dtlsTransport:r.transceivers[0].dtlsTransport}:r._createIceAndDtlsTransports(C,u);if(R&&T.iceTransport.setRemoteCandidates(F),p=RTCRtpReceiver.getCapabilities(E),k=[{ssrc:1001*(2*u+2)}],h=new RTCRtpReceiver(T.dtlsTransport,E),v=h.track,t.push([v,h]),i.addTrack(v),r.localStreams.length>0&&r.localStreams[0].getTracks().length>=u){var P=r.localStreams[0].getTracks()[u];b=new RTCRtpSender(P,T.dtlsTransport)}r.transceivers[u]={iceGatherer:T.iceGatherer,iceTransport:T.iceTransport,dtlsTransport:T.dtlsTransport,localCapabilities:p,remoteCapabilities:O,rtpSender:b,rtpReceiver:h,kind:E,mid:C,cname:A,sendEncodingParameters:k,recvEncodingParameters:_},r._transceive(r.transceivers[u],!1,"sendrecv"===x||"sendonly"===x)}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return i.getTracks().length&&(r.remoteStreams.push(i),window.setTimeout(function(){var e=new Event("addstream");e.stream=i,r.dispatchEvent(e),null!==r.onaddstream&&window.setTimeout(function(){r.onaddstream(e)},0),t.forEach(function(n){var t=n[0],o=n[1],a=new Event("track");a.track=t,a.receiver=o,a.streams=[i],r.dispatchEvent(e),null!==r.ontrack&&window.setTimeout(function(){r.ontrack(a)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var r=new Event("signalingstatechange");this.dispatchEvent(r),null!==this.onsignalingstatechange&&this.onsignalingstatechange(r)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,r=this,i={"new":0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){i[e.iceTransport.state]++,i[e.dtlsTransport.state]++}),i.connected+=i.completed,e="new",i.failed>0?e="failed":i.connecting>0||i.checking>0?e="connecting":i.disconnected>0?e="disconnected":i["new"]>0?e="new":(i.connected>0||i.completed>0)&&(e="connected"),e!==r.iceConnectionState){r.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this.dispatchEvent(n),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(n)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var r;1===arguments.length&&"function"!=typeof arguments[0]?r=arguments[0]:3===arguments.length&&(r=arguments[2]);var i=[],t=0,o=0;if(this.localStreams.length&&(t=this.localStreams[0].getAudioTracks().length,o=this.localStreams[0].getVideoTracks().length),r){if(r.mandatory||r.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==r.offerToReceiveAudio&&(t=r.offerToReceiveAudio),void 0!==r.offerToReceiveVideo&&(o=r.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){i.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?t>0:o>0}),"audio"===e.kind?t--:"video"===e.kind&&o--});t>0||o>0;)t>0&&(i.push({kind:"audio",wantReceive:!0}),t--),o>0&&(i.push({kind:"video",wantReceive:!0}),o--);var a=n.writeSessionBoilerplate(),f=[];i.forEach(function(r,i){var t,o,a=r.track,u=r.kind,s=n.generateIdentifier(),l=e.usingBundle&&i>0?{iceGatherer:f[0].iceGatherer,iceTransport:f[0].iceTransport,dtlsTransport:f[0].dtlsTransport}:e._createIceAndDtlsTransports(s,i),c=RTCRtpSender.getCapabilities(u),d=[{ssrc:1001*(2*i+1)}];a&&(t=new RTCRtpSender(a,l.dtlsTransport)),r.wantReceive&&(o=new RTCRtpReceiver(l.dtlsTransport,u)),f[i]={iceGatherer:l.iceGatherer,iceTransport:l.iceTransport,dtlsTransport:l.dtlsTransport,localCapabilities:c,remoteCapabilities:null,rtpSender:t,rtpReceiver:o,kind:u,mid:s,sendEncodingParameters:d,recvEncodingParameters:null}}),this.usingBundle&&(a+="a=group:BUNDLE "+f.map(function(e){return e.mid}).join(" ")+"\r\n"),i.forEach(function(r,i){var t=f[i];a+=n.writeMediaSection(t,t.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=f;var u=new RTCSessionDescription({type:"offer",sdp:a});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,u),Promise.resolve(u)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,r=n.writeSessionBoilerplate();this.usingBundle&&(r+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(i){var t=e._getCommonCapabilities(i.localCapabilities,i.remoteCapabilities);r+=n.writeMediaSection(i,t,"answer",e.localStreams[0])});var i=new RTCSessionDescription({type:"answer",sdp:r});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,i),Promise.resolve(i)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var r=e.sdpMLineIndex;if(e.sdpMid)for(var i=0;i0?n.parseCandidate(e.candidate):{};if("tcp"===o.protocol&&0===o.port)return;if("1"!==o.component)return;"endOfCandidates"===o.type&&(o={}),t.iceTransport.addRemoteCandidate(o);var a=n.splitSections(this.remoteDescription.sdp);a[r+1]+=(o.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=a.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(r){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(i){r[i]&&e.push(r[i].getStats())})});var r=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(i){var n=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(r){n.set(r,e[r]),n[r]=e[r]})}),r&&window.setTimeout(r,0,n),i(n)})})}},attachMediaStream:function(e,r){t("DEPRECATED, attachMediaStream will soon be removed."),e.srcObject=r},reattachMediaStream:function(e,r){t("DEPRECATED, reattachMediaStream will soon be removed."),e.srcObject=r.srcObject}};r.exports={shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:e("./getusermedia"),attachMediaStream:o.attachMediaStream,reattachMediaStream:o.reattachMediaStream}},{"../utils":352,"./getusermedia":348,sdp:339}],348:[function(e,r,i){"use strict";r.exports=function(){var e=function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}},r=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(i){return r(i)["catch"](function(r){return Promise.reject(e(r))})}}},{}],349:[function(e,r,i){"use strict";var n=e("../utils").log,t=e("../utils").browserDetails,o={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(r){var i=new Event("track");i.track=r,i.receiver={track:r},i.streams=[e.stream],this.dispatchEvent(i)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,r){if(t.version<38&&e&&e.iceServers){for(var i=[],n=0;n=i&&parseInt(n[i],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,e.minVersion=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1),e.minVersion=31;else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2),e.minVersion=38;else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1),e.minVersion=602}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2),e.minVersion=10547}return e.version0&&void 0!==arguments[0]?arguments[0]:null;return regeneratorRuntime.async(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this._fsm.can("start")){r.next=5;break}return r.next=3,regeneratorRuntime.awrap(this._fsm.start(e));case 3:r.next=9;break;case 5:return r.next=7,regeneratorRuntime.awrap(this._fsm.stop());case 7:return r.next=9,regeneratorRuntime.awrap(this._fsm.start(e));case 9:case"end":return r.stop()}},null,this)}},{key:"stop",value:function(){return regeneratorRuntime.async(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._fsm.can("stop")){e.next=3;break}return e.next=3,regeneratorRuntime.awrap(this._fsm.stop());case 3:case"end":return e.stop()}},null,this)}},{key:"_enableScan",value:function(e){var r;return regeneratorRuntime.async(function(i){for(;;)switch(i.prev=i.next){case 0:if(this._camera=e||this._camera,this._camera){i.next=3;break}throw new Error("Camera is not defined.");case 3:return i.next=5,regeneratorRuntime.awrap(this._camera.start());case 5:r=i.sent,this.video.srcObject=r,this._continuous&&this._scanner.start();case 8:case"end":return i.stop()}},null,this)}},{key:"_disableScan",value:function(){this.video.src="",this._scanner&&this._scanner.stop(),this._camera&&this._camera.stop()}},{key:"_configureVideo",value:function(e){if(e.video&&"VIDEO"!==e.video.tagName)throw new Error("Video must be a