New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rtc-beauty-plugin

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rtc-beauty-plugin - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "rtc-beauty-plugin",
"version": "0.0.6",
"version": "0.0.7",
"description": "rtc-beauty-plugin for TRTC SDK",

@@ -5,0 +5,0 @@ "main": "rtc-beauty-plugin.js",

## 功能描述
TRTC 可以通过插件,帮助开发者轻松实现基础美颜功能。用户可以调整美颜参数,实现自然的美颜效果。[点击此处](https://web.sdk.qcloud.com/trtc/webrtc/test/latest/beauty/index.html) 体验美颜效果。
TRTC 可以通过插件,帮助开发者轻松实现基础美颜功能。用户可以调整美颜参数,实现自然的美颜效果。[点击此处](https://web.sdk.qcloud.com/trtc/webrtc/demo/api-sample/improve-beauty.html) 体验美颜效果。

@@ -66,2 +66,4 @@ | 浏览器 | 版本 |

如果您想关闭美颜效果,将三个参数都设置为 0 即可。
#### Params:

@@ -77,2 +79,5 @@

beautyPlugin.setBeautyParam({ beauty: 0.5, brightness: 0.5, ruddy: 0.5 });
// 如果您想关闭美颜效果,将三个参数都设置为 0 即可,如果要重新开启,设置任意一个参数 > 0 即可打开美颜能力。
beautyPlugin.setBeautyParam({ beauty: 0, brightness: 0, ruddy: 0 });
```

@@ -79,0 +84,0 @@

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("trtc-js-sdk")):"function"==typeof define&&define.amd?define(["trtc-js-sdk"],e):(t=t||self).RTCBeautyPlugin=e(t.TRTC)}(this,(function(t){function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var a,u,s=function(t){return t&&t.Math==Math&&t},c=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof i&&i)||function(){return this}()||Function("return this")(),l=function(t){try{return!!t()}catch(e){return!0}},f=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,p={f:v&&!h.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:h},g=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,y=function(t){return d.call(t).slice(8,-1)},b="".split,m=l((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==y(t)?b.call(t,""):Object(t)}:Object,x=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},T=function(t){return m(x(t))},A=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t){return"function"==typeof t?t:void 0},E=function(t,e){return arguments.length<2?w(c[t]):c[t]&&c[t][e]},S=E("navigator","userAgent")||"",C=c.process,O=c.Deno,R=C&&C.versions||O&&O.version,I=R&&R.v8;I?u=(a=I.split("."))[0]<4?1:a[0]+a[1]:S&&(!(a=S.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=S.match(/Chrome\/(\d+)/))&&(u=a[1]);var _=u&&+u,P=!!Object.getOwnPropertySymbols&&!l((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&_&&_<41})),k=P&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,D=k?function(t){return"symbol"==typeof t}:function(t){var e=E("Symbol");return"function"==typeof e&&Object(t)instanceof e},U=function(t,e){try{Object.defineProperty(c,t,{value:e,configurable:!0,writable:!0})}catch(r){c[t]=e}return e},j=c["__core-js_shared__"]||U("__core-js_shared__",{}),L=o((function(t){(t.exports=function(t,e){return j[t]||(j[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.0",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),M=function(t){return Object(x(t))},F={}.hasOwnProperty,B=Object.hasOwn||function(t,e){return F.call(M(t),e)},N=0,Y=Math.random(),V=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++N+Y).toString(36)},W=L("wks"),G=c.Symbol,z=k?G:G&&G.withoutSetter||V,$=function(t){return B(W,t)&&(P||"string"==typeof W[t])||(P&&B(G,t)?W[t]=G[t]:W[t]=z("Symbol."+t)),W[t]},X=$("toPrimitive"),H=function(t,e){if(!A(t)||D(t))return t;var r,n=t[X];if(void 0!==n){if(void 0===e&&(e="default"),r=n.call(t,e),!A(r)||D(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&"function"==typeof(r=t.toString)&&!A(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!A(n=r.call(t)))return n;if("string"!==e&&"function"==typeof(r=t.toString)&&!A(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(t,e)},K=function(t){var e=H(t,"string");return D(e)?e:String(e)},q=c.document,J=A(q)&&A(q.createElement),Q=function(t){return J?q.createElement(t):{}},Z=!f&&!l((function(){return 7!=Object.defineProperty(Q("div"),"a",{get:function(){return 7}}).a})),tt=Object.getOwnPropertyDescriptor,et={f:f?tt:function(t,e){if(t=T(t),e=K(e),Z)try{return tt(t,e)}catch(r){}if(B(t,e))return g(!p.f.call(t,e),t[e])}},rt=function(t){if(!A(t))throw TypeError(String(t)+" is not an object");return t},nt=Object.defineProperty,it={f:f?nt:function(t,e,r){if(rt(t),e=K(e),rt(r),Z)try{return nt(t,e,r)}catch(n){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},ot=f?function(t,e,r){return it.f(t,e,g(1,r))}:function(t,e,r){return t[e]=r,t},at=Function.toString;"function"!=typeof j.inspectSource&&(j.inspectSource=function(t){return at.call(t)});var ut,st,ct,lt=j.inspectSource,ft=c.WeakMap,ht="function"==typeof ft&&/native code/.test(lt(ft)),vt=L("keys"),pt=function(t){return vt[t]||(vt[t]=V(t))},gt={},dt=c.WeakMap;if(ht||j.state){var yt=j.state||(j.state=new dt),bt=yt.get,mt=yt.has,xt=yt.set;ut=function(t,e){if(mt.call(yt,t))throw new TypeError("Object already initialized");return e.facade=t,xt.call(yt,t,e),e},st=function(t){return bt.call(yt,t)||{}},ct=function(t){return mt.call(yt,t)}}else{var Tt=pt("state");gt[Tt]=!0,ut=function(t,e){if(B(t,Tt))throw new TypeError("Object already initialized");return e.facade=t,ot(t,Tt,e),e},st=function(t){return B(t,Tt)?t[Tt]:{}},ct=function(t){return B(t,Tt)}}var At={set:ut,get:st,has:ct,enforce:function(t){return ct(t)?st(t):ut(t,{})},getterFor:function(t){return function(e){var r;if(!A(e)||(r=st(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},wt=o((function(t){var e=At.get,r=At.enforce,n=String(String).split("String");(t.exports=function(t,e,i,o){var a,u=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,l=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof e||B(i,"name")||ot(i,"name",e),(a=r(i)).source||(a.source=n.join("string"==typeof e?e:""))),t!==c?(u?!l&&t[e]&&(s=!0):delete t[e],s?t[e]=i:ot(t,e,i)):s?t[e]=i:U(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||lt(this)}))})),Et=Math.ceil,St=Math.floor,Ct=function(t){return isNaN(t=+t)?0:(t>0?St:Et)(t)},Ot=Math.min,Rt=function(t){return t>0?Ot(Ct(t),9007199254740991):0},It=Math.max,_t=Math.min,Pt=function(t,e){var r=Ct(t);return r<0?It(r+e,0):_t(r,e)},kt=function(t){return function(e,r,n){var i,o=T(e),a=Rt(o.length),u=Pt(n,a);if(t&&r!=r){for(;a>u;)if((i=o[u++])!=i)return!0}else for(;a>u;u++)if((t||u in o)&&o[u]===r)return t||u||0;return!t&&-1}},Dt={includes:kt(!0),indexOf:kt(!1)},Ut=Dt.indexOf,jt=function(t,e){var r,n=T(t),i=0,o=[];for(r in n)!B(gt,r)&&B(n,r)&&o.push(r);for(;e.length>i;)B(n,r=e[i++])&&(~Ut(o,r)||o.push(r));return o},Lt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mt=Lt.concat("length","prototype"),Ft={f:Object.getOwnPropertyNames||function(t){return jt(t,Mt)}},Bt={f:Object.getOwnPropertySymbols},Nt=E("Reflect","ownKeys")||function(t){var e=Ft.f(rt(t)),r=Bt.f;return r?e.concat(r(t)):e},Yt=function(t,e){for(var r=Nt(e),n=it.f,i=et.f,o=0;o<r.length;o++){var a=r[o];B(t,a)||n(t,a,i(e,a))}},Vt=/#|\.prototype\./,Wt=function(t,e){var r=zt[Gt(t)];return r==Xt||r!=$t&&("function"==typeof e?l(e):!!e)},Gt=Wt.normalize=function(t){return String(t).replace(Vt,".").toLowerCase()},zt=Wt.data={},$t=Wt.NATIVE="N",Xt=Wt.POLYFILL="P",Ht=Wt,Kt=et.f,qt=function(t,e){var r,n,i,o,a,u=t.target,s=t.global,l=t.stat;if(r=s?c:l?c[u]||U(u,{}):(c[u]||{}).prototype)for(n in e){if(o=e[n],i=t.noTargetGet?(a=Kt(r,n))&&a.value:r[n],!Ht(s?n:u+(l?".":"#")+n,t.forced)&&void 0!==i){if(typeof o==typeof i)continue;Yt(o,i)}(t.sham||i&&i.sham)&&ot(o,"sham",!0),wt(r,n,o,t)}},Jt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Qt=function(t,e,r){if(Jt(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},Zt=Array.isArray||function(t){return"Array"==y(t)},te=$("species"),ee=function(t,e){return new(function(t){var e;return Zt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Zt(e.prototype)?A(e)&&null===(e=e[te])&&(e=void 0):e=void 0),void 0===e?Array:e}(t))(0===e?0:e)},re=[].push,ne=function(t){var e=1==t,r=2==t,n=3==t,i=4==t,o=6==t,a=7==t,u=5==t||o;return function(s,c,l,f){for(var h,v,p=M(s),g=m(p),d=Qt(c,l,3),y=Rt(g.length),b=0,x=f||ee,T=e?x(s,y):r||a?x(s,0):void 0;y>b;b++)if((u||b in g)&&(v=d(h=g[b],b,p),t))if(e)T[b]=v;else if(v)switch(t){case 3:return!0;case 5:return h;case 6:return b;case 2:re.call(T,h)}else switch(t){case 4:return!1;case 7:re.call(T,h)}return o?-1:n||i?i:T}},ie={forEach:ne(0),map:ne(1),filter:ne(2),some:ne(3),every:ne(4),find:ne(5),findIndex:ne(6),filterReject:ne(7)},oe=$("species"),ae=ie.filter,ue=function(t){return _>=51||!l((function(){var e=[];return(e.constructor={})[oe]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("filter");qt({target:"Array",proto:!0,forced:!ue},{filter:function(t){return ae(this,t,arguments.length>1?arguments[1]:void 0)}});var se=Date.prototype,ce=se.toString,le=se.getTime;"Invalid Date"!=String(new Date(NaN))&&wt(se,"toString",(function(){var t=le.call(this);return t==t?ce.call(this):"Invalid Date"}));var fe=[].slice,he={},ve=function(t,e,r){if(!(e in he)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";he[e]=Function("C,a","return new C("+n.join(",")+")")}return he[e](t,r)},pe=Function.bind||function(t){var e=Jt(this),r=fe.call(arguments,1),n=function(){var i=r.concat(fe.call(arguments));return this instanceof n?ve(e,i.length,i):e.apply(t,i)};return A(e.prototype)&&(n.prototype=e.prototype),n};qt({target:"Function",proto:!0},{bind:pe});var ge=[].slice,de=/MSIE .\./.test(S),ye=function(t){return function(e,r){var n=arguments.length>2,i=n?ge.call(arguments,2):void 0;return t(n?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,r)}};qt({global:!0,bind:!0,forced:de},{setTimeout:ye(c.setTimeout),setInterval:ye(c.setInterval)});var be,me=Object.keys||function(t){return jt(t,Lt)},xe=f?Object.defineProperties:function(t,e){rt(t);for(var r,n=me(e),i=n.length,o=0;i>o;)it.f(t,r=n[o++],e[r]);return t},Te=E("document","documentElement"),Ae=pt("IE_PROTO"),we=function(){},Ee=function(t){return"<script>"+t+"<\/script>"},Se=function(t){t.write(Ee("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ce=function(){try{be=new ActiveXObject("htmlfile")}catch(e){}Ce=document.domain&&be?Se(be):function(){var t,e=Q("iframe");if(e.style)return e.style.display="none",Te.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Ee("document.F=Object")),t.close(),t.F}()||Se(be);for(var t=Lt.length;t--;)delete Ce.prototype[Lt[t]];return Ce()};gt[Ae]=!0;var Oe=Object.create||function(t,e){var r;return null!==t?(we.prototype=rt(t),r=new we,we.prototype=null,r[Ae]=t):r=Ce(),void 0===e?r:xe(r,e)},Re=$("unscopables"),Ie=Array.prototype;null==Ie[Re]&&it.f(Ie,Re,{configurable:!0,value:Oe(null)});var _e,Pe,ke,De=function(t){Ie[Re][t]=!0},Ue={},je=!l((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Le=pt("IE_PROTO"),Me=Object.prototype,Fe=je?Object.getPrototypeOf:function(t){return t=M(t),B(t,Le)?t[Le]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Me:null},Be=$("iterator"),Ne=!1;[].keys&&("next"in(ke=[].keys())?(Pe=Fe(Fe(ke)))!==Object.prototype&&(_e=Pe):Ne=!0),(null==_e||l((function(){var t={};return _e[Be].call(t)!==t})))&&(_e={}),B(_e,Be)||ot(_e,Be,(function(){return this}));var Ye={IteratorPrototype:_e,BUGGY_SAFARI_ITERATORS:Ne},Ve=it.f,We=$("toStringTag"),Ge=function(t,e,r){t&&!B(t=r?t:t.prototype,We)&&Ve(t,We,{configurable:!0,value:e})},ze=Ye.IteratorPrototype,$e=function(){return this},Xe=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(n){}return function(r,n){return rt(r),function(t){if(!A(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),He=Ye.IteratorPrototype,Ke=Ye.BUGGY_SAFARI_ITERATORS,qe=$("iterator"),Je=function(){return this},Qe=function(t,e,r,n,i,o,a){!function(t,e,r){var n=e+" Iterator";t.prototype=Oe(ze,{next:g(1,r)}),Ge(t,n,!1),Ue[n]=$e}(r,e,n);var u,s,c,l=function(t){if(t===i&&d)return d;if(!Ke&&t in v)return v[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},f=e+" Iterator",h=!1,v=t.prototype,p=v[qe]||v["@@iterator"]||i&&v[i],d=!Ke&&p||l(i),y="Array"==e&&v.entries||p;if(y&&(u=Fe(y.call(new t)),He!==Object.prototype&&u.next&&(Fe(u)!==He&&(Xe?Xe(u,He):"function"!=typeof u[qe]&&ot(u,qe,Je)),Ge(u,f,!0))),"values"==i&&p&&"values"!==p.name&&(h=!0,d=function(){return p.call(this)}),v[qe]!==d&&ot(v,qe,d),Ue[e]=d,i)if(s={values:l("values"),keys:o?d:l("keys"),entries:l("entries")},a)for(c in s)(Ke||h||!(c in v))&&wt(v,c,s[c]);else qt({target:e,proto:!0,forced:Ke||h},s);return s},Ze=At.set,tr=At.getterFor("Array Iterator"),er=Qe(Array,"Array",(function(t,e){Ze(this,{type:"Array Iterator",target:T(t),index:0,kind:e})}),(function(){var t=tr(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");Ue.Arguments=Ue.Array,De("keys"),De("values"),De("entries");var rr=Ft.f,nr={}.toString,ir="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],or={f:function(t){return ir&&"[object Window]"==nr.call(t)?function(t){try{return rr(t)}catch(e){return ir.slice()}}(t):rr(T(t))}},ar=!l((function(){return Object.isExtensible(Object.preventExtensions({}))})),ur=o((function(t){var e=it.f,r=!1,n=V("meta"),i=0,o=Object.isExtensible||function(){return!0},a=function(t){e(t,n,{value:{objectID:"O"+i++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},r=!0;var t=Ft.f,e=[].splice,i={};i[n]=1,t(i).length&&(Ft.f=function(r){for(var i=t(r),o=0,a=i.length;o<a;o++)if(i[o]===n){e.call(i,o,1);break}return i},qt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:or.f}))},fastKey:function(t,e){if(!A(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!B(t,n)){if(!o(t))return"F";if(!e)return"E";a(t)}return t[n].objectID},getWeakData:function(t,e){if(!B(t,n)){if(!o(t))return!0;if(!e)return!1;a(t)}return t[n].weakData},onFreeze:function(t){return ar&&r&&o(t)&&!B(t,n)&&a(t),t}};gt[n]=!0})),sr=(ur.enable,ur.fastKey,ur.getWeakData,ur.onFreeze,$("iterator")),cr=Array.prototype,lr=function(t){return void 0!==t&&(Ue.Array===t||cr[sr]===t)},fr={};fr[$("toStringTag")]="z";var hr="[object z]"===String(fr),vr=$("toStringTag"),pr="Arguments"==y(function(){return arguments}()),gr=hr?y:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(r){}}(e=Object(t),vr))?r:pr?y(e):"Object"==(n=y(e))&&"function"==typeof e.callee?"Arguments":n},dr=$("iterator"),yr=function(t){if(null!=t)return t[dr]||t["@@iterator"]||Ue[gr(t)]},br=function(t){var e=t.return;if(void 0!==e)return rt(e.call(t)).value},mr=function(t,e){this.stopped=t,this.result=e},xr=function(t,e,r){var n,i,o,a,u,s,c,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_ITERATOR),v=!(!r||!r.INTERRUPTED),p=Qt(e,l,1+f+v),g=function(t){return n&&br(n),new mr(!0,t)},d=function(t){return f?(rt(t),v?p(t[0],t[1],g):p(t[0],t[1])):v?p(t,g):p(t)};if(h)n=t;else{if("function"!=typeof(i=yr(t)))throw TypeError("Target is not iterable");if(lr(i)){for(o=0,a=Rt(t.length);a>o;o++)if((u=d(t[o]))&&u instanceof mr)return u;return new mr(!1)}n=i.call(t)}for(s=n.next;!(c=s.call(n)).done;){try{u=d(c.value)}catch(y){throw br(n),y}if("object"==typeof u&&u&&u instanceof mr)return u}return new mr(!1)},Tr=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},Ar=$("iterator"),wr=!1;try{var Er=0,Sr={next:function(){return{done:!!Er++}},return:function(){wr=!0}};Sr[Ar]=function(){return this},Array.from(Sr,(function(){throw 2}))}catch(qa){}var Cr=function(t,e){if(!e&&!wr)return!1;var r=!1;try{var n={};n[Ar]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(qa){}return r},Or=function(t,e,r){var n,i;return Xe&&"function"==typeof(n=e.constructor)&&n!==r&&A(i=n.prototype)&&i!==r.prototype&&Xe(t,i),t},Rr=function(t,e,r){for(var n in e)wt(t,n,e[n],r);return t},Ir=$("species"),_r=function(t){var e=E(t),r=it.f;f&&e&&!e[Ir]&&r(e,Ir,{configurable:!0,get:function(){return this}})},Pr=it.f,kr=ur.fastKey,Dr=At.set,Ur=At.getterFor,jr=(function(t,e,r){var n=-1!==t.indexOf("Map"),i=-1!==t.indexOf("Weak"),o=n?"set":"add",a=c[t],u=a&&a.prototype,s=a,f={},h=function(t){var e=u[t];wt(u,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(i&&!A(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return i&&!A(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(i&&!A(t))&&e.call(this,0===t?0:t)}:function(t,r){return e.call(this,0===t?0:t,r),this})};if(Ht(t,"function"!=typeof a||!(i||u.forEach&&!l((function(){(new a).entries().next()})))))s=r.getConstructor(e,t,n,o),ur.enable();else if(Ht(t,!0)){var v=new s,p=v[o](i?{}:-0,1)!=v,g=l((function(){v.has(1)})),d=Cr((function(t){new a(t)})),y=!i&&l((function(){for(var t=new a,e=5;e--;)t[o](e,e);return!t.has(-0)}));d||((s=e((function(e,r){Tr(e,s,t);var i=Or(new a,e,s);return null!=r&&xr(r,i[o],{that:i,AS_ENTRIES:n}),i}))).prototype=u,u.constructor=s),(g||y)&&(h("delete"),h("has"),n&&h("get")),(y||p)&&h(o),i&&u.clear&&delete u.clear}f[t]=s,qt({global:!0,forced:s!=a},f),Ge(s,t),i||r.setStrong(s,t,n)}("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,e,r,n){var i=t((function(t,o){Tr(t,i,e),Dr(t,{type:e,index:Oe(null),first:void 0,last:void 0,size:0}),f||(t.size=0),null!=o&&xr(o,t[n],{that:t,AS_ENTRIES:r})})),o=Ur(e),a=function(t,e,r){var n,i,a=o(t),s=u(t,e);return s?s.value=r:(a.last=s={index:i=kr(e,!0),key:e,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=s),n&&(n.next=s),f?a.size++:t.size++,"F"!==i&&(a.index[i]=s)),t},u=function(t,e){var r,n=o(t),i=kr(e);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==e)return r};return Rr(i.prototype,{clear:function(){for(var t=o(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,f?t.size=0:this.size=0},delete:function(t){var e=o(this),r=u(this,t);if(r){var n=r.next,i=r.previous;delete e.index[r.index],r.removed=!0,i&&(i.next=n),n&&(n.previous=i),e.first==r&&(e.first=n),e.last==r&&(e.last=i),f?e.size--:this.size--}return!!r},forEach:function(t){for(var e,r=o(this),n=Qt(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!u(this,t)}}),Rr(i.prototype,r?{get:function(t){var e=u(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),f&&Pr(i.prototype,"size",{get:function(){return o(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Ur(e),o=Ur(n);Qe(t,e,(function(t,e){Dr(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),_r(e)}}),hr?{}.toString:function(){return"[object "+gr(this)+"]"});hr||wt(Object.prototype,"toString",jr,{unsafe:!0});var Lr=function(t){if(D(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},Mr=function(t){return function(e,r){var n,i,o=Lr(x(e)),a=Ct(r),u=o.length;return a<0||a>=u?t?"":void 0:(n=o.charCodeAt(a))<55296||n>56319||a+1===u||(i=o.charCodeAt(a+1))<56320||i>57343?t?o.charAt(a):n:t?o.slice(a,a+2):i-56320+(n-55296<<10)+65536}},Fr={codeAt:Mr(!1),charAt:Mr(!0)},Br=Fr.charAt,Nr=At.set,Yr=At.getterFor("String Iterator");Qe(String,"String",(function(t){Nr(this,{type:"String Iterator",string:Lr(t),index:0})}),(function(){var t,e=Yr(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Br(r,n),e.index+=t.length,{value:t,done:!1})}));var Vr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Wr=$("iterator"),Gr=$("toStringTag"),zr=er.values;for(var $r in Vr){var Xr=c[$r],Hr=Xr&&Xr.prototype;if(Hr){if(Hr[Wr]!==zr)try{ot(Hr,Wr,zr)}catch(qa){Hr[Wr]=zr}if(Hr[Gr]||ot(Hr,Gr,$r),Vr[$r])for(var Kr in er)if(Hr[Kr]!==er[Kr])try{ot(Hr,Kr,er[Kr])}catch(qa){Hr[Kr]=er[Kr]}}}var qr="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Jr=function(t){if(void 0===t)return 0;var e=Ct(t),r=Rt(e);if(e!==r)throw RangeError("Wrong length or index");return r},Qr=Math.abs,Zr=Math.pow,tn=Math.floor,en=Math.log,rn=Math.LN2,nn=function(t,e,r){var n,i,o,a=new Array(r),u=8*r-e-1,s=(1<<u)-1,c=s>>1,l=23===e?Zr(2,-24)-Zr(2,-77):0,f=t<0||0===t&&1/t<0?1:0,h=0;for((t=Qr(t))!=t||Infinity===t?(i=t!=t?1:0,n=s):(n=tn(en(t)/rn),t*(o=Zr(2,-n))<1&&(n--,o*=2),(t+=n+c>=1?l/o:l*Zr(2,1-c))*o>=2&&(n++,o/=2),n+c>=s?(i=0,n=s):n+c>=1?(i=(t*o-1)*Zr(2,e),n+=c):(i=t*Zr(2,c-1)*Zr(2,e),n=0));e>=8;a[h++]=255&i,i/=256,e-=8);for(n=n<<e|i,u+=e;u>0;a[h++]=255&n,n/=256,u-=8);return a[--h]|=128*f,a},on=function(t,e){var r,n=t.length,i=8*n-e-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=t[s--],l=127&c;for(c>>=7;u>0;l=256*l+t[s],s--,u-=8);for(r=l&(1<<-u)-1,l>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===l)l=1-a;else{if(l===o)return r?NaN:c?-Infinity:Infinity;r+=Zr(2,e),l-=a}return(c?-1:1)*r*Zr(2,l-e)},an=function(t){for(var e=M(this),r=Rt(e.length),n=arguments.length,i=Pt(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:Pt(o,r);a>i;)e[i++]=t;return e},un=Ft.f,sn=it.f,cn=At.get,ln=At.set,fn=c.ArrayBuffer,hn=fn,vn=c.DataView,pn=vn&&vn.prototype,gn=Object.prototype,dn=c.RangeError,yn=nn,bn=on,mn=function(t){return[255&t]},xn=function(t){return[255&t,t>>8&255]},Tn=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},An=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},wn=function(t){return yn(t,23,4)},En=function(t){return yn(t,52,8)},Sn=function(t,e){sn(t.prototype,e,{get:function(){return cn(this)[e]}})},Cn=function(t,e,r,n){var i=Jr(r),o=cn(t);if(i+e>o.byteLength)throw dn("Wrong index");var a=cn(o.buffer).bytes,u=i+o.byteOffset,s=a.slice(u,u+e);return n?s:s.reverse()},On=function(t,e,r,n,i,o){var a=Jr(r),u=cn(t);if(a+e>u.byteLength)throw dn("Wrong index");for(var s=cn(u.buffer).bytes,c=a+u.byteOffset,l=n(+i),f=0;f<e;f++)s[c+f]=l[o?f:e-f-1]};if(qr){if(!l((function(){fn(1)}))||!l((function(){new fn(-1)}))||l((function(){return new fn,new fn(1.5),new fn(NaN),"ArrayBuffer"!=fn.name}))){for(var Rn,In=(hn=function(t){return Tr(this,hn),new fn(Jr(t))}).prototype=fn.prototype,_n=un(fn),Pn=0;_n.length>Pn;)(Rn=_n[Pn++])in hn||ot(hn,Rn,fn[Rn]);In.constructor=hn}Xe&&Fe(pn)!==gn&&Xe(pn,gn);var kn=new vn(new hn(2)),Dn=pn.setInt8;kn.setInt8(0,2147483648),kn.setInt8(1,2147483649),!kn.getInt8(0)&&kn.getInt8(1)||Rr(pn,{setInt8:function(t,e){Dn.call(this,t,e<<24>>24)},setUint8:function(t,e){Dn.call(this,t,e<<24>>24)}},{unsafe:!0})}else hn=function(t){Tr(this,hn,"ArrayBuffer");var e=Jr(t);ln(this,{bytes:an.call(new Array(e),0),byteLength:e}),f||(this.byteLength=e)},vn=function(t,e,r){Tr(this,vn,"DataView"),Tr(t,hn,"DataView");var n=cn(t).byteLength,i=Ct(e);if(i<0||i>n)throw dn("Wrong offset");if(i+(r=void 0===r?n-i:Rt(r))>n)throw dn("Wrong length");ln(this,{buffer:t,byteLength:r,byteOffset:i}),f||(this.buffer=t,this.byteLength=r,this.byteOffset=i)},f&&(Sn(hn,"byteLength"),Sn(vn,"buffer"),Sn(vn,"byteLength"),Sn(vn,"byteOffset")),Rr(vn.prototype,{getInt8:function(t){return Cn(this,1,t)[0]<<24>>24},getUint8:function(t){return Cn(this,1,t)[0]},getInt16:function(t){var e=Cn(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Cn(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return An(Cn(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return An(Cn(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return bn(Cn(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return bn(Cn(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){On(this,1,t,mn,e)},setUint8:function(t,e){On(this,1,t,mn,e)},setInt16:function(t,e){On(this,2,t,xn,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){On(this,2,t,xn,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){On(this,4,t,Tn,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){On(this,4,t,Tn,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){On(this,4,t,wn,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){On(this,8,t,En,e,arguments.length>2?arguments[2]:void 0)}});Ge(hn,"ArrayBuffer"),Ge(vn,"DataView");var Un={ArrayBuffer:hn,DataView:vn},jn=$("species"),Ln=function(t,e){var r,n=rt(t).constructor;return void 0===n||null==(r=rt(n)[jn])?e:Jt(r)},Mn=Un.ArrayBuffer,Fn=Un.DataView,Bn=Mn.prototype.slice,Nn=l((function(){return!new Mn(2).slice(1,void 0).byteLength}));qt({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Nn},{slice:function(t,e){if(void 0!==Bn&&void 0===e)return Bn.call(rt(this),t);for(var r=rt(this).byteLength,n=Pt(t,r),i=Pt(void 0===e?r:e,r),o=new(Ln(this,Mn))(Rt(i-n)),a=new Fn(this),u=new Fn(o),s=0;n<i;)u.setUint8(s++,a.getUint8(n++));return o}});var Yn,Vn,Wn,Gn=it.f,zn=c.Int8Array,$n=zn&&zn.prototype,Xn=c.Uint8ClampedArray,Hn=Xn&&Xn.prototype,Kn=zn&&Fe(zn),qn=$n&&Fe($n),Jn=Object.prototype,Qn=Jn.isPrototypeOf,Zn=$("toStringTag"),ti=V("TYPED_ARRAY_TAG"),ei=V("TYPED_ARRAY_CONSTRUCTOR"),ri=qr&&!!Xe&&"Opera"!==gr(c.opera),ni=!1,ii={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},oi={BigInt64Array:8,BigUint64Array:8},ai=function(t){if(!A(t))return!1;var e=gr(t);return B(ii,e)||B(oi,e)};for(Yn in ii)(Wn=(Vn=c[Yn])&&Vn.prototype)?ot(Wn,ei,Vn):ri=!1;for(Yn in oi)(Wn=(Vn=c[Yn])&&Vn.prototype)&&ot(Wn,ei,Vn);if((!ri||"function"!=typeof Kn||Kn===Function.prototype)&&(Kn=function(){throw TypeError("Incorrect invocation")},ri))for(Yn in ii)c[Yn]&&Xe(c[Yn],Kn);if((!ri||!qn||qn===Jn)&&(qn=Kn.prototype,ri))for(Yn in ii)c[Yn]&&Xe(c[Yn].prototype,qn);if(ri&&Fe(Hn)!==qn&&Xe(Hn,qn),f&&!B(qn,Zn))for(Yn in ni=!0,Gn(qn,Zn,{get:function(){return A(this)?this[ti]:void 0}}),ii)c[Yn]&&ot(c[Yn],ti,Yn);var ui={NATIVE_ARRAY_BUFFER_VIEWS:ri,TYPED_ARRAY_CONSTRUCTOR:ei,TYPED_ARRAY_TAG:ni&&ti,aTypedArray:function(t){if(ai(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(Xe&&!Qn.call(Kn,t))throw TypeError("Target is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r){if(f){if(r)for(var n in ii){var i=c[n];if(i&&B(i.prototype,t))try{delete i.prototype[t]}catch(qa){}}qn[t]&&!r||wt(qn,t,r?e:ri&&$n[t]||e)}},exportTypedArrayStaticMethod:function(t,e,r){var n,i;if(f){if(Xe){if(r)for(n in ii)if((i=c[n])&&B(i,t))try{delete i[t]}catch(qa){}if(Kn[t]&&!r)return;try{return wt(Kn,t,r?e:ri&&Kn[t]||e)}catch(qa){}}for(n in ii)!(i=c[n])||i[t]&&!r||wt(i,t,e)}},isView:function(t){if(!A(t))return!1;var e=gr(t);return"DataView"===e||B(ii,e)||B(oi,e)},isTypedArray:ai,TypedArray:Kn,TypedArrayPrototype:qn},si=ui.NATIVE_ARRAY_BUFFER_VIEWS,ci=c.ArrayBuffer,li=c.Int8Array,fi=!si||!l((function(){li(1)}))||!l((function(){new li(-1)}))||!Cr((function(t){new li,new li(null),new li(1.5),new li(t)}),!0)||l((function(){return 1!==new li(new ci(2),1,void 0).length})),hi=Math.floor,vi=function(t,e){var r=function(t){var e=Ct(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}(t);if(r%e)throw RangeError("Wrong offset");return r},pi=ui.aTypedArrayConstructor,gi=function(t){var e,r,n,i,o,a,u=M(t),s=arguments.length,c=s>1?arguments[1]:void 0,l=void 0!==c,f=yr(u);if(null!=f&&!lr(f))for(a=(o=f.call(u)).next,u=[];!(i=a.call(o)).done;)u.push(i.value);for(l&&s>2&&(c=Qt(c,arguments[2],2)),r=Rt(u.length),n=new(pi(this))(r),e=0;r>e;e++)n[e]=l?c(u[e],e):u[e];return n};o((function(t){var e=Ft.f,r=ie.forEach,n=At.get,i=At.set,o=it.f,a=et.f,u=Math.round,s=c.RangeError,l=Un.ArrayBuffer,h=Un.DataView,v=ui.NATIVE_ARRAY_BUFFER_VIEWS,p=ui.TYPED_ARRAY_CONSTRUCTOR,d=ui.TYPED_ARRAY_TAG,y=ui.TypedArray,b=ui.TypedArrayPrototype,m=ui.aTypedArrayConstructor,x=ui.isTypedArray,T=function(t,e){for(var r=0,n=e.length,i=new(m(t))(n);n>r;)i[r]=e[r++];return i},w=function(t,e){o(t,e,{get:function(){return n(this)[e]}})},E=function(t){var e;return t instanceof l||"ArrayBuffer"==(e=gr(t))||"SharedArrayBuffer"==e},S=function(t,e){return x(t)&&!D(e)&&e in t&&(!A(r=+e)&&isFinite(r)&&hi(r)===r)&&e>=0;var r},C=function(t,e){return e=K(e),S(t,e)?g(2,t[e]):a(t,e)},O=function(t,e,r){return e=K(e),!(S(t,e)&&A(r)&&B(r,"value"))||B(r,"get")||B(r,"set")||r.configurable||B(r,"writable")&&!r.writable||B(r,"enumerable")&&!r.enumerable?o(t,e,r):(t[e]=r.value,t)};f?(v||(et.f=C,it.f=O,w(b,"buffer"),w(b,"byteOffset"),w(b,"byteLength"),w(b,"length")),qt({target:"Object",stat:!0,forced:!v},{getOwnPropertyDescriptor:C,defineProperty:O}),t.exports=function(t,a,f){var g=t.match(/\d+$/)[0]/8,m=t+(f?"Clamped":"")+"Array",w="get"+t,S="set"+t,C=c[m],O=C,R=O&&O.prototype,I={},_=function(t,e){o(t,e,{get:function(){return function(t,e){var r=n(t);return r.view[w](e*g+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var i=n(t);f&&(r=(r=u(r))<0?0:r>255?255:255&r),i.view[S](e*g+i.byteOffset,r,!0)}(this,e,t)},enumerable:!0})};v?fi&&(O=a((function(t,e,r,n){return Tr(t,O,m),Or(A(e)?E(e)?void 0!==n?new C(e,vi(r,g),n):void 0!==r?new C(e,vi(r,g)):new C(e):x(e)?T(O,e):gi.call(O,e):new C(Jr(e)),t,O)})),Xe&&Xe(O,y),r(e(C),(function(t){t in O||ot(O,t,C[t])})),O.prototype=R):(O=a((function(t,e,r,n){Tr(t,O,m);var o,a,u,c=0,f=0;if(A(e)){if(!E(e))return x(e)?T(O,e):gi.call(O,e);o=e,f=vi(r,g);var v=e.byteLength;if(void 0===n){if(v%g)throw s("Wrong length");if((a=v-f)<0)throw s("Wrong length")}else if((a=Rt(n)*g)+f>v)throw s("Wrong length");u=a/g}else u=Jr(e),o=new l(a=u*g);for(i(t,{buffer:o,byteOffset:f,byteLength:a,length:u,view:new h(o)});c<u;)_(t,c++)})),Xe&&Xe(O,y),R=O.prototype=Oe(b)),R.constructor!==O&&ot(R,"constructor",O),ot(R,p,O),d&&ot(R,d,m),I[m]=O,qt({global:!0,forced:O!=C,sham:!v},I),"BYTES_PER_ELEMENT"in O||ot(O,"BYTES_PER_ELEMENT",g),"BYTES_PER_ELEMENT"in R||ot(R,"BYTES_PER_ELEMENT",g),_r(m)}):t.exports=function(){}}))("Float32",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var di=Math.min,yi=[].copyWithin||function(t,e){var r=M(this),n=Rt(r.length),i=Pt(t,n),o=Pt(e,n),a=arguments.length>2?arguments[2]:void 0,u=di((void 0===a?n:Pt(a,n))-o,n-i),s=1;for(o<i&&i<o+u&&(s=-1,o+=u-1,i+=u-1);u-- >0;)o in r?r[i]=r[o]:delete r[i],i+=s,o+=s;return r},bi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("copyWithin",(function(t,e){return yi.call(bi(this),t,e,arguments.length>2?arguments[2]:void 0)}));var mi=ie.every,xi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("every",(function(t){return mi(xi(this),t,arguments.length>1?arguments[1]:void 0)}));var Ti=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("fill",(function(t){return an.apply(Ti(this),arguments)}));var Ai=ui.TYPED_ARRAY_CONSTRUCTOR,wi=ui.aTypedArrayConstructor,Ei=function(t){return wi(Ln(t,t[Ai]))},Si=function(t,e){return function(t,e){for(var r=0,n=e.length,i=new t(n);n>r;)i[r]=e[r++];return i}(Ei(t),e)},Ci=ie.filter,Oi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("filter",(function(t){var e=Ci(Oi(this),t,arguments.length>1?arguments[1]:void 0);return Si(this,e)}));var Ri=ie.find,Ii=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("find",(function(t){return Ri(Ii(this),t,arguments.length>1?arguments[1]:void 0)}));var _i=ie.findIndex,Pi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("findIndex",(function(t){return _i(Pi(this),t,arguments.length>1?arguments[1]:void 0)}));var ki=ie.forEach,Di=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("forEach",(function(t){ki(Di(this),t,arguments.length>1?arguments[1]:void 0)}));var Ui=Dt.includes,ji=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("includes",(function(t){return Ui(ji(this),t,arguments.length>1?arguments[1]:void 0)}));var Li=Dt.indexOf,Mi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("indexOf",(function(t){return Li(Mi(this),t,arguments.length>1?arguments[1]:void 0)}));var Fi=$("iterator"),Bi=c.Uint8Array,Ni=er.values,Yi=er.keys,Vi=er.entries,Wi=ui.aTypedArray,Gi=ui.exportTypedArrayMethod,zi=Bi&&Bi.prototype[Fi],$i=!!zi&&("values"==zi.name||null==zi.name),Xi=function(){return Ni.call(Wi(this))};Gi("entries",(function(){return Vi.call(Wi(this))})),Gi("keys",(function(){return Yi.call(Wi(this))})),Gi("values",Xi,!$i),Gi(Fi,Xi,!$i);var Hi=ui.aTypedArray,Ki=[].join;(0,ui.exportTypedArrayMethod)("join",(function(t){return Ki.apply(Hi(this),arguments)}));var qi=function(t,e){var r=[][t];return!!r&&l((function(){r.call(null,e||function(){throw 1},1)}))},Ji=Math.min,Qi=[].lastIndexOf,Zi=!!Qi&&1/[1].lastIndexOf(1,-0)<0,to=qi("lastIndexOf"),eo=Zi||!to?function(t){if(Zi)return Qi.apply(this,arguments)||0;var e=T(this),r=Rt(e.length),n=r-1;for(arguments.length>1&&(n=Ji(n,Ct(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:Qi,ro=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("lastIndexOf",(function(t){return eo.apply(ro(this),arguments)}));var no=ie.map,io=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("map",(function(t){return no(io(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(Ei(t))(e)}))}));var oo=function(t){return function(e,r,n,i){Jt(r);var o=M(e),a=m(o),u=Rt(o.length),s=t?u-1:0,c=t?-1:1;if(n<2)for(;;){if(s in a){i=a[s],s+=c;break}if(s+=c,t?s<0:u<=s)throw TypeError("Reduce of empty array with no initial value")}for(;t?s>=0:u>s;s+=c)s in a&&(i=r(i,a[s],s,o));return i}},ao={left:oo(!1),right:oo(!0)},uo=ao.left,so=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("reduce",(function(t){return uo(so(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var co=ao.right,lo=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("reduceRight",(function(t){return co(lo(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var fo=ui.aTypedArray,ho=ui.exportTypedArrayMethod,vo=Math.floor;ho("reverse",(function(){for(var t,e=fo(this).length,r=vo(e/2),n=0;n<r;)t=this[n],this[n++]=this[--e],this[e]=t;return this}));var po=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("set",(function(t){po(this);var e=vi(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=M(t),i=Rt(n.length),o=0;if(i+e>r)throw RangeError("Wrong length");for(;o<i;)this[e+o]=n[o++]}),l((function(){new Int8Array(1).set({})})));var go=ui.aTypedArray,yo=[].slice;(0,ui.exportTypedArrayMethod)("slice",(function(t,e){for(var r=yo.call(go(this),t,e),n=Ei(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),l((function(){new Int8Array(1).slice()})));var bo=ie.some,mo=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("some",(function(t){return bo(mo(this),t,arguments.length>1?arguments[1]:void 0)}));var xo=Math.floor,To=function(t,e){var r=t.length,n=xo(r/2);return r<8?Ao(t,e):wo(To(t.slice(0,n),e),To(t.slice(n),e),e)},Ao=function(t,e){for(var r,n,i=t.length,o=1;o<i;){for(n=o,r=t[o];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==o++&&(t[n]=r)}return t},wo=function(t,e,r){for(var n=t.length,i=e.length,o=0,a=0,u=[];o<n||a<i;)o<n&&a<i?u.push(r(t[o],e[a])<=0?t[o++]:e[a++]):u.push(o<n?t[o++]:e[a++]);return u},Eo=To,So=S.match(/firefox\/(\d+)/i),Co=!!So&&+So[1],Oo=/MSIE|Trident/.test(S),Ro=S.match(/AppleWebKit\/(\d+)\./),Io=!!Ro&&+Ro[1],_o=ui.aTypedArray,Po=ui.exportTypedArrayMethod,ko=c.Uint16Array,Do=ko&&ko.prototype.sort,Uo=!!Do&&!l((function(){var t=new ko(2);t.sort(null),t.sort({})})),jo=!!Do&&!l((function(){if(_)return _<74;if(Co)return Co<67;if(Oo)return!0;if(Io)return Io<602;var t,e,r=new ko(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(r.sort((function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));Po("sort",(function(t){if(void 0!==t&&Jt(t),jo)return Do.call(this,t);_o(this);var e,r=Rt(this.length),n=Array(r);for(e=0;e<r;e++)n[e]=this[e];for(n=Eo(this,function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t)),e=0;e<r;e++)this[e]=n[e];return this}),!jo||Uo);var Lo=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("subarray",(function(t,e){var r=Lo(this),n=r.length,i=Pt(t,n);return new(Ei(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,Rt((void 0===e?n:Pt(e,n))-i))}));var Mo=c.Int8Array,Fo=ui.aTypedArray,Bo=ui.exportTypedArrayMethod,No=[].toLocaleString,Yo=[].slice,Vo=!!Mo&&l((function(){No.call(new Mo(1))}));Bo("toLocaleString",(function(){return No.apply(Vo?Yo.call(Fo(this)):Fo(this),arguments)}),l((function(){return[1,2].toLocaleString()!=new Mo([1,2]).toLocaleString()}))||!l((function(){Mo.prototype.toLocaleString.call([1,2])})));var Wo=ui.exportTypedArrayMethod,Go=c.Uint8Array,zo=Go&&Go.prototype||{},$o=[].toString,Xo=[].join;l((function(){$o.call({})}))&&($o=function(){return Xo.call(this)});var Ho=zo.toString!=$o;Wo("toString",$o,Ho);var Ko=function(){var t=rt(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},qo=function(t,e){return RegExp(t,e)},Jo={UNSUPPORTED_Y:l((function(){var t=qo("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:l((function(){var t=qo("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Qo=l((function(){var t=RegExp(".","string".charAt(0));return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),Zo=l((function(){var t=RegExp("(?<a>b)","string".charAt(5));return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),ta=At.get,ea=RegExp.prototype.exec,ra=L("native-string-replace",String.prototype.replace),na=ea,ia=function(){var t=/a/,e=/b*/g;return ea.call(t,"a"),ea.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),oa=Jo.UNSUPPORTED_Y||Jo.BROKEN_CARET,aa=void 0!==/()??/.exec("")[1];(ia||aa||oa||Qo||Zo)&&(na=function(t){var e,r,n,i,o,a,u,s=this,c=ta(s),l=Lr(t),f=c.raw;if(f)return f.lastIndex=s.lastIndex,e=na.call(f,l),s.lastIndex=f.lastIndex,e;var h=c.groups,v=oa&&s.sticky,p=Ko.call(s),g=s.source,d=0,y=l;if(v&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=l.slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==l.charAt(s.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,d++),r=new RegExp("^(?:"+g+")",p)),aa&&(r=new RegExp("^"+g+"$(?!\\s)",p)),ia&&(n=s.lastIndex),i=ea.call(v?r:s,y),v?i?(i.input=i.input.slice(d),i[0]=i[0].slice(d),i.index=s.lastIndex,s.lastIndex+=i[0].length):s.lastIndex=0:ia&&i&&(s.lastIndex=s.global?i.index+i[0].length:n),aa&&i&&i.length>1&&ra.call(i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=a=Oe(null),o=0;o<h.length;o++)a[(u=h[o])[0]]=i[u[1]];return i});var ua=na;qt({target:"RegExp",proto:!0,forced:/./.exec!==ua},{exec:ua});var sa=$("species"),ca=RegExp.prototype,la=Fr.charAt,fa=function(t,e,r){return e+(r?la(t,e).length:1)},ha=Math.floor,va="".replace,pa=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ga=/\$([$&'`]|\d{1,2})/g,da=function(t,e,r,n,i,o){var a=r+t.length,u=n.length,s=ga;return void 0!==i&&(i=M(i),s=pa),va.call(o,s,(function(o,s){var c;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(a);case"<":c=i[s.slice(1,-1)];break;default:var l=+s;if(0===l)return o;if(l>u){var f=ha(l/10);return 0===f?o:f<=u?void 0===n[f-1]?s.charAt(1):n[f-1]+s.charAt(1):o}c=n[l-1]}return void 0===c?"":c}))},ya=function(t,e){var r=t.exec;if("function"==typeof r){var n=r.call(t,e);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==y(t))throw TypeError("RegExp#exec called on incompatible receiver");return ua.call(t,e)},ba=$("replace"),ma=Math.max,xa=Math.min,Ta="$0"==="a".replace(/./,"$0"),Aa=!!/./[ba]&&""===/./[ba]("a","$0");!function(t,e,r,n){var i=$(t),o=!l((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),a=o&&!l((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[sa]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return e=!0,null},r[i](""),!e}));if(!o||!a||r){var u=/./[i],s=e(i,""[t],(function(t,e,r,n,i){var a=e.exec;return a===ua||a===ca.exec?o&&!i?{done:!0,value:u.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}}));wt(String.prototype,t,s[0]),wt(ca,i,s[1])}n&&ot(ca[i],"sham",!0)}("replace",(function(t,e,r){var n=Aa?"$":"$0";return[function(t,r){var n=x(this),i=null==t?void 0:t[ba];return void 0!==i?i.call(t,n,r):e.call(Lr(n),t,r)},function(t,i){var o=rt(this),a=Lr(t);if("string"==typeof i&&-1===i.indexOf(n)&&-1===i.indexOf("$<")){var u=r(e,o,a,i);if(u.done)return u.value}var s="function"==typeof i;s||(i=Lr(i));var c=o.global;if(c){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=ya(o,a);if(null===h)break;if(f.push(h),!c)break;""===Lr(h[0])&&(o.lastIndex=fa(a,Rt(o.lastIndex),l))}for(var v,p="",g=0,d=0;d<f.length;d++){h=f[d];for(var y=Lr(h[0]),b=ma(xa(Ct(h.index),a.length),0),m=[],x=1;x<h.length;x++)m.push(void 0===(v=h[x])?v:String(v));var T=h.groups;if(s){var A=[y].concat(m,b,a);void 0!==T&&A.push(T);var w=Lr(i.apply(void 0,A))}else w=da(y,a,b,m,T,i);b>=g&&(p+=a.slice(g,b)+w,g=b+y.length)}return p+a.slice(g)}]}),!!l((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!Ta||Aa);var wa=RegExp.prototype,Ea=wa.toString,Sa=l((function(){return"/a/b"!=Ea.call({source:"a",flags:"b"})})),Ca="toString"!=Ea.name;(Sa||Ca)&&wt(RegExp.prototype,"toString",(function(){var t=rt(this),e=Lr(t.source),r=t.flags;return"/"+e+"/"+Lr(void 0===r&&t instanceof RegExp&&!("flags"in wa)?Ko.call(t):r)}),{unsafe:!0});var Oa=$("match"),Ra=it.f,Ia=Ft.f,_a=At.enforce,Pa=$("match"),ka=c.RegExp,Da=ka.prototype,Ua=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,ja=/a/g,La=/a/g,Ma=new ka(ja)!==ja,Fa=Jo.UNSUPPORTED_Y,Ba=f&&(!Ma||Fa||Qo||Zo||l((function(){return La[Pa]=!1,ka(ja)!=ja||ka(La)==La||"/a/i"!=ka(ja,"i")})));if(Ht("RegExp",Ba)){for(var Na=function(t,e){var r,n,i,o,a,u,s,c,l=this instanceof Na,f=A(r=t)&&(void 0!==(n=r[Oa])?!!n:"RegExp"==y(r)),h=void 0===e,v=[],p=t;if(!l&&f&&h&&t.constructor===Na)return t;if((f||t instanceof Na)&&(t=t.source,h&&(e="flags"in p?p.flags:Ko.call(p))),t=void 0===t?"":Lr(t),e=void 0===e?"":Lr(e),p=t,Qo&&"dotAll"in ja&&(o=!!e&&e.indexOf("s")>-1)&&(e=e.replace(/s/g,"")),i=e,Fa&&"sticky"in ja&&(a=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,"")),Zo&&(t=(u=function(t){for(var e,r=t.length,n=0,i="",o=[],a={},u=!1,s=!1,c=0,l="";n<=r;n++){if("\\"===(e=t.charAt(n)))e+=t.charAt(++n);else if("]"===e)u=!1;else if(!u)switch(!0){case"["===e:u=!0;break;case"("===e:Ua.test(t.slice(n+1))&&(n+=2,s=!0),i+=e,c++;continue;case">"===e&&s:if(""===l||B(a,l))throw new SyntaxError("Invalid capture group name");a[l]=!0,o.push([l,c]),s=!1,l="";continue}s?l+=e:i+=e}return[i,o]}(t))[0],v=u[1]),s=Or(ka(t,e),l?this:Da,Na),(o||a||v.length)&&(c=_a(s),o&&(c.dotAll=!0,c.raw=Na(function(t){for(var e,r=t.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(e=t.charAt(n))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),i+=e):i+="[\\s\\S]":i+=e+t.charAt(++n);return i}(t),i)),a&&(c.sticky=!0),v.length&&(c.groups=v)),t!==p)try{ot(s,"source",""===p?"(?:)":p)}catch(qa){}return s},Ya=function(t){t in Na||Ra(Na,t,{configurable:!0,get:function(){return ka[t]},set:function(e){ka[t]=e}})},Va=Ia(ka),Wa=0;Va.length>Wa;)Ya(Va[Wa++]);Da.constructor=Na,Na.prototype=Da,wt(c,"RegExp",Na)}_r("RegExp");var Ga=[].join,za=m!=Object,$a=qi("join",",");function Xa(t,e,r){var n=function(t,e,r){var n=new RegExp("\\b".concat(e," \\w+ (\\w+)"),"ig");t.replace(n,(function(t,e){return r[e]=0,t}))},i=function(t,e,r){var n=t.createShader(r);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(console.log(t.getShaderInfoLog(n)),null)};this.uniform={},this.attribute={};var o=i(t,e,t.VERTEX_SHADER),a=i(t,r,t.FRAGMENT_SHADER);for(var u in this.id=t.createProgram(),t.attachShader(this.id,o),t.attachShader(this.id,a),t.linkProgram(this.id),t.getProgramParameter(this.id,t.LINK_STATUS)||console.log(t.getProgramInfoLog(this.id)),t.useProgram(this.id),n(e,"attribute",this.attribute),this.attribute)this.attribute[u]=t.getAttribLocation(this.id,u);for(var s in n(e,"uniform",this.uniform),n(r,"uniform",this.uniform),this.uniform)this.uniform[s]=t.getUniformLocation(this.id,s)}qt({target:"Array",proto:!0,forced:za||!$a},{join:function(t){return Ga.call(T(this),void 0===t?",":t)}});var Ha=function(){function t(r){e(this,t),this.canvas=r.canvas,this.width=r.width||640,this.height=r.height||480,this.gl=this.createGL(r.canvas),this.sourceTexture=this.gl.createTexture(),this.vertexBuffer=null,this.currentProgram=null,this.applied=!1,this.beautyParams={beauty:.5,brightness:.5,ruddy:.5}}return n(t,[{key:"setRect",value:function(t,e){this.width=t,this.height=e}},{key:"apply",value:function(t){if(!this.vertexBuffer){var e=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);this.vertexBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}this.gl.viewport(0,0,this.width,this.height),this.gl.bindTexture(this.gl.TEXTURE_2D,this.sourceTexture),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.applied?this.gl.texSubImage2D(this.gl.TEXTURE_2D,0,0,0,this.gl.RGB,this.gl.UNSIGNED_BYTE,t):(this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGB,this.gl.RGB,this.gl.UNSIGNED_BYTE,t),this.applied=!0),this.beauty()}},{key:"beauty",value:function(){var t=this.beautyParams,e=t.beauty,r=t.brightness,n=t.ruddy,i=2/this.width,o=2/this.height,a=this.compileBeautyShader();this.gl.uniform2f(a.uniform.singleStepOffset,i,o);var u=new Float32Array([1-.8*e,1-.6*e,.1+.45*n,.1+.45*n]);this.gl.uniform4fv(a.uniform.params,u),this.gl.uniform1f(a.uniform.brightness,.37*(-.5+r)),this.draw()}},{key:"draw",value:function(){this.gl.bindTexture(this.gl.TEXTURE_2D,this.sourceTexture),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.uniform1f(this.currentProgram.uniform.flipY,1),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}},{key:"compileBeautyShader",value:function(){if(this.currentProgram)return this.currentProgram;this.currentProgram=new Xa(this.gl,["precision highp float;","attribute vec2 pos;","attribute vec2 uv;","varying vec2 vUv;","uniform float flipY;","void main(void) {","vUv = uv;","gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);","}"].join("\n"),["precision highp float;","uniform vec2 singleStepOffset;","uniform sampler2D texture;","uniform vec4 params;","uniform float brightness;","varying vec2 vUv;","const highp vec3 W = vec3(0.299,0.587,0.114);","const mat3 saturateMatrix = mat3(1.1102,-0.0598,-0.061,-0.0774,1.0826,-0.1186,-0.0228,-0.0228,1.1772);","vec2 blurCoordinates[24];","float hardLight(float color){","if(color <= 0.5){","color = color * color * 2.0;","} else {","color = 1.0 - ((1.0 - color)*(1.0 - color) * 2.0);","}","return color;","}","void main(){","vec3 centralColor = texture2D(texture, vUv).rgb;","blurCoordinates[0] = vUv.xy + singleStepOffset * vec2(0.0, -10.0);","blurCoordinates[1] = vUv.xy + singleStepOffset * vec2(0.0, 10.0);","blurCoordinates[2] = vUv.xy + singleStepOffset * vec2(-10.0, 0.0);","blurCoordinates[3] = vUv.xy + singleStepOffset * vec2(10.0, 0.0);","blurCoordinates[4] = vUv.xy + singleStepOffset * vec2(5.0, -8.0);","blurCoordinates[5] = vUv.xy + singleStepOffset * vec2(5.0, 8.0);","blurCoordinates[6] = vUv.xy + singleStepOffset * vec2(-5.0, 8.0);","blurCoordinates[7] = vUv.xy + singleStepOffset * vec2(-5.0, -8.0);","blurCoordinates[8] = vUv.xy + singleStepOffset * vec2(8.0, -5.0);","blurCoordinates[9] = vUv.xy + singleStepOffset * vec2(8.0, 5.0);","blurCoordinates[10] = vUv.xy + singleStepOffset * vec2(-8.0, 5.0);","blurCoordinates[11] = vUv.xy + singleStepOffset * vec2(-8.0, -5.0);","blurCoordinates[12] = vUv.xy + singleStepOffset * vec2(0.0, -6.0);","blurCoordinates[13] = vUv.xy + singleStepOffset * vec2(0.0, 6.0);","blurCoordinates[14] = vUv.xy + singleStepOffset * vec2(6.0, 0.0);","blurCoordinates[15] = vUv.xy + singleStepOffset * vec2(-6.0, 0.0);","blurCoordinates[16] = vUv.xy + singleStepOffset * vec2(-4.0, -4.0);","blurCoordinates[17] = vUv.xy + singleStepOffset * vec2(-4.0, 4.0);","blurCoordinates[18] = vUv.xy + singleStepOffset * vec2(4.0, -4.0);","blurCoordinates[19] = vUv.xy + singleStepOffset * vec2(4.0, 4.0);","blurCoordinates[20] = vUv.xy + singleStepOffset * vec2(-2.0, -2.0);","blurCoordinates[21] = vUv.xy + singleStepOffset * vec2(-2.0, 2.0);","blurCoordinates[22] = vUv.xy + singleStepOffset * vec2(2.0, -2.0);","blurCoordinates[23] = vUv.xy + singleStepOffset * vec2(2.0, 2.0);","float sampleColor = centralColor.g * 22.0;","sampleColor += texture2D(texture, blurCoordinates[0]).g;","sampleColor += texture2D(texture, blurCoordinates[1]).g;","sampleColor += texture2D(texture, blurCoordinates[2]).g;","sampleColor += texture2D(texture, blurCoordinates[3]).g;","sampleColor += texture2D(texture, blurCoordinates[4]).g;","sampleColor += texture2D(texture, blurCoordinates[5]).g;","sampleColor += texture2D(texture, blurCoordinates[6]).g;","sampleColor += texture2D(texture, blurCoordinates[7]).g;","sampleColor += texture2D(texture, blurCoordinates[8]).g;","sampleColor += texture2D(texture, blurCoordinates[9]).g;","sampleColor += texture2D(texture, blurCoordinates[10]).g;","sampleColor += texture2D(texture, blurCoordinates[11]).g;","sampleColor += texture2D(texture, blurCoordinates[12]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[13]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[14]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[15]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[16]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[17]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[18]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[19]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[20]).g * 3.0;","sampleColor += texture2D(texture, blurCoordinates[21]).g * 3.0;","sampleColor += texture2D(texture, blurCoordinates[22]).g * 3.0;","sampleColor += texture2D(texture, blurCoordinates[23]).g * 3.0;","sampleColor = sampleColor / 62.0;","float highPass = centralColor.g - sampleColor + 0.5;","for(int i = 0; i < 5;i++){","highPass = hardLight(highPass);","}","float luminance = dot(centralColor, W);","float alpha = pow(luminance, params.r);","vec3 smoothColor = centralColor + (centralColor-vec3(highPass))*alpha*0.1;","smoothColor.r = clamp(pow(smoothColor.r, params.g),0.0,1.0);","smoothColor.g = clamp(pow(smoothColor.g, params.g),0.0,1.0);","smoothColor.b = clamp(pow(smoothColor.b, params.g),0.0,1.0);","vec3 screen = vec3(1.0) - (vec3(1.0)-smoothColor) * (vec3(1.0)-centralColor);","vec3 lighten = max(smoothColor, centralColor);","vec3 softLight = 2.0 * centralColor*smoothColor + centralColor*centralColor - 2.0 * centralColor*centralColor * smoothColor;","gl_FragColor = vec4(mix(centralColor, screen, alpha), 1.0);","gl_FragColor.rgb = mix(gl_FragColor.rgb, lighten, alpha);","gl_FragColor.rgb = mix(gl_FragColor.rgb, softLight, params.b);","vec3 satColor = gl_FragColor.rgb * saturateMatrix;","gl_FragColor.rgb = mix(gl_FragColor.rgb, satColor, params.a);","gl_FragColor.rgb = vec3(gl_FragColor.rgb + vec3(brightness));","}"].join("\n"));var t=Float32Array.BYTES_PER_ELEMENT,e=4*t;return this.gl.enableVertexAttribArray(this.currentProgram.attribute.pos),this.gl.vertexAttribPointer(this.currentProgram.attribute.pos,2,this.gl.FLOAT,!1,e,0),this.gl.enableVertexAttribArray(this.currentProgram.attribute.uv),this.gl.vertexAttribPointer(this.currentProgram.attribute.uv,2,this.gl.FLOAT,!1,e,2*t),this.currentProgram}},{key:"createGL",value:function(t){var e=t.getContext("webgl");if(e||t.getContext("experimental-webgl",{preserveDrawingBuffer:!0}),!e)throw"Couldn't get WebGL context";return e}},{key:"setBeautyParams",value:function(t){this.beautyParams=t}},{key:"reset",value:function(){this.applied=!1}}]),t}(),Ka=function(){function r(){e(this,r),this.video=document.createElement("video"),this.video.loop=!0,this.video.autoplay=!0,this.canvas=document.createElement("canvas"),this.filter=new Ha({canvas:this.canvas}),this.beautyParams={beauty:.5,brightness:.5,ruddy:.5},this.timeoutId=null,this.rafId=null,this.startTime=null,this.originTrack=null,this.beautyTrack=null,this.localStream=null,this.frameRate=null}return n(r,[{key:"generateBeautyStream",value:function(t){var e=t.getVideoTrack(),r=this.generateBeautyTrack(e);return t.replaceTrack(r),this.localStream=t,t}},{key:"generateBeautyTrack",value:function(t){var e=this;this.reset();var r=t.getSettings();this.frameRate=r.frameRate,this.filter.setRect(r.width,r.height),this.setRect(r.width,r.height);var n=new MediaStream;n.addTrack(t),this.video.srcObject=n,this.video.play();var i=this.generateVideoTrackFromCanvasCapture(r.frameRate||15);return this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((function(){e.startTime=(new Date).getTime(),e.render()})),this.installEvents(),this.setBeautyTrack({originTrack:t,beautyTrack:i}),this.originTrack=t,this.beautyTrack=i,i}},{key:"draw",value:function(){this.video&&this.video.readyState===this.video.HAVE_ENOUGH_DATA&&this.filter.apply(this.video)}},{key:"render",value:function(){var t=this,e=(new Date).getTime();e-this.startTime>1e3/this.frameRate&&(this.draw(),this.startTime=e),document.hidden?(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.render()}),1e3/this.frameRate)):(this.timeoutId&&clearTimeout(this.timeoutId),this.rafId&&cancelAnimationFrame(this.rafId),requestAnimationFrame(this.render.bind(this)))}},{key:"setBeautyParam",value:function(t){var e=t.beauty,r=t.brightness,n=t.ruddy;e&&(this.beautyParams.beauty=e),r&&(this.beautyParams.brightness=r),n&&(this.beautyParams.ruddy=n),this.filter.setBeautyParams(this.beautyParams)}},{key:"setRect",value:function(t,e){var r=t||640,n=e||480;this.video.height=n,this.video.width=r,this.canvas.height=n,this.canvas.width=r}},{key:"reset",value:function(){cancelAnimationFrame(this.rafId),clearTimeout(this.timeoutId),this.video.pause(),this.filter.reset()}},{key:"destroy",value:function(){cancelAnimationFrame(this.rafId),clearTimeout(this.timeoutId),this.canvas&&(this.canvas.width=0,this.canvas.height=0,this.canvas.remove(),delete this.canvas),this.video&&(this.video.pause(),this.video.removeAttribute("srcObject"),this.video.removeAttribute("src"),this.video.load(),this.video.width=0,this.video.height=0,this.video.remove(),delete this.video),this.beautyTrack&&this.beautyTrack.stop(),this.originTrack&&this.originTrack.stop(),this.uninstallEvents()}},{key:"generateVideoTrackFromCanvasCapture",value:function(t){return this.canvas.captureStream(t).getVideoTracks()[0]}},{key:"setBeautyTrack",value:function(e){var r=e.originTrack,n=e.beautyTrack;t&&(t.beautyTrackMap||(t.beautyTrackMap=new Map),t.beautyTrackMap.set(n.id,{originTrack:r,beautyTrack:n,param:this.beautyParams,pluginInstance:this}))}},{key:"installEvents",value:function(){document.addEventListener("visibilitychange",this.render.bind(this))}},{key:"uninstallEvents",value:function(){document.removeEventListener("visibilitychange",this.render.bind(this))}}]),r}();return t&&(t.getRTCBeautyPlugin=function(){return new Ka}),Ka}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("trtc-js-sdk")):"function"==typeof define&&define.amd?define(["trtc-js-sdk"],e):(t=t||self).RTCBeautyPlugin=e(t.TRTC)}(this,(function(t){function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var a,u,s=function(t){return t&&t.Math==Math&&t},c=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof i&&i)||function(){return this}()||Function("return this")(),l=function(t){try{return!!t()}catch(e){return!0}},f=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,p={f:v&&!h.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:h},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g={}.toString,y=function(t){return g.call(t).slice(8,-1)},b="".split,m=l((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==y(t)?b.call(t,""):Object(t)}:Object,T=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},x=function(t){return m(T(t))},A=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t){return"function"==typeof t?t:void 0},E=function(t,e){return arguments.length<2?w(c[t]):c[t]&&c[t][e]},S=E("navigator","userAgent")||"",C=c.process,O=c.Deno,R=C&&C.versions||O&&O.version,I=R&&R.v8;I?u=(a=I.split("."))[0]<4?1:a[0]+a[1]:S&&(!(a=S.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=S.match(/Chrome\/(\d+)/))&&(u=a[1]);var _=u&&+u,P=!!Object.getOwnPropertySymbols&&!l((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&_&&_<41})),k=P&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,D=k?function(t){return"symbol"==typeof t}:function(t){var e=E("Symbol");return"function"==typeof e&&Object(t)instanceof e},U=function(t,e){try{Object.defineProperty(c,t,{value:e,configurable:!0,writable:!0})}catch(r){c[t]=e}return e},j=c["__core-js_shared__"]||U("__core-js_shared__",{}),L=o((function(t){(t.exports=function(t,e){return j[t]||(j[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.0",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),M=function(t){return Object(T(t))},F={}.hasOwnProperty,B=Object.hasOwn||function(t,e){return F.call(M(t),e)},N=0,Y=Math.random(),V=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++N+Y).toString(36)},W=L("wks"),G=c.Symbol,z=k?G:G&&G.withoutSetter||V,$=function(t){return B(W,t)&&(P||"string"==typeof W[t])||(P&&B(G,t)?W[t]=G[t]:W[t]=z("Symbol."+t)),W[t]},X=$("toPrimitive"),H=function(t,e){if(!A(t)||D(t))return t;var r,n=t[X];if(void 0!==n){if(void 0===e&&(e="default"),r=n.call(t,e),!A(r)||D(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&"function"==typeof(r=t.toString)&&!A(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!A(n=r.call(t)))return n;if("string"!==e&&"function"==typeof(r=t.toString)&&!A(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(t,e)},K=function(t){var e=H(t,"string");return D(e)?e:String(e)},q=c.document,J=A(q)&&A(q.createElement),Q=function(t){return J?q.createElement(t):{}},Z=!f&&!l((function(){return 7!=Object.defineProperty(Q("div"),"a",{get:function(){return 7}}).a})),tt=Object.getOwnPropertyDescriptor,et={f:f?tt:function(t,e){if(t=x(t),e=K(e),Z)try{return tt(t,e)}catch(r){}if(B(t,e))return d(!p.f.call(t,e),t[e])}},rt=function(t){if(!A(t))throw TypeError(String(t)+" is not an object");return t},nt=Object.defineProperty,it={f:f?nt:function(t,e,r){if(rt(t),e=K(e),rt(r),Z)try{return nt(t,e,r)}catch(n){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},ot=f?function(t,e,r){return it.f(t,e,d(1,r))}:function(t,e,r){return t[e]=r,t},at=Function.toString;"function"!=typeof j.inspectSource&&(j.inspectSource=function(t){return at.call(t)});var ut,st,ct,lt=j.inspectSource,ft=c.WeakMap,ht="function"==typeof ft&&/native code/.test(lt(ft)),vt=L("keys"),pt=function(t){return vt[t]||(vt[t]=V(t))},dt={},gt=c.WeakMap;if(ht||j.state){var yt=j.state||(j.state=new gt),bt=yt.get,mt=yt.has,Tt=yt.set;ut=function(t,e){if(mt.call(yt,t))throw new TypeError("Object already initialized");return e.facade=t,Tt.call(yt,t,e),e},st=function(t){return bt.call(yt,t)||{}},ct=function(t){return mt.call(yt,t)}}else{var xt=pt("state");dt[xt]=!0,ut=function(t,e){if(B(t,xt))throw new TypeError("Object already initialized");return e.facade=t,ot(t,xt,e),e},st=function(t){return B(t,xt)?t[xt]:{}},ct=function(t){return B(t,xt)}}var At={set:ut,get:st,has:ct,enforce:function(t){return ct(t)?st(t):ut(t,{})},getterFor:function(t){return function(e){var r;if(!A(e)||(r=st(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},wt=o((function(t){var e=At.get,r=At.enforce,n=String(String).split("String");(t.exports=function(t,e,i,o){var a,u=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,l=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof e||B(i,"name")||ot(i,"name",e),(a=r(i)).source||(a.source=n.join("string"==typeof e?e:""))),t!==c?(u?!l&&t[e]&&(s=!0):delete t[e],s?t[e]=i:ot(t,e,i)):s?t[e]=i:U(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||lt(this)}))})),Et=Math.ceil,St=Math.floor,Ct=function(t){return isNaN(t=+t)?0:(t>0?St:Et)(t)},Ot=Math.min,Rt=function(t){return t>0?Ot(Ct(t),9007199254740991):0},It=Math.max,_t=Math.min,Pt=function(t,e){var r=Ct(t);return r<0?It(r+e,0):_t(r,e)},kt=function(t){return function(e,r,n){var i,o=x(e),a=Rt(o.length),u=Pt(n,a);if(t&&r!=r){for(;a>u;)if((i=o[u++])!=i)return!0}else for(;a>u;u++)if((t||u in o)&&o[u]===r)return t||u||0;return!t&&-1}},Dt={includes:kt(!0),indexOf:kt(!1)},Ut=Dt.indexOf,jt=function(t,e){var r,n=x(t),i=0,o=[];for(r in n)!B(dt,r)&&B(n,r)&&o.push(r);for(;e.length>i;)B(n,r=e[i++])&&(~Ut(o,r)||o.push(r));return o},Lt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mt=Lt.concat("length","prototype"),Ft={f:Object.getOwnPropertyNames||function(t){return jt(t,Mt)}},Bt={f:Object.getOwnPropertySymbols},Nt=E("Reflect","ownKeys")||function(t){var e=Ft.f(rt(t)),r=Bt.f;return r?e.concat(r(t)):e},Yt=function(t,e){for(var r=Nt(e),n=it.f,i=et.f,o=0;o<r.length;o++){var a=r[o];B(t,a)||n(t,a,i(e,a))}},Vt=/#|\.prototype\./,Wt=function(t,e){var r=zt[Gt(t)];return r==Xt||r!=$t&&("function"==typeof e?l(e):!!e)},Gt=Wt.normalize=function(t){return String(t).replace(Vt,".").toLowerCase()},zt=Wt.data={},$t=Wt.NATIVE="N",Xt=Wt.POLYFILL="P",Ht=Wt,Kt=et.f,qt=function(t,e){var r,n,i,o,a,u=t.target,s=t.global,l=t.stat;if(r=s?c:l?c[u]||U(u,{}):(c[u]||{}).prototype)for(n in e){if(o=e[n],i=t.noTargetGet?(a=Kt(r,n))&&a.value:r[n],!Ht(s?n:u+(l?".":"#")+n,t.forced)&&void 0!==i){if(typeof o==typeof i)continue;Yt(o,i)}(t.sham||i&&i.sham)&&ot(o,"sham",!0),wt(r,n,o,t)}},Jt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Qt=function(t,e,r){if(Jt(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},Zt=Array.isArray||function(t){return"Array"==y(t)},te=$("species"),ee=function(t,e){return new(function(t){var e;return Zt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Zt(e.prototype)?A(e)&&null===(e=e[te])&&(e=void 0):e=void 0),void 0===e?Array:e}(t))(0===e?0:e)},re=[].push,ne=function(t){var e=1==t,r=2==t,n=3==t,i=4==t,o=6==t,a=7==t,u=5==t||o;return function(s,c,l,f){for(var h,v,p=M(s),d=m(p),g=Qt(c,l,3),y=Rt(d.length),b=0,T=f||ee,x=e?T(s,y):r||a?T(s,0):void 0;y>b;b++)if((u||b in d)&&(v=g(h=d[b],b,p),t))if(e)x[b]=v;else if(v)switch(t){case 3:return!0;case 5:return h;case 6:return b;case 2:re.call(x,h)}else switch(t){case 4:return!1;case 7:re.call(x,h)}return o?-1:n||i?i:x}},ie={forEach:ne(0),map:ne(1),filter:ne(2),some:ne(3),every:ne(4),find:ne(5),findIndex:ne(6),filterReject:ne(7)},oe=$("species"),ae=ie.filter,ue=function(t){return _>=51||!l((function(){var e=[];return(e.constructor={})[oe]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("filter");qt({target:"Array",proto:!0,forced:!ue},{filter:function(t){return ae(this,t,arguments.length>1?arguments[1]:void 0)}});var se=Date.prototype,ce=se.toString,le=se.getTime;"Invalid Date"!=String(new Date(NaN))&&wt(se,"toString",(function(){var t=le.call(this);return t==t?ce.call(this):"Invalid Date"}));var fe=[].slice,he={},ve=function(t,e,r){if(!(e in he)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";he[e]=Function("C,a","return new C("+n.join(",")+")")}return he[e](t,r)},pe=Function.bind||function(t){var e=Jt(this),r=fe.call(arguments,1),n=function(){var i=r.concat(fe.call(arguments));return this instanceof n?ve(e,i.length,i):e.apply(t,i)};return A(e.prototype)&&(n.prototype=e.prototype),n};qt({target:"Function",proto:!0},{bind:pe});var de=[].slice,ge=/MSIE .\./.test(S),ye=function(t){return function(e,r){var n=arguments.length>2,i=n?de.call(arguments,2):void 0;return t(n?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,r)}};qt({global:!0,bind:!0,forced:ge},{setTimeout:ye(c.setTimeout),setInterval:ye(c.setInterval)});var be,me=Object.keys||function(t){return jt(t,Lt)},Te=f?Object.defineProperties:function(t,e){rt(t);for(var r,n=me(e),i=n.length,o=0;i>o;)it.f(t,r=n[o++],e[r]);return t},xe=E("document","documentElement"),Ae=pt("IE_PROTO"),we=function(){},Ee=function(t){return"<script>"+t+"<\/script>"},Se=function(t){t.write(Ee("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ce=function(){try{be=new ActiveXObject("htmlfile")}catch(e){}Ce=document.domain&&be?Se(be):function(){var t,e=Q("iframe");if(e.style)return e.style.display="none",xe.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Ee("document.F=Object")),t.close(),t.F}()||Se(be);for(var t=Lt.length;t--;)delete Ce.prototype[Lt[t]];return Ce()};dt[Ae]=!0;var Oe=Object.create||function(t,e){var r;return null!==t?(we.prototype=rt(t),r=new we,we.prototype=null,r[Ae]=t):r=Ce(),void 0===e?r:Te(r,e)},Re=$("unscopables"),Ie=Array.prototype;null==Ie[Re]&&it.f(Ie,Re,{configurable:!0,value:Oe(null)});var _e,Pe,ke,De=function(t){Ie[Re][t]=!0},Ue={},je=!l((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Le=pt("IE_PROTO"),Me=Object.prototype,Fe=je?Object.getPrototypeOf:function(t){return t=M(t),B(t,Le)?t[Le]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Me:null},Be=$("iterator"),Ne=!1;[].keys&&("next"in(ke=[].keys())?(Pe=Fe(Fe(ke)))!==Object.prototype&&(_e=Pe):Ne=!0),(null==_e||l((function(){var t={};return _e[Be].call(t)!==t})))&&(_e={}),B(_e,Be)||ot(_e,Be,(function(){return this}));var Ye={IteratorPrototype:_e,BUGGY_SAFARI_ITERATORS:Ne},Ve=it.f,We=$("toStringTag"),Ge=function(t,e,r){t&&!B(t=r?t:t.prototype,We)&&Ve(t,We,{configurable:!0,value:e})},ze=Ye.IteratorPrototype,$e=function(){return this},Xe=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(n){}return function(r,n){return rt(r),function(t){if(!A(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),He=Ye.IteratorPrototype,Ke=Ye.BUGGY_SAFARI_ITERATORS,qe=$("iterator"),Je=function(){return this},Qe=function(t,e,r,n,i,o,a){!function(t,e,r){var n=e+" Iterator";t.prototype=Oe(ze,{next:d(1,r)}),Ge(t,n,!1),Ue[n]=$e}(r,e,n);var u,s,c,l=function(t){if(t===i&&g)return g;if(!Ke&&t in v)return v[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},f=e+" Iterator",h=!1,v=t.prototype,p=v[qe]||v["@@iterator"]||i&&v[i],g=!Ke&&p||l(i),y="Array"==e&&v.entries||p;if(y&&(u=Fe(y.call(new t)),He!==Object.prototype&&u.next&&(Fe(u)!==He&&(Xe?Xe(u,He):"function"!=typeof u[qe]&&ot(u,qe,Je)),Ge(u,f,!0))),"values"==i&&p&&"values"!==p.name&&(h=!0,g=function(){return p.call(this)}),v[qe]!==g&&ot(v,qe,g),Ue[e]=g,i)if(s={values:l("values"),keys:o?g:l("keys"),entries:l("entries")},a)for(c in s)(Ke||h||!(c in v))&&wt(v,c,s[c]);else qt({target:e,proto:!0,forced:Ke||h},s);return s},Ze=At.set,tr=At.getterFor("Array Iterator"),er=Qe(Array,"Array",(function(t,e){Ze(this,{type:"Array Iterator",target:x(t),index:0,kind:e})}),(function(){var t=tr(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");Ue.Arguments=Ue.Array,De("keys"),De("values"),De("entries");var rr=Ft.f,nr={}.toString,ir="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],or={f:function(t){return ir&&"[object Window]"==nr.call(t)?function(t){try{return rr(t)}catch(e){return ir.slice()}}(t):rr(x(t))}},ar=!l((function(){return Object.isExtensible(Object.preventExtensions({}))})),ur=o((function(t){var e=it.f,r=!1,n=V("meta"),i=0,o=Object.isExtensible||function(){return!0},a=function(t){e(t,n,{value:{objectID:"O"+i++,weakData:{}}})},u=t.exports={enable:function(){u.enable=function(){},r=!0;var t=Ft.f,e=[].splice,i={};i[n]=1,t(i).length&&(Ft.f=function(r){for(var i=t(r),o=0,a=i.length;o<a;o++)if(i[o]===n){e.call(i,o,1);break}return i},qt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:or.f}))},fastKey:function(t,e){if(!A(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!B(t,n)){if(!o(t))return"F";if(!e)return"E";a(t)}return t[n].objectID},getWeakData:function(t,e){if(!B(t,n)){if(!o(t))return!0;if(!e)return!1;a(t)}return t[n].weakData},onFreeze:function(t){return ar&&r&&o(t)&&!B(t,n)&&a(t),t}};dt[n]=!0})),sr=(ur.enable,ur.fastKey,ur.getWeakData,ur.onFreeze,$("iterator")),cr=Array.prototype,lr=function(t){return void 0!==t&&(Ue.Array===t||cr[sr]===t)},fr={};fr[$("toStringTag")]="z";var hr="[object z]"===String(fr),vr=$("toStringTag"),pr="Arguments"==y(function(){return arguments}()),dr=hr?y:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(r){}}(e=Object(t),vr))?r:pr?y(e):"Object"==(n=y(e))&&"function"==typeof e.callee?"Arguments":n},gr=$("iterator"),yr=function(t){if(null!=t)return t[gr]||t["@@iterator"]||Ue[dr(t)]},br=function(t){var e=t.return;if(void 0!==e)return rt(e.call(t)).value},mr=function(t,e){this.stopped=t,this.result=e},Tr=function(t,e,r){var n,i,o,a,u,s,c,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_ITERATOR),v=!(!r||!r.INTERRUPTED),p=Qt(e,l,1+f+v),d=function(t){return n&&br(n),new mr(!0,t)},g=function(t){return f?(rt(t),v?p(t[0],t[1],d):p(t[0],t[1])):v?p(t,d):p(t)};if(h)n=t;else{if("function"!=typeof(i=yr(t)))throw TypeError("Target is not iterable");if(lr(i)){for(o=0,a=Rt(t.length);a>o;o++)if((u=g(t[o]))&&u instanceof mr)return u;return new mr(!1)}n=i.call(t)}for(s=n.next;!(c=s.call(n)).done;){try{u=g(c.value)}catch(y){throw br(n),y}if("object"==typeof u&&u&&u instanceof mr)return u}return new mr(!1)},xr=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},Ar=$("iterator"),wr=!1;try{var Er=0,Sr={next:function(){return{done:!!Er++}},return:function(){wr=!0}};Sr[Ar]=function(){return this},Array.from(Sr,(function(){throw 2}))}catch(Ja){}var Cr=function(t,e){if(!e&&!wr)return!1;var r=!1;try{var n={};n[Ar]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(Ja){}return r},Or=function(t,e,r){var n,i;return Xe&&"function"==typeof(n=e.constructor)&&n!==r&&A(i=n.prototype)&&i!==r.prototype&&Xe(t,i),t},Rr=function(t,e,r){for(var n in e)wt(t,n,e[n],r);return t},Ir=$("species"),_r=function(t){var e=E(t),r=it.f;f&&e&&!e[Ir]&&r(e,Ir,{configurable:!0,get:function(){return this}})},Pr=it.f,kr=ur.fastKey,Dr=At.set,Ur=At.getterFor,jr=(function(t,e,r){var n=-1!==t.indexOf("Map"),i=-1!==t.indexOf("Weak"),o=n?"set":"add",a=c[t],u=a&&a.prototype,s=a,f={},h=function(t){var e=u[t];wt(u,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(i&&!A(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return i&&!A(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(i&&!A(t))&&e.call(this,0===t?0:t)}:function(t,r){return e.call(this,0===t?0:t,r),this})};if(Ht(t,"function"!=typeof a||!(i||u.forEach&&!l((function(){(new a).entries().next()})))))s=r.getConstructor(e,t,n,o),ur.enable();else if(Ht(t,!0)){var v=new s,p=v[o](i?{}:-0,1)!=v,d=l((function(){v.has(1)})),g=Cr((function(t){new a(t)})),y=!i&&l((function(){for(var t=new a,e=5;e--;)t[o](e,e);return!t.has(-0)}));g||((s=e((function(e,r){xr(e,s,t);var i=Or(new a,e,s);return null!=r&&Tr(r,i[o],{that:i,AS_ENTRIES:n}),i}))).prototype=u,u.constructor=s),(d||y)&&(h("delete"),h("has"),n&&h("get")),(y||p)&&h(o),i&&u.clear&&delete u.clear}f[t]=s,qt({global:!0,forced:s!=a},f),Ge(s,t),i||r.setStrong(s,t,n)}("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,e,r,n){var i=t((function(t,o){xr(t,i,e),Dr(t,{type:e,index:Oe(null),first:void 0,last:void 0,size:0}),f||(t.size=0),null!=o&&Tr(o,t[n],{that:t,AS_ENTRIES:r})})),o=Ur(e),a=function(t,e,r){var n,i,a=o(t),s=u(t,e);return s?s.value=r:(a.last=s={index:i=kr(e,!0),key:e,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=s),n&&(n.next=s),f?a.size++:t.size++,"F"!==i&&(a.index[i]=s)),t},u=function(t,e){var r,n=o(t),i=kr(e);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==e)return r};return Rr(i.prototype,{clear:function(){for(var t=o(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,f?t.size=0:this.size=0},delete:function(t){var e=o(this),r=u(this,t);if(r){var n=r.next,i=r.previous;delete e.index[r.index],r.removed=!0,i&&(i.next=n),n&&(n.previous=i),e.first==r&&(e.first=n),e.last==r&&(e.last=i),f?e.size--:this.size--}return!!r},forEach:function(t){for(var e,r=o(this),n=Qt(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!u(this,t)}}),Rr(i.prototype,r?{get:function(t){var e=u(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),f&&Pr(i.prototype,"size",{get:function(){return o(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Ur(e),o=Ur(n);Qe(t,e,(function(t,e){Dr(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),_r(e)}}),hr?{}.toString:function(){return"[object "+dr(this)+"]"});hr||wt(Object.prototype,"toString",jr,{unsafe:!0});var Lr=function(t){if(D(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},Mr=function(t){return function(e,r){var n,i,o=Lr(T(e)),a=Ct(r),u=o.length;return a<0||a>=u?t?"":void 0:(n=o.charCodeAt(a))<55296||n>56319||a+1===u||(i=o.charCodeAt(a+1))<56320||i>57343?t?o.charAt(a):n:t?o.slice(a,a+2):i-56320+(n-55296<<10)+65536}},Fr={codeAt:Mr(!1),charAt:Mr(!0)},Br=Fr.charAt,Nr=At.set,Yr=At.getterFor("String Iterator");Qe(String,"String",(function(t){Nr(this,{type:"String Iterator",string:Lr(t),index:0})}),(function(){var t,e=Yr(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Br(r,n),e.index+=t.length,{value:t,done:!1})}));var Vr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Wr=$("iterator"),Gr=$("toStringTag"),zr=er.values;for(var $r in Vr){var Xr=c[$r],Hr=Xr&&Xr.prototype;if(Hr){if(Hr[Wr]!==zr)try{ot(Hr,Wr,zr)}catch(Ja){Hr[Wr]=zr}if(Hr[Gr]||ot(Hr,Gr,$r),Vr[$r])for(var Kr in er)if(Hr[Kr]!==er[Kr])try{ot(Hr,Kr,er[Kr])}catch(Ja){Hr[Kr]=er[Kr]}}}var qr="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Jr=function(t){if(void 0===t)return 0;var e=Ct(t),r=Rt(e);if(e!==r)throw RangeError("Wrong length or index");return r},Qr=Math.abs,Zr=Math.pow,tn=Math.floor,en=Math.log,rn=Math.LN2,nn=function(t,e,r){var n,i,o,a=new Array(r),u=8*r-e-1,s=(1<<u)-1,c=s>>1,l=23===e?Zr(2,-24)-Zr(2,-77):0,f=t<0||0===t&&1/t<0?1:0,h=0;for((t=Qr(t))!=t||Infinity===t?(i=t!=t?1:0,n=s):(n=tn(en(t)/rn),t*(o=Zr(2,-n))<1&&(n--,o*=2),(t+=n+c>=1?l/o:l*Zr(2,1-c))*o>=2&&(n++,o/=2),n+c>=s?(i=0,n=s):n+c>=1?(i=(t*o-1)*Zr(2,e),n+=c):(i=t*Zr(2,c-1)*Zr(2,e),n=0));e>=8;a[h++]=255&i,i/=256,e-=8);for(n=n<<e|i,u+=e;u>0;a[h++]=255&n,n/=256,u-=8);return a[--h]|=128*f,a},on=function(t,e){var r,n=t.length,i=8*n-e-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=t[s--],l=127&c;for(c>>=7;u>0;l=256*l+t[s],s--,u-=8);for(r=l&(1<<-u)-1,l>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===l)l=1-a;else{if(l===o)return r?NaN:c?-Infinity:Infinity;r+=Zr(2,e),l-=a}return(c?-1:1)*r*Zr(2,l-e)},an=function(t){for(var e=M(this),r=Rt(e.length),n=arguments.length,i=Pt(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:Pt(o,r);a>i;)e[i++]=t;return e},un=Ft.f,sn=it.f,cn=At.get,ln=At.set,fn=c.ArrayBuffer,hn=fn,vn=c.DataView,pn=vn&&vn.prototype,dn=Object.prototype,gn=c.RangeError,yn=nn,bn=on,mn=function(t){return[255&t]},Tn=function(t){return[255&t,t>>8&255]},xn=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},An=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},wn=function(t){return yn(t,23,4)},En=function(t){return yn(t,52,8)},Sn=function(t,e){sn(t.prototype,e,{get:function(){return cn(this)[e]}})},Cn=function(t,e,r,n){var i=Jr(r),o=cn(t);if(i+e>o.byteLength)throw gn("Wrong index");var a=cn(o.buffer).bytes,u=i+o.byteOffset,s=a.slice(u,u+e);return n?s:s.reverse()},On=function(t,e,r,n,i,o){var a=Jr(r),u=cn(t);if(a+e>u.byteLength)throw gn("Wrong index");for(var s=cn(u.buffer).bytes,c=a+u.byteOffset,l=n(+i),f=0;f<e;f++)s[c+f]=l[o?f:e-f-1]};if(qr){if(!l((function(){fn(1)}))||!l((function(){new fn(-1)}))||l((function(){return new fn,new fn(1.5),new fn(NaN),"ArrayBuffer"!=fn.name}))){for(var Rn,In=(hn=function(t){return xr(this,hn),new fn(Jr(t))}).prototype=fn.prototype,_n=un(fn),Pn=0;_n.length>Pn;)(Rn=_n[Pn++])in hn||ot(hn,Rn,fn[Rn]);In.constructor=hn}Xe&&Fe(pn)!==dn&&Xe(pn,dn);var kn=new vn(new hn(2)),Dn=pn.setInt8;kn.setInt8(0,2147483648),kn.setInt8(1,2147483649),!kn.getInt8(0)&&kn.getInt8(1)||Rr(pn,{setInt8:function(t,e){Dn.call(this,t,e<<24>>24)},setUint8:function(t,e){Dn.call(this,t,e<<24>>24)}},{unsafe:!0})}else hn=function(t){xr(this,hn,"ArrayBuffer");var e=Jr(t);ln(this,{bytes:an.call(new Array(e),0),byteLength:e}),f||(this.byteLength=e)},vn=function(t,e,r){xr(this,vn,"DataView"),xr(t,hn,"DataView");var n=cn(t).byteLength,i=Ct(e);if(i<0||i>n)throw gn("Wrong offset");if(i+(r=void 0===r?n-i:Rt(r))>n)throw gn("Wrong length");ln(this,{buffer:t,byteLength:r,byteOffset:i}),f||(this.buffer=t,this.byteLength=r,this.byteOffset=i)},f&&(Sn(hn,"byteLength"),Sn(vn,"buffer"),Sn(vn,"byteLength"),Sn(vn,"byteOffset")),Rr(vn.prototype,{getInt8:function(t){return Cn(this,1,t)[0]<<24>>24},getUint8:function(t){return Cn(this,1,t)[0]},getInt16:function(t){var e=Cn(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Cn(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return An(Cn(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return An(Cn(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return bn(Cn(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return bn(Cn(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){On(this,1,t,mn,e)},setUint8:function(t,e){On(this,1,t,mn,e)},setInt16:function(t,e){On(this,2,t,Tn,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){On(this,2,t,Tn,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){On(this,4,t,xn,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){On(this,4,t,xn,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){On(this,4,t,wn,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){On(this,8,t,En,e,arguments.length>2?arguments[2]:void 0)}});Ge(hn,"ArrayBuffer"),Ge(vn,"DataView");var Un={ArrayBuffer:hn,DataView:vn},jn=$("species"),Ln=function(t,e){var r,n=rt(t).constructor;return void 0===n||null==(r=rt(n)[jn])?e:Jt(r)},Mn=Un.ArrayBuffer,Fn=Un.DataView,Bn=Mn.prototype.slice,Nn=l((function(){return!new Mn(2).slice(1,void 0).byteLength}));qt({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Nn},{slice:function(t,e){if(void 0!==Bn&&void 0===e)return Bn.call(rt(this),t);for(var r=rt(this).byteLength,n=Pt(t,r),i=Pt(void 0===e?r:e,r),o=new(Ln(this,Mn))(Rt(i-n)),a=new Fn(this),u=new Fn(o),s=0;n<i;)u.setUint8(s++,a.getUint8(n++));return o}});var Yn,Vn,Wn,Gn=it.f,zn=c.Int8Array,$n=zn&&zn.prototype,Xn=c.Uint8ClampedArray,Hn=Xn&&Xn.prototype,Kn=zn&&Fe(zn),qn=$n&&Fe($n),Jn=Object.prototype,Qn=Jn.isPrototypeOf,Zn=$("toStringTag"),ti=V("TYPED_ARRAY_TAG"),ei=V("TYPED_ARRAY_CONSTRUCTOR"),ri=qr&&!!Xe&&"Opera"!==dr(c.opera),ni=!1,ii={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},oi={BigInt64Array:8,BigUint64Array:8},ai=function(t){if(!A(t))return!1;var e=dr(t);return B(ii,e)||B(oi,e)};for(Yn in ii)(Wn=(Vn=c[Yn])&&Vn.prototype)?ot(Wn,ei,Vn):ri=!1;for(Yn in oi)(Wn=(Vn=c[Yn])&&Vn.prototype)&&ot(Wn,ei,Vn);if((!ri||"function"!=typeof Kn||Kn===Function.prototype)&&(Kn=function(){throw TypeError("Incorrect invocation")},ri))for(Yn in ii)c[Yn]&&Xe(c[Yn],Kn);if((!ri||!qn||qn===Jn)&&(qn=Kn.prototype,ri))for(Yn in ii)c[Yn]&&Xe(c[Yn].prototype,qn);if(ri&&Fe(Hn)!==qn&&Xe(Hn,qn),f&&!B(qn,Zn))for(Yn in ni=!0,Gn(qn,Zn,{get:function(){return A(this)?this[ti]:void 0}}),ii)c[Yn]&&ot(c[Yn],ti,Yn);var ui={NATIVE_ARRAY_BUFFER_VIEWS:ri,TYPED_ARRAY_CONSTRUCTOR:ei,TYPED_ARRAY_TAG:ni&&ti,aTypedArray:function(t){if(ai(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(Xe&&!Qn.call(Kn,t))throw TypeError("Target is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r){if(f){if(r)for(var n in ii){var i=c[n];if(i&&B(i.prototype,t))try{delete i.prototype[t]}catch(Ja){}}qn[t]&&!r||wt(qn,t,r?e:ri&&$n[t]||e)}},exportTypedArrayStaticMethod:function(t,e,r){var n,i;if(f){if(Xe){if(r)for(n in ii)if((i=c[n])&&B(i,t))try{delete i[t]}catch(Ja){}if(Kn[t]&&!r)return;try{return wt(Kn,t,r?e:ri&&Kn[t]||e)}catch(Ja){}}for(n in ii)!(i=c[n])||i[t]&&!r||wt(i,t,e)}},isView:function(t){if(!A(t))return!1;var e=dr(t);return"DataView"===e||B(ii,e)||B(oi,e)},isTypedArray:ai,TypedArray:Kn,TypedArrayPrototype:qn},si=ui.NATIVE_ARRAY_BUFFER_VIEWS,ci=c.ArrayBuffer,li=c.Int8Array,fi=!si||!l((function(){li(1)}))||!l((function(){new li(-1)}))||!Cr((function(t){new li,new li(null),new li(1.5),new li(t)}),!0)||l((function(){return 1!==new li(new ci(2),1,void 0).length})),hi=Math.floor,vi=function(t,e){var r=function(t){var e=Ct(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}(t);if(r%e)throw RangeError("Wrong offset");return r},pi=ui.aTypedArrayConstructor,di=function(t){var e,r,n,i,o,a,u=M(t),s=arguments.length,c=s>1?arguments[1]:void 0,l=void 0!==c,f=yr(u);if(null!=f&&!lr(f))for(a=(o=f.call(u)).next,u=[];!(i=a.call(o)).done;)u.push(i.value);for(l&&s>2&&(c=Qt(c,arguments[2],2)),r=Rt(u.length),n=new(pi(this))(r),e=0;r>e;e++)n[e]=l?c(u[e],e):u[e];return n};o((function(t){var e=Ft.f,r=ie.forEach,n=At.get,i=At.set,o=it.f,a=et.f,u=Math.round,s=c.RangeError,l=Un.ArrayBuffer,h=Un.DataView,v=ui.NATIVE_ARRAY_BUFFER_VIEWS,p=ui.TYPED_ARRAY_CONSTRUCTOR,g=ui.TYPED_ARRAY_TAG,y=ui.TypedArray,b=ui.TypedArrayPrototype,m=ui.aTypedArrayConstructor,T=ui.isTypedArray,x=function(t,e){for(var r=0,n=e.length,i=new(m(t))(n);n>r;)i[r]=e[r++];return i},w=function(t,e){o(t,e,{get:function(){return n(this)[e]}})},E=function(t){var e;return t instanceof l||"ArrayBuffer"==(e=dr(t))||"SharedArrayBuffer"==e},S=function(t,e){return T(t)&&!D(e)&&e in t&&(!A(r=+e)&&isFinite(r)&&hi(r)===r)&&e>=0;var r},C=function(t,e){return e=K(e),S(t,e)?d(2,t[e]):a(t,e)},O=function(t,e,r){return e=K(e),!(S(t,e)&&A(r)&&B(r,"value"))||B(r,"get")||B(r,"set")||r.configurable||B(r,"writable")&&!r.writable||B(r,"enumerable")&&!r.enumerable?o(t,e,r):(t[e]=r.value,t)};f?(v||(et.f=C,it.f=O,w(b,"buffer"),w(b,"byteOffset"),w(b,"byteLength"),w(b,"length")),qt({target:"Object",stat:!0,forced:!v},{getOwnPropertyDescriptor:C,defineProperty:O}),t.exports=function(t,a,f){var d=t.match(/\d+$/)[0]/8,m=t+(f?"Clamped":"")+"Array",w="get"+t,S="set"+t,C=c[m],O=C,R=O&&O.prototype,I={},_=function(t,e){o(t,e,{get:function(){return function(t,e){var r=n(t);return r.view[w](e*d+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var i=n(t);f&&(r=(r=u(r))<0?0:r>255?255:255&r),i.view[S](e*d+i.byteOffset,r,!0)}(this,e,t)},enumerable:!0})};v?fi&&(O=a((function(t,e,r,n){return xr(t,O,m),Or(A(e)?E(e)?void 0!==n?new C(e,vi(r,d),n):void 0!==r?new C(e,vi(r,d)):new C(e):T(e)?x(O,e):di.call(O,e):new C(Jr(e)),t,O)})),Xe&&Xe(O,y),r(e(C),(function(t){t in O||ot(O,t,C[t])})),O.prototype=R):(O=a((function(t,e,r,n){xr(t,O,m);var o,a,u,c=0,f=0;if(A(e)){if(!E(e))return T(e)?x(O,e):di.call(O,e);o=e,f=vi(r,d);var v=e.byteLength;if(void 0===n){if(v%d)throw s("Wrong length");if((a=v-f)<0)throw s("Wrong length")}else if((a=Rt(n)*d)+f>v)throw s("Wrong length");u=a/d}else u=Jr(e),o=new l(a=u*d);for(i(t,{buffer:o,byteOffset:f,byteLength:a,length:u,view:new h(o)});c<u;)_(t,c++)})),Xe&&Xe(O,y),R=O.prototype=Oe(b)),R.constructor!==O&&ot(R,"constructor",O),ot(R,p,O),g&&ot(R,g,m),I[m]=O,qt({global:!0,forced:O!=C,sham:!v},I),"BYTES_PER_ELEMENT"in O||ot(O,"BYTES_PER_ELEMENT",d),"BYTES_PER_ELEMENT"in R||ot(R,"BYTES_PER_ELEMENT",d),_r(m)}):t.exports=function(){}}))("Float32",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var gi=Math.min,yi=[].copyWithin||function(t,e){var r=M(this),n=Rt(r.length),i=Pt(t,n),o=Pt(e,n),a=arguments.length>2?arguments[2]:void 0,u=gi((void 0===a?n:Pt(a,n))-o,n-i),s=1;for(o<i&&i<o+u&&(s=-1,o+=u-1,i+=u-1);u-- >0;)o in r?r[i]=r[o]:delete r[i],i+=s,o+=s;return r},bi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("copyWithin",(function(t,e){return yi.call(bi(this),t,e,arguments.length>2?arguments[2]:void 0)}));var mi=ie.every,Ti=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("every",(function(t){return mi(Ti(this),t,arguments.length>1?arguments[1]:void 0)}));var xi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("fill",(function(t){return an.apply(xi(this),arguments)}));var Ai=ui.TYPED_ARRAY_CONSTRUCTOR,wi=ui.aTypedArrayConstructor,Ei=function(t){return wi(Ln(t,t[Ai]))},Si=function(t,e){return function(t,e){for(var r=0,n=e.length,i=new t(n);n>r;)i[r]=e[r++];return i}(Ei(t),e)},Ci=ie.filter,Oi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("filter",(function(t){var e=Ci(Oi(this),t,arguments.length>1?arguments[1]:void 0);return Si(this,e)}));var Ri=ie.find,Ii=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("find",(function(t){return Ri(Ii(this),t,arguments.length>1?arguments[1]:void 0)}));var _i=ie.findIndex,Pi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("findIndex",(function(t){return _i(Pi(this),t,arguments.length>1?arguments[1]:void 0)}));var ki=ie.forEach,Di=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("forEach",(function(t){ki(Di(this),t,arguments.length>1?arguments[1]:void 0)}));var Ui=Dt.includes,ji=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("includes",(function(t){return Ui(ji(this),t,arguments.length>1?arguments[1]:void 0)}));var Li=Dt.indexOf,Mi=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("indexOf",(function(t){return Li(Mi(this),t,arguments.length>1?arguments[1]:void 0)}));var Fi=$("iterator"),Bi=c.Uint8Array,Ni=er.values,Yi=er.keys,Vi=er.entries,Wi=ui.aTypedArray,Gi=ui.exportTypedArrayMethod,zi=Bi&&Bi.prototype[Fi],$i=!!zi&&("values"==zi.name||null==zi.name),Xi=function(){return Ni.call(Wi(this))};Gi("entries",(function(){return Vi.call(Wi(this))})),Gi("keys",(function(){return Yi.call(Wi(this))})),Gi("values",Xi,!$i),Gi(Fi,Xi,!$i);var Hi=ui.aTypedArray,Ki=[].join;(0,ui.exportTypedArrayMethod)("join",(function(t){return Ki.apply(Hi(this),arguments)}));var qi=function(t,e){var r=[][t];return!!r&&l((function(){r.call(null,e||function(){throw 1},1)}))},Ji=Math.min,Qi=[].lastIndexOf,Zi=!!Qi&&1/[1].lastIndexOf(1,-0)<0,to=qi("lastIndexOf"),eo=Zi||!to?function(t){if(Zi)return Qi.apply(this,arguments)||0;var e=x(this),r=Rt(e.length),n=r-1;for(arguments.length>1&&(n=Ji(n,Ct(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:Qi,ro=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("lastIndexOf",(function(t){return eo.apply(ro(this),arguments)}));var no=ie.map,io=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("map",(function(t){return no(io(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(Ei(t))(e)}))}));var oo=function(t){return function(e,r,n,i){Jt(r);var o=M(e),a=m(o),u=Rt(o.length),s=t?u-1:0,c=t?-1:1;if(n<2)for(;;){if(s in a){i=a[s],s+=c;break}if(s+=c,t?s<0:u<=s)throw TypeError("Reduce of empty array with no initial value")}for(;t?s>=0:u>s;s+=c)s in a&&(i=r(i,a[s],s,o));return i}},ao={left:oo(!1),right:oo(!0)},uo=ao.left,so=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("reduce",(function(t){return uo(so(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var co=ao.right,lo=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("reduceRight",(function(t){return co(lo(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}));var fo=ui.aTypedArray,ho=ui.exportTypedArrayMethod,vo=Math.floor;ho("reverse",(function(){for(var t,e=fo(this).length,r=vo(e/2),n=0;n<r;)t=this[n],this[n++]=this[--e],this[e]=t;return this}));var po=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("set",(function(t){po(this);var e=vi(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=M(t),i=Rt(n.length),o=0;if(i+e>r)throw RangeError("Wrong length");for(;o<i;)this[e+o]=n[o++]}),l((function(){new Int8Array(1).set({})})));var go=ui.aTypedArray,yo=[].slice;(0,ui.exportTypedArrayMethod)("slice",(function(t,e){for(var r=yo.call(go(this),t,e),n=Ei(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),l((function(){new Int8Array(1).slice()})));var bo=ie.some,mo=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("some",(function(t){return bo(mo(this),t,arguments.length>1?arguments[1]:void 0)}));var To=Math.floor,xo=function(t,e){var r=t.length,n=To(r/2);return r<8?Ao(t,e):wo(xo(t.slice(0,n),e),xo(t.slice(n),e),e)},Ao=function(t,e){for(var r,n,i=t.length,o=1;o<i;){for(n=o,r=t[o];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==o++&&(t[n]=r)}return t},wo=function(t,e,r){for(var n=t.length,i=e.length,o=0,a=0,u=[];o<n||a<i;)o<n&&a<i?u.push(r(t[o],e[a])<=0?t[o++]:e[a++]):u.push(o<n?t[o++]:e[a++]);return u},Eo=xo,So=S.match(/firefox\/(\d+)/i),Co=!!So&&+So[1],Oo=/MSIE|Trident/.test(S),Ro=S.match(/AppleWebKit\/(\d+)\./),Io=!!Ro&&+Ro[1],_o=ui.aTypedArray,Po=ui.exportTypedArrayMethod,ko=c.Uint16Array,Do=ko&&ko.prototype.sort,Uo=!!Do&&!l((function(){var t=new ko(2);t.sort(null),t.sort({})})),jo=!!Do&&!l((function(){if(_)return _<74;if(Co)return Co<67;if(Oo)return!0;if(Io)return Io<602;var t,e,r=new ko(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(r.sort((function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));Po("sort",(function(t){if(void 0!==t&&Jt(t),jo)return Do.call(this,t);_o(this);var e,r=Rt(this.length),n=Array(r);for(e=0;e<r;e++)n[e]=this[e];for(n=Eo(this,function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t)),e=0;e<r;e++)this[e]=n[e];return this}),!jo||Uo);var Lo=ui.aTypedArray;(0,ui.exportTypedArrayMethod)("subarray",(function(t,e){var r=Lo(this),n=r.length,i=Pt(t,n);return new(Ei(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,Rt((void 0===e?n:Pt(e,n))-i))}));var Mo=c.Int8Array,Fo=ui.aTypedArray,Bo=ui.exportTypedArrayMethod,No=[].toLocaleString,Yo=[].slice,Vo=!!Mo&&l((function(){No.call(new Mo(1))}));Bo("toLocaleString",(function(){return No.apply(Vo?Yo.call(Fo(this)):Fo(this),arguments)}),l((function(){return[1,2].toLocaleString()!=new Mo([1,2]).toLocaleString()}))||!l((function(){Mo.prototype.toLocaleString.call([1,2])})));var Wo=ui.exportTypedArrayMethod,Go=c.Uint8Array,zo=Go&&Go.prototype||{},$o=[].toString,Xo=[].join;l((function(){$o.call({})}))&&($o=function(){return Xo.call(this)});var Ho=zo.toString!=$o;Wo("toString",$o,Ho);var Ko=function(){var t=rt(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},qo=function(t,e){return RegExp(t,e)},Jo={UNSUPPORTED_Y:l((function(){var t=qo("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:l((function(){var t=qo("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Qo=l((function(){var t=RegExp(".","string".charAt(0));return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),Zo=l((function(){var t=RegExp("(?<a>b)","string".charAt(5));return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),ta=At.get,ea=RegExp.prototype.exec,ra=L("native-string-replace",String.prototype.replace),na=ea,ia=function(){var t=/a/,e=/b*/g;return ea.call(t,"a"),ea.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),oa=Jo.UNSUPPORTED_Y||Jo.BROKEN_CARET,aa=void 0!==/()??/.exec("")[1];(ia||aa||oa||Qo||Zo)&&(na=function(t){var e,r,n,i,o,a,u,s=this,c=ta(s),l=Lr(t),f=c.raw;if(f)return f.lastIndex=s.lastIndex,e=na.call(f,l),s.lastIndex=f.lastIndex,e;var h=c.groups,v=oa&&s.sticky,p=Ko.call(s),d=s.source,g=0,y=l;if(v&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=l.slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==l.charAt(s.lastIndex-1))&&(d="(?: "+d+")",y=" "+y,g++),r=new RegExp("^(?:"+d+")",p)),aa&&(r=new RegExp("^"+d+"$(?!\\s)",p)),ia&&(n=s.lastIndex),i=ea.call(v?r:s,y),v?i?(i.input=i.input.slice(g),i[0]=i[0].slice(g),i.index=s.lastIndex,s.lastIndex+=i[0].length):s.lastIndex=0:ia&&i&&(s.lastIndex=s.global?i.index+i[0].length:n),aa&&i&&i.length>1&&ra.call(i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=a=Oe(null),o=0;o<h.length;o++)a[(u=h[o])[0]]=i[u[1]];return i});var ua=na;qt({target:"RegExp",proto:!0,forced:/./.exec!==ua},{exec:ua});var sa=$("species"),ca=RegExp.prototype,la=Fr.charAt,fa=function(t,e,r){return e+(r?la(t,e).length:1)},ha=Math.floor,va="".replace,pa=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,da=/\$([$&'`]|\d{1,2})/g,ga=function(t,e,r,n,i,o){var a=r+t.length,u=n.length,s=da;return void 0!==i&&(i=M(i),s=pa),va.call(o,s,(function(o,s){var c;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(a);case"<":c=i[s.slice(1,-1)];break;default:var l=+s;if(0===l)return o;if(l>u){var f=ha(l/10);return 0===f?o:f<=u?void 0===n[f-1]?s.charAt(1):n[f-1]+s.charAt(1):o}c=n[l-1]}return void 0===c?"":c}))},ya=function(t,e){var r=t.exec;if("function"==typeof r){var n=r.call(t,e);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==y(t))throw TypeError("RegExp#exec called on incompatible receiver");return ua.call(t,e)},ba=$("replace"),ma=Math.max,Ta=Math.min,xa="$0"==="a".replace(/./,"$0"),Aa=!!/./[ba]&&""===/./[ba]("a","$0");!function(t,e,r,n){var i=$(t),o=!l((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),a=o&&!l((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[sa]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return e=!0,null},r[i](""),!e}));if(!o||!a||r){var u=/./[i],s=e(i,""[t],(function(t,e,r,n,i){var a=e.exec;return a===ua||a===ca.exec?o&&!i?{done:!0,value:u.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}}));wt(String.prototype,t,s[0]),wt(ca,i,s[1])}n&&ot(ca[i],"sham",!0)}("replace",(function(t,e,r){var n=Aa?"$":"$0";return[function(t,r){var n=T(this),i=null==t?void 0:t[ba];return void 0!==i?i.call(t,n,r):e.call(Lr(n),t,r)},function(t,i){var o=rt(this),a=Lr(t);if("string"==typeof i&&-1===i.indexOf(n)&&-1===i.indexOf("$<")){var u=r(e,o,a,i);if(u.done)return u.value}var s="function"==typeof i;s||(i=Lr(i));var c=o.global;if(c){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=ya(o,a);if(null===h)break;if(f.push(h),!c)break;""===Lr(h[0])&&(o.lastIndex=fa(a,Rt(o.lastIndex),l))}for(var v,p="",d=0,g=0;g<f.length;g++){h=f[g];for(var y=Lr(h[0]),b=ma(Ta(Ct(h.index),a.length),0),m=[],T=1;T<h.length;T++)m.push(void 0===(v=h[T])?v:String(v));var x=h.groups;if(s){var A=[y].concat(m,b,a);void 0!==x&&A.push(x);var w=Lr(i.apply(void 0,A))}else w=ga(y,a,b,m,x,i);b>=d&&(p+=a.slice(d,b)+w,d=b+y.length)}return p+a.slice(d)}]}),!!l((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!xa||Aa);var wa=RegExp.prototype,Ea=wa.toString,Sa=l((function(){return"/a/b"!=Ea.call({source:"a",flags:"b"})})),Ca="toString"!=Ea.name;(Sa||Ca)&&wt(RegExp.prototype,"toString",(function(){var t=rt(this),e=Lr(t.source),r=t.flags;return"/"+e+"/"+Lr(void 0===r&&t instanceof RegExp&&!("flags"in wa)?Ko.call(t):r)}),{unsafe:!0});var Oa=$("match"),Ra=it.f,Ia=Ft.f,_a=At.enforce,Pa=$("match"),ka=c.RegExp,Da=ka.prototype,Ua=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,ja=/a/g,La=/a/g,Ma=new ka(ja)!==ja,Fa=Jo.UNSUPPORTED_Y,Ba=f&&(!Ma||Fa||Qo||Zo||l((function(){return La[Pa]=!1,ka(ja)!=ja||ka(La)==La||"/a/i"!=ka(ja,"i")})));if(Ht("RegExp",Ba)){for(var Na=function(t,e){var r,n,i,o,a,u,s,c,l=this instanceof Na,f=A(r=t)&&(void 0!==(n=r[Oa])?!!n:"RegExp"==y(r)),h=void 0===e,v=[],p=t;if(!l&&f&&h&&t.constructor===Na)return t;if((f||t instanceof Na)&&(t=t.source,h&&(e="flags"in p?p.flags:Ko.call(p))),t=void 0===t?"":Lr(t),e=void 0===e?"":Lr(e),p=t,Qo&&"dotAll"in ja&&(o=!!e&&e.indexOf("s")>-1)&&(e=e.replace(/s/g,"")),i=e,Fa&&"sticky"in ja&&(a=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,"")),Zo&&(t=(u=function(t){for(var e,r=t.length,n=0,i="",o=[],a={},u=!1,s=!1,c=0,l="";n<=r;n++){if("\\"===(e=t.charAt(n)))e+=t.charAt(++n);else if("]"===e)u=!1;else if(!u)switch(!0){case"["===e:u=!0;break;case"("===e:Ua.test(t.slice(n+1))&&(n+=2,s=!0),i+=e,c++;continue;case">"===e&&s:if(""===l||B(a,l))throw new SyntaxError("Invalid capture group name");a[l]=!0,o.push([l,c]),s=!1,l="";continue}s?l+=e:i+=e}return[i,o]}(t))[0],v=u[1]),s=Or(ka(t,e),l?this:Da,Na),(o||a||v.length)&&(c=_a(s),o&&(c.dotAll=!0,c.raw=Na(function(t){for(var e,r=t.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(e=t.charAt(n))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),i+=e):i+="[\\s\\S]":i+=e+t.charAt(++n);return i}(t),i)),a&&(c.sticky=!0),v.length&&(c.groups=v)),t!==p)try{ot(s,"source",""===p?"(?:)":p)}catch(Ja){}return s},Ya=function(t){t in Na||Ra(Na,t,{configurable:!0,get:function(){return ka[t]},set:function(e){ka[t]=e}})},Va=Ia(ka),Wa=0;Va.length>Wa;)Ya(Va[Wa++]);Da.constructor=Na,Na.prototype=Da,wt(c,"RegExp",Na)}_r("RegExp");var Ga=[].join,za=m!=Object,$a=qi("join",",");function Xa(t,e,r){var n=function(t,e,r){var n=new RegExp("\\b".concat(e," \\w+ (\\w+)"),"ig");t.replace(n,(function(t,e){return r[e]=0,t}))},i=function(t,e,r){var n=t.createShader(r);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)?n:(console.log(t.getShaderInfoLog(n)),null)};this.uniform={},this.attribute={};var o=i(t,e,t.VERTEX_SHADER),a=i(t,r,t.FRAGMENT_SHADER);for(var u in this.id=t.createProgram(),t.attachShader(this.id,o),t.attachShader(this.id,a),t.linkProgram(this.id),t.getProgramParameter(this.id,t.LINK_STATUS)||console.log(t.getProgramInfoLog(this.id)),t.useProgram(this.id),n(e,"attribute",this.attribute),this.attribute)this.attribute[u]=t.getAttribLocation(this.id,u);for(var s in n(e,"uniform",this.uniform),n(r,"uniform",this.uniform),this.uniform)this.uniform[s]=t.getUniformLocation(this.id,s)}qt({target:"Array",proto:!0,forced:za||!$a},{join:function(t){return Ga.call(x(this),void 0===t?",":t)}});var Ha=function(){function t(r){e(this,t),this.canvas=r.canvas,this.width=r.width||640,this.height=r.height||480,this.gl=this.createGL(r.canvas),this.sourceTexture=this.gl.createTexture(),this.vertexBuffer=null,this.currentProgram=null,this.applied=!1,this.beautyParams={beauty:.5,brightness:.5,ruddy:.5}}return n(t,[{key:"setRect",value:function(t,e){this.width=t,this.height=e}},{key:"apply",value:function(t){if(!this.vertexBuffer){var e=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,-1,1,0,0,1,-1,1,1,1,1,1,0]);this.vertexBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}this.gl.viewport(0,0,this.width,this.height),this.gl.bindTexture(this.gl.TEXTURE_2D,this.sourceTexture),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.applied?this.gl.texSubImage2D(this.gl.TEXTURE_2D,0,0,0,this.gl.RGB,this.gl.UNSIGNED_BYTE,t):(this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGB,this.gl.RGB,this.gl.UNSIGNED_BYTE,t),this.applied=!0),this.beauty()}},{key:"beauty",value:function(){var t=this.beautyParams,e=t.beauty,r=t.brightness,n=t.ruddy,i=2/this.width,o=2/this.height,a=this.compileBeautyShader();this.gl.uniform2f(a.uniform.singleStepOffset,i,o);var u=new Float32Array([1-.8*e,1-.6*e,.1+.45*n,.1+.45*n]);this.gl.uniform4fv(a.uniform.params,u),this.gl.uniform1f(a.uniform.brightness,.12*r),this.draw()}},{key:"draw",value:function(){this.gl.bindTexture(this.gl.TEXTURE_2D,this.sourceTexture),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.uniform1f(this.currentProgram.uniform.flipY,1),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}},{key:"compileBeautyShader",value:function(){if(this.currentProgram)return this.currentProgram;this.currentProgram=new Xa(this.gl,["precision highp float;","attribute vec2 pos;","attribute vec2 uv;","varying vec2 vUv;","uniform float flipY;","void main(void) {","vUv = uv;","gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.);","}"].join("\n"),["precision highp float;","uniform vec2 singleStepOffset;","uniform sampler2D texture;","uniform vec4 params;","uniform float brightness;","varying vec2 vUv;","const highp vec3 W = vec3(0.299,0.587,0.114);","const mat3 saturateMatrix = mat3(1.1102,-0.0598,-0.061,-0.0774,1.0826,-0.1186,-0.0228,-0.0228,1.1772);","vec2 blurCoordinates[24];","float hardLight(float color){","if(color <= 0.5){","color = color * color * 2.0;","} else {","color = 1.0 - ((1.0 - color)*(1.0 - color) * 2.0);","}","return color;","}","void main(){","vec3 centralColor = texture2D(texture, vUv).rgb;","blurCoordinates[0] = vUv.xy + singleStepOffset * vec2(0.0, -10.0);","blurCoordinates[1] = vUv.xy + singleStepOffset * vec2(0.0, 10.0);","blurCoordinates[2] = vUv.xy + singleStepOffset * vec2(-10.0, 0.0);","blurCoordinates[3] = vUv.xy + singleStepOffset * vec2(10.0, 0.0);","blurCoordinates[4] = vUv.xy + singleStepOffset * vec2(5.0, -8.0);","blurCoordinates[5] = vUv.xy + singleStepOffset * vec2(5.0, 8.0);","blurCoordinates[6] = vUv.xy + singleStepOffset * vec2(-5.0, 8.0);","blurCoordinates[7] = vUv.xy + singleStepOffset * vec2(-5.0, -8.0);","blurCoordinates[8] = vUv.xy + singleStepOffset * vec2(8.0, -5.0);","blurCoordinates[9] = vUv.xy + singleStepOffset * vec2(8.0, 5.0);","blurCoordinates[10] = vUv.xy + singleStepOffset * vec2(-8.0, 5.0);","blurCoordinates[11] = vUv.xy + singleStepOffset * vec2(-8.0, -5.0);","blurCoordinates[12] = vUv.xy + singleStepOffset * vec2(0.0, -6.0);","blurCoordinates[13] = vUv.xy + singleStepOffset * vec2(0.0, 6.0);","blurCoordinates[14] = vUv.xy + singleStepOffset * vec2(6.0, 0.0);","blurCoordinates[15] = vUv.xy + singleStepOffset * vec2(-6.0, 0.0);","blurCoordinates[16] = vUv.xy + singleStepOffset * vec2(-4.0, -4.0);","blurCoordinates[17] = vUv.xy + singleStepOffset * vec2(-4.0, 4.0);","blurCoordinates[18] = vUv.xy + singleStepOffset * vec2(4.0, -4.0);","blurCoordinates[19] = vUv.xy + singleStepOffset * vec2(4.0, 4.0);","blurCoordinates[20] = vUv.xy + singleStepOffset * vec2(-2.0, -2.0);","blurCoordinates[21] = vUv.xy + singleStepOffset * vec2(-2.0, 2.0);","blurCoordinates[22] = vUv.xy + singleStepOffset * vec2(2.0, -2.0);","blurCoordinates[23] = vUv.xy + singleStepOffset * vec2(2.0, 2.0);","float sampleColor = centralColor.g * 22.0;","sampleColor += texture2D(texture, blurCoordinates[0]).g;","sampleColor += texture2D(texture, blurCoordinates[1]).g;","sampleColor += texture2D(texture, blurCoordinates[2]).g;","sampleColor += texture2D(texture, blurCoordinates[3]).g;","sampleColor += texture2D(texture, blurCoordinates[4]).g;","sampleColor += texture2D(texture, blurCoordinates[5]).g;","sampleColor += texture2D(texture, blurCoordinates[6]).g;","sampleColor += texture2D(texture, blurCoordinates[7]).g;","sampleColor += texture2D(texture, blurCoordinates[8]).g;","sampleColor += texture2D(texture, blurCoordinates[9]).g;","sampleColor += texture2D(texture, blurCoordinates[10]).g;","sampleColor += texture2D(texture, blurCoordinates[11]).g;","sampleColor += texture2D(texture, blurCoordinates[12]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[13]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[14]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[15]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[16]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[17]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[18]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[19]).g * 2.0;","sampleColor += texture2D(texture, blurCoordinates[20]).g * 3.0;","sampleColor += texture2D(texture, blurCoordinates[21]).g * 3.0;","sampleColor += texture2D(texture, blurCoordinates[22]).g * 3.0;","sampleColor += texture2D(texture, blurCoordinates[23]).g * 3.0;","sampleColor = sampleColor / 62.0;","float highPass = centralColor.g - sampleColor + 0.5;","for(int i = 0; i < 5;i++){","highPass = hardLight(highPass);","}","float luminance = dot(centralColor, W);","float alpha = pow(luminance, params.r);","vec3 smoothColor = centralColor + (centralColor-vec3(highPass))*alpha*0.1;","smoothColor.r = clamp(pow(smoothColor.r, params.g),0.0,1.0);","smoothColor.g = clamp(pow(smoothColor.g, params.g),0.0,1.0);","smoothColor.b = clamp(pow(smoothColor.b, params.g),0.0,1.0);","vec3 screen = vec3(1.0) - (vec3(1.0)-smoothColor) * (vec3(1.0)-centralColor);","vec3 lighten = max(smoothColor, centralColor);","vec3 softLight = 2.0 * centralColor*smoothColor + centralColor*centralColor - 2.0 * centralColor*centralColor * smoothColor;","gl_FragColor = vec4(mix(centralColor, screen, alpha), 1.0);","gl_FragColor.rgb = mix(gl_FragColor.rgb, lighten, alpha);","gl_FragColor.rgb = mix(gl_FragColor.rgb, softLight, params.b);","vec3 satColor = gl_FragColor.rgb * saturateMatrix;","gl_FragColor.rgb = mix(gl_FragColor.rgb, satColor, params.a);","gl_FragColor.rgb = vec3(gl_FragColor.rgb + vec3(brightness));","}"].join("\n"));var t=Float32Array.BYTES_PER_ELEMENT,e=4*t;return this.gl.enableVertexAttribArray(this.currentProgram.attribute.pos),this.gl.vertexAttribPointer(this.currentProgram.attribute.pos,2,this.gl.FLOAT,!1,e,0),this.gl.enableVertexAttribArray(this.currentProgram.attribute.uv),this.gl.vertexAttribPointer(this.currentProgram.attribute.uv,2,this.gl.FLOAT,!1,e,2*t),this.currentProgram}},{key:"createGL",value:function(t){var e=t.getContext("webgl");if(e||t.getContext("experimental-webgl",{preserveDrawingBuffer:!0}),!e)throw"Couldn't get WebGL context";return e}},{key:"setBeautyParams",value:function(t){this.beautyParams=t}},{key:"reset",value:function(){this.applied=!1}}]),t}(),Ka=function(t){return"number"==typeof t},qa=function(){function r(){e(this,r),this.video=document.createElement("video"),this.video.loop=!0,this.video.autoplay=!0,this.canvas=document.createElement("canvas"),this.filter=new Ha({canvas:this.canvas}),this.beautyParams={beauty:.5,brightness:.5,ruddy:.5},this.timeoutId=null,this.rafId=null,this.startTime=null,this.originTrack=null,this.beautyTrack=null,this.localStream=null,this.frameRate=null,this.disableStatus=!1}return n(r,[{key:"generateBeautyStream",value:function(t){var e=t.getVideoTrack();if(!e)throw new Error("Your localStream does not contain video track.");var r=this.generateBeautyTrack(e);return t.replaceTrack(r),this.localStream=t,t.setBeautyStatus&&t.setBeautyStatus(!0),t}},{key:"generateBeautyTrack",value:function(t){var e=this;this.reset();var r=t.getSettings();this.frameRate=r.frameRate,this.filter.setRect(r.width,r.height),this.setRect(r.width,r.height);var n=new MediaStream;n.addTrack(t),this.video.srcObject=n,this.video.play();var i=this.generateVideoTrackFromCanvasCapture(r.frameRate||15);return this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((function(){e.startTime=(new Date).getTime(),e.render()})),this.installEvents(),this.setBeautyTrack({originTrack:t,beautyTrack:i}),this.originTrack=t,this.beautyTrack=i,i}},{key:"draw",value:function(){this.video&&this.video.readyState===this.video.HAVE_ENOUGH_DATA&&this.filter.apply(this.video)}},{key:"render",value:function(){var t=this,e=(new Date).getTime();e-this.startTime>1e3/this.frameRate&&(this.draw(),this.startTime=e),document.hidden?(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.render()}),1e3/this.frameRate)):(this.timeoutId&&clearTimeout(this.timeoutId),this.rafId&&cancelAnimationFrame(this.rafId),requestAnimationFrame(this.render.bind(this)))}},{key:"setBeautyParam",value:function(t){var e=t.beauty,r=t.brightness,n=t.ruddy;Ka(e)&&(this.beautyParams.beauty=e),Ka(r)&&(this.beautyParams.brightness=r),Ka(n)&&(this.beautyParams.ruddy=n),this.filter.setBeautyParams(this.beautyParams),this.getClose()&&!this.disableStatus&&this.disable(),!this.getClose()&&this.disableStatus&&this.enable()}},{key:"setRect",value:function(t,e){var r=t||640,n=e||480;this.video.height=n,this.video.width=r,this.canvas.height=n,this.canvas.width=r}},{key:"reset",value:function(){cancelAnimationFrame(this.rafId),clearTimeout(this.timeoutId),this.video.pause(),this.filter.reset(),this.beautyTrack&&this.beautyTrack.stop(),this.originTrack&&this.originTrack.stop()}},{key:"destroy",value:function(){cancelAnimationFrame(this.rafId),clearTimeout(this.timeoutId),this.canvas&&(this.canvas.width=0,this.canvas.height=0,this.canvas.remove(),delete this.canvas),this.video&&(this.video.pause(),this.video.removeAttribute("srcObject"),this.video.removeAttribute("src"),this.video.load(),this.video.width=0,this.video.height=0,this.video.remove(),delete this.video),this.beautyTrack&&this.beautyTrack.stop(),this.originTrack&&this.originTrack.stop(),this.uninstallEvents()}},{key:"generateVideoTrackFromCanvasCapture",value:function(t){return this.canvas.captureStream(t).getVideoTracks()[0]}},{key:"setBeautyTrack",value:function(e){var r=e.originTrack,n=e.beautyTrack;t&&(t.beautyTrackMap||(t.beautyTrackMap=new Map),t.beautyTrackMap.set(n.id,{originTrack:r,beautyTrack:n,param:this.beautyParams,pluginInstance:this}))}},{key:"disable",value:function(){this.localStream&&this.originTrack&&(this.localStream.replaceTrack(this.originTrack),cancelAnimationFrame(this.rafId),clearTimeout(this.timeoutId),this.disableStatus=!0)}},{key:"enable",value:function(){this.localStream&&this.beautyTrack&&(this.localStream.replaceTrack(this.beautyTrack),this.render(),this.disableStatus=!1)}},{key:"installEvents",value:function(){document.addEventListener("visibilitychange",this.render.bind(this))}},{key:"uninstallEvents",value:function(){document.removeEventListener("visibilitychange",this.render.bind(this))}},{key:"getClose",value:function(){return 0===this.beautyParams.beauty&&0===this.beautyParams.brightness&&0===this.beautyParams.ruddy}}]),r}();return t&&(t.getRTCBeautyPlugin=function(){return new qa}),qa}));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc