UNPKG

krtc-js-sdk

Version:

KRTC SDK for Web

103 lines 807 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.KRTC=t():e.KRTC=t()}(self,(()=>(()=>{var e={1277:function(e){var t;"undefined"!=typeof window&&(t=function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="./src/index.ts")}({"./node_modules/@babel/runtime/helpers/assertThisInitialized.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! \**********************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},"./node_modules/@babel/runtime/helpers/asyncToGenerator.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! \*****************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){function i(e,t,i,r,n,o,a){try{var s=e[o](a),c=s.value}catch(e){return void i(e)}s.done?t(c):Promise.resolve(c).then(r,n)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}},"./node_modules/@babel/runtime/helpers/createClass.js": /*!************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/createClass.js ***! \************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}},"./node_modules/@babel/runtime/helpers/extends.js": /*!********************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/extends.js ***! \********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){function i(){return e.exports=i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},i.apply(this,arguments)}e.exports=i},"./node_modules/@babel/runtime/helpers/inheritsLoose.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/inheritsLoose.js ***! \**************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},"./node_modules/@babel/runtime/regenerator/index.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/runtime/regenerator/index.js ***! \**********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports=i(/*! regenerator-runtime */"./node_modules/regenerator-runtime/runtime.js")},"./node_modules/events/events.js": /*!***************************************!*\ !*** ./node_modules/events/events.js ***! \***************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";var r,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(i,r){function n(i){e.removeListener(t,o),r(i)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",n),i([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&v(e,"error",t,i)}(e,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,i,r){var n,o,a,s;if(u(i),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),void 0===a)a=o[t]=i,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),(n=l(e))>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,i){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=h.bind(r);return n.listener=i,r.wrapFn=n,n}function f(e,t,i){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(n):g(n,n.length)}function m(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function g(e,t){for(var i=new Array(t),r=0;r<t;++r)i[r]=e[r];return i}function v(e,t,i,r){if("function"==typeof e.on)r.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(o){r.once&&e.removeEventListener(t,n),i(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r="error"===e,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=n[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,l=g(c,u);for(i=0;i<u;++i)o(l[i],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return u(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var i,r,n,o,a;if(u(t),void 0===(r=this._events))return this;if(void 0===(i=r[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(n=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){a=i[o].listener,n=o;break}if(n<0)return this;0===n?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,n),1===i.length&&(r[e]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var n,o=Object.keys(i);for(r=0;r<o.length;++r)"removeListener"!==(n=o[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},"./node_modules/regenerator-runtime/runtime.js": /*!*****************************************************!*\ !*** ./node_modules/regenerator-runtime/runtime.js ***! \*****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){var r=function(e){"use strict";var t,i=Object.prototype,r=i.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function u(e,t,i,r){var n=t&&t.prototype instanceof g?t:g,o=Object.create(n.prototype),a=new w(r||[]);return o._invoke=function(e,t,i){var r=d;return function(n,o){if(r===p)throw new Error("Generator is already running");if(r===f){if("throw"===n)throw o;return k()}for(i.method=n,i.arg=o;;){var a=i.delegate;if(a){var s=E(a,i);if(s){if(s===m)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===d)throw r=f,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=p;var c=l(e,t,i);if("normal"===c.type){if(r=i.done?f:h,c.arg===m)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(r=f,i.method="throw",i.arg=c.arg)}}}(e,i,a),o}function l(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",p="executing",f="completed",m={};function g(){}function v(){}function A(){}var T={};T[o]=function(){return this};var _=Object.getPrototypeOf,y=_&&_(_(R([])));y&&y!==i&&r.call(y,o)&&(T=y);var x=A.prototype=g.prototype=Object.create(T);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function i(n,o,a,s){var c=l(e[n],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var n;this._invoke=function(e,r){function o(){return new t((function(t,n){i(e,r,t,n)}))}return n=n?n.then(o,o):o()}}function E(e,i){var r=e.iterator[i.method];if(r===t){if(i.delegate=null,"throw"===i.method){if(e.iterator.return&&(i.method="return",i.arg=t,E(e,i),"throw"===i.method))return m;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var n=l(r,e.iterator,i.arg);if("throw"===n.type)return i.method="throw",i.arg=n.arg,i.delegate=null,m;var o=n.arg;return o?o.done?(i[e.resultName]=o.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,m):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,m)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function R(e){if(e){var i=e[o];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}return v.prototype=x.constructor=A,A.constructor=v,v.displayName=c(A,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,A):(e.__proto__=A,c(e,s,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},b(C.prototype),C.prototype[a]=function(){return this},e.AsyncIterator=C,e.async=function(t,i,r,n,o){void 0===o&&(o=Promise);var a=new C(u(t,i,r,n),o);return e.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(x),c(x,s,"Generator"),x[o]=function(){return this},x.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var r=t.pop();if(r in e)return i.value=r,i.done=!1,i}return i.done=!0,i}},e.values=R,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return s.type="throw",s.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),I(i),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var n=r.arg;I(i)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:R(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},"./node_modules/url-toolkit/src/url-toolkit.js": /*!*****************************************************!*\ !*** ./node_modules/url-toolkit/src/url-toolkit.js ***! \*****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){var r,n,o,a,s;r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var o=s.parseURL(t);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return i.alwaysNormalize?(o.path=s.normalizePath(o.path),s.buildURLFromParts(o)):t;var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var c=n.exec(a.path);a.netLoc=c[1],a.path=c[2]}a.netLoc&&!a.path&&(a.path="/");var u={scheme:a.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(u.netLoc=a.netLoc,"/"!==o.path[0]))if(o.path){var l=a.path,d=l.substring(0,l.lastIndexOf("/")+1)+o.path;u.path=s.normalizePath(d)}else u.path=a.path,o.params||(u.params=a.params,o.query||(u.query=a.query));return null===u.path&&(u.path=i.alwaysNormalize?s.normalizePath(o.path):o.path),s.buildURLFromParts(u)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(o,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s},"./src/config.ts": /*!***********************!*\ !*** ./src/config.ts ***! \***********************/ /*! exports provided: ConfigHelper */function(e,t,i){"use strict";i.r(t),i.d(t,"ConfigHelper",(function(){return h}));var r=i(/*! @babel/runtime/helpers/extends */"./node_modules/@babel/runtime/helpers/extends.js"),n=i.n(r),o=i(/*! ./core/tf-urls */"./src/core/tf-urls.ts"),a=i(/*! ./types/main */"./src/types/main.ts"),s=i(/*! ./utils/browser-helper */"./src/utils/browser-helper.ts"),c=i(/*! ./utils/log */"./src/utils/log.ts"),u=i(/*! ./utils/pixel-ratio */"./src/utils/pixel-ratio.ts"),l=i(/*! ./utils/tf-utils */"./src/utils/tf-utils.ts"),d={keepAlive:!1,pixelRatioByDevice:!0,webWorker:!1,virtualBackgroundModel:o.DEFAULT_VB_MODEL_URL,tfBaseUrl:o.TF_BASE_URL,tfThread:0,tfFastStart:!0,maxRetry:2,connectionTimeout:1e4,transmissionTimeout:0,retryDelay:500,log:c.LOG_LEVEL.LEVEL_INFO},h=function(){function e(){}return e.processConfig=function(e){var t=n()({},d);return n()(t,e),u.PixelRatio.setPixelRatioByDevice(t.pixelRatioByDevice),t},e.updateTFModelConfig=function(e,t){void 0===t&&(t=!1),"string"!=typeof e.virtualBackgroundModel&&(e.tfModelType||(e.tfModelType=navigator.hardwareConcurrency>=4&&Object(l.getIsSupportSIMD)()&&!s.default.isAndroid&&!s.default.isIOS?a.TFModelType.full:a.TFModelType.lite))},e}()},"./src/core/errors.ts": /*!****************************!*\ !*** ./src/core/errors.ts ***! \****************************/ /*! exports provided: ErrorCode */function(e,t,i){"use strict";var r;i.r(t),i.d(t,"ErrorCode",(function(){return r})),function(e){e[e.MAIN_ERROR=101]="MAIN_ERROR",e[e.WEBGL_INIT_ERROR=102]="WEBGL_INIT_ERROR",e[e.FILTER_SELECT_ERROR=103]="FILTER_SELECT_ERROR",e[e.WORKER_INIT_ERROR=104]="WORKER_INIT_ERROR",e[e.TF_INIT_ERROR=105]="TF_INIT_ERROR",e[e.TF_LOAD_ERROR=10]="TF_LOAD_ERROR",e[e.TF_JS_LOAD_ERROR=11]="TF_JS_LOAD_ERROR",e[e.TF_MODEL_LOAD_ERROR=12]="TF_MODEL_LOAD_ERROR"}(r||(r={}))},"./src/core/events.ts": /*!****************************!*\ !*** ./src/core/events.ts ***! \****************************/ /*! exports provided: default */function(e,t,i){"use strict";var r;i.r(t),function(e){e.INIT="init",e.ERROR="error",e.HEARTBEAT="heartbeat",e.DRAWN="drawn",e.FILTER_SELECTED="filterSelected",e.RESIZED="resized",e.RES_READY="ready",e.RES_EMPTIED="emptied",e.RES_RESIZE="resize"}(r||(r={})),t.default=r},"./src/core/filter-list.ts": /*!*********************************!*\ !*** ./src/core/filter-list.ts ***! \*********************************/ /*! exports provided: FilterList */function(e,t,i){"use strict";i.r(t),i.d(t,"FilterList",(function(){return r}));var r={base:{id:"base",filter:i(/*! ../filter/filter-base */"./src/filter/filter-base.ts").default}}},"./src/core/renderer-worker.ts": /*!*************************************!*\ !*** ./src/core/renderer-worker.ts ***! \*************************************/ /*! exports provided: default */ /*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/core/render-manager.ts (referenced with require.resolve) */function(e,t,i){"use strict";i.r(t);var r=i(/*! events */"./node_modules/events/events.js"),n=i(/*! ../utils/log */"./src/utils/log.ts"),o=i(/*! ./events */"./src/core/events.ts"),a=i(/*! ./filter-list */"./src/core/filter-list.ts"),s=i(/*! ./renderer */"./src/core/renderer.ts"),c=i(/*! ./worker-cmd */"./src/core/worker-cmd.ts");console.log(1001),t.default=function(e){var t=new r.EventEmitter,i=new s.default(t);console.log(1002),a.FilterList,console.log(1003),t.on(o.default.ERROR,(function(t){return e.postMessage({event:o.default.ERROR,data:t})})),t.on(o.default.DRAWN,(function(t){t&&t.bitmap?e.postMessage({event:o.default.DRAWN,data:t},[t.bitmap]):e.postMessage({event:o.default.DRAWN,data:t})})),t.on(o.default.FILTER_SELECTED,(function(t){return e.postMessage({event:o.default.FILTER_SELECTED,data:t})})),e.addEventListener("message",(function(e){var t=e.data;switch(t.cmd){case c.WorkerCmd.INIT:i.init(t.config,t.output),n.Log.level(t.config.log);break;case c.WorkerCmd.DRAW:i.draw(t.ts,t.data,t.extra);break;case c.WorkerCmd.SELECT:i.select(t.name,t.immediate);break;case c.WorkerCmd.SET_PARAMS:i.setParams(t.params);break;case c.WorkerCmd.SET_FILTERS:break;case c.WorkerCmd.CLEAR:i.clear();break;case c.WorkerCmd.UPDATE_OUTPUT_SIZE:i.updateOutputSize(t.w,t.h)}}))}},"./src/core/renderer.ts": /*!******************************************!*\ !*** ./src/core/renderer.ts + 2 modules ***! \******************************************/ /*! exports provided: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/createClass.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/extends.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/core/errors.ts because of ./src/index.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/core/events.ts because of ./src/index.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/core/filter-list.ts because of ./src/index.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/filter/filter-group.ts because of ./src/filter/filter-unsharp-mask.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/types/main.ts because of ./src/index.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/log.ts because of ./src/index.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/tex-helper.ts because of ./src/index.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/webgl-utils.ts because of ./src/index.ts */function(e,t,i){"use strict";i.r(t);var r=i("./src/types/main.ts"),n=i("./node_modules/@babel/runtime/helpers/extends.js"),o=i.n(n),a=i("./node_modules/@babel/runtime/helpers/createClass.js"),s=i.n(a),c=i("./src/filter/filter-group.ts"),u=i("./src/utils/log.ts"),l=i("./src/core/filter-list.ts"),d="combo_m",h=function(){function e(e){this._itemNames=[],this._name="",this._filter=void 0,this._filterList=[],this._gl=null,this._params=void 0,this._config=void 0,this._config=e}e.getComboFilterName=function(e){return e.length?e.reduce((function(e,t){return e+"_"+t}),"c"):""};var t=e.prototype;return t.setWebGLCtx=function(e){u.Log.i(d,"set gl ctx"),this._gl=e||null,this._filter&&this._name&&this._newCombo()},t.select=function(t){if(t.length){var i=e.getComboFilterName(t);return this._name=i,this._itemNames=t,this._newCombo(),!0}return!1},t.setParams=function(e){var t=this;this._params&&(e.forEach((function(e,i){t._params&&(t._params[i]?o()(t._params[i],e):t._params[i]=e)})),this.applyParams())},t.applyParams=function(){var e=this,t=this._params;t&&(t.forEach((function(i,r){var n=e._filterList[r];if(i&&n)for(var o in i)t&&n&&(n[o]=i[o])})),this._filter&&this._filter.rebuildGraph())},t.destroy=function(){this._removeCombo(),this._itemNames=[],this._gl=null},t._newCombo=function(){var e=this;u.Log.i(d,"new combo"),this._removeCombo();var t=this._filter=new c.default(this._gl);this._itemNames.forEach((function(i){if(l.FilterList[i]){var r=new l.FilterList[i].filter(e._gl,e._config);e._filterList.push(r),t.addFilter(r)}})),this._params=this._getDefaultParams(this._itemNames)},t._removeCombo=function(){this._filter&&(this._filter.destroy(),delete l.FilterList[this._name],this._filter=void 0),this._filterList=[]},t._getDefaultParams=function(e){var t=[];return e.forEach((function(e,i){var r,n=l.FilterList[e].paramsInfo;n?Object.keys(n).forEach((function(e){n[e]&&n[e].default&&(r||(r={},t[i]=r),r[e]=n[e].default)})):t[i]=void 0})),t},s()(e,[{key:"filter",get:function(){return this._filter}},{key:"filterName",get:function(){return this._name}}]),e}(),p=i("./src/utils/tex-helper.ts"),f=i("./src/core/events.ts"),m=i("./src/utils/webgl-utils.ts"),g=i("./src/core/errors.ts"),v="filter-m",A=function(){function e(e,t,i){this._filterName="base",this._filter=void 0,this._gl=null,this._source=void 0,this._eventEmitter=void 0,this._config=void 0,this._inWorker=void 0,this._externalGL=!1,this._comboM=void 0,this._waitingFilter=void 0,this._waitingFilterName="",this._recover=!1,this._eventEmitter=e,this._config=t,this._inWorker=i,this._comboM=new h(t)}var t=e.prototype;return t.select=function(e,t){var i,r,n=this;if(u.Log.i(v,"select: "+e),this.destroyWaitingFilter(),Array.isArray(e)){if(!this._comboM.select(e))return;t&&Array.isArray(t)&&this._comboM.setParams(t),i=this._comboM.filter}else{if(!(r=l.FilterList[e]))return;i=new r.filter(this._gl,this._config)}this._waitingFilter=i,this._waitingFilterName=e,i&&this._gl&&(this._source||this._inWorker)&&i.init().then((function(a){var s;if(n._waitingFilter=void 0,n._waitingFilterName="",null!=(s=i)&&s.gl){if(a.error)return n._recover||(n.select(n._filterName),n._recover=!0),void n._eventEmitter.emit(f.default.ERROR,a.error);if(n._recover=!1,n._filter&&n._filter.destroy(),i&&(n._source||n._inWorker)){i.active(),r?(r.paramsInfo&&Object.keys(r.paramsInfo).forEach((function(e){r&&r.paramsInfo&&r.paramsInfo[e]&&r.paramsInfo[e].default&&(r.params||(r.params={}),void 0===r.params[e]&&(r.params[e]=r.paramsInfo[e].default))})),r.params&&(t&&!Array.isArray(t)&&o()(r.params,t),n.setParams(i,r.params,r.id))):n._comboM.applyParams(),n._source&&i.setInput(n._source),n._filter=i,n._filterName=e;var c={name:e};a.extraInfo&&(c.extraInfo=a.extraInfo),u.Log.i(v,"selected: "+n._filterName),n._eventEmitter.emit(f.default.FILTER_SELECTED,c)}}}))},t.attachSource=function(e){this._source=e},t.detachSource=function(){this._source=void 0},t.attachOutput=function(e){this._gl&&this.destroyCurrentFilter(),e instanceof WebGLRenderingContext?(this._externalGL=!0,this._gl=e):(this._externalGL=!1,this._gl=Object(m.getWebGLRenderingContext)(e)),this._comboM.setWebGLCtx(this._gl),this._gl||this._eventEmitter.emit(f.default.ERROR,{code:g.ErrorCode.WEBGL_INIT_ERROR,reason:"init webgl error",fatal:!0})},t.detachOutput=function(){this._gl&&(this.clear(),this.destroyCurrentFilter()),this._gl=null},t.setParams=function(e,t,i){if(void 0===i&&(i=""),u.Log.i(v,"setParams",i,t),i=i||this._filterName,Array.isArray(i))Array.isArray(t)&&this._comboM.setParams(t);else if(!Array.isArray(t)){var r=l.FilterList[i];r&&(r.params?o()(r.params,t):r.params=t),t&&Object.keys(t).forEach((function(i){t&&e&&(e[i]=t[i])}))}},t.clear=function(){u.Log.i(v,"clear"),this._gl&&(this._gl.clearColor(0,0,0,0),this._gl.clear(this._gl.COLOR_BUFFER_BIT))},t.destroyCurrentFilter=function(e){void 0===e&&(e=!1),this._filter&&(this._filter.destroy(e),this._filter=void 0)},t.destroyWaitingFilter=function(){this._waitingFilter&&(this._waitingFilter.destroy(),this._waitingFilter=void 0),this._waitingFilterName=""},t.destroy=function(){u.Log.w(v,"destroy"),Object.keys(l.FilterList).forEach((function(e){l.FilterList[e].params=void 0})),this.destroyCurrentFilter(this._externalGL),this._comboM.destroy(),this.destroyWaitingFilter()},t._isSameName=function(e,t){return typeof e==typeof t&&(Array.isArray(e)?e.length===t.length&&0===e.filter((function(e,i){return e!==t[i]})).length:e===t)},s()(e,[{key:"filters",get:function(){var e=[];return Object.keys(l.FilterList).forEach((function(t){e.push({name:t,paramsInfo:l.FilterList[t].paramsInfo,extra:l.FilterList[t].extra})})),e}},{key:"currentFilterName",get:function(){return this._filterName}},{key:"currentFilter",get:function(){return this._filter}},{key:"waitingFilter",get:function(){return this._waitingFilter}},{key:"waitingFilterName",get:function(){return this._waitingFilterName}}]),e}(),T="renderer",_=function(){function e(e){this._eventEmitter=void 0,this._config=void 0,this._inputSize={width:0,height:0},this._outputSize={width:0,height:0},this._canvas=void 0,this._gl=null,this._source=void 0,this._filterName="base",this._filter=void 0,this._waitingFilter=void 0,this._waitingFilterName="",this._comboM=void 0,this._externalGL=!1,this._filterM=void 0,this._filterParams=void 0,this._inWorker=!1,this._eventEmitter=e,this._inWorker="undefined"==typeof HTMLElement}var t=e.prototype;return t.init=function(e,t){this._config=e,this._comboM=new h(e),this._filterM=new A(this._eventEmitter,e,this._inWorker),t instanceof WebGLRenderingContext?(this._canvas=t.canvas,this._gl=t):"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement?this._canvas=t:this._canvas=new OffscreenCanvas(t.width,t.height),this._canvas&&(this._outputSize.width=this._canvas.width,this._outputSize.height=this._canvas.height,this._filterM.attachOutput(this._canvas))},t.attachSource=function(e){this._source=e,this._filterM&&this._filterM.attachSource(e)},t.detachSource=function(){this._source=void 0,this._filterM&&this._filterM.detachSource()},t.select=function(e,t){u.Log.i(T,"select",e,t),(Array.isArray(e)||l.FilterList[e])&&(this._filterName=e,t&&this._selectFilter(e))},t.setParams=function(e){if(u.Log.i(T,"setParams"),this._filterM){var t=this._filterM.waitingFilter||this._filterM.currentFilter,i=this._filterM.waitingFilterName||this._filterM.currentFilterName;t?this._filterM.setParams(t,e,i):this._filterParams=e}},t.draw=function(e,t){var i,n=null==(i=this._filterM)?void 0:i.currentFilter;if(n){var o={ts:e,duration:0};t&&(n.setInputSize({width:t.width,height:t.height}),n.setInput(t,0,!1,!0)),this._source&&void 0===this._source.texture&&n.setInputSize(Object(p.getSourceSize)(this._source));var a=n.draw();a&&a.time&&(o.details=a.time),this._inWorker&&this._canvas instanceof OffscreenCanvas&&(!a||a.code===r.DrawStatuCode.success)?this._eventEmitter.emit(f.default.DRAWN,{time:o,bitmap:this._canvas.transferToImageBitmap()}):this._eventEmitter.emit(f.default.DRAWN,{time:o})}else this._eventEmitter.emit(f.default.DRAWN)},t.updateOutputSize=function(e,t){this._filterM&&this._canvas&&(this._outputSize.width!==e||this._outputSize.height!==t)&&(this._outputSize.width=e,this._outputSize.height=t,this._canvas.width=e,this._canvas.height=t,this._filterM.currentFilter&&this._filterM.currentFilter.onResize())},t.destroy=function(){Object.keys(l.FilterList).forEach((function(e){l.FilterList[e].params=void 0})),this.destroyCurrentFilter(this._externalGL),this._comboM&&this._comboM.destroy(),this._filterM&&this._filterM.destroy(),this.destroyWaitingFilter()},t.clear=function(){this._filterM&&this._filterM.clear()},t.destroyCurrentFilter=function(e){void 0===e&&(e=!1),this._filter&&(this._filter.destroy(e),this._filter=void 0)},t.destroyWaitingFilter=function(){this._waitingFilter&&(this._waitingFilter.destroy(),this._waitingFilter=void 0),this._waitingFilterName=""},t._selectFilter=function(e){u.Log.i(T,"_select",e,this._filterParams,this._filterM),this._filterM&&(this._filterM.select(e,this._filterParams),this._filterParams&&(this._filterParams=void 0))},e}();t.default=_},"./src/core/tf-urls.ts": /*!*****************************!*\ !*** ./src/core/tf-urls.ts ***! \*****************************/ /*! exports provided: WASM_URL, WASM_SIMD_URL, WASM_THREAD_URL, WASM_SIMD_THREAD_URL, JS_URL, JS_THREAD_URL, JS_SIMD_THREAD_URL, JS_WORKER_URL, MODEL, MODEL_LITE, DEFAULT_VB_MODEL_URL, TF_BASE_URL */function(e,t,i){"use strict";i.r(t),i.d(t,"WASM_URL",(function(){return r})),i.d(t,"WASM_SIMD_URL",(function(){return n})),i.d(t,"WASM_THREAD_URL",(function(){return o})),i.d(t,"WASM_SIMD_THREAD_URL",(function(){return a})),i.d(t,"JS_URL",(function(){return s})),i.d(t,"JS_THREAD_URL",(function(){return c})),i.d(t,"JS_SIMD_THREAD_URL",(function(){return u})),i.d(t,"JS_WORKER_URL",(function(){return l})),i.d(t,"MODEL",(function(){return d})),i.d(t,"MODEL_LITE",(function(){return h})),i.d(t,"DEFAULT_VB_MODEL_URL",(function(){return p})),i.d(t,"TF_BASE_URL",(function(){return f}));var r="ktf-1",n="ktf-s-1",o="ktf-t-1",a="ktf-st-1",s="ktf-js-1",c="ktf-t-js-1",u="ktf-st-js-1",l="ktf-st-jsw-1",d="portraitnet075cmask_160288_orimodel_mergebn_int8",h="portraitnetsmall015cmask_epoch7_256",p={full:d,lite:h},f="https://s2-10895.kwimgs.com/kos/nlav10895/tflite/"},"./src/core/worker-cmd.ts": /*!********************************!*\ !*** ./src/core/worker-cmd.ts ***! \********************************/ /*! exports provided: WorkerCmd */function(e,t,i){"use strict";var r;i.r(t),i.d(t,"WorkerCmd",(function(){return r})),function(e){e.INIT="init",e.DRAW="draw",e.CLEAR="clear",e.SELECT="select",e.SET_PARAMS="setParams",e.SET_FILTERS="setFilters",e.UPDATE_OUTPUT_SIZE="updateOutputSize",e.RESIZE="resize"}(r||(r={}))},"./src/filter/adv/filter-1977.ts": /*!***************************************************!*\ !*** ./src/filter/adv/filter-1977.ts + 2 modules ***! \***************************************************/ /*! exports provided: FILTER_1977_FRAGMENT, default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/asyncToGenerator.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/inheritsLoose.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/filter/filter-group-res.ts because of ./src/filter/adv/filter-valencia.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/filter/filter-three-input.ts because of ./src/filter/adv/filter-beauty.ts */function(e,t,i){"use strict";i.r(t),i.d(t,"FILTER_1977_FRAGMENT",(function(){return d}));var r=i("./node_modules/@babel/runtime/helpers/asyncToGenerator.js"),n=i.n(r),o=i("./node_modules/@babel/runtime/helpers/inheritsLoose.js"),a=i.n(o),s=i("./node_modules/@babel/runtime/regenerator/index.js"),c=i.n(s),u=i("./src/filter/filter-group-res.ts"),l=i("./src/filter/filter-three-input.ts"),d="\nprecision lowp float;\n \nvarying highp vec2 textureCoordinate;\n\nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\n\nvoid main()\n{\n \n vec4 texel = texture2D(inputImageTexture, textureCoordinate);\n \n texel.r = texture2D(inputImageTexture2, vec2(texel.r, .16666)).r;\n texel.g = texture2D(inputImageTexture2, vec2(texel.g, .5)).g;\n texel.b = texture2D(inputImageTexture2, vec2(texel.b, .83333)).b;\n \n gl_FragColor = texel;\n}\n",h=function(e){function t(t){var i;return(i=e.call(this,t)||this)._three=void 0,i._image=void 0,i._image2=void 0,i._three=new l.default(t),i._image={src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAABCAYAAAAxWXB3AAAAIGNIUk0AAG2YAABzjgAA2e0AAIGfAAB/mgAA2GMAADIXAAAdLVvevdMAAAAJcEhZcwAACxMAAAsTAQCanBgAAACdSURBVDjL3ZJBDgMxCAPH/lVv/UL//5j2AEkIK0U5dyUkJxhjyOrzen/5k0+AC+5nj/tMWoElZXhiRyJx3GMhItf5W9hLg8UddWRObhro6cXVi0vv0PbgevcQNfs8yqHdfAPHeSyXXZQ6GfvgvWrkTqYORWPb3a4xZ2fNT9nL4NK8ifUOVYfsuTD30X+uE29gLjg68H3owyWv8hvvB7DNA7Qc4vbAAAAAAElFTkSuQmCC"},i._image2={src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP8AAAD/CAYAAAA+CADKAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEA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ff/AOgYN/U474d+zYwbvF5uffC34WC/TZ4N+5cyfvIgvkOeL/888/eXdZIM8R/19//cW7DnBWjvj//vtvdgSYWTni37VrFzsIkCzws1isbPDv3r0b/CxWhut/4MrYoIuGfM4AAAAASUVORK5CYII="},i._res.setQueue([i._image,i._image2]),i._res.start(),i}a()(t,e);var i=t.prototype;return i.active=function(){this._three.active()},i.init=function(){var e=n()(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.addFilter(this._three),e.abrupt("return",this._three.init({fragment:d}));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),i._setResInput=function(){!this._resUploaded&&this._res.ready&&this._image.img&&this._image2.img&&(this._three.active(),this._three.setInput(this._image.img,1,!0),this._three.setInput(this._image2.img,2,!0),this._resUploaded=!0)},t}(u.default);t.default=h},"./src/filter/adv/filter-background.ts": /*!*********************************************!*\ !*** ./src/filter/adv/filter-background.ts ***! \*********************************************/ /*! exports provided: FILTER_MIX_FRAGMENT, default */ /*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/index.ts (referenced with require.resolve) */function(e,t,i){"use strict";i.r(t),i.d(t,"FILTER_MIX_FRAGMENT",(function(){return d}));var r=i(/*! @babel/runtime/helpers/createClass */"./node_modules/@babel/runtime/helpers/createClass.js"),n=i.n(r),o=i(/*! @babel/runtime/helpers/inheritsLoose */"./node_modules/@babel/runtime/helpers/inheritsLoose.js"),a=i.n(o),s=i(/*! ../../types/filter */"./src/types/filter.ts"),c=i(/*! ../../utils/tex-helper */"./src/utils/tex-helper.ts"),u=i(/*! ../../utils/tex-proxy */"./src/utils/tex-proxy.ts"),l=i(/*! ../filter-base */"./src/filter/filter-base.ts"),d="\nprecision mediump float;\n\nvarying highp vec2 textureCoordinate;\n\nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\n\nuniform vec4 uBGView;\n\nvoid main() {\n // background\n vec4 centerColor = texture2D(inputImageTexture, textureCoordinate);\n lowp vec2 bgCoord = vec2(textureCoordinate.x * uBGView[2] + uBGView[0], textureCoordinate.y * uBGView[3] + uBGView[1]);\n vec3 backgroundColor = texture2D(inputImageTexture2, bgCoord).rgb;\n gl_FragColor = vec4(mix(backgroundColor, centerColor.rgb, centerColor.a), 1.0);\n}\n",h=function(e){function t(t){var i;return(i=e.call(this,t)||this)._backgroundTexture=null,i._inputTextureUniform2=null,i._bgViewUniform=null,i._bgW=0,i._bgH=0,i._backgr