2 lines
175 KiB
JavaScript
2 lines
175 KiB
JavaScript
|
!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("trtc-sdk-v5"),require("trtc-sdk-v5/plugins/video-effect/virtual-background")):"function"==typeof define&&define.amd?define(["exports","trtc-sdk-v5","trtc-sdk-v5/plugins/video-effect/virtual-background"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).TRTCCloud={},A.TRTC,A.virtualBackground)}(this,(function(A,e,t){function r(A){return A&&"object"==typeof A&&"default"in A?A:{default:A}}var i=r(e),o=function(A,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},o(A,e)};var n=function(){return n=Object.assign||function(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(A[i]=e[i]);return A},n.apply(this,arguments)};function g(A,e,t,r){return new(t||(t=Promise))((function(i,o){function n(A){try{a(r.next(A))}catch(e){o(e)}}function g(A){try{a(r.throw(A))}catch(e){o(e)}}function a(A){var e;A.done?i(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(n,g)}a((r=r.apply(A,e||[])).next())}))}function a(A,e){var t,r,i,o,n={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:g(0),throw:g(1),return:g(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function g(g){return function(a){return function(g){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,g[0]&&(n=0)),n;)try{if(t=1,r&&(i=2&g[0]?r.return:g[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,g[1])).done)return i;switch(r=0,i&&(g=[2&g[0],i.value]),g[0]){case 0:case 1:i=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,r=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(!(i=n.trys,(i=i.length>0&&i[i.length-1])||6!==g[0]&&2!==g[0])){n=0;continue}if(3===g[0]&&(!i||g[1]>i[0]&&g[1]<i[3])){n.label=g[1];break}if(6===g[0]&&n.label<i[1]){n.label=i[1],i=g;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(g);break}i[2]&&n.ops.pop(),n.trys.pop();continue}g=e.call(A,n)}catch(a){g=[6,a],r=0}finally{t=i=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([g,a])}}}function s(A,e,t){if(t||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return A.concat(r||Array.prototype.slice.call(e))}var I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(A,e){return A(e={exports:{}},e.exports),e.exports}var c,B,u,Q,E,l,d,h,p=C((function(A){var e=Object.prototype.hasOwnProperty,t="~";function r(){}function i(A,e,t){this.fn=A,this.context=e,this.once=t||!1}function o(A,e,r,o,n){if("function"!=typeof r)throw new TypeError("The listener must be a function");var g=new i(r,o||A,n),a=t?t+e:e;return A._events[a]?A._events[a].fn?A._events[a]=[A._events[a],g]:A._events[a].push(g):(A._events[a]=g,A._eventsCount++),A}function n(A,e){0==--A._eventsCount?A._events=new r:delete A._events[e]}function g(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1)),g.prototype.eventNames=function(){var A,r,i=[];if(0===this._eventsCount)return i;for(r in A=this._events)e.call(A,r)&&i.push(t?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(A)):i},g.prototype.listeners=function(A){var e=t?t+A:A,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,n=new Array(o);i<o;i++)n[i]=r[i].fn;return n},g.prototype.listenerCount=function(A){var e=t?t+A:A,r=this._events[e];return r?r.fn?1:r.length:0},g.prototype.emit=function(A,e,r,i,o,n){var g=t?t+A:A;if(!this._events[g])return!1;var a,s,I=this._events[g],C=arguments.length;if(I.fn){switch(I.once&&this.removeListener(A,I.fn,void 0,!0),C){case 1:return I.fn.call(I.context),!0;case 2:return I.fn.call(I.context,e),!0;case 3:return I.fn.call(I.context,e
|