PageSourceSearch

https://gate.ai/javascript/collect-rangers-v5.2.8.js

js gate.ai collected 2026-10-05 12:01:14 UTC 271,348 bytes, 1 lines download raw bytes

1!function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function t(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function n(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((i=i.apply(e,t||[])).next())})}function i(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function a(e,t){for(var n=0,i=t.length,r=e.length;n<i;n++,r++)e[r]=t[n];return e}var s,c=function(){function e(e){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;if(e&&t&&"function"==typeof t){this.on(e,function i(r){t(r),n.off(e,i)})}},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&a([],o(this._hooks[e])).forEach(function(e){try{e(t)}catch(e){}})},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),l=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},u=function(e){return Array.isArray(e)},h=function(e){return"boolean"==typeof e},d=function(e){return void 0===e},f=(s=+Date.now()+Number("".concat(Math.random()).slice(2,8)),function(){return s+=1}),p=function(e,t,n,i){e.addEventListener?e.addEventListener(t,n,i):e.attachEven?e.attachEven("on".concat(t),n):e["on".concat(t)]=n},g=function(e,t,n,i){e.addEventListener?e.removeEventListener(t,n,i):e.attachEven&&e.detachEven("on".concat(t),n)},m=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof t&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^t;var c=String.fromCharCode(s);
1r.push(c)}return r.join("")}}(e,64,25)},_=function(e){var t=-1!==navigator.userAgent.indexOf("iPhone")||-1!==navigator.userAgent.indexOf("iPad")||-1!==navigator.userAgent.indexOf("Mac OS X");p(window,t?"pagehide":"beforeunload",e,!1)},v=function(e,t,n){var i=document.createElement("script");i.src=e,i.onerror=function(){n(e)},i.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(i)},y=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach(function(t){void 0!==document[t]&&(e=1)}),e},b=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,i=Date.now()+t;return n=window.setTimeout(function r(){var o=Date.now()-i;e(),i+=t,n=window.setTimeout(r,Math.max(0,t-o))},t),function(){window.clearTimeout(n)}},w=function(e){var t=document.createElement("a");return t.href=e,t},E=function(e){var t={};try{var n=w(e).search;(n=n.slice(1)).split("&").forEach(function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(e){t[n]=i}})}catch(e){}return t},S=function(e,t){e.split("&").forEach(function(e){var n=e.indexOf("="),i="",r="";if(-1===n?i=e:(i=e.substring(0,n),r=e.substring(n+1)),i){try{i=decodeURIComponent(i)}catch(e){}try{r=decodeURIComponent(r)}catch(e){}t[i]=r}})},k=function(e){for(var t=0,n=0,i=(e+="").length,r=0;r<i;r++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t},z=function(){var e=window.navigator.appName,t=window.navigator.userAgent;return-1!==e.indexOf("Microsoft Internet Explorer")&&(-1!==t.indexOf("MSIE 8.0")||-1!==t.indexOf("MSIE 7.0")||-1!==t.indexOf("MSIE 9.0"))},D=function(){var e=window.navigator.appName,t=window.navigator.userAgent;return-1!==e.indexOf("Microsoft Internet Explorer")&&(-1!==t.indexOf("MSIE 8.0")||-1!==t.indexOf("MSIE 9.0"))},T=function(){var e=window.navigator.appName,t=window.navigator.userAgent;return-1!==e.indexOf("Microsoft Internet Explorer")&&-1!==t.indexOf("MSIE 7.0")},A="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function R(e,t){return e(t={exports:{}},t.exports),t.exports}var I=R(function(e,t){var n;n=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2}
1)+/g,decodeURIComponent)}return function n(i){function r(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(e){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in o)o[c]&&(s+="; "+c,!0!==o[c]&&(s+="="+o[c].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),c=s.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var l=t(s[0]);if(c=(i.read||i)(c,l)||t(c),n)try{c=JSON.parse(c)}catch(e){}if(r[l]=c,e===l)break}catch(e){}}return e?r[e]:r}}return r.set=o,r.get=function(e){return a(e,!1)},r.getJSON=function(e){return a(e,!0)},r.remove=function(t,n){o(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}(function(){})},e.exports=n()}),O=R(function(e,t){e.exports=function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c=x;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n||e)},u,u.exports,e,t,n,i)}return n[a].exports}for(var o=x,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){(function(e){var n,i,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var o=0,a=new r(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;i=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}i=!1}t.exports=function(e){1!==l.push(e)||i||n()}}).call(this,void 0!==A?A:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var i=e(1);function r(){}var o={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==r&&f(this,e)}function u(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(e,t,n){i(function(){var i;try{i=t(n)}catch(t){return o.reject(e,t)}i===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,i)})}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function i(t){n||(n=!0,o.reject(e,t))}function r(t){n||(n=!0,o.resolve(e,t))}var a=p(function(){t(r,i)});"error"===a.status&&i(a.value)}function p(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(r);if(this.state!==c){var i=this.state===s?e:t;h(n,i,this.outcome)}else this.queue.push(new u(n,e,t));return n},u.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){o.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=p(d,t);
1if("error"===n.status)return o.reject(e,n.value);var i=n.value;if(i)f(e,i);else{e.state=s,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:o.resolve(new this(r),e)},l.reject=function(e){var t=new this(r);return o.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,l=new this(r);++c<n;)u(e[c],c);return l;function u(e,r){t.resolve(e).then(function(e){a[r]=e,++s!==n||i||(i=!0,o.resolve(l,a))},function(e){i||(i=!0,o.reject(l,e))})}},l.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var a,s=-1,c=new this(r);++s<n;)a=e[s],t.resolve(a).then(function(e){i||(i=!0,o.resolve(c,e))},function(e){i||(i=!0,o.reject(c,e))});return c}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==A?A:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function o(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,i=new n,r=0;r<e.length;r+=1)i.append(e[r]);return i.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function s(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function c(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function l(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function u(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var h="local-forage-detect-blob-support",d=void 0,f={},p=Object.prototype.toString,g="readonly",m="readwrite";function _(e){return"boolean"==typeof d?a.resolve(d):function(e){return new a(function(t){var n=e.transaction(h,m),i=o([""]);n.objectStore(h).put(i,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return d=e})}function v(e){var t=f[e.name],n={};n.promise=new a(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function y(e){var t=f[e.name],n=t.deferredOperations.pop();if(n)return n.resolve(),n.promise}function b(e,t){var n=f[e.name],i=n.deferredOperations.pop();if(i)return i.reject(t),i.promise}function w(e,t){return new a(function(n,i){if(f[e.name]=f[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);v(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var a=r.open.apply(r,o);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(h)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),i(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),y(e)}})}function E(e){return w(e,!1)}function S(e){return w(e,!0)}function k(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,r=e.version>e.db.version;if(i&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||n){if(n){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function z(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n),r=0;r<t;r++)i[r]=e.charCodeAt(r);return n}(atob(e.data));return o([t],{type:e.type})}function D(e){return e&&e.__local_forage_encoded_blob}function T(e){var t=this,n=t._initReady().then(function(){var e=f[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return c(n,e,e),n}function A(e,t,n,i){void 0===i&&(i=1);try{var r=e.db.transaction(e.storeName,t);n(null,r)}catch(r){if(i>0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return a.resolve().then(function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),S(e)}).then(function(){return function(e){v(e);for(var t=f[e.name],n=t.forages,i=0;i<n.length;i++){var r=n[i];r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null)}return e.db=null,E(e).then(function(t){return e.db=t,k(e)?S(e):t}).then(function(i){e.db=t.db=i;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=i}).catch(function(t){throw b(e,t),t})}(e).then(function(){A(e,t,n,i-1)})}).catch(n);n(r)}}var x={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var i in e)n[i]=e[i];var r=f[n.name];r||(r={forages:[],db:null,dbReady:null,deferredOperations:[]},f[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=T);var o=[];function s(){return a.resolve()}for(var c=0;c<r.forages.length;c++){var l=r.forages[c];l!==t&&o.push(l._initReady().catch(s))}var u=r.forages.slice(0);return a.all(o).then(function(){return n.db=r.db,E(n)}).then(function(e){return n.db=e,k(n,t._defaultConfig.version)?S(n):e}).then(function(e){n.db=r.db=e,t._dbInfo=n;for(var i=0;i<u.length;i++){var o=u[i];o!==t&&(o._dbInfo.db=n.db,o._dbInfo.version=n.version)}})},_support:function(){try{if(!r||!r.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,i=new a(function(t,i){n.ready().then(function(){A(n._dbInfo,g,function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName),s=a.openCursor(),c=1;s.onsuccess=function(){var n=s.result;if(n){var i=n.value;D(i)&&(i=z(i));var r=e(i,n.key,c++);void 0!==r?t(r):n.continue()}else t()},s.onerror=function(){i(s.error)}}catch(e){i(e)}})}).catch(i)});return s(i,t),i},getItem:function(e,t){var n=this;e=l(e);var i=new a(function(t,i){n.ready().then(function(){A(n._dbInfo,g,function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName),s=a.get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),D(e)&&(e=z(e)),t(e)},s.onerror=function(){i(s.error)}}catch(e){i(e)}})}).catch(i)});return s(i,t),i},setItem:function(e,t,n){var i=this;e=l(e);var r=new a(function(n,r){var o;i.ready().then(function(){return o=i._dbInfo,"[object Blob]"===p.call(t)?_(o.db).then(function(e){return e?t:(n=t,new a(function(e,t){var i=new FileReader;i.onerror=t,i.onloadend=function(t){var i=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:i,type:n.type})},i.readAsBinaryString(n)}));var n}):t}).then(function(t){A(i._dbInfo,m,function(o,a){if(o)return r(o);try{var s=a.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){try{var e=c.error?c.error:c.transaction.error;r(e)}catch(e){r(e)}}}catch(e){r(e)}})}).catch(r)});return s(r,n),r},removeItem:function(e,t){var n=this;e=l(e);var i=new a(function(t,i){n.ready().then(function(){A(n._dbInfo,m,function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName),s=a.delete(e);o.oncomplete=function(){t()},o.onerror=function(){i(s.error)},o.onabort=function(){try{var e=s.error?s.error:s.transaction.error;i(e)}catch(e){i(e)}}}catch(e){i(e)}})}).catch(i)});return s(i,t),i},clear:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){A(t._dbInfo,m,function(i,r){if(i)return n(i);try{var o=r.objectStore(t._dbInfo.storeName),a=o.clear();r.oncomplete=function(){e()},r.onabort=r.onerror=function(){try{var e=a.error?a.error:a.transaction.error;n(e)}catch(e){n(e)}}}catch(e){n(e)}})}).catch(n)});return s(n,e),n},length:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){A(t._dbInfo,g,function(i,r){if(i)return n(i);try{var o=r.objectStore(t._dbInfo.storeName),a=o.count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return s(n,e),n},key:function(e,t){var n=this,i=new a(function(t,i){e<0?t(null):n.ready().then(function(){A(n._dbInfo,g,function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName),s=!1,c=(a.openKeyCursor||a.openCursor).call(a);c.onsuccess=function(){var n=c.result;n?0===e?t(n.key):s?t(n.key):(s=!0,n.advance(e)):t(null)},c.onerror=function(){i(c.error)}}catch(e){i(e)}})}).catch(i)});return s(i,t),i},keys:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){A(t._dbInfo,g,function(i,r){if(i)return n(i);try{var o=r.objectStore(t._dbInfo.storeName),a=(o.openKeyCursor||o.openCursor).call(o),s=[];a.onsuccess=function(){var t=a.result;t?(s.push(t.key),t.continue()):e(s)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return s(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n,i=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||i.name,e.storeName=e.storeName||i.storeName),e.name){var o=e.name===i.name&&this._dbInfo.db,c=o?a.resolve(this._dbInfo.db):E(e).then(function(t){var n=f[e.name],i=n.forages;n.db=t;for(var r=0;r<i.length;r++)i[r]._dbInfo.db=t;return t});n=e.storeName?c.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.ver
1sion+1;v(e);var i=f[e.name],o=i.forages;t.close();for(var s=0;s<o.length;s++){var c=o[s];c._dbInfo.db=null,c._dbInfo.version=n}var l=new a(function(t,i){var o=r.open(e.name,n);o.onerror=function(e){var t=o.result;t.close(),i(e)},o.onupgradeneeded=function(){var t=o.result;t.deleteObjectStore(e.storeName)},o.onsuccess=function(){var e=o.result;e.close(),t(e)}});return l.then(function(e){i.db=e;for(var t=0;t<o.length;t++){var n=o[t];n._dbInfo.db=e,y(n._dbInfo)}}).catch(function(t){throw(b(e,t)||a.resolve()).catch(function(){}),t})}}):c.then(function(t){v(e);var n=f[e.name],i=n.forages;t.close();for(var o=0;o<i.length;o++){var s=i[o];s._dbInfo.db=null}var c=new a(function(t,n){var i=r.deleteDatabase(e.name);i.onerror=function(){var e=i.result;e&&e.close(),n(i.error)},i.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},i.onsuccess=function(){var e=i.result;e&&e.close(),t(e)}});return c.then(function(e){n.db=e;for(var t=0;t<i.length;t++){var r=i[t];y(r._dbInfo)}}).catch(function(t){throw(b(e,t)||a.resolve()).catch(function(){}),t})})}else n=a.reject("Invalid arguments");return s(n,t),n}},R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I="~~local_forage_type~",O=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",C=M.length,G="arbf",B="blob",U="si08",N="ui08",L="uic8",P="si16",j="si32",q="ur16",K="ui32",V="fl32",H="fl64",F=C+G.length,J=Object.prototype.toString;function W(e){var t,n,i,r,o,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),u=new Uint8Array(l);for(t=0;t<s;t+=4)n=R.indexOf(e[t]),i=R.indexOf(e[t+1]),r=R.indexOf(e[t+2]),o=R.indexOf(e[t+3]),u[c++]=n<<2|i>>4,u[c++]=(15&i)<<4|r>>2,u[c++]=(3&r)<<6|63&o;return l}function X(e){var t,n=new Uint8Array(e),i="";for(t=0;t<n.length;t+=3)i+=R[n[t]>>2],i+=R[(3&n[t])<<4|n[t+1]>>4],i+=R[(15&n[t+1])<<2|n[t+2]>>6],i+=R[63&n[t+2]];return n.length%3==2?i=i.substring(0,i.length-1)+"=":n.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}var Z={serialize:function(e,t){var n="";if(e&&(n=J.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===J.call(e.buffer))){var i,r=M;e instanceof ArrayBuffer?(i=e,r+=G):(i=e.buffer,"[object Int8Array]"===n?r+=U:"[object Uint8Array]"===n?r+=N:"[object Uint8ClampedArray]"===n?r+=L:"[object Int16Array]"===n?r+=P:"[object Uint16Array]"===n?r+=q:"[object Int32Array]"===n?r+=j:"[object Uint32Array]"===n?r+=K:"[object Float32Array]"===n?r+=V:"[object Float64Array]"===n?r+=H:t(new Error("Failed to get type for BinaryArray"))),t(r+X(i))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n=I+e.type+"~"+X(this.result);t(M+B+n)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,C)!==M)return JSON.parse(e);var t,n=e.substring(F),i=e.substring(C,F);if(i===B&&O.test(n)){var r=n.match(O);t=r[1],n=n.substring(r[0].length)}var a=W(n);switch(i){case G:return a;case B:return o([a],{type:t});case U:return new Int8Array(a);case N:return new Uint8Array(a);case L:return new Uint8ClampedArray(a);case P:return new Int16Array(a);case q:return new Uint16Array(a);case j:return new Int32Array(a);case K:return new Uint32Array(a);case V:return new Float32Array(a);case H:return new Float64Array(a);default:throw new Error("Unkown type: "+i)}},stringToBuffer:W,bufferToString:X};function Y(e,t,n,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function $(e,t,n,i,r,o){e.executeSql(n,i,r,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?o(e,a):Y(e,t,function(){e.executeSql(n,i,r,o)},o)},o):o(e,a)},o)}var Q={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var i in e)n[i]="string"!=typeof e[i]?e[i].toString():e[i];var r=new a(function(e,i){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return i(e)}n.db.transaction(function(r){Y(r,n,function(){t._dbInfo=n,e()},function(e,t){i(t)})},i)});
1return n.serializer=Z,r},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,i=new a(function(t,i){n.ready().then(function(){var r=n._dbInfo;r.db.transaction(function(n){$(n,r,"SELECT * FROM "+r.storeName,[],function(n,i){for(var o=i.rows,a=o.length,s=0;s<a;s++){var c=o.item(s),l=c.value;if(l&&(l=r.serializer.deserialize(l)),void 0!==(l=e(l,c.key,s+1)))return void t(l)}t()},function(e,t){i(t)})})}).catch(i)});return s(i,t),i},getItem:function(e,t){var n=this;e=l(e);var i=new a(function(t,i){n.ready().then(function(){var r=n._dbInfo;r.db.transaction(function(n){$(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],function(e,n){var i=n.rows.length?n.rows.item(0).value:null;i&&(i=r.serializer.deserialize(i)),t(i)},function(e,t){i(t)})})}).catch(i)});return s(i,t),i},setItem:function(e,t,n){return function e(t,n,i,r){var o=this;t=l(t);var c=new a(function(a,s){o.ready().then(function(){void 0===n&&(n=null);var c=n,l=o._dbInfo;l.serializer.serialize(n,function(n,u){u?s(u):l.db.transaction(function(e){$(e,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[t,n],function(){a(c)},function(e,t){s(t)})},function(n){if(n.code===n.QUOTA_ERR){if(r>0)return void a(e.apply(o,[t,c,i,r-1]));s(n)}})})}).catch(s)});return s(c,i),c}.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=l(e);var i=new a(function(t,i){n.ready().then(function(){var r=n._dbInfo;r.db.transaction(function(n){$(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){i(t)})})}).catch(i)});return s(i,t),i},clear:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(t){$(t,i,"DELETE FROM "+i.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return s(n,e),n},length:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(t){$(t,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(t,n){var i=n.rows.item(0).c;e(i)},function(e,t){n(t)})})}).catch(n)});return s(n,e),n},key:function(e,t){var n=this,i=new a(function(t,i){n.ready().then(function(){var r=n._dbInfo;r.db.transaction(function(n){$(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,n){var i=n.rows.length?n.rows.item(0).key:null;t(i)},function(e,t){i(t)})})}).catch(i)});return s(i,t),i},keys:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(t){$(t,i,"SELECT key FROM "+i.storeName,[],function(t,n){for(var i=[],r=0;r<n.rows.length;r++)i.push(n.rows.item(r).key);e(i)},function(e,t){n(t)})})}).catch(n)});return s(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i,r=this;return s(i=e.name?new a(function(t){var i;i=e.name===n.name?r._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:i,storeNames:[e.storeName]}):t(function(e){return new a(function(t,n){e.transaction(function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var r=[],o=0;o<i.rows.length;o++)r.push(i.rows.item(o).name);t({db:e,storeNames:r})},function(e,t){n(t)})},function(e){n(e)})})}(i))}).then(function(e){return new a(function(t,n){e.db.transaction(function(i){function r(e){return new a(function(t,n){i.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){n(t)})})}for(var o=[],s=0,c=e.storeNames.length;s<c;s++)o.push(r(e.storeNames[s]));a.all(o).then(function(){t()}).catch(function(e){n(e)})},function(e){n(e)})})}):a.reject("Invalid arguments"),t),i}};function ee(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function te(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0}var ne={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=ee(e,this._defaultConfig),te()?(this._dbInfo=t,t.serializer
vendor: 5,209 bytes, line 1
1=Z,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,i=n.ready().then(function(){for(var t=n._dbInfo,i=t.keyPrefix,r=i.length,o=localStorage.length,a=1,s=0;s<o;s++){var c=localStorage.key(s);if(0===c.indexOf(i)){var l=localStorage.getItem(c);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,c.substring(r),a++)))return l}}});return s(i,t),i},getItem:function(e,t){var n=this;e=l(e);var i=n.ready().then(function(){var t=n._dbInfo,i=localStorage.getItem(t.keyPrefix+e);return i&&(i=t.serializer.deserialize(i)),i});return s(i,t),i},setItem:function(e,t,n){var i=this;e=l(e);var r=i.ready().then(function(){void 0===t&&(t=null);var n=t;return new a(function(r,o){var a=i._dbInfo;a.serializer.serialize(t,function(t,i){if(i)o(i);else try{localStorage.setItem(a.keyPrefix+e,t),r(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}})})});return s(r,n),r},removeItem:function(e,t){var n=this;e=l(e);var i=n.ready().then(function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return s(i,t),i},clear:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);0===i.indexOf(e)&&localStorage.removeItem(i)}});return s(n,e),n},length:function(e){var t=this.keys().then(function(e){return e.length});return s(t,e),t},key:function(e,t){var n=this,i=n.ready().then(function(){var t,i=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(i.keyPrefix.length)),t});return s(i,t),i},keys:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,i=[],r=0;r<n;r++){var o=localStorage.key(r);0===o.indexOf(e.keyPrefix)&&i.push(o.substring(e.keyPrefix.length))}return i});return s(n,e),n},dropInstance:function(e,t){if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var i,r=this;return s(i=e.name?new a(function(t){e.storeName?t(ee(e,r._defaultConfig)):t(e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}}):a.reject("Invalid arguments"),t),i}},ie=function(e,t){for(var n=e.length,i=0;i<n;){if((r=e[i])===(o=t)||"number"==typeof r&&"number"==typeof o&&isNaN(r)&&isNaN(o))return!0;i++}var r,o;return!1},re=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},oe={},ae={},se={INDEXEDDB:x,WEBSQL:Q,LOCALSTORAGE:ne},ce=[se.INDEXEDDB._driver,se.WEBSQL._driver,se.LOCALSTORAGE._driver],le=["dropInstance"],ue=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(le),he={description:"",driver:ce.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var n=arguments;return e.ready().then(function(){return e[t].apply(e,n)})}}function fe(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(re(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var pe=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),se)if(se.hasOwnProperty(n)){var i=se[n],r=i._driver;this[n]=r,oe[r]||this.defineDriver(i)}this._defaultConfig=fe({},he),this._config=fe({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":i(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var i=new a(function(t,n){try{var i=e._driver,r=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(r);for(var o=ue.concat("_initStorage"),c=0,l=o.length;c<l;c++){var u=o[c],h=!ie(le,u);if((h||e[u])&&"function"!=typeof e[u])return void n(r)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=a.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,i=le.length;n<i;n++){var r=le[n];e[r]||(e[r]=t(r))}}();var d=function(n){oe[i]&&console.info("Redefining LocalForage driver: "+i),oe[i]=e,ae[i]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}});return c(i,t,n),i},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var i=oe[e]?a.resolve(oe[e]):a.reject(new Error("Driver not found."));return c(i,t,n),i}
1,e.prototype.getSerializer=function(e){var t=a.resolve(Z);return c(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return c(n,e,e),n},e.prototype.setDriver=function(e,t,n){var i=this;re(e)||(e=[e]);var r=this._getSupportedDrivers(e);function o(){i._config.driver=i.driver()}function s(e){return i._extend(e),o(),i._ready=i._initStorage(i._config),i._ready}var l=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve();return this._driverSet=l.then(function(){var e=r[0];return i._dbInfo=null,i._ready=null,i.getDriver(e).then(function(e){i._driver=e._driver,o(),i._wrapLibraryMethodsWithReady(),i._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var r=e[t];return t++,i._dbInfo=null,i._ready=null,i.getDriver(r).then(s).catch(n)}o();var c=new Error("No available storage method found.");return i._driverSet=a.reject(c),i._driverSet}()}}(r)})}).catch(function(){o();var e=new Error("No available storage method found.");return i._driverSet=a.reject(e),i._driverSet}),c(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){fe(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];this.supports(r)&&t.push(r)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ue.length;e<t;e++)de(this,ue[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),ge=new pe;t.exports=ge},{3:3}]},{},[4])(4)}),M=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e}(),C=function(){function e(){this.support=this.isSupportLS()}return e.prototype.isSupportLS=function(){try{return localStorage.setItem("_applogtest-test-key","hi"),localStorage.getItem("_applogtest-test-key"),localStorage.removeItem("_applogtest-test-key"),!0}catch(e){return!1}},e.prototype.getItem=function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},e.prototype.setItem=function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(e){}},e.prototype.removeItem=function(e){try{localStorage.removeItem(e)}catch(e){}},e}(),G=function(){function e(){this.support=this.isSupportSession()}return e.prototype.isSupportSession=function(){try{return sessionStorage.setItem("_applogtest-test-key","hi"),sessionStorage.getItem("_applogtest-test-key"),sessionStorage.removeItem("_applogtest-test-key"),!0}catch(e){return!1}},e.prototype.getItem=function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},e.prototype.setItem=function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(e){}},e.prototype.removeItem=function(e){try{sessionStorage.removeItem(e)}catch(e){}},e}(),B=function(){function e(e,t){return this.dbStorage=O.createInstance({driver:[O.INDEXEDDB,O.LOCALSTORAGE],name:e,storeName:t}),this.dbStorage}return e.prototype.getItem=function(e){return n(this,void 0,void 0,function(){var t,n;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.dbStorage.getItem(e)];case 1:t=i.sent(),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return[2,n||void 0];case 2:return i.sent(),console.warn("db get storage error"),[3,3];case 3:return[2,void 0]}})})},e.prototype.setItem=function(e,t){try{this.dbStorage.setItem(e,t)}catch(e){console.warn("db set storage error")}},e.prototype.removeItem=function(e){try{this.dbStorage.removeItem(e)}catch(e){console.warn("db remove storage error")}},e}(),U=function(){function e(){this.defaultExpireTime=6048e5,this.local=new C,this.session=new G,this.cache=new M}return e.prototype.getLocalItem=function(e){return this.local.getItem(e)},e.prototype.setLocalItem=function(e,t){this.local.setItem(e,t)},e.prototype.removeLocalItem=function(e){this.local.removeItem(e)},e.prototype.getSessionItem=function(e){return this.session.getItem(e)},e.prototype.setSessionItem=function(e,t){this.session.setItem(e,t)},e.prototype.removeSessionItem=function(e){this.session.removeItem(e)},e.prototype.getCacheItem=function(e){return this.cache.getItem(e)},e.prototype.setCacheItem=function(e,t){this.cache.setItem(e,t)},e.prototype.removeCacheItem=function(e){this.cache.removeItem(e)},e.prototype.getCookie=function(e,t){try{return I.get(e)}catch(e){return""}},e.prototype.setCookie=function(e,t,n,i){void 0===n&&(n=this.defaultExpireTime);try{var r=i||document.domain,o=+new Date+n;I.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},e.prototype.removeCookie=function(e,t){try{I.remove(e,{path:"/",domain:t||""})}catch(e){}},e}(),N=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,i=n?w(n).hostname:"",r=(E(window.location.href),function(e){var t={},n=e.indexOf("?");if(-1!==n){var i=e.slice(n+1,-1!==e.indexOf("#")?e.indexOf("#"):void 0);S(i,t)}var r=e.indexOf("#");if(-1!==r){var o=e.slice(r+1),a=o.indexOf("?");if(-1!==a){var s=o.slice(a+1);S(s,t)}}return t}(window.location.href)),o="web";-1===this.appVersion.indexOf("Mobile")&&-1===this.appVersion.indexOf("Android")&&-1===this.appVersion.indexOf("iPhone")&&-1===this.appVersion.indexOf("iPad")&&-1===this.appVersion.indexOf("mini")||(o="wap"),this.utm=function(e,t,n,i){var r=new 
1U,o=e?"_tea_utm_cache_".concat(e):"_tea_utm_cache",a=e?"_$utm_from_url_".concat(e):"_$utm_from_url",s={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],l={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var u=!1;for(var h in l)l[h]&&(-1!==c.indexOf(h)?(s.hasOwnProperty("tracer_data")||(s.tracer_data={}),s.tracer_data[h]=l[h]):s[h]=l[h],u=!0);if(u)r.setSessionItem(a,"1"),r.setCookie(o,JSON.stringify(s),i,n);else{var d=r.getCookie(o,n);d&&(s=JSON.parse(d))}1==r.getSessionItem(a)&&(s.hasOwnProperty("tracer_data")||(s.tracer_data={}),s.tracer_data.$utm_from_url=1)}catch(e){return l}return s}(this.appid,r,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:i,utm:this.utm,latest_data:this.last(n,i)}},e.prototype.last=function(e,t){var n="",i="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,i=t,a=!0;var s=E(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:i,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,n="",i="".concat(parseFloat(this.appVersion)),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==r.indexOf("MSIE")||-1!==r.indexOf("Trident")?(n="Microsoft Internet Explorer",-1!==r.indexOf("MSIE")?(e=r.indexOf("MSIE"),i=r.substring(e+5,e+9)):(e=r.indexOf("rv"),i=r.substring(e+3,e+7))):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(n="sougoubrowser",i=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(n="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),i=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),i=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(n="360browser",i=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),i=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),i=r.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(n="openlanguage xiaomi",i=r.substring(e+7,e+13)):(n="xiaomi",i=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):-1!==(e=r.indexOf("Chrome"))?(n="Chrome",i=r.substring(e+7)):-1!==(e=r.indexOf("Chrome"))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(n="Firefox",i=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+3,e+8)):-1!==(e=r.indexOf("Opera"))&&(n="Opera",i=r.substring(e+6),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}},e.prototype.os=function(){var e,t,n,i="";if(z());else{for(var r=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows",r:/(Windows|Windows NT)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"OpenHarmony",r:/Harmony/}],o=0;o<r.length;o++){var a=r[o];if(a.r.test(this.userAgent)){"Mac OS X"===(i=a.s)&&this.isNewIpad()&&(i="iOS");break}}var s=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},c=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:".concat(e,")"),"i").exec(t);return n?n.slice(1)[0]:""};/Windows/.test(i)&&(e=s(/Windows (.*)/,i),i="windows");switch(i){case"Mac OS X":e=c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),i="mac";break;case"Android":t=this.userAgent,(n=s(/Android ([\.\_\d]+)/,t))||(n=s(/Android\/([\.\_\d]+)/,t)),e=n,i="android";break;case"iOS":e=this.isNewIpad()?c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(e=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?"".concat(e[1],".").concat(e[2],".").concat(0|e[3]):"",i="ios";break;case"OpenHarmony":e=function(e){var t=s(/OpenHarmony\s*([\d\.]+)/,e);return t||(t=s(/OpenHarmony\s*([\d\.]+)/,e)),t}(this.userAgent),i="OpenHarmony"}}return{os_name:i,os_version:e}},e.prototype.getDeviceModel=function(e){var t="";
1try{if("android"===e)navigator.userAgent.split(";").forEach(function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))});else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=-1===i?"":n.slice(0,i)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),L=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e.prototype.removeCookie=function(e,t){this.removeItem(e)},e}();var P={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){try{return I.get(e)}catch(e){return""}},setCookie:function(e,t,n,i){try{var r=i||document.domain,o=+new Date+n;I.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},removeCookie:function(e,t){try{I.remove(e,{path:"/",domain:t||""})}catch(e){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},j={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(e){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},removeCookie:function(e,t){this.removeItem(e)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},q=function(){function e(e,t){this._storage=t&&"session"===t?j:!e&&P.isSupportLS?P:new L}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,i){this._storage.setCookie(e,t,n,i)},e.prototype.removeCookie=function(e,t){this._storage.removeCookie(e,t)},e}(),K={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},V="5.2.8_tob";var H,F,J={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},W="1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1az1mz20z1cz4az1hz21";!function(e){e.Init="init",e.Config="config",e.Start="start",e.ReStart="re-start-sdk",e.Stop="stop-sdk",e.SDKFail="sdk-fail",e.SDKException="sdk-exception",e.Ready="ready",e.CloudReady="cloud-ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigUuidType="config-uuid-type",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.AnonymousId="anonymous-id",e.TokenChange="token-change",e.TokenReset="token-reset",e.TokenTypeChange="token-type-change",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.SessionResetInner="session-reset-inner",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitSuccess="submit-success",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SDKInnerError="sdk-inner-error",e.SDKRunTimeError="sdk-run-time-error",e.SubmitVerifyH="submit-verify-h5",e.BindToken="bind-token",e.BindTokenReady="bind-token-ready",e.CustomHeader="custom-request-header",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeO
1n="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.AbTimeout="ab-timeout",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.TrackDuration="track-duration",e.TrackDurationStart="track-duration-start",e.TrackDurationEnd="track-duration-end",e.TrackDurationPause="track-duration-pause",e.TrackDurationResume="tracl-duration-resume",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.SetExposureType="set-exposure-type",e.CepReady="cep-ready",e.TracerReady="tracer-ready",e.EncryptData="encrypt-data",e.LogSettingReady="logsetting-ready",e.SetResource="set-resource",e.MonitorConfig="monitor-config",e.SubmitDegrade="submit-degrade",e.XhrBeforeSend="xhr-before-send",e.XhrCurrendSend="xhr-current-send",e.HttpOk="http-ok",e.HttpError="http-error"}(H||(H={})),function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(F||(F={}));var X=H,Z=void 0,Y=(new Date).getTimezoneOffset(),$=parseInt("".concat(-Y/60),10),Q=60*Y,ee=7776e6,te=function(){function t(e,t){var n=this;this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var i=new N(t.app_id,t.cookie_domain||"",t.cookie_expire||ee).init();this.commonInfo=i;var r="__tea_cache_first_".concat(t.app_id);this.configKey="__tea_cache_config_".concat(t.app_id),this.sessionStorage=new q(!1,"session"),this.localStorage=new q(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var o=this.localStorage.getItem(r);o&&1==o?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:Z,user_type:Z,user_id:Z,user_is_auth:Z,user_is_login:Z,device_id:Z,web_id:Z,ip_addr_id:Z,user_unique_id_type:Z,anonymous_id:Z},header:{app_id:Z,app_name:Z,app_install_id:Z,install_id:Z,app_package:Z,app_channel:Z,app_version:Z,ab_version:Z,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:Z,traffic_type:Z,client_ip:Z,device_brand:Z,os_api:Z,access:Z,language:i.language,region:Z,app_language:Z,app_region:Z,creative_id:i.utm.creative_id,ad_id:i.utm.ad_id,campaign_id:i.utm.campaign_id,log_type:Z,rnd:Z,platform:i.platform,sdk_version:V,sdk_lib:"js",province:Z,city:Z,timezone:$,tz_offset:Q,tz_name:Z,sim_region:Z,carrier:Z,resolution:"".concat(i.screen_width,"x").concat(i.screen_height),browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:i.utm.utm_term,utm_content:i.utm.utm_content,utm_source:i.utm.utm_source,utm_medium:i.utm.utm_medium,utm_campaign:i.utm.utm_campaign,tracer_data:JSON.stringify(i.utm.tracer_data),custom:{},wechat_unionid:Z,wechat_openid:Z}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(i),this.initDomain(),this.initABData(),this.collect.on("route-change",function(e){n.changeReferInfo(e.config)})}return t.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=m(K[t])}},t.prototype.setDomain=function(e){this.domain=e},t.prototype.getDomain=function(){return this.domain},t.prototype.getCommonInfo=function(e){return e?this.commonInfo[e]||"":this.commonInfo},t.prototype.initABData=function(){var e="__tea_sdk_ab_version_".concat(this.initConfig.app_id),t=null;if(this.initConfig.ab_cross){var n=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=n?JSON.parse(n):null}else t=this.localStorage.getItem(e);this.setAbCache(t)},t.prototype.setAbCache=function(e){this.ab_cache=e},t.prototype.getAbCache=function(){return this.ab_cache},t.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},t.prototype.setAbVersion=function(e){this.ab_version=e},t.prototype.getAbVersion=function(){return this.ab_version},t.prototype.getUrl=function(e){var t="";switch(e){case"event":t="/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid";break;case"profile":t="/profile/list";break;case"img":t="/gif";break;case"bind":t="/service/2/id_bind"}var n="";return this.initConfig.caller&&(n="?sdk_version=".concat(V,"&sdk_name=web&app_id=").concat(this.initConfig.app_id,"&caller=").concat(this.initConfig.caller)),this.initConfig.report_url?"".concat(this.initConfig.report_url).concat(n):"".concat(this.getDomain()).concat(t).concat(n)},t.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data){this.envInfo.header.custom[t]=e.latest_data[t];var n={};n["".concat(t)]=e.latest_data[t],this.set(n)}},t.prototype.changeReferInfo=function(e){var t=e;this.set({referrer:t.referrer});var n="";try{n=new URL(t.referrer).host}catch(e){}this.set({referrer_host:n||this.envInfo.header.referrer_host})},t.prototype.set=function(t){var n=this;Object.keys(t).forEach(function(i){if(void 0!==t[i]&&null!==t[i]||n.delete(i),"traffic_type"===i&&n.isLast&&(n.envInfo.header.custom.$latest_traffic_source_type=t[i]),"evtParams"===i)n.evtParams=e(e({},n.evtParams||{}),t.evtParams||{});else if("_staging_flag"===i)n.evtParams=e(e({},n.evtParams||{}),{_staging_flag:t._staging_flag});else if("reportErrorCallback"===i&&"function"==typeof t[i])n.reportErrorCallback=t[i];else{var r="",o="";if(i.indexOf(".")>-1){var a=i.split(".");r=a[0],o=a[1]}r?"user"===r||"header"===r?n.envInfo[r][o]=t[i]:(n.envInfo.header.custom[o]=t[i],n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 添加了Custom",level:"info",time:Date.now(),infoType:"sdk",secType:"HEADER",common:"custom"})):Object.hasOwnProperty.call(n.envInfo.user,i)?(["user_type","ip_addr_id"].indexOf(i)>-1?n.envInfo.user[i]=t[i]?Number(t[i]):t[i]:["user_id","web_id","user_unique_id","user_unique_id_type","anonymous_id"].indexOf(i)>-1?n.envInfo.user[i]=t[i]?String(t[i]):t[i]:["user_is_auth","user_is_login"].indexOf(i)>-1?n.envInfo.user[i]=Boolean(t[i]):"device_id"===i&&(n.envInfo.user[i]=t[i]),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 修改了公共参数",level:"info",time:Date.now(),infoType:"sdk",secType:"USER",common:i})):Object.hasOwnProperty.call(n.envInfo.header,i)?(n.envInfo.header[i]=t[i],n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 修改了公共参数",level:"info",time:Date.now(),infoType:"sdk",secType:"HEADER",common:i})):(n.envInfo.header.custom[i]=t[i],n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 添加了Custom",level:"info",time:Date.now(),infoType:"sdk",secType:"HEADER",common:"custom"}))}})},t.prototype.getSettingData=function(e){if(this.logSettingConfig&&!d(this.logSettingConfig[e]))return this.logSettingConfig[e]},t.prototype.setSettingData=function(e){this.logSettingConfig=e},t.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){console.log("get config stringify error "),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message})}},t.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(e){console.log("setStore error"),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message})}},t.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(e){return this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),null}},t.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),console.log("delete error")}},t}(),ne=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: ".concat(this.name,"]")+" "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("%c %s","color: yellow; background-color: black;","[instance: ".concat(this.name,"]")+" "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: ".concat(this.name,"]")+" "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),ie=function(){function e(e,t){this.configManager=t,this.native=e.enable_native||e["evitaN".split("").reverse().join("")],this.os=t.get("os_name"),this.currentUserUniqueId="",this.currentUserUniqueIdType=""}return e.prototype.error=function(e,t){console.error("".concat(e,", msg: ").concat(t||""))},e.prototype.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),AppLogBridge.osName?this.os=AppLogBridge.osName():this.os=this.os,!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},e.prototype.bridgeReady=function(){var e=this;return new Promise(function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted(function(e){console.log("AppLogBridge is started? : ".concat(e)),e?t(!0):n(!1)}):n(!1)}catch(e){console.log("AppLogBridge, error:".concat(JSON.stringify(e.stack))),n(!1)}})},e.prototype.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: ".concat(e))}catch(e){this.error("setNativeAppId error",e.message)}},e.prototype.setConfig=function(e){var n,i;try{var a=e.user_unique_id,s=e.user_unique_id_type,c=t(e,["user_unique_id","user_unique_id_type"]);a&&s?this.setUserUniqueIdWithType(a,s):a?this.setUserUniqueId(a):s&&this.validateAndSetUserIdType(s);try{for(var l=r(Object.entries(c)),u=l.next();!u.done;u=l.next()){var h=o(u.value,2),d=h[0],f=h[1];f?this.addHeaderInfo(d,f):this.removeHeaderInfo(d)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}catch(e){this.error("setConfig error",e.message)}},e.prototype.setUserUniqueId=function(e){try{this.currentUserUniqueId=e,this.currentUserIdType=""}catch(e){this.error("setUserUniqueId error",e.message)}},e.prototype.validateAndSetUserIdType=function(e){this.currentUserUniqueId?this.setUserUniqueIdWithType(this.currentUserUniqueId,e):console.warn("please set user_unique_id and user_unique_id_type together")},e.prototype.setUserUniqueIdWithType=function(e,t){try{this.currentUserUniqueId=e,this.currentUserUniqueIdType=t,AppLogBridge.setUserUniqueIdWithType(e,t)}catch(e){this.error("setUserUniqueType error",e.message)}},e.prototype.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){this.error("addHeaderInfo error",e.message)}},e.prototype.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){this.error("setHeaderInfo error",e.message)}},e.prototype.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){this.error("removeHeaderInfo error",e.message)}},e.prototype.reportPv=function(e){this.onEventV3("predefine_pageview",e)},e.prototype.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t)}catch(e){this.error("onEventV3 error",e.message)}}
1,e.prototype.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){this.error("profileSet error",e.message)}},e.prototype.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){this.error("profileSetOnce error",e.message)}},e.prototype.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){this.error("profileIncrement error",e.message)}},e.prototype.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){this.error("profileUnset error",e.message)}},e.prototype.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){this.error("profileAppend error",e.message)}},e.prototype.setExternalAbVersion=function(e){try{AppLogBridge.setExternalAbVersion(e)}catch(e){this.error("setExternalAbVersion error",e.message)}},e.prototype.getVar=function(e,t,n){try{"harmonyos"===this.os?n(AppLogBridge.getABTestConfigValueForKey(e,t)):"android"===this.os?n(AppLogBridge.getABTestConfigValueForKey(e,t)):AppLogBridge.getABTestConfigValueForKey(e,t,function(e){n(e)})}catch(e){this.error("getVar error",e.message),n(t)}},e.prototype.getAllVars=function(e){try{"harmonyos"===this.os?e(AppLogBridge.getAllAbTestConfigs()):"android"===this.os?e(AppLogBridge.getAllAbTestConfigs()):AppLogBridge.getAllAbTestConfigs(function(t){e(t)})}catch(t){this.error("getAllVars error",t.message),e(null)}},e.prototype.getAbSdkVersion=function(e){try{"harmonyos"===this.os?e(AppLogBridge.getAbSdkVersion()):"android"===this.os?e(AppLogBridge.getAbSdkVersion()):AppLogBridge.getAbSdkVersion(function(t){e(t)})}catch(t){this.error("getAbSdkVersion error",t.message),e("")}},e}(),re={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005};function oe(e,t,n,i,r,o,a,s,c,l){try{var u;if(window.XDomainRequest&&D()){u=new XDomainRequest;var h=s||"post";u.open(h,e),n&&(u.timeout=n,u.ontimeout=function(){o&&o(t,re.TIMEOUT)}),u.onerror=function(){u.abort(),o&&o(t,re.XHR_ON)},u.onload=function(){if(r){var e=null;if(u.responseText){try{e=JSON.parse(u.responseText)}catch(t){e={}}r(e,t)}}},setTimeout(function(){u.send(JSON.stringify(t))},0)}else if(window.ActiveXObject&&T()){u=new ActiveXObject("Micrsorf.XMLHTTP");h=s||"POST";u.open(h,e),n&&(u.timeout=n,u.ontimeout=function(){o&&o(t,re.TIMEOUT)}),u.onerror=function(){u.abort(),o&&o(t,re.XHR_ON)},u.onload=function(){if(r){var e=null;if(u.responseText){try{e=JSON.parse(u.responseText)}catch(t){e={}}r(e,t)}}},setTimeout(function(){u.send(JSON.stringify(t))},0)}else if(window.XMLHttpRequest){u=new XMLHttpRequest;h=s||"POST";u.open(h,e,!0),u.setRequestHeader("Content-Type","application/json; charset=utf-8"),a&&u.setRequestHeader("X-MCS-AppKey","".concat(a)),i&&(u.withCredentials=!0),n&&(u.timeout=n,u.ontimeout=function(){o&&o(t,re.TIMEOUT)}),u.onreadystatechange=function(){if(4===u.readyState&&200===u.status&&r){var e=null;if(u.responseText){try{e=JSON.parse(u.responseText)}catch(t){e={}}r(e,t)}}},u.onerror=function(){u.abort(),o&&o(t,re.XHR_ON)},u.send(JSON.stringify(t))}}catch(e){console.log(e.message)}}var ae=4e3,se=4002,ce=function(e,t,n,i){try{t.forEach(function(r){var o=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t+="&".concat(n,"=").concat(encodeURIComponent(JSON.stringify(e[n]))));return t="&"===t.slice(0,1)?t.slice(1):t}(r),a=new Image(1,1);a.onload=function(){a=null,n&&n()},a.onerror=function(){a=null,i&&i(e,t,ae)},a.src="".concat(e,"?").concat(o)})}catch(n){i&&i(e,t,se,n.message)}},le=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},ue=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new q(!1,"session"),this.sessionKey="__tea_session_id_".concat(t.app_id),this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(X.SessionReset,function(){n.resetSessionId()}),this.collect.on(X.SessionResetTime,function(){n.updateSessionIdTime()}))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?(e={sessionId:le(),timestamp:Date.now()},this.collect.emit(X.SessionResetInner)):e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:le(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval(function(){e.checkEXp()},this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval(function(){e.checkEXp()},this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:le(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&(Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:le(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e)))},e}(),he=function(){function t(e,t){var n=this;
1this.MAX_LEVEL=3,this.metaResource={},this.eventCache=[],t.enable_track_id&&(this.MAX_LEVEL=t.track_level||3,e.on(X.SetResource,function(e){n.metaResource=e}))}return t.prototype.handleMetaResource=function(t){var n=this;return Object.keys(this.metaResource).length?(t.forEach(function(t){var i=t.event,r=t.local_time_ms,s=t.params,c=e({},JSON.parse(s));try{for(var l in c)if(n.metaResource.hasOwnProperty(l)){var u=c[l],h=n.metaResource[l];if(h.length&&h.includes(u)){var d=le();c.ubt_source_id=d,n.eventCache.length&&(c.ubt_source=a([],o(n.eventCache)).reverse()),n.eventCache.length>=n.MAX_LEVEL&&n.eventCache.shift(),n.eventCache.push({event:i,params:e(e({},JSON.parse(s)),{ubt_source_id:d}),local_time_ms:r})}break}}finally{t.params=JSON.stringify(c)}}),t):t},t}(),de=function(){function t(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return t.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new q(!0),this.localStorage=new q(!1),this.trackId=new he(e,t),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_".concat(this.configManager.get("app_id")),this.beconKey="__tea_cache_events_becon_".concat(this.configManager.get("app_id")),this.abKey="__tea_sdk_ab_version_".concat(this.configManager.get("app_id")),this.refer_key="__tea_cache_refer_".concat(this.configManager.get("app_id")),this.blockList=[],this.collect.on(X.Ready,function(){n.reportAll(!1)}),this.collect.on(X.ConfigDomain,function(){n.reportUrl=n.configManager.getUrl("event")}),this.collect.on(X.Event,function(e){n.event(e)}),this.collect.on(X.BeconEvent,function(e){n.beconEvent(e)}),this.collect.on(X.CleanEvents,function(){n.reportAll(!1)}),this.collect.on(X.BindTokenReady,function(){n.reportAll(!1)}),this.linster()},t.prototype.linster=function(){var e=this;p(window,"unload",function(){e.reportAll(!0)},!1),_(function(){e.reportAll(!0)}),p(document,"visibilitychange",function(){"hidden"===document.visibilityState&&e.reportAll(!0)},!1)},t.prototype.reportAll=function(e){this.report(e),this.reportBecon()},t.prototype.event=function(e){var t=this;try{var n=this.cacheStorgae.getItem(this.eventKey)||[],i=a(a([],o(e)),o(n));if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var r=this.reportTime;this.reportTimeout=setTimeout(function(){t.report(!1),t.reportTimeout=null},r)}}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),this.collect.emit(X.SDKException,{error:e.message||"sdk event event api something error"})}},t.prototype.beconEvent=function(e){if(!this.collect.destroyInstance&&!this.collect.sdkStop){var t=this.cacheStorgae.getItem(this.beconKey)||[],n=a(a([],o(e)),o(t));this.cacheStorgae.setItem(this.beconKey,n),this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(n)),!0))}},t.prototype.reportBecon=function(){if(!this.collect.destroyInstance&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},t.prototype.report=function(e){if(!this.collect.destroyInstance&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},t.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);var r=this.split(this.merge(i));this.send(r,t)}else{r=this.split(this.merge(e));this.send(r,t)}},t.prototype.merge=function(t,n){var i,r,o=this,a=this.configManager.get(),s=a.header,c=a.user;s.custom.origin_referrer=null===(i=this.collect.configManager)||void 0===i?void 0:i.getCommonInfo("referrer"),s.custom.origin_referrer_host=null===(r=this.collect.configManager)||void 0===r?void 0:r.getCommonInfo("referrer_host"),s.custom=JSON.stringify(s.custom);var l=this.configManager.get("evtParams"),u=this.configManager.get("user_unique_id_type"),h=[];try{var d=t.filter(function(t){try{if(Object.keys(l).length&&!n&&(t.params=e(e({},t.params),l)),o.collect.dynamicParamsFilter&&!n){var i=o.collect.dynamicParamsFilter();Object.keys(i).length&&(t.params=e(e({},t.params),i))}u&&!n&&(t.params.$user_unique_id_type=u);var r=o.configManager.getAbCache(),a=o.configManager.getAbVersion();return a&&r&&(o.config.disable_ab_reset?t.ab_sdk_version=a:r.uuid===c.user_unique_id&&(t.ab_sdk_version=a)),t.session_id=o.collect.sessionManager.getSessionId(),t.params=JSON.stringify(t.params),o.blockEvent(t.event)&&o.whiteEvent(t.event)}catch(e){return console.warn("filter merge event: ".concat(t&&t.event," error, pls check"),e&&e.message),o.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 处理Event数据异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),!1}});if(this.config.enable_track_id&&(d=this.trackId.handleMetaResource(d)),!Object.keys(c).length)return console.warn("user info error,cant report"),h;this.config.enable_anonymousid&&delete c.web_id;var f=JSON.parse(JSON.stringify({events:d,user:c,header:s}));f.local_time=Math.floor(Date.now()/1e3),f.verbose=1,f.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,h.push(f)}catch(e){console.warn("event merge error, pls check",e&&e.message),this.collect.emit(X.SDKException,{error:e.message||"sdk merge event api something error"})}return h},t.prototype.split=function(e){return e=e.map(function(e){var t=[];return t.push(e),t})},t.prototype.blockEvent=function(e){var t;try{var n=null!==(t=this.blockList)&&void 0!==t?t:[];if(this.config.enable_logsetting){var i=this.blockList,r=this.collect.configManager.getSettingData("blockl
1ist_events")||[];n=i.concat(r.filter(function(e){return-1===i.indexOf(e)}))}return!(n&&n.length&&n.includes(e))}catch(e){return!0}},t.prototype.whiteEvent=function(e){var t;try{return(null===(t=this.whiteList)||void 0===t?!void 0:!t.length)||!!this.whiteList.includes(e)}catch(e){return!0}},t.prototype.send=function(e,t){var n=this;e.length&&e.forEach(function(e){try{var i=JSON.parse(JSON.stringify(e));n.config.filter&&((i=n.config.filter(i))||console.warn("filter must return data !!")),n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var r=i||e,o=JSON.parse(JSON.stringify(r));if(!r.length)return;var a=!0;if(r.forEach(function(e){e.events.length||(a=!1)}),!a)return;n.collect.emit(X.SubmitBefore,r),n.collect.emit(X.XhrBeforeSend,{type:"make_event",eventData:r});var s=n.collect.cryptoData(r);if(z())return void ce(n.configManager.getUrl("img"),s);if(n.collect.degradeStarted)return void n.collect.emit(X.SubmitDegrade,r);var c=d(n.collect.configManager.getSettingData("request_timeout"))?n.timeout:n.collect.configManager.getSettingData("request_timeout");n.collect.requestManager.useRequest({url:n.reportUrl,data:r,success:function(e,t,i,r,a){e&&0!==e.e?(n.collect.emit(X.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e,startTime:r,endTime:Date.now(),status:a}),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:o,code:e.e,failType:"数据异常失败",status:"fail"})):(n.collect.emit(X.SubmitScuess,{eventData:t,res:e,response:e,startTime:r,endTime:Date.now(),status:a}),n.collect.emit(X.SubmitSuccess,{eventData:t,res:e,response:e,startTime:r,endTime:Date.now(),status:a}),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:o,code:200,status:"success"}),n.updateFilter(e))},fail:function(e,t,i,r){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit(X.SubmitError,{type:"f_net",eventData:e,errorCode:t,startTime:i,errorMessage:r,endTime:Date.now()}),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:o,code:t,failType:"网络异常失败",status:"fail"})},timeout:c,useBeacon:t,encryption:n.config.enable_encryption,encryption_header:n.config.encryption_header,zip:!0,type:"event"}),n.collect.emit(X.SubmitVerifyH,r),n.collect.emit(X.SubmitAfter,r)}catch(e){console.warn("something error, ".concat(JSON.stringify(e.stack))),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK发送埋点发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),n.collect.emit(X.SDKException,{error:e.message||"sdk send api something error"})}})},t.prototype.updateFilter=function(e){var t,n;this.blockList=(null===(t=null==e?void 0:e.blocklist)||void 0===t?void 0:t.v3)||[],this.whiteList=(null===(n=null==e?void 0:e.whitelist)||void 0===n?void 0:n.v3)||[]},t}(),fe=function(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},pe=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enableTTwebid=!1,this.enableCustomWebid=!1,this.enableAnonymousid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new q(!1),this.tokenKey="__tea_cache_tokens_".concat(t.app_id),this.enableAnonymousid=t.enable_anonymousid,this.enableTTwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.timeout=t.timeout||3e5,this.collect.on(X.AnonymousId,function(e){n.setAnonymousId(e)}),this.collect.on(X.ConfigUuid,function(e){n.setUuid(e)}),this.collect.on(X.ConfigWebId,function(e){n.setWebId(e)}),this.collect.on(X.ConfigUuidType,function(e){n.setUuidType(e)}),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid||this.enableAnonymousid?this.enableAnonymousid?this.completeAnonymous(this.cacheToken):this.enableCustomWebid?this.collect.on(X.CustomWebId,function(){e.tokenReady=!0,e.collect.emit(X.TokenComplete)}):this.checkEnv()||(this.enableTTwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){if(this.cacheToken&&this.cacheToken.web_id)this.complete(this.cacheToken);else if(this.config.disable_webid){var e=this.getLocalId();this.complete({web_id:e,user_unique_id:this.configManager.get("user_unique_id")||e})}else this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=E(window.location.href);return!(!t||!t.Web_ID)&&(this.complete({web_id:"".concat(t.Web_ID),user_unique_id:this.configManager.get("user_unique_id")||"".concat(t.Web_ID)}),!0)}return!1},e.prototype.remoteWebid=function(){var e=this;try{var t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:n});var i=this.collect.cryptoData(n);
1this.collect.requestManager.useRequest({url:t,data:i,success:function(t){var n;if(t&&0===t.e)n=t.web_id,e.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t});else{var i=e.getLocalId();n=i,e.collect.configManager.set({localWebId:i}),e.collect.emit(X.TokenError),e.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"WEBID请求返回值异常",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: ".concat(e.config.app_id," get webid error, use local webid~"))}e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})},fail:function(){var t=e.getLocalId();e.complete({web_id:e.configManager.get("web_id")||t,user_unique_id:e.configManager.get("user_unique_id")||t}),e.collect.configManager.set({localWebId:t}),e.collect.emit(X.TokenError),e.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: ".concat(e.config.app_id,", get webid error, use local webid~")),e.collect.emit(X.SDKException,{error:"sdk webid request fail"})},timeout:this.timeout,encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header})}catch(e){this.collect.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk webid request something error"})}},e.prototype.getLocalId=function(){for(var e=fe(),t=0;0===e.indexOf("0")||0===e.indexOf("9");){if(t>=10){e=e.replace(/^(0|9)/,"");break}e=fe(),t++}return e},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id,i=e.user_unique_id_type;if(!t&&!n)return this.collect.emit(X.TokenError),void console.warn("token error");e.timestamp=Date.now(),0===t.indexOf("9")&&t.length>18?this.remoteWebid():(this.collect.configManager.set({web_id:t,user_unique_id:n,user_unique_id_type:i}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(X.TokenComplete))},e.prototype.completeAnonymous=function(e){var t=e.anonymous_id||le(),n=e.user_unique_id||this.configManager.get("user_unique_id");this.collect.configManager.set({anonymous_id:t,user_unique_id:n||t}),e.anonymous_id=t,e.user_unique_id=n||t,this.setStorage(e),this.tokenReady=!0,this.collect.emit(X.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(X.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken?this.cacheToken.user_unique_id=t:(this.cacheToken={},this.cacheToken.user_unique_id=t),this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(X.TokenChange,{type:"uuid",id:e}),this.collect.emit(X.ProfileClear),this.collect.emit(X.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){if(!this.config.enable_ttwebid){var e=this.enableAnonymousid?this.configManager.get("anonymous_id"):this.configManager.get("web_id");this.configManager.get("user_unique_id")!==e&&(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(X.ProfileClear),this.collect.emit(X.TokenReset))}},e.prototype.setAnonymousId=function(e){if(e&&this.enableAnonymousid){var t=this.configManager.get("anonymous_id"),n=this.configManager.get("user_unique_id");t!==e&&(t!==n&&n||(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.collect.emit(X.TokenChange,{type:"uuid",id:e})),this.configManager.set({anonymous_id:e}),this.cacheToken.anonymous_id=e,this.collect.emit(X.TokenChange,{type:"anonymous_id",id:e}),this.setStorage(this.cacheToken))}},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid&&!this.enableAnonymousid){var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.cacheToken.user_unique_id=e,this.collect.emit(X.TokenChange,{type:"uuid",id:e}
1)),t!==e&&(this.configManager.set({web_id:e}),this.cacheToken.web_id=e,this.collect.emit(X.ProfileClear),this.collect.emit(X.TokenChange,{type:"webid",id:e})),this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}},e.prototype.setUuidType=function(e){if(e){var t=this.configManager.get("user_unique_id_type"),n=this.cacheToken&&this.cacheToken.user_unique_id_type;e===t&&e===n||(this.configManager.set({user_unique_id_type:e}),this.cacheToken&&(this.cacheToken.user_unique_id_type=e),this.setStorage(this.cacheToken),this.collect.emit(X.TokenTypeChange,{type:"uuidType",uuidType:e}))}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")];var t=this.collect.configManager.get("user_unique_id_type");t&&(e.user_unique_id_type=t),this.enableCookie||this.enableTTwebid?this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(e){var t=this;try{var n={app_id:this.config.app_id,user_unique_id:this.configManager.get("user_unique_id"),user_unique_id_type:this.configManager.get("user_unique_id_type")};this.enableAnonymousid?n.anonymous_id=this.configManager.get("anonymous_id"):n.web_id=this.configManager.get("web_id");var i=this.collect.cryptoData(n);this.collect.requestManager.useRequest({url:this.configManager.getUrl("tobid"),data:i,success:function(n){n&&0===n.e?(e(n.tobid),t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"GetToken请求成功",logType:"fetch",level:"info",time:Date.now(),data:n,infoType:"sdk"})):(e(""),t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"GetToken请求失败",logType:"fetch",level:"error",time:Date.now(),data:n,infoType:"sdk"}))},fail:function(){e(""),t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"GetToken请求失败",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"}),t.collect.emit(X.SDKException,{error:"sdk get token request fail"})},timeout:this.timeout,encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header})}catch(e){this.collect.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk get tobid something error"})}},e}();function ge(e){let t=e.length;for(;--t>=0;)e[t]=0}const me=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),_e=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ve=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),be=new Array(576);ge(be);const we=new Array(60);ge(we);const Ee=new Array(512);ge(Ee);const Se=new Array(256);ge(Se);const ke=new Array(29);ge(ke);const ze=new Array(30);function De(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}let Te,Ae,xe;function Re(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ge(ze);const Ie=e=>e<256?Ee[e]:Ee[256+(e>>>7)],Oe=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Me=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Oe(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ce=(e,t,n)=>{Me(e,n[2*t],n[2*t+1])},Ge=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Be=(e,t,n)=>{const i=new Array(16);let r,o,a=0;for(r=1;r<=15;r++)a=a+n[r-1]<<1,i[r]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Ge(i[t]++,t))}},Ue=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Ne=e=>{e.bi_valid>8?Oe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Le=(e,t,n,i)=>{const r=2*t,o=2*n;return e[r]<e[o]||e[r]===e[o]&&i[t]<=i[n]},Pe=(e,t,n)=>{const i=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&Le(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Le(t,
vendor: 4,371 bytes, line 1
1i,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=i},je=(e,t,n)=>{let i,r,o,a,s=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+s++],i+=(255&e.pending_buf[e.sym_buf+s++])<<8,r=e.pending_buf[e.sym_buf+s++],0===i?Ce(e,r,t):(o=Se[r],Ce(e,o+256+1,t),0!==(a=me[o])&&(r-=ke[o],Me(e,r,a)),o=Ie(--i),Ce(e,o,n),0!==(a=_e[o])&&(i-=ze[o],Me(e,i,a)))}while(s<e.sym_next);Ce(e,256,t)},qe=(e,t)=>{const n=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,c,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==n[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)n[2*(c=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[c]=0,e.opt_len--,r&&(e.static_len-=i[2*c+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)Pe(e,n,a);c=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Pe(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[2*c]=n[2*a]+n[2*s],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[2*a+1]=n[2*s+1]=c,e.heap[1]=c++,Pe(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let l,u,h,d,f,p,g=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)(d=n[2*n[2*(u=e.heap[l])+1]+1]+1)>c&&(d=c,g++),n[2*u+1]=d,u>i||(e.bl_count[d]++,f=0,u>=s&&(f=a[u-s]),p=n[2*u],e.opt_len+=p*(d+f),o&&(e.static_len+=p*(r[2*u+1]+f)));if(0!==g){do{for(d=c-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(d=c;0!==d;d--)for(u=e.bl_count[d];0!==u;)(h=e.heap[--l])>i||(n[2*h+1]!==d&&(e.opt_len+=(d-n[2*h+1])*n[2*h],n[2*h+1]=d),u--)}})(e,t),Be(n,l,e.bl_count)},Ke=(e,t,n)=>{let i,r,o=-1,a=t[1],s=0,c=7,l=4;for(0===a&&(c=138,l=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=a,a=t[2*(i+1)+1],++s<c&&r===a||(s<l?e.bl_tree[2*r]+=s:0!==r?(r!==o&&e.bl_tree[2*r]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=r,0===a?(c=138,l=3):r===a?(c=6,l=3):(c=7,l=4))},Ve=(e,t,n)=>{let i,r,o=-1,a=t[1],s=0,c=7,l=4;for(0===a&&(c=138,l=3),i=0;i<=n;i++)if(r=a,a=t[2*(i+1)+1],!(++s<c&&r===a)){if(s<l)do{Ce(e,r,e.bl_tree)}while(0!=--s);else 0!==r?(r!==o&&(Ce(e,r,e.bl_tree),s--),Ce(e,16,e.bl_tree),Me(e,s-3,2)):s<=10?(Ce(e,17,e.bl_tree),Me(e,s-3,3)):(Ce(e,18,e.bl_tree),Me(e,s-11,7));s=0,o=r,0===a?(c=138,l=3):r===a?(c=6,l=3):(c=7,l=4)}};let He=!1;const Fe=(e,t,n,i)=>{Me(e,0+(i?1:0),3),Ne(e),Oe(e,n),Oe(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var Je={_tr_init:e=>{He||((()=>{let e,t,n,i,r;const o=new Array(16);for(n=0,i=0;i<28;i++)for(ke[i]=n,e=0;e<1<<me[i];e++)Se[n++]=i;for(Se[n-1]=i,r=0,i=0;i<16;i++)for(ze[i]=r,e=0;e<1<<_e[i];e++)Ee[r++]=i;for(r>>=7;i<30;i++)for(ze[i]=r<<7,e=0;e<1<<_e[i]-7;e++)Ee[256+r++]=i;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)be[2*e+1]=8,e++,o[8]++;for(;e<=255;)be[2*e+1]=9,e++,o[9]++;for(;e<=279;)be[2*e+1]=7,e++,o[7]++;for(;e<=287;)be[2*e+1]=8,e++,o[8]++;for(Be(be,287,o),e=0;e<30;e++)we[2*e+1]=5,we[2*e]=Ge(e,5);Te=new De(be,me,257,286,15),Ae=new De(we,_e,0,30,15),xe=new De(new Array(0),ve,0,19,7)})(),He=!0),e.l_desc=new Re(e.dyn_ltree,Te),e.d_desc=new Re(e.dyn_dtree,Ae),e.bl_desc=new Re(e.bl_tree,xe),e.bi_buf=0,e.bi_valid=0,Ue(e)},_tr_stored_block:Fe,_tr_flush_block:(e,t,n,i)=>{let r,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),qe(e,e.l_desc),qe(e,e.d_desc),a=(e=>{let t;for(Ke(e,e.dyn_ltree,e.l_desc.max_code),Ke(e,e.dyn_dtree,e.d_desc.max_code),qe(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ye[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),r=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==t?Fe(e,t,n,i):4===e.strategy||o===r?(Me(e,2+(i?1:0),3),je(e,be,we)):(Me(e,4+(i?1:0),3),((e,t,n,i)=>{let r;for(Me(e,t-257,5),Me(e,n-1,5),Me(e,i-4,4),r=0;r<i;r++)Me(e,e.bl_tree[2*ye[r]+1],3);Ve(e,e.dyn_ltree,t-1),Ve(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),je(e,e.dyn_ltree,e.dyn_dtree)),Ue(e),i&&Ne(e)},_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>
18,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Se[n]+256+1)]++,e.dyn_dtree[2*Ie(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Me(e,2,3),Ce(e,256,be),(e=>{16===e.bi_valid?(Oe(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var We=(e,t,n,i)=>{let r=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(r=r+t[i++]|0)|0}while(--a);r%=65521,o%=65521}return r|o<<16|0};const Xe=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var Ze=(e,t,n,i)=>{const r=Xe,o=i+n;e^=-1;for(let n=i;n<o;n++)e=e>>>8^r[255&(e^t[n])];return-1^e},Ye={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},$e={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Qe,_tr_stored_block:et,_tr_flush_block:tt,_tr_tally:nt,_tr_align:it}=Je,{Z_NO_FLUSH:rt,Z_PARTIAL_FLUSH:ot,Z_FULL_FLUSH:at,Z_FINISH:st,Z_BLOCK:ct,Z_OK:lt,Z_STREAM_END:ut,Z_STREAM_ERROR:ht,Z_DATA_ERROR:dt,Z_BUF_ERROR:ft,Z_DEFAULT_COMPRESSION:pt,Z_FILTERED:gt,Z_HUFFMAN_ONLY:mt,Z_RLE:_t,Z_FIXED:vt,Z_DEFAULT_STRATEGY:yt,Z_UNKNOWN:bt,Z_DEFLATED:wt}=$e,Et=286,St=30,kt=19,zt=2*Et+1,Dt=15,Tt=(e,t)=>(e.msg=Ye[t],t),At=e=>2*e-(e>4?9:0),xt=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Rt=e=>{let t,n,i,r=e.w_size;i=t=e.hash_size;do{n=e.head[--i],e.head[i]=n>=r?n-r:0}while(--t);i=t=r;do{n=e.prev[--i],e.prev[i]=n>=r?n-r:0}while(--t)};let It=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Ot=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Mt=(e,t)=>
vendor: 5,015 bytes, line 1
1{tt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ot(e.strm)},Ct=(e,t)=>{e.pending_buf[e.pending++]=t},Gt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Bt=(e,t,n,i)=>{let r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),n),1===e.state.wrap?e.adler=We(e.adler,t,r,n):2===e.state.wrap&&(e.adler=Ze(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},Ut=(e,t)=>{let n,i,r=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,u=e.w_mask,h=e.prev,d=e.strstart+258;let f=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(n=t)+a]===p&&l[n+a-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<d);if(i=258-(d-o),o=d-258,i>a){if(e.match_start=t,a=i,i>=s)break;f=l[o+a-1],p=l[o+a]}}}while((t=h[t&u])>c&&0!=--r);return a<=e.lookahead?a:e.lookahead},Nt=e=>{const t=e.w_size;let n,i,r;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Rt(e),i+=t),0===e.strm.avail_in)break;if(n=Bt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=n,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=It(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=It(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},Lt=(e,t)=>{let n,i,r,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;do{if(n=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,n>(i=e.strstart-e.block_start)+e.strm.avail_in&&(n=i+e.strm.avail_in),n>r&&(n=r),n<o&&(0===n&&t!==st||t===rt||n!==i+e.strm.avail_in))break;a=t===st&&n===i+e.strm.avail_in?1:0,et(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Ot(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(Bt(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return(s-=e.strm.avail_in)&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==rt&&t!==st&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Bt(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,o=(r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r)>e.w_size?e.w_size:r,((i=e.strstart-e.block_start)>=o||(i||t===st)&&t!==rt&&0===e.strm.avail_in&&i<=r)&&(n=i>r?r:i,a=t===st&&0===e.strm.avail_in&&n===i?1:0,et(e,e.block_start,n,a),e.block_start+=n,Ot(e.strm)),a?3:1)},Pt=(e,t)=>{let n,i;for(;;){if(e.lookahead<262){if(Nt(e),e.lookahead<262&&t===rt)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=It(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-262&&(e.match_length=Ut(e,n)),e.match_length>=3)if(i=nt(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=It(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=It(e,e.ins_h,e.window[e.strstart+1]);else i=nt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(Mt(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===st?(Mt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Mt(e,!1),0===e.strm.avail_out)?1:2},jt=(e,t)=>
vendor: 4,437 bytes, line 1
1{let n,i,r;for(;;){if(e.lookahead<262){if(Nt(e),e.lookahead<262&&t===rt)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=It(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=Ut(e,n),e.match_length<=5&&(e.strategy===gt||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,i=nt(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=It(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(Mt(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((i=nt(e,0,e.window[e.strstart-1]))&&Mt(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=nt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===st?(Mt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Mt(e,!1),0===e.strm.avail_out)?1:2};function qt(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}const Kt=[new qt(0,0,0,0,Lt),new qt(4,4,8,4,Pt),new qt(4,5,16,8,Pt),new qt(4,6,32,32,Pt),new qt(4,4,16,16,jt),new qt(8,16,32,32,jt),new qt(8,16,128,128,jt),new qt(8,32,128,256,jt),new qt(32,128,258,1024,jt),new qt(32,258,258,4096,jt)];function Vt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=wt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*zt),this.dyn_dtree=new Uint16Array(2*(2*St+1)),this.bl_tree=new Uint16Array(2*(2*kt+1)),xt(this.dyn_ltree),xt(this.dyn_dtree),xt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Dt+1),this.heap=new Uint16Array(2*Et+1),xt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Et+1),xt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ht=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0},Ft=e=>{if(Ht(e))return Tt(e,ht);e.total_in=e.total_out=0,e.data_type=bt;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=-2,Qe(t),lt},Jt=e=>{const t=Ft(e);return t===lt&&(e=>{e.window_size=2*e.w_size,xt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Wt=(e,t,n,i,r,o)=>{if(!e)return ht;let a=1;if(t===pt&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>9||n!==wt||i<8||i>15||t<0||t>9||o<0||o>vt||8===i&&1!==a)return Tt(e,ht);8===i&&(i=9);const s=new Vt;return e.state=s,s.strm=e,s.status=42,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=o,s.method=n,Jt(e)};var Xt={deflateInit:(e,t)=>
1Wt(e,t,wt,15,8,yt),deflateInit2:Wt,deflateReset:Jt,deflateResetKeep:Ft,deflateSetHeader:(e,t)=>Ht(e)||2!==e.state.wrap?ht:(e.state.gzhead=t,lt),deflate:(e,t)=>{if(Ht(e)||t>ct||t<0)return e?Tt(e,ht):ht;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==st)return Tt(e,0===e.avail_out?ft:ht);const i=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Ot(e),0===e.avail_out)return n.last_flush=-1,lt}else if(0===e.avail_in&&At(t)<=At(i)&&t!==st)return Tt(e,ft);if(666===n.status&&0!==e.avail_in)return Tt(e,ft);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){let t=wt+(n.w_bits-8<<4)<<8,i=-1;if(t|=(i=n.strategy>=mt||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(t|=32),Gt(n,t+=31-t%31),0!==n.strstart&&(Gt(n,e.adler>>>16),Gt(n,65535&e.adler)),e.adler=1,n.status=113,Ot(e),0!==n.pending)return n.last_flush=-1,lt}if(57===n.status)if(e.adler=0,Ct(n,31),Ct(n,139),Ct(n,8),n.gzhead)Ct(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ct(n,255&n.gzhead.time),Ct(n,n.gzhead.time>>8&255),Ct(n,n.gzhead.time>>16&255),Ct(n,n.gzhead.time>>24&255),Ct(n,9===n.level?2:n.strategy>=mt||n.level<2?4:0),Ct(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ct(n,255&n.gzhead.extra.length),Ct(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ze(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Ct(n,0),Ct(n,0),Ct(n,0),Ct(n,0),Ct(n,0),Ct(n,9===n.level?2:n.strategy>=mt||n.level<2?4:0),Ct(n,3),n.status=113,Ot(e),0!==n.pending)return n.last_flush=-1,lt;if(69===n.status){if(n.gzhead.extra){let t=n.pending,i=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+i>n.pending_buf_size;){let r=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=Ze(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=r,Ot(e),0!==n.pending)return n.last_flush=-1,lt;t=0,i-=r}let r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending+=i,n.gzhead.hcrc&&n.pending>t&&(e.adler=Ze(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ze(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),0!==n.pending)return n.last_flush=-1,lt;i=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Ct(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ze(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ze(e.adler,n.pending_buf,n.pending-i,i)),Ot(e),0!==n.pending)return n.last_flush=-1,lt;i=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Ct(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ze(e.adler,n.pending_buf,n.pending-i,i))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ot(e),0!==n.pending))return n.last_flush=-1,lt;Ct(n,255&e.adler),Ct(n,e.adler>>8&255),e.adler=0}if(n.status=113,Ot(e),0!==n.pending)return n.last_flush=-1,lt}if(0!==e.avail_in||0!==n.lookahead||t!==rt&&666!==n.status){let i=0===n.level?Lt(n,t):n.strategy===mt?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(Nt(e),0===e.lookahead)){if(t===rt)return 1;break}if(e.match_length=0,n=nt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Mt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===st?(Mt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Mt(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===_t?((e,t)=>{let n,i,r,o;const a=e.window;for(;;){if(e.lookahead<=258){if(Nt(e),e.lookahead<=258&&t===rt)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=a[r=e.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){o=e.strstart+258;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<o);e.match_length=258-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=nt(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=nt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Mt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===st?(Mt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Mt(e,!1),0===e.strm.avail_out)?1:2})(n,t):Kt[n.level].func(n,t);if(3!==i&&4!==i||(n.status=666),1===i||3===i)return 0===e.avail_out&&(n.last_flush=-1),lt;if(2===i&&(t===ot?it(n):t!==ct&&(et(n,0,0,!1),t===at&&(xt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Ot(e),0===e.avail_out))return n.last_flush=-1,lt}return t!==st?lt:n.wrap<=0?ut:(2===n.wrap?(Ct(n,255&e.adler),Ct(n,e.adler>>8&255),Ct(n,e.adler>>16&255),Ct(n,e.adler>>24&255),Ct(n,255&e.total_in),Ct(n,e.total_in>>8&255),Ct(n,e.total_in>>16&255),Ct(n,e.total_in>>24&255)):(Gt(n,e.adler>>>16),Gt(n,65535&e.adler)),Ot(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?lt:ut)},deflateEnd:e=>{if(Ht(e))return ht;const t=e.state.status;return e.state=null,113===t?Tt(e,dt):lt},deflateSetDictionary:(e,t)=>{let n=t.length;if(Ht(e))return ht;const i=e.state,r=i.wrap;if(2===r||1===r&&42!==i.status||i.lookahead)return ht;if(1===r&&(e.adler=We(e.adler,t,n,0)),i.wrap=0,n>=i.w_size){0===r&&(xt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(n-i.w_size,n),0),t=e,n=i.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Nt(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=It(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,Nt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,i.wrap=r,lt},deflateInfo:"pako deflate (from Nodeca project)"};const Zt=(e,t)=>
vendor: 3,971 bytes, line 1
1Object.prototype.hasOwnProperty.call(e,t);var Yt={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Zt(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,i=0,r=e.length;t<r;t++){let r=e[t];n.set(r,i),i+=r.length}return n}};let $t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){$t=!1}const Qt=new Uint8Array(256);for(let e=0;e<256;e++)Qt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Qt[254]=Qt[254]=1;var en={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,i,r,o,a=e.length,s=0;for(r=0;r<a;r++)55296==(64512&(n=e.charCodeAt(r)))&&r+1<a&&56320==(64512&(i=e.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,r=0;o<s;r++)55296==(64512&(n=e.charCodeAt(r)))&&r+1<a&&56320==(64512&(i=e.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,r;const o=new Array(2*n);for(r=0,i=0;i<n;){let t=e[i++];if(t<128){o[r++]=t;continue}let a=Qt[t];if(a>4)o[r++]=65533,i+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&i<n;)t=t<<6|63&e[i++],a--;a>1?o[r++]=65533:t<65536?o[r++]=t:(t-=65536,o[r++]=55296|t>>10&1023,o[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&$t)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(o,r)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+Qt[e[n]]>t?n:t}};var tn=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const nn=Object.prototype.toString,{Z_NO_FLUSH:rn,Z_SYNC_FLUSH:on,Z_FULL_FLUSH:an,Z_FINISH:sn,Z_OK:cn,Z_STREAM_END:ln,Z_DEFAULT_COMPRESSION:un,Z_DEFAULT_STRATEGY:hn,Z_DEFLATED:dn}=$e;function fn(e){this.options=Yt.assign({level:un,method:dn,chunkSize:16384,windowBits:15,memLevel:8,strategy:hn},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tn,this.strm.avail_out=0;let n=Xt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==cn)throw new Error(Ye[n]);if(t.header&&Xt.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?en.string2buf(t.dictionary):"[object ArrayBuffer]"===nn.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=Xt.deflateSetDictionary(this.strm,e))!==cn)throw new Error(Ye[n]);this._dict_set=!0}}function pn(e,t){const n=new fn(t);if(n.push(e,!0),n.err)throw n.msg||Ye[n.err];return n.result}fn.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize;let r,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?sn:rn,"string"==typeof e?n.input=en.string2buf(e):"[object ArrayBuffer]"===nn.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(o===on||o===an)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if((r=Xt.deflate(n,o))===ln)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Xt.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===cn;
1if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},fn.prototype.onData=function(e){this.chunks.push(e)},fn.prototype.onEnd=function(e){e===cn&&(this.result=Yt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var gn={Deflate:fn,deflate:pn,deflateRaw:function(e,t){return(t=t||{}).raw=!0,pn(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,pn(e,t)},constants:$e};var mn=function(e,t){let n,i,r,o,a,s,c,l,u,h,d,f,p,g,m,_,v,y,b,w,E,S,k,z;const D=e.state;n=e.next_in,k=e.input,i=n+(e.avail_in-5),r=e.next_out,z=e.output,o=r-(t-e.avail_out),a=r+(e.avail_out-257),s=D.dmax,c=D.wsize,l=D.whave,u=D.wnext,h=D.window,d=D.hold,f=D.bits,p=D.lencode,g=D.distcode,m=(1<<D.lenbits)-1,_=(1<<D.distbits)-1;e:do{f<15&&(d+=k[n++]<<f,f+=8,d+=k[n++]<<f,f+=8),v=p[d&m];t:for(;;){if(d>>>=y=v>>>24,f-=y,0===(y=v>>>16&255))z[r++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=p[(65535&v)+(d&(1<<y)-1)];continue t}if(32&y){D.mode=16191;break e}e.msg="invalid literal/length code",D.mode=16209;break e}b=65535&v,(y&=15)&&(f<y&&(d+=k[n++]<<f,f+=8),b+=d&(1<<y)-1,d>>>=y,f-=y),f<15&&(d+=k[n++]<<f,f+=8,d+=k[n++]<<f,f+=8),v=g[d&_];n:for(;;){if(d>>>=y=v>>>24,f-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=g[(65535&v)+(d&(1<<y)-1)];continue n}e.msg="invalid distance code",D.mode=16209;break e}if(w=65535&v,f<(y&=15)&&(d+=k[n++]<<f,(f+=8)<y&&(d+=k[n++]<<f,f+=8)),(w+=d&(1<<y)-1)>s){e.msg="invalid distance too far back",D.mode=16209;break e}if(d>>>=y,f-=y,w>(y=r-o)){if((y=w-y)>l&&D.sane){e.msg="invalid distance too far back",D.mode=16209;break e}if(E=0,S=h,0===u){if(E+=c-y,y<b){b-=y;do{z[r++]=h[E++]}while(--y);E=r-w,S=z}}else if(u<y){if(E+=c+u-y,(y-=u)<b){b-=y;do{z[r++]=h[E++]}while(--y);if(E=0,u<b){b-=y=u;do{z[r++]=h[E++]}while(--y);E=r-w,S=z}}}else if(E+=u-y,y<b){b-=y;do{z[r++]=h[E++]}while(--y);E=r-w,S=z}for(;b>2;)z[r++]=S[E++],z[r++]=S[E++],z[r++]=S[E++],b-=3;b&&(z[r++]=S[E++],b>1&&(z[r++]=S[E++]))}else{E=r-w;do{z[r++]=z[E++],z[r++]=z[E++],z[r++]=z[E++],b-=3}while(b>2);b&&(z[r++]=z[E++],b>1&&(z[r++]=z[E++]))}break}}break}}while(n<i&&r<a);n-=b=f>>3,d&=(1<<(f-=b<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=r<a?a-r+257:257-(r-a),D.hold=d,D.bits=f};const _n=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),vn=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),yn=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),bn=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var wn=(e,t,n,i,r,o,a,s)=>{const c=s.bits;let l,u,h,d,f,p,g=0,m=0,_=0,v=0,y=0,b=0,w=0,E=0,S=0,k=0,z=null;const D=new Uint16Array(16),T=new Uint16Array(16);let A,x,R,I=null;for(g=0;g<=15;g++)D[g]=0;for(m=0;m<i;m++)D[t[n+m]]++;for(y=c,v=15;v>=1&&0===D[v];v--);if(y>v&&(y=v),0===v)return r[o++]=20971520,r[o++]=20971520,s.bits=1,0;for(_=1;_<v&&0===D[_];_++);for(y<_&&(y=_),E=1,g=1;g<=15;g++)if(E<<=1,(E-=D[g])<0)return-1;if(E>0&&(0===e||1!==v))return-1;for(T[1]=0,g=1;g<15;g++)T[g+1]=T[g]+D[g];for(m=0;m<i;m++)0!==t[n+m]&&(a[T[t[n+m]]++]=m);if(0===e?(z=I=a,p=20):1===e?(z=_n,I=vn,p=257):(z=yn,I=bn,p=0),k=0,m=0,g=_,f=o,b=y,w=0,h=-1,d=(S=1<<y)-1,1===e&&S>852||2===e&&S>592)return 1;for(;;){A=g-w,a[m]+1<p?(x=0,R=a[m]):a[m]>=p?(x=I[a[m]-p],R=z[a[m]-p]):(x=96,R=0),l=1<<g-w,_=u=1<<b;do{r[f+(k>>w)+(u-=l)]=A<<24|x<<16|R|0}while(0!==u);for(l=1<<g-1;k&l;)l>>=1;if(0!==l?(k&=l-1,k+=l):k=0,m++,0==--D[g]){if(g===v)break;g=t[n+a[m]]}if(g>y&&(k&d)!==h){for(0===w&&(w=y),f+=_,E=1<<(b=g-w);b+w<v&&!((E-=D[b+w])<=0);)b++,E<<=1;if(S+=1<<b,1===e&&S>852||2===e&&S>592)return 1;r[h=k&d]=y<<24|b<<16|f-o|0}}return 0!==k&&(r[f+k]=g-w<<24|64<<16|0),s.bits=y,0};const{Z_FINISH:En,Z_BLOCK:Sn,Z_TREES:kn,Z_OK:zn,Z_STREAM_END:Dn,Z_NEED_DICT:Tn,Z_STREAM_ERROR:An,Z_DATA_ERROR:xn,Z_MEM_ERROR:Rn,Z_BUF_ER
vendor: 9,783 bytes, line 1
1ROR:In,Z_DEFLATED:On}=$e,Mn=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Cn(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Gn=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<16180||t.mode>16211?1:0},Bn=e=>{if(Gn(e))return An;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=16180,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,zn},Un=e=>{if(Gn(e))return An;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Bn(e)},Nn=(e,t)=>{let n;if(Gn(e))return An;const i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?An:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Un(e))},Ln=(e,t)=>{if(!e)return An;const n=new Cn;e.state=n,n.strm=e,n.window=null,n.mode=16180;const i=Nn(e,t);return i!==zn&&(e.state=null),i};let Pn,jn,qn=!0;const Kn=e=>{if(qn){Pn=new Int32Array(512),jn=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(wn(1,e.lens,0,288,Pn,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wn(2,e.lens,0,32,jn,0,e.work,{bits:5}),qn=!1}e.lencode=Pn,e.lenbits=9,e.distcode=jn,e.distbits=5},Vn=(e,t,n,i)=>{let r;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),o.window.set(t.subarray(n-i,n-i+r),o.wnext),(i-=r)?(o.window.set(t.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0};var Hn={inflateReset:Un,inflateReset2:Nn,inflateResetKeep:Bn,inflateInit:e=>Ln(e,15),inflateInit2:Ln,inflate:(e,t)=>{let n,i,r,o,a,s,c,l,u,h,d,f,p,g,m,_,v,y,b,w,E,S,k=0;const z=new Uint8Array(4);let D,T;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gn(e)||!e.output||!e.input&&0!==e.avail_in)return An;16191===(n=e.state).mode&&(n.mode=16192),a=e.next_out,r=e.output,c=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,l=n.hold,u=n.bits,h=s,d=c,S=zn;e:for(;;)switch(n.mode){case 16180:if(0===n.wrap){n.mode=16192;break}for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,z[0]=255&l,z[1]=l>>>8&255,n.check=Ze(n.check,z,2,0),l=0,u=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=16209;break}if((15&l)!==On){e.msg="unknown compression method",n.mode=16209;break}if(u-=4,E=8+(15&(l>>>=4)),0===n.wbits&&(n.wbits=E),E>15||E>n.wbits){e.msg="invalid window size",n.mode=16209;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:16191,l=0,u=0;break;case 16181:for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(n.flags=l,(255&n.flags)!==On){e.msg="unknown compression method",n.mode=16209;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=16209;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(z[0]=255&l,z[1]=l>>>8&255,n.check=Ze(n.check,z,2,0)),l=0,u=0,n.mode=16182;case 16182:for(;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(z[0]=255&l,z[1]=l>>>8&255,z[2]=l>>>16&255,z[3]=l>>>24&255,n.check=Ze(n.check,z,4,0)),l=0,u=0,n.mode=16183;case 16183:for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(z[0]=255&l,z[1]=l>>>8&255,n.check=Ze(n.check,z,2,0)),l=0,u=0,n.mode=16184;case 16184:if(1024&n.flags){for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(z[0]=255&l,z[1]=l>>>8&255,n.check=Ze(n.check,z,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((f=n.length)>s&&(f=s),f&&(n.head&&(E=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+f),E)),512&n.flags&&4&n.wrap&&(n.check=Ze(n.check,i,f,o)),s-=f,o+=f,n.length-=f),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;f=0;do{E=i[o+f++],n.head&&E&&n.length<65536&&(n.head.name+=String.fromCharCode(E))}while(E&&f<s);if(512&n.flags&&4&n.wrap&&(n.check=Ze(n.check,i,f,o)),s-=f,o+=f,E)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;f=0;do{E=i[o+f++],n.head&&E&&n.length<65536&&(n.head.comment+=String.fromCharCode(E))}while(E&&f<s);if(512&n.flags&&4&n.wrap&&(n.check=Ze(n.check,i,f,o)),s-=f,o+=f,E)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=16209;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=16191;break;case 16189:for(;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}e.adler=n.check=Mn(l),l=0,u=0,n.mode=16190;case 16190:if(0===n.havedict)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=u,Tn;e.adler=n.check=1,n.mode=16191;case 16191:if(t===Sn||t===kn)break e;case 16192:if(n.last){l>>>=7&u,u-=7&u,n.mode=16206;break}for(;u<3;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}switch(n.last=1&l,u-=1,3&(l>>>=1)){case 0:n.mode=16193;break;case 1:if(Kn(n),n.mode=16199,t===kn){l>>>=2,u-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=16209}l>>>=2,u-=2;break;case 16193:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=16209;break}if(n.length=65535&l,l=0,u=0,n.mode=16194,t===kn)break e;case 16194:n.mode=16195;case 16195:if(f=n.length){if(f>s&&(f=s),f>c&&(f=c),0===f)break e;r.set(i.subarray(o,o+f),a),s-=f,o+=f,c-=f,a+=f,n.length-=f;break}n.mode=16191;break;case 16196:for(;u<14;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(n.nlen=257+(31&l),l>>>=5,u-=5,n.ndist=1+(31&l),l>>>=5,u-=5,n.ncode=4+(15&l),l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=16209;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.lens[A[n.have++]]=7&l,l>>>=3,u-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},S=wn(0,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,S){e.msg="invalid code lengths set",n.mode=16209;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;_=(k=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,v=65535&k,!((m=k>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(v<16)l>>>=m,u-=m,n.lens[n.have++]=v;else{if(16===v){for(T=m+2;u<T;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(l>>>=m,u-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=16209;break}E=n.lens[n.have-1],f=3+(3&l),l>>>=2,u-=2}else if(17===v){for(T=m+3;u<T;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}u-=m,E=0,f=3+(7&(l>>>=m)),l>>>=3,u-=3}else{for(T=m+7;u<T;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}u-=m,E=0,f=11+(127&(l>>>=m)),l>>>=7,u-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=16209;break}for(;f--;)n.lens[n.have++]=E}}if(16209===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=16209;break}if(n.lenbits=9,D={bits:n.lenbits},S=wn(1,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,S){e.msg="invalid literal/lengths set",n.mode=16209;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},S=wn(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,S){e.msg="invalid distances set",n.mode=16209;break}if(n.mode=16199,t===kn)break e;case 16199:n.mode=16200;case 16200:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=u,mn(e,d),a=e.next_out,r=e.output,c=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,l=n.hold,u=n.bits,16191===n.mode&&(n.back=-1);break}for(n.back=0;_=(k=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,v=65535&k,!((m=k>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(_&&0==(240&_)){for(y=m,b=_,w=v;_=(k=n.lencode[w+((l&(1<<y+b)-1)>>y)])>>>16&255,v=65535&k,!(y+(m=k>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}l>>>=y,u-=y,n.back+=y}if(l>>>=m,u-=m,n.back+=m,n.length=v,0===_){n.mode=16205;break}if(32&_){n.back=-1,n.mode=16191;break}if(64&_){e.msg="invalid literal/length code",n.mode=16209;break}n.extra=15&_,n.mode=16201;case 16201:if(n.extra){for(T=n.extra;u<T;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;_=(k=n.distcode[l&(1<<n.distbits)-1])>>>16&255,v=65535&k,!((m=k>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(0==(240&_)){for(y=m,b=_,w=v;_=(k=n.distcode[w+((l&(1<<y+b)-1)>>y)])>>>16&255,v=65535&k,!(y+(m=k>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}l>>>=y,u-=y,n.back+=y}if(l>>>=m,u-=m,n.back+=m,64&_){e.msg="invalid distance code",n.mode=16209;break}n.offset=v,n.extra=15&_,n.mode=16203;case 16203:if(n.extra){for(T=n.extra;u<T;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>
1n.dmax){e.msg="invalid distance too far back",n.mode=16209;break}n.mode=16204;case 16204:if(0===c)break e;if(f=d-c,n.offset>f){if((f=n.offset-f)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=16209;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),g=n.window}else g=r,p=a-n.offset,f=n.length;f>c&&(f=c),c-=f,n.length-=f;do{r[a++]=g[p++]}while(--f);0===n.length&&(n.mode=16200);break;case 16205:if(0===c)break e;r[a++]=n.length,c--,n.mode=16200;break;case 16206:if(n.wrap){for(;u<32;){if(0===s)break e;s--,l|=i[o++]<<u,u+=8}if(d-=c,e.total_out+=d,n.total+=d,4&n.wrap&&d&&(e.adler=n.check=n.flags?Ze(n.check,r,d,a-d):We(n.check,r,d,a-d)),d=c,4&n.wrap&&(n.flags?l:Mn(l))!==n.check){e.msg="incorrect data check",n.mode=16209;break}l=0,u=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=16209;break}l=0,u=0}n.mode=16208;case 16208:S=Dn;break e;case 16209:S=xn;break e;case 16210:return Rn;case 16211:default:return An}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||d!==e.avail_out&&n.mode<16209&&(n.mode<16206||t!==En))&&Vn(e,e.output,e.next_out,d-e.avail_out),h-=e.avail_in,d-=e.avail_out,e.total_in+=h,e.total_out+=d,n.total+=d,4&n.wrap&&d&&(e.adler=n.check=n.flags?Ze(n.check,r,d,e.next_out-d):We(n.check,r,d,e.next_out-d)),e.data_type=n.bits+(n.last?64:0)+(16191===n.mode?128:0)+(16199===n.mode||16194===n.mode?256:0),(0===h&&0===d||t===En)&&S===zn&&(S=In),S},inflateEnd:e=>{if(Gn(e))return An;let t=e.state;return t.window&&(t.window=null),e.state=null,zn},inflateGetHeader:(e,t)=>{if(Gn(e))return An;const n=e.state;return 0==(2&n.wrap)?An:(n.head=t,t.done=!1,zn)},inflateSetDictionary:(e,t)=>{const n=t.length;let i,r,o;return Gn(e)?An:0!==(i=e.state).wrap&&16190!==i.mode?An:16190===i.mode&&(r=We(r=1,t,n,0))!==i.check?xn:(o=Vn(e,t,n,n))?(i.mode=16210,Rn):(i.havedict=1,zn)},inflateInfo:"pako inflate (from Nodeca project)"};var Fn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Jn=Object.prototype.toString,{Z_NO_FLUSH:Wn,Z_FINISH:Xn,Z_OK:Zn,Z_STREAM_END:Yn,Z_NEED_DICT:$n,Z_STREAM_ERROR:Qn,Z_DATA_ERROR:ei,Z_MEM_ERROR:ti}=$e;function ni(e){this.options=Yt.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tn,this.strm.avail_out=0;let n=Hn.inflateInit2(this.strm,t.windowBits);if(n!==Zn)throw new Error(Ye[n]);if(this.header=new Fn,Hn.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=en.string2buf(t.dictionary):"[object ArrayBuffer]"===Jn.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Hn.inflateSetDictionary(this.strm,t.dictionary))!==Zn))throw new Error(Ye[n])}function ii(e,t){const n=new ni(t);if(n.push(e),n.err)throw n.msg||Ye[n.err];return n.result}ni.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Xn:Wn,"[object ArrayBuffer]"===Jn.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(o=Hn.inflate(n,a))===$n&&r&&((o=Hn.inflateSetDictionary(n,r))===Zn?o=Hn.inflate(n,a):o===ei&&(o=$n));n.avail_in>0&&o===Yn&&n.state.wrap>0&&0!==e[n.next_in];)Hn.inflateReset(n),o=Hn.inflate(n,a);switch(o){case Qn:case ei:case $n:case ti:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===Yn))if("string"===this.options.to){let e=en.utf8border(n.output,n.next_out),t=n.next_out-e,r=en.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}
1else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==Zn||0!==s){if(o===Yn)return o=Hn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ni.prototype.onData=function(e){this.chunks.push(e)},ni.prototype.onEnd=function(e){e===Zn&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Yt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ri={Inflate:ni,inflate:ii,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ii(e,t)},ungzip:ii,constants:$e};const{Deflate:oi,deflate:ai,deflateRaw:si,gzip:ci}=gn,{Inflate:li,inflate:ui,inflateRaw:hi,ungzip:di}=ri;var fi={Deflate:oi,deflate:ai,deflateRaw:si,gzip:ci,Inflate:li,inflate:ui,inflateRaw:hi,ungzip:di,constants:$e},pi=function(){return!(!window.navigator||!window.navigator.sendBeacon)},gi=function(){function e(e,t){var n=this;this.collector=e,this.config=t,this.requestType=t.request_type||"xhr",this.supportBeacon=pi(),this.errorCode={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ERROR:5002,TIMEOUT:5005},this.errorMessage={BEACON_FALSE:"xhr sendbeacon error",XHR_ERROR:"xhr request error",BEACON:"xhr sendbeacon error",TIMEOUT:"xhr request timeout"},this.customHeader=t.custom_request_header||{},this.collector.on(X.CustomHeader,function(e){n.setRequestHeader(e)})}return e.prototype.setRequestHeader=function(e){this.customHeader=Object.assign(this.customHeader,e)},e.prototype.useFetch=function(e){var t=e.url,n=e.data,i=e.method,r=e.success,o=e.fail,a={"Content-Type":"application/json; charset=utf-8"};if(Object.keys(this.customHeader).length)for(var s in this.customHeader)a[s]=this.customHeader[s];window.fetch?fetch(t,{method:i||"POST",headers:a,body:JSON.stringify(n)}).then(function(e){return e.json()}).then(function(e){r&&r(e)}).catch(function(e){o&&o(n,e)}):(this.requestType="xhr",console.log("your brwoser not support fetch, use xhr"),this.useRequest({url:t,data:n,method:i,success:r,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,n=e.data,i=e.success,r=e.fail,o=Date.now();window.navigator.sendBeacon(t,JSON.stringify(n))?i&&i({e:0},n,o):r&&r(n,this.errorCode.BEACON_FALSE,o,this.errorMessage.BEACON_FALSE)},e.prototype.useRequest=function(e){var t=this,n=e.url,i=e.data,r=e.method,o=e.success,a=e.fail,s=e.timeout,c=e.useBeacon,l=e.withCredentials,u=e.app_key,h=e.forceXhr,d=(e.encryption,e.encryption_header,e.status),f=e.zip,p=e.type;if(c&&this.supportBeacon)this.useBeacon({url:n,data:i,method:r,success:o,fail:a});else if("fetch"!==this.requestType||h)try{var g=null;if(window.XDomainRequest&&D()){g=new XDomainRequest;var m=r||"post",_=Date.now();g.open(m,n),s&&(g.timeout=s,g.ontimeout=function(){a&&a(i,t.errorCode.TIMEOUT,_,t.errorMessage.TIMEOUT)}),g.onerror=function(){a&&a(i,t.errorCode.XHR_ERROR,_,t.errorMessage.XHR_ERROR),g.abort()},g.onload=function(){if(o){var e=null;if(g.responseText){try{e=JSON.parse(g.responseText)}catch(t){e={}}o(e,i)}}},setTimeout(function(){g.send(JSON.stringify(i))},0)}else if(window.ActiveXObject&&T()){g=new ActiveXObject("Micrsorf.XMLHTTP");m=r||"POST";var v=Date.now();g.open(m,n),s&&(g.timeout=s,g.ontimeout=function(){a&&a(i,t.errorCode.TIMEOUT,v,t.errorMessage.TIMEOUT)}),g.onerror=function(){a&&a(i,t.errorCode.XHR_ERROR,v,t.errorMessage.XHR_ERROR),g.abort()},g.onload=function(){if(o){var e=null;if(g.responseText){try{e=JSON.parse(g.responseText)}catch(t){e={}}o(e,i)}}},setTimeout(function(){g.send(JSON.stringify(i))},0)}else if(window.XMLHttpRequest){g=new XMLHttpRequest;m=r||"POST";g.open(m,"".concat(n),!0);var y=Date.now();if(g.setRequestHeader("Content-Type","application/json; charset=utf-8"),this.collector.emit(X.XhrCurrendSend,{type:"net_event",eventData:i}),u&&g.setRequestHeader("X-MCS-AppKey","".concat(u)),Object.keys(this.customHeader).length)for(var b in this.customHeader)g.setRequestHeader(b,this.customHeader[b]);l&&(g.withCredentials=!0),s&&(g.timeout=s,g.ontimeout=function(){a&&a(i,t.errorCode.TIMEOUT,y,t.errorMessage.TIMEOUT)}),g.onload=function(){if(o){var e=null;if(g.responseText){try{e=JSON.parse(g.responseText)}catch(t){e={}}o(e,i,d,y,g.status),"monitor"!==d&&"event"===p&&t.collector.emit(X.HttpOk,{data:i,status:d})}}},g.onerror=function(){a&&a(i,t.errorCode.XHR_ERROR,y,t.errorMessage.XHR_ERROR),"monitor"!==d&&"event"===p&&t.collector.emit(X.HttpError,{data:i,status:d}),g.abort()};try{if(f&&this.config.enable_zip){var w=(new TextEncoder).encode(JSON.stringify(i)),E=fi.gz
1ip(w);g.setRequestHeader("Content-Encoding","gzip"),g.send(E)}else g.send(JSON.stringify(i))}catch(e){g.setRequestHeader("Content-Encoding",""),g.send(JSON.stringify(i)),this.collector.emit(X.SDKInnerError,{type:"sdk_error_send",eventData:i,errorCode:1e3,msg:e.message||e.stack||"sdk_error_send"})}}}catch(e){this.collector.emit(X.SDKInnerError,{type:"sdk_error_request",eventData:i,errorCode:1001,msg:e.message||e.stack||"sdk_error_request"}),this.collector.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK useRequest 发送请求发生了一些问题",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}else this.useFetch({url:n,data:i,method:r,success:o,fail:a})},e}(),mi=function(){function t(){}return t.prototype.apply=function(e,t){var n=this;if(!z()){this.collect=e,this.config=t,this.duration=6e4,this.reportUrl="".concat(e.configManager.getDomain(),"/profile/list");var i=e.Types,r=e.adapters.fetch;this.fetch=r,this.cache={},this.types=i,this.collect.on(i.ProfileSet,function(e){n.setProfile(e)}),this.collect.on(i.ProfileSetOnce,function(e){n.setOnceProfile(e)}),this.collect.on(i.ProfileUnset,function(e){n.unsetProfile(e)}),this.collect.on(i.ProfileIncrement,function(e){n.incrementProfile(e)}),this.collect.on(i.ProfileAppend,function(e){n.appendProfile(e)}),this.collect.on(i.ProfileClear,function(){n.cache={}}),this.ready(i.Profile)}},t.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach(function(n){t.collect.hook.emit(e,n)})};for(var r in n)i(r)}},t.prototype.report=function(e,t){var n=this;void 0===t&&(t={});try{if(this.config.disable_track_event)return;if(this.collect.sdkStop)return;var i=[];i.push(this.collect.processEvent(e,t));var r=this.collect.eventManager.merge(i,!0),o=this.collect.cryptoData(r);this.collect.configManager.getUrl("profile");this.collect.requestManager.useRequest({url:this.reportUrl,data:o,timeout:1e5,encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header,zip:!0,success:function(e,t,i,r,o){e&&0!==e.e?n.collect.emit(n.types.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e,startTime:r,endTime:Date.now(),status:o}):n.collect.emit(n.types.SubmitSuccess,{eventData:t,res:e,response:e,startTime:r,endTime:Date.now(),status:o})},fail:function(e,t,i){n.collect.emit(n.types.SubmitError,{type:"f_net",eventData:e,errorCode:t,startTime:i,endTime:Date.now()})}}),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_EVENT,info:"profile 埋点上报成功",time:Date.now(),data:r,code:200,status:"success"})}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"profile report 发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},t.prototype.setProfile=function(t){var n=this.formatParams(t);n&&Object.keys(n).length&&(this.pushCache(n),this.report("__profile_set",e(e({},n),{profile:!0})))},t.prototype.setOnceProfile=function(t){var n=this.formatParams(t,!0);n&&Object.keys(n).length&&(this.pushCache(n),this.report("__profile_set_once",e(e({},n),{profile:!0})))},t.prototype.incrementProfile=function(t){t?this.report("__profile_increment",e(e({},t),{profile:!0})):console.warn("please check the params, must be object!!!")},t.prototype.unsetProfile=function(t){if(t){var n={};n[t]="1",this.report("__profile_unset",e(e({},n),{profile:!0}))}else console.warn("please check the key, must be string!!!")},t.prototype.appendProfile=function(t){if(t){var n={};for(var i in t)"string"==typeof t[i]||"Array"===Object.prototype.toString.call(t[i]).slice(8,-1)?n[i]=t[i]:console.warn("please check the value of param: ".concat(i,", must be string or array !!!"));Object.keys(n).length&&this.report("__profile_append",e(e({},n),{profile:!0}))}else console.warn("please check the params, must be object!!!")},t.prototype.pushCache=function(e){var t=this;Object.keys(e).forEach(function(n){t.cache[n]={val:t.clone(e[n]),timestamp:Date.now()}})},t.prototype.formatParams=function(e,t){var n=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var r in e)"string"==typeof e[r]||"number"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1)?i[r]=e[r]:console.warn("please check the value of params:".concat(r,", must be string,number,Array !!!"));var o=Object.keys(i);if(!o.length)return;var a=Date.now();return o.filter(function(i){var r=n.cache[i];return t?!r:!(r&&n.compare(r.val,e[i])&&a-r.timestamp<n.duration)}).reduce(function(e,t){return e[t]=i[t],e},{})}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),console.log("error")}},t.prototype.compare=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(e){return this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),!1}},t.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),e}},t.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},t}(),_i=function(){return"undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null},vi=function(){function e(){this.setUrl="/service/2/log_settings",this.expire=216e5}return e.prototype.apply=function(e,t){if(t.enable_logsetting){this.collect=e,this.config=t;var n=e.adapters.storage;this.setKey="__applog_web_logsetting_".concat(t.app_id),this.cacheStorgae=new n(!1),this.check()}else e.emit(X.LogSettingReady)},e.prototype.check=function(){try{var e=this.getLocalData();e&&Object.keys(e).length?(null==e?void 0:e.timestamp)<Date.now()-this.expire?this.fetchSetting():(this.setLocalData(e),this.fetchSetting(!0)):this.fetchSetting()}catch(e){this.collect.emit(X.LogSettingReady),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK Check LogSetting Data Error",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"}),this.collect.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk logsetting check cache something error"})}},e.prototype.fetchSetting=function(e){var t=this;e?this.collect.emit(X.LogSettingReady):this.collect.requestManager.useRequest
1({url:"".concat(this.collect.configManager.getDomain()).concat(this.setUrl),data:{magic_tag:"ss_app_log",header:{aid:this.config.app_id,platform:"web"}},timeout:3e4,success:function(e){(null==e?void 0:e.config)?(t.setLocalData(e.config),t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"LogSetting Request Success",logType:"fetch",level:"info",time:Date.now(),data:e,infoType:"sdk"})):t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"LogSetting Request Response No Data",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"}),t.collect.emit(X.LogSettingReady)},fail:function(){t.collect.emit(X.LogSettingReady),t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"LogSetting Request Fail",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"}),t.collect.emit(X.SDKException,{error:"sdk logsetting request fail"})},encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header})},e.prototype.getLocalData=function(){return this.cacheStorgae.getItem(this.setKey)},e.prototype.setLocalData=function(e){this.collect.configManager.setSettingData(e),this.cacheStorgae.setItem(this.setKey,e)},e}();try{var yi=_i();yi&&(yi.LogSetting=function(e,t){(new vi).apply(e,t)})}catch(e){console.log(e)}var bi=function(){function t(e,t){var n=this;if(this.initData={},this.requestData={},this.errorData={},this.timeout=3e4,this.intervalTime=6e4,this.errorLimitCount=3,this.errorSampling=.9,this.sampling=.9,this.retryLimitCount=3,this.idRange=4,this.idPrefix="sdk_solid_user_",this.collect=e,t.enable_observe){this.reportUrl="1fz22z22z1nz21z4mz4bz4bz21z22z18z1ez1gz1lz1ez49z1az1jz1mz23z1bz23z19z18z4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22z4bz1jz1gz21z22",this.reportDomain=m("1fz22z22z1nz21z4mz4bz4bz21z22z18z1ez1gz1lz1ez49z1az1jz1mz23z1bz23z19z18z4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22"),this.reportId=20000050,this.startTime=Date.now(),this.requestRangerStartTime=this.startTime,this.errorRangerStartTime=this.startTime,this.requestIndex=1,this.preEvent=0,this.retryMap=new Map,this.randomUser=["sdk_solid_user_1","sdk_solid_user_2","sdk_solid_user_3","sdk_solid_user_4"],this.randomSUser=["1738231126490767749","1738231126490767757","1738231126490767758","1738231126490767760"];var i=Math.floor(1e3*Math.random());this.currentSUser=this.randomSUser[i],this.currentUser="".concat(this.idPrefix).concat(Math.ceil(Math.random()*this.idRange)),this.collect.on(X.Init,function(){n.addInitData({time:Date.now(),status:"run_start",type:"init"})}),this.collect.on(X.MonitorConfig,function(e){var t=e.initConfig;n.addConfig(t)}),this.collect.on(X.Ready,function(){n.addInitData({time:Date.now(),status:"run_end",type:"init"})}),this.collect.on(X.SDKFail,function(e){var t=e.message;n.addInitData({time:Date.now(),status:"run_fail",type:"init",message:t})}),this.collect.on(X.XhrBeforeSend,function(e){n.addRequestData(e)}),this.collect.on(X.SubmitSuccess,function(e){n.addRequestData(e)}),this.collect.on(X.SubmitError,function(e){n.addRequestData(e)}),this.collect.on(X.XhrCurrendSend,function(e){n.addRequestData(e)}),this.collect.on(X.SDKException,function(e){n.addErrorData({time:Date.now(),status:"run_fail",type:"init",error:e.error})}),this.collect.on(X.SessionResetInner,function(){n.reportImmediately()}),this.collect.on("send-sdk-monitor-request",function(){n.reportRequestData()}),this.collect.on("send-sdk-monitor-error",function(){n.reportErrorData()}),this.remove=this.addListener(),this.ready("monitor")}}return t.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach(function(n){t.collect.hook.emit(e,n)})};for(var r in n)i(r)}},t.prototype.addConfig=function(t){var n={};for(var i in t){n["config_".concat(i)]=t[i]}t.channel_domain?("https://gator.volces.com"===t.channel_domain?this.reportId=20000050:this.reportId=666666,this.reportDomain=t.channel_domain):("cn"===t.channel?this.reportId=2174:this.reportId=183136,this.reportDomain=m(K[t.channel])),this.initData=e(e({},this.initData),n)},t.prototype.addInitData=function(t){var n=t.status;if("run_start"===n)this.initData=e(e({},this.initData),{run_start:t.time,type:"init",status:0,sdk_channel:"script"});else if("run_end"===n){var i=this.getData("init","run_start")||this.startTime,r=i?t.time-i:0,o=this.collect.configManager.get("header"),a=this.collect.sessionManager.getSessionId(),s={};s.device_platform=o.device_platform,s.device_language=o.platform,s.device_network=o.network,s.sdk_version=o.sdk_version,s.sdk_lib=o.sdk_lib,s.device_browser=o.browser,s.device_os=o.os_name,this.initData=e(e(e({},this.initData),{run_duration:r,run_end:t.time,status:1,session_id:a,stage:"init_post"}),s),this.reportInitData()}else"run_fail"===n&&(this.initData=e(e({},this.initData),{run_fail:t.message,status:2}),this.reportInitData())},t.prototype.addRequestData=function(e){var t=e.type,n=e.eventData,i=e.response,r=this.getData("report","net")||0,o=this.getData("report","f_event")||0,a=this.collect.sessionManager.getSessionId();this.setRequestData("session_id",a);var s=0;if(n&&n.length>0){var c=n[0].events;s=c&&c.length||0}if("f_net"===t){var l=(this.getData("report","f_net")||0)+1,u=o+s;this.setRequestData("f_net",l),this.setRequestData("f_net_event",u)}else if("f_data"===t){var h=this.getData("report","f_data")||0,d=this.getData("report","f_data_event")||0,f=h+1;if(this.setRequestData("f_data",f),null==i?void 0:i.tc){var p=i.sc||0,g=d+(i.tc-p);this.setRequestData("f_data_event",g)}}else if("make_event"===t){var m=(this.getData("report","make_event")||0)+s;this.setRequestData("make_event",m)}else if("net_event"===t){m=(this.getData("report","net_event")||0)+s;this.setRequestData("net_event",m)}else{var _=(this.getData("report","event")||0)+s;this.setRequestData("event",_)}var v=r+1;if(this.setRequestData("net",v),"f_net"===t||"f_data"===t){var y=e.startTime,b=e.endTime,w=e.status,E=e.errorCode,S=e.errorMessage,k=w||E;if(k&&200!==k&&k.toString()){var z="";k.toString().startsWith("4")?z="f_4xx":k.toString().startsWith("5")&&(z="f_5xx");
1var D=(this.getData("report",z)||0)+1;this.setRequestData(z,D)}var T=this.getData("report","sampling")||[];if(Math.random()<this.sampling){var A=w||E,x=b-y||0,R=JSON.stringify(n);T.push({request_start:y,request_end:b,size:R.length,duration:x,http_status:A,error:(null==i?void 0:i.m)||(null==i?void 0:i.message)||S||"request default error"}),this.setRequestData("sampling",T)}}},t.prototype.addErrorData=function(e){var t=(this.getData("exception","count")||0)+1,n=this.getData("exception","sampling")||[];n.push({timestamp:e.time,error:e.error}),this.setErrorData("sampling",n),this.setErrorData("count",t),t>=this.errorLimitCount&&this.reportErrorData()},t.prototype.getData=function(e,t){var n={};return n="init"===e?this.initData:"report"===e?this.requestData:this.errorData,t?n[t]||null:n},t.prototype.setRequestData=function(e,t){e&&(this.requestData[e]=t)},t.prototype.setErrorData=function(e,t){e&&(this.errorData[e]=t)},t.prototype.addListener=function(){var e=this;return window.addEventListener("pagehide",function(){e.reportImmediately()},!1),window.addEventListener("beforeunload",function(){e.reportImmediately()},!1),this.timer=setInterval(function(){e.reportRequestData()},this.intervalTime),function(){clearInterval(e.timer),e.timer=null}},t.prototype.reportRequestData=function(){var t=JSON.parse(JSON.stringify(this.requestData));if(0!==t.net&&0!==t.event&&t.net&&t.event){var n=e({start_time:this.requestRangerStartTime,end_time:Date.now(),type:"report",index:this.requestIndex,pre_event:this.preEvent},t),i=this.composeData(n);this.report(i,this.resetRequestData.bind(this)),this.preEvent=this.preEvent+t.event}},t.prototype.reportInitData=function(){var e=JSON.parse(JSON.stringify(this.initData)),t=this.composeData(e);this.report(t,this.resetInitData.bind(this))},t.prototype.reportErrorData=function(){var t=JSON.parse(JSON.stringify(this.errorData)),n=e({start_time:this.errorRangerStartTime,session_id:this.collect.sessionManager.getSessionId(),end_time:Date.now(),type:"exception"},t),i=this.composeData(n);this.report(i,this.resetErrorData.bind(this))},t.prototype.composeData=function(e){var t=this.collect.configManager.get(),n=t.header,i=t.user,r=i.web_id,o=i.user_unique_id,a={event:"sdk_monitor",params:JSON.stringify(e),local_time_ms:Date.now()};return n.app_id=this.reportId,n.custom.client_webid=r||"",n.custom.client_uuid=o||"",n.custom.client_appid=this.collect.configManager.get("app_id"),n.custom=JSON.stringify(n.custom),[{events:[a],user:{user_unique_id:this.currentUser},header:n}]},t.prototype.resetRequestData=function(){this.requestRangerStartTime=Date.now(),this.requestIndex++,this.requestData={}},t.prototype.resetInitData=function(){},t.prototype.resetErrorData=function(){this.errorData={}},t.prototype.reportImmediately=function(){this.reportRequestData(),this.reportInitData(),this.reportErrorData()},t.prototype.report=function(e,t,n){var i=this;this.collect.requestManager.useRequest({url:"".concat(this.reportDomain,"/list"),data:e,success:function(e,r,o,a,s){200===s||n||i.retry(r),t&&t(s)},fail:function(){i.retry(e,n),t&&t()},timeout:this.timeout,status:"monitor"})},t.prototype.retry=function(e,t){var n=this,i=null,r=null;if(t){var o=this.retryMap.get(t);if(!o)return;if(o.count>=this.retryLimitCount)return void this.retryMap.delete(t);r=t,i=o.data,o.count++,this.retryMap.set(t,o)}else i=e,r=fe(),this.retryMap.set(r,{data:e,count:1});this.report(i,function(e){e&&200===e?n.retryMap.delete(t):n.retry(i,r)},r)},t}(),wi={autotrack:{src:{cn:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/plugin/autotrack.js",sg:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{cn:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/plugin/ab.js",sg:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{cn:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/plugin/stay.js",sg:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{cn:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/plugin/route.js",sg:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},tracer:{src:{cn:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/plugin/tracer.js",sg:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"}},Ei=_i(),Si=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach(function(t,n){if("sdk"===t)if(wi.hasOwnProperty(n)){var i=wi[n].object,r="".concat(wi[n].src[e.channel],"?query=").concat(Date.now());e.exist(n,i,r)}else console.warn("your ".concat(n," is not exist,please check plugin name"));else"object"==typeof t&&(t.src?e.exist(n,t.call,t.src):e.process(n,t.instance,"INSTANCE"))})}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,n){var i=this;Ei[t]?this.process(e,Ei[t]):this.loadPlugin(e,n,function(){i.process(e,Ei[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","–","load plugin:".concat(e," success"),"-")},function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","–","load plugin:".concat(e," error"),"-")})},e.prototype.process=function(e,t,n){try{if(n){var i=new t;i.apply&&i.apply(this.collect,this.config),console.log("excude ".concat(e," success"))}else t&&t(this.collect,this.config)}catch(t){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("excude ".concat(e," error, message:").concat(t.message))}},e.prototype.loadPlugin=function(e,t,n,i){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(n),o.onerror=function(){i(t)},o.onload=function(){r._plugin[e].forEach(function(e){e()})},document.getElementsByTagName("head")[0].appendChild(o)}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message})}},e}(),ki=function(){function e(e){var t=this;this.onMove=function(e){if(t.isDragging){var n=e.clientX||e.touches[0].clientX,i=e.clientY||e.touches[0].clientY;if(t.clickAllowed){var r=Math.abs(n-t.initialX),o=Math.abs(i-t.initialY);(r>t.dragThreshold||o>t.dragThreshold)&&(t.clickAllowed=!1)}t.animationFrameId&&cancelAnimationFrame(t.animationFrameId),t.animationFrameId=requestAnimationFrame(function(){var n=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,r=n-t.offsetX,o=i-t.offsetY,a=window.innerWidth-t.element.offsetWidth,s=window.innerHeight-t.element.offsetHeight;r=Math.max(0,Math.min(r,a)),o=Math.max(0,Math.min(o,s)),t.element.style.transform="translate(\n        ".concat(r-t.initialX,"px, \n        ").concat(o-t.initialY,"px\n      )")})}},this.onEnd=function(){if(t.isDragging){t.isDragging=!1;var e=new DOMMatrix(getComputedStyle(t.element).transform),n=t.initialX+e.m41,i=t.initialY+e.m42;t.element.style.left="".concat(n,"px"),t.element.style.top="".concat(i,"px"),t.element.style.transform="none",t.initialX=n,t.initialY=i,document.removeEventListener("mousemove",t.onMove),document.removeEventListener("mouseup",t.onEnd),document.removeEventListener("touchmove",t.onMove),document.removeEventListener("touchend",t.onEnd),setTimeout(function(){t.clickAllowed=!0},50)}},this.element=e,this.isDragging=!1,this.animationFrameId=null,this.lastX=0,this.lastY=0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.clickAllowed=!0,this.dragThreshold=1,this.initPosition(),this.bindEvents(),this.bindClickHandler()}return e.prototype.initPosition=function(){var e=this.element.getBoundingClientRect();this.element.style.position="fixed",this.element.style.left="".concat(e.left,"px"),this.element.style.top="".concat(e.top,"px"),this.element.style.transform="translate(0, 0)"},e.prototype.bindEvents=function(){this.element.addEventListener("mousedown",this.onStart.bind(this)),this.element.addEventListener("touchstart",this.onStart.bind(this))},e.prototype.onStart=function(e){e.preventDefault(),this.initialX=e.clientX||e.touches[0].clientX,this.initialY=e.clientY||e.touches[0].clientY;var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY,i=this.element.getBoundingClientRect();this.initialX=i.left,this.initialY=i.top,this.offsetX=t-this.initialX,this.offsetY=n-this.initialY,this.clickAllowed=!0,this.isDragging=!0,document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd),document.addEventListener("touchmove",this.onMove),document.addEventListener("touchend",this.onEnd)},e.prototype.bindClickHandler=function(){var e=this;this.element.addEventListener("click",function(t){if(!e.clickAllowed)return t.stopImmediatePropagation(),void t.preventDefault();window&&window.postMessage({type:"devtool:web:open-draw"},location.origin)})},e}(),zi=function(){function e(e,t){if(this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,this.trackEnabled=!0,t.enable_debug&&"Microsoft Internet Explorer"!==e.configManager.get("browser")){this.collect=e,this.config=t,this.app_id=t.app_id,this.trackEnabled=!!t.track_enabled;var n=e.adapters.storage;this.cacheStorgae=new n(!1),this.loadUrl=t.devtool_url||"https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/devtool/debug-web.v2.0.1.js",this.filterEvent=ne
1w Set(["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"]),this.load()}}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(e){console.log("devTool load fail, ".concat(e.message))}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach(function(t){var n=t.split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])})}catch(e){}return e},e.prototype.load=function(){try{this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(e){console.log("debug fail, ".concat(e.message))}},e.prototype.getStorage=function(){var e=this.cacheStorgae.getItem("__applog_open_devtool_web");return e&&parseInt(e)===this.app_id},e.prototype.setStorage=function(){this.cacheStorgae.setItem("__applog_open_devtool_web",this.app_id),this.cacheStorgae.setItem("__applog_devtool_web_track_enable",this.trackEnabled)},e.prototype.loadDevTool=function(){this.loadScript(this.loadUrl)},e.prototype.loadBaseInfo=function(){if(this.log=[],this.event=[],this.info=[{title:"基本信息",key:"base",type:1,content:[{name:"app_id",desc:"APP_ID",value:this.config.app_id},{name:"channel",desc:"CHANNEL",value:this.config.channel},{name:"domain",desc:"上报域名",value:this.collect.configManager.getDomain()},{name:"sdk_version",desc:"SDK版本",value:V},{name:"sdk_type",desc:"SDK引入方式",value:"script"}]},{title:"用户信息",key:"user",type:2,content:[{name:"uuid",desc:"UUID",value:this.collect.configManager.get("user").user_unique_id||""},{name:"web_id",desc:"WEB_ID",value:this.collect.configManager.get("user").web_id||""}]},{title:"公共参数信息",type:2,key:"common",content:[{name:"browser",desc:"浏览器",value:this.collect.configManager.get("browser")},{name:"browser_version",desc:"浏览器版本",value:this.collect.configManager.get("browser_version")},{name:"platform",desc:"平台",value:this.collect.configManager.get("platform")},{name:"device_model",desc:"设备型号",value:this.collect.configManager.get("device_model")},{name:"os_name",desc:"操作系统",value:this.collect.configManager.get("os_name")},{name:"os_version",desc:"操作系统版本",value:this.collect.configManager.get("os_version")},{name:"resolution",desc:"屏幕分辨率",value:this.collect.configManager.get("resolution")},{name:"referrer",desc:"来源",value:this.collect.configManager.get("referrer")},{name:"custom",desc:"自定义信息",value:JSON.stringify(this.collect.configManager.get("custom"))}]},{title:"配置信息",key:"config",type:3,content:[{name:"autotrack",desc:"全埋点",value:!!this.config.autotrack},{name:"stay",desc:"停留时长",value:!!this.config.enable_stay_duration}]},{title:"A/B配置信息",key:"ab",type:4,content:[{name:"ab",desc:"A/B实验",value:!!this.config.enable_ab_test}]}],this.config.enable_ab_test){var e=this.getInfo("ab"),t=[{name:"ab",desc:"A/B实验",value:!!this.config.enable_ab_test},{name:"vid",desc:"已曝光VID",value:this.collect.configManager.getAbVersion()},{name:"ab_domain",desc:"A/B域名",value:this.config.ab_channel_domain||m(J[this.config.channel])},{name:"all_values",desc:"全部配置",value:this.collect.configManager.getAbCache()}];e.content=t,this.setInfo("ab",e)}if(this.config.enable_native||this.config.Native){var n={title:"客户端信息",type:3,content:[{name:"native",desc:"是否打通",value:!!this.collect.bridgeReport}]};this.setInfo("native",n)}if(V.includes("tob")){var i=this.getInfo("user");i.content.push({name:"sid",desc:"DISS".split("").reverse().join(""),value:"点击获取"}),this.setInfo("user",i)}},e.prototype.getInfo=function(e){var t=null;return this.info.forEach(function(n){n.key===e&&(t=n)}),t},e.prototype.setInfo=function(e,t){var n=!1;this.info.forEach(function(i){i.key===e&&(n=!0,i=t)}),n||this.info.push(t)},e.prototype.getSecondInfo=function(e,t){var n=this.getInfo(e),i=null;return n.content.forEach(function(e){e.name===t&&(i=e)}),i},e.prototype.setSecondInfo=function(e,t,n){var i=this.getInfo(e),r=!1;if(i.content.forEach(function(e){e.name===t&&(e.value=n,r=!0)}),!r){var o={name:t,value:n,desc:t.toLocaleUpperCase()};i.content.push(o)}this.setInfo(e,i)},e.prototype.loadHook=function(){var e=this;this.collect.on(F.DEBUGGER_MESSAGE,function(t){switch(t.type){case F.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",infoType:t.infoType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};if(t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType)e.setSecondInfo("ab","vid",e.collect.configManager.getAbVersion()),e.setSecondInfo("ab","all_values",e.collect.configManager.getAbCache());else if("USER"===t.secType)e.setSecondInfo("user","user_unique_id"===t.common?"uuid":t.common,e.collect.configManager.get(t.common));else if("HEADER"===t.secType){var i=e.collect.configManager.get(t.common);e.setSecondInfo("common",t.common,"custom"===t.common?JSON.stringify(i):i)}return void e.updateInfo();case F.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var r=t.data[0],o=r.events;if(!o.length)return;o.forEach(function(n){n.checkShow=!0,n.searchShow=!0,n.focusShow=!0,n.status=t.status,n.type=e.filterEvent.has(n.event)?"sdk":"cus",n.verifyType=t.verifyType?"verify":"no",n.info="","fail"
1===t.status&&(n.info={message:"code: ".concat(t.code,", msg: ").concat(t.msg||t.failType)})}),e.updateEvent(r)}return}})},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",function(t){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event,sdk_type:V.includes("tob")?"tob":"inner",appId:e.app_id}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken(function(t){e.setSecondInfo("user","sid",t.tobid),e.updateInfo()})})},e.prototype.sendData=function(e,t){try{var n={type:e,payload:t};window&&window.postMessage(n,this.devToolOrigin)}catch(e){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e="#debugger-applog-web {\n      position: fixed;\n      width: 45px;\n      height: 45px;\n      background-image: url(".concat(m("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1bz1cz24z22z1mz1mz1jz4bz18z1nz1nz1jz1mz1ez4az1nz1lz1e"),");\n      bottom: 5%;\n      right: 10%;\n      cursor: pointer;\n      z-index:100;\n      background-size: 45px;\n    }"),t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.appendChild(document.createTextNode(e)),t.appendChild(n);var i=document.createElement("div");i.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web"></div>';var r=document.createElement("div");r.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(i),document.getElementsByTagName("body")[0].appendChild(r);var o=document.getElementById("debugger-applog-web");new ki(o)},e}();var Di=function(){function n(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new c(this),this.logger=new ne(e),this.remotePlugin=new Map,this.Types=X,this.adapters.fetch=oe,this.adapters.storage=q}return n.usePlugin=function(e,t,i){if(t){for(var r=!1,o=0,a=n.plugins.length;o<a;o++){if(n.plugins[o].name===t){n.plugins[o].plugin=e,n.plugins[o].options=i||{},r=!0;break}}r||n.plugins.push({name:t,plugin:e,options:i})}else n.plugins.push({plugin:e})},n.prototype.usePlugin=function(e,t,n){e&&(this.remotePlugin.get(e)?console.info("your sdk version has ".concat(e," already ~")):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:n}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},n.prototype.init=function(e){var t=this;if(this.monitor=new bi(this,e),this.inited)console.log("init can be call only one time");else{if(!e||!l(e))return console.warn("init params error,please check"),void this.hook.emit(X.SDKFail,{message:"init params error,please check;"});if(!e.app_id||("number"!=typeof(i=e.app_id)||isNaN(i)))return console.warn("app_id param is error, must be number, please check!"),void this.hook.emit(X.SDKFail,{message:"app_id param is error, must be number, please check!"});var i;if(e.app_key&&!function(e){return"string"==typeof e}(e.app_key))return console.warn("app_key param is error, must be string, please check!"),void this.hook.emit(X.SDKFail,{message:"app_key param is error, must be string, please check!"});if(e.channel_domain||-1!==["cn","sg","va"].indexOf(e.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),e.channel="cn"),this.emit(X.MonitorConfig,{initConfig:e}),this.logger=new ne(this.name,e.log),this.configManager=new te(this,e),this.appBridge=new ie(e,this.configManager),this.bridgeReport=this.appBridge.bridgeInject(),this.requestManager=new gi(this,e),this.logSetting=new vi,this.debugger=new zi(this,e),this.initConfig=e,this.env=e.channel_domain?"self":"public",this.emit
1(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Init",data:e,level:"info",time:Date.now(),infoType:"cus"}),e.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport){try{n.plugins.length&&n.plugins.reduce(function(e,n){var i=n.plugin,r=n.options;if("stay"===(null==n?void 0:n.name)||"autotrack"===(null==n?void 0:n.name)){var o=Object.assign(t.initConfig,r),a=new i;a.apply(t,o),e.push(a)}return e},this.pluginInstances)}catch(e){console.log("load plugin error, ".concat(e.message)),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK加载插件发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),this.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk load plugin something error"})}this.inited=!0,this.emit(X.Init)}else this.configManager.set({app_id:e.app_id}),this.eventManager=new de,this.tokenManager=new pe,this.sessionManager=new ue,this.profileManager=new mi,this.extendManager=new Si,Promise.all([new Promise(function(e){t.once(X.TokenComplete,function(){e(!0)})}),new Promise(function(e){t.once(X.Start,function(){e(!0)})}),new Promise(function(e){t.once(X.LogSettingReady,function(){e(!0)})})]).then(function(){t.ready(e)}).catch(function(e){console.log(e)}),this.logSetting.apply(this,e),this.tokenManager.apply(this,e),this.eventManager.apply(this,e),this.sessionManager.apply(this,e),this.inited=!0,this.emit(X.Init)}},n.prototype.ready=function(e){var t=this;try{this.extendManager.apply(this,this.initConfig),n.plugins.length&&n.plugins.reduce(function(e,n){var i=n.plugin,r=n.options,o=Object.assign(t.initConfig,r),a=new i;return a.apply(t,o),e.push(a),t.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK加载".concat(n.name,"插件"),level:"info",time:Date.now(),infoType:"sdk"}),e},this.pluginInstances)}catch(e){console.log("load plugin error, ".concat(e.message)),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK加载插件发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),this.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk load plugin something error"})}try{this.sdkReady=!0,this.emit(X.Ready,{userInfo:this.configManager.get("user")}),this.emit(X.CloudReady,{userInfo:this.configManager.get("user")}),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 用户信息初始化完成",time:Date.now(),secType:"USER",level:"info",data:this.configManager.get("user"),infoType:"sdk"}),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:this.configManager.get("user"),infoType:"sdk"}),this.logger.info("appid: ".concat(e.app_id,", userInfo:").concat(JSON.stringify(this.configManager.get("user")))),this.logger.info("appid: ".concat(e.app_id,", sdk is ready, version is ").concat(V,", you can report now !!!")),this.profileManager.apply(this,e);try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}this.pageView(),this.on(X.TokenChange,function(n){"webid"!==n.type&&"anonymous_id"!==n.type||t.pageView(),t.logger.info("appid: ".concat(e.app_id," token change, new userInfo:").concat(JSON.stringify(t.configManager.get("user")))),t.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:t.configManager.get("user"),infoType:"sdk"})}),this.on(X.TokenReset,function(){t.logger.info("appid: ".concat(e.app_id," token reset, new userInfo:").concat(JSON.stringify(t.configManager.get("user")))),t.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:t.configManager.get("user"),infoType:"sdk"})}),this.on(X.RouteChange,function(n){n.init||e.disable_route_report||t.pageView(n.config)}),this.on(X.ReStart,function(){t.pageView()})}catch(e){this.emit(X.SDKFail,{message:(null==e?void 0:e.message)||"sdk init ready fail."}
1),this.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk load plugin something error"})}},n.prototype.config=function(n){if(this.inited)if(n&&l(n))if(this.bridgeReport)this.appBridge.setConfig(n);else{n._staging_flag&&1===n._staging_flag&&(this.staging=!0),n.disable_auto_pv&&(this.disableAutoPageView=!0,delete n.disable_auto_pv);var i=e({},n);if(this.initConfig&&this.initConfig.configPersist){var r=this.configManager.getStore();r&&(i=Object.assign(r,n)),this.configManager.setStore(n)}i.web_id,i.user_unique_id;var o=t(i,["web_id","user_unique_id"]);i.hasOwnProperty("web_id")&&this.emit(X.ConfigWebId,i.web_id),i.hasOwnProperty("user_unique_id")&&this.emit(X.ConfigUuid,i.user_unique_id),i.hasOwnProperty("user_unique_id_type")&&this.emit(X.ConfigUuidType,i.user_unique_id_type),this.emit(X.ConfigTransform,i),this.configManager.set(o),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Config",level:"info",time:Date.now(),data:i,infoType:"cus"})}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},n.prototype.setUserUniqueID=function(e){this.config({user_unique_id:e})},n.prototype.setHeaderInfo=function(e,t){var n={};n[e]=t,this.config(n)},n.prototype.removeHeaderInfo=function(e){var t={};t[e]=void 0,this.config(t)},n.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(X.ConfigDomain)},n.prototype.getConfig=function(e){return this.configManager.get(e)},n.prototype.send=function(){this.start()},n.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(X.Start),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Start",level:"info",time:Date.now(),infoType:"cus"}),this.bridgeReport&&(this.pageView(),this.emit(X.Ready)))},n.prototype.event=function(e,t){var n=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var i=[];if(Array.isArray(e))e.forEach(function(e){var t=n.processEvent(e[0],e[1]||{});t&&i.push(t)});else{var r=this.processEvent(e,t);if(!r)return;i.push(r)}this.bridgeReport?i.forEach(function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))}):i.length&&(this.emit(X.Event,i),this.emit(X.SessionResetTime)),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Event",level:"info",time:Date.now(),data:e,infoType:"cus"})}catch(e){this.logger.warn("something error, please check"),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Event发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),this.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk event api something error"})}},n.prototype.beconEvent=function(e,t){var n=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;if(Array.isArray(e))return void console.warn("beconEvent not support batch report, please check");var i=[],r=this.processEvent(e,t||{});if(!r)return;i.push(r),this.bridgeReport?i.forEach(function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))}):i.length&&(this.emit(X.BeconEvent,i),this.emit(X.SessionResetTime)),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Beacon Event",level:"info",time:Date.now(),data:e,infoType:"sdk"})}catch(e){this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行Beacon Event发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),this.emit(X.SDKException,{error:(null==e?void 0:e.message)||"sdk beaconevent api something error"})}},n.prototype.beaconEvent=function(e,t){this.beconEvent(e,t)},n.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return this.logger.warn("eventName is null, please check"),null;var n=e;/^event\./.test(e)&&(n=e.slice(6));var i=t;"object"!=typeof i&&(i={}),i.profile?delete i.profile:i.event_index=f();var r=void 0;return i.local_ms?(r=i.local_ms,delete i.local_ms):r=+new Date,{event:n,params:i,local_time_ms:r,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}
1catch(n){return this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK发生了异常",level:"error",time:Date.now(),data:n.message,infoType:"sdk"}),this.emit(X.SDKException,{error:(null==n?void 0:n.message)||"sdk processEvent has something error"}),{event:e,params:t}}},n.prototype.dynamicParams=function(e){this.dynamicParamsFilter=e},n.prototype.filterEvent=function(e){this.eventFilter=e},n.prototype.on=function(e,t){this.hook.on(e,t)},n.prototype.once=function(e,t){this.hook.once(e,t)},n.prototype.off=function(e,t){this.hook.off(e,t)},n.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},n.prototype.set=function(e){this.hook.set(e)},n.prototype.pageView=function(e){this.disableAutoPageView||this.predefinePageView(e)},n.prototype.predefinePageView=function(t){if(void 0===t&&(t={}),this.inited){var n={title:document.title||location.pathname,url:location.href,url_path:this.handlePath(),time:Date.now(),referrer:window.document.referrer,$is_first_time:"".concat(this.configManager&&this.configManager.is_first_time||!1)},i=e(e({},n),t);this.event("predefine_pageview",i),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 上报PV",level:"info",time:Date.now(),infoType:"sdk"})}else console.warn("predefinePageView should call after init")},n.prototype.handlePath=function(){var e=location.pathname;try{if(this.initConfig.allow_hash){var t=new URL(location.href).hash.match(/#\/([^?#]+)/i);return t&&t.length?t[1]:location.pathname}}catch(t){e=location.pathname}return e},n.prototype.clearEventCache=function(){this.emit(X.CleanEvents)},n.prototype.setWebIDviaUnionID=function(e){if(e){var t=k(e);this.config({web_id:"".concat(t),wechat_unionid:e}),this.emit(X.CustomWebId)}},n.prototype.setWebIDviaOpenID=function(e){if(e){var t=k(e);this.config({web_id:"".concat(t),wechat_openid:e}),this.emit(X.CustomWebId)}},n.prototype.setAnonymousId=function(e){this.emit(X.AnonymousId,e)},n.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},n.prototype.setRequestHeaders=function(e){this.emit(X.CustomHeader,e)},n.prototype.resetStayDuration=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(X.ResetStay,{url_path:e,title:t,url:n},X.Stay)},n.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(X.SetStay,{url_path:e,title:t,url:n},X.Stay)},n.prototype.getToken=function(t,n){var i=this;if(this.inited){var r=!1,o=function(n){if(!r){r=!0;var o=i.configManager.get().user;return n&&(o.tobid=n,o["diss".split("").reverse().join("")]=n),t(e({},o))}},a=function(){i.tokenManager.getTobId(function(e){o(e)})};this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行GetToken",level:"info",time:Date.now(),infoType:"cus"}),this.sdkReady?a():(n&&setTimeout(function(){o()},n),this.on(X.Ready,function(){a()}))}else this.logger.warn("getToken must be use after function init")},n.prototype.bindToken=function(e,t,n){},n.prototype.setResourceEvent=function(e){this.emit(X.SetResource,e)},n.prototype.startTrackEvent=function(e){e&&this.emit(X.TrackDurationStart,e,X.TrackDuration)},n.prototype.endTrackEvent=function(e,t){void 0===t&&(t={}),e&&this.emit(X.TrackDurationEnd,{eventName:e,params:t},X.TrackDuration)},n.prototype.pauseTrackEvent=function(e){e&&this.emit(X.TrackDurationPause,e,X.TrackDuration)},n.prototype.resumeTrackEvent=function(e){e&&this.emit(X.TrackDurationResume,e,X.TrackDuration)},n.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(X.ProfileSet,e,X.Profile),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e,infoType:"cus"})},n.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(X.ProfileSetOnce,e,X.Profile),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e,infoType:"cus"})},n.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit
1(X.ProfileIncrement,e,X.Profile),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e,infoType:"cus"})},n.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(X.ProfileUnset,e,X.Profile),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e,infoType:"cus"})},n.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(X.ProfileAppend,e,X.Profile),this.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e,infoType:"cus"})},n.prototype.setExternalAbVersion=function(e){this.bridgeReport?this.appBridge.setExternalAbVersion(e):this.emit(X.AbExternalVersion,"string"==typeof e&&e?"".concat(e).trim():null,X.Ab)},n.prototype.getVar=function(e,t,n){this.bridgeReport?this.appBridge.getVar(e,t,n):this.emit(X.AbVar,{name:e,defaultValue:t,callback:n},X.Ab)},n.prototype.getAllVars=function(e){this.bridgeReport?this.appBridge.getAllVars(e):this.emit(X.AbAllVars,e,X.Ab)},n.prototype.getABconfig=function(e,t){this.emit(X.AbConfig,{params:e,callback:t},X.Ab)},n.prototype.getAbSdkVersion=function(e){if(!this.bridgeReport||!e)return this.configManager.getAbVersion()||"";this.appBridge.getAbSdkVersion(e)},n.prototype.onAbSdkVersionChange=function(e){var t=this;
1return this.emit(X.AbVersionChangeOn,e,X.Ab),function(){t.emit(X.AbVersionChangeOff,e,X.Ab)}},n.prototype.offAbSdkVersionChange=function(e){this.emit(X.AbVersionChangeOff,e,X.Ab)},n.prototype.openOverlayer=function(){this.emit(X.AbOpenLayer,"",X.Ab)},n.prototype.closeOverlayer=function(){this.emit(X.AbCloseLayer,"",X.Ab)},n.prototype.initCrypto=function(){this.publicKey=this.initConfig.crypto_publicKey||"04BA9E229380DC0E41E10839B0C52A4763D3EDFE8903F3B8E81395523381E03AA995D295BD4A4088792E4785B224F7837EB4D2C7C05973C7AE8687A35ACAE470A0"},n.prototype.cryptoData=function(e){return e},n.prototype.stop=function(){this.sdkStop=!0},n.prototype.reStart=function(){this.sdkStop=!1,this.emit(X.ReStart)},n.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(X.TokenComplete))},n.prototype.destoryInstance=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(X.TokenComplete))},n.prototype.setExposureType=function(e){this.emit(X.SetExposureType,e)},n.plugins=[],n}(),Ti={},Ai=[],xi=function(e){e.length&&e.forEach(function(e){Ai.push(e)})},Ri=function(e,t,n,i){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||i||"*",a={type:t,payload:n};r.postMessage(JSON.stringify(a),o)},Ii=function(e,t){Ti[e]=Ti[e]||[],Ti[e].push(t)},Oi=function(e){if(Ai.some(function(e){return"*"===e})||Ai.some(function(t){return e.origin.indexOf(t)>-1})){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var n=t.type,i=t.payload;
1Ti[n]&&Ti[n].forEach(function(t){"function"==typeof t&&t(e,i)})}},Mi=function(e,t){var n={};if(Object.keys(e).length)for(var i in e){if("filter"===i||"autotrack"===i||"enable_stay_duration"===i)break;n[i]=e[i]}(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:n,version:t},location.host),window.addEventListener("message",Oi,!1)},Ci="__applog_ab_style__",Gi="",Bi=!1;function Ui(e){var t=e.event,n=e.editorUrl;e.collectInstance,e.fromSession;Bi||(Bi=!0,v(n,function(){Ri(t,"abEditorScriptloadSuccess")},function(){t&&Ri(t,"abEditorScriptloadError"),Bi=!1}))}var Ni;!function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),n=function(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(n[Symbol.iterator]=function(){return n}),n},i=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},r=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};(function(){try{var t=e.URLSearchParams;return"a=1"===new t("?a=1").toString()&&"function"==typeof t.prototype.set&&"function"==typeof t.prototype.entries}catch(t){return!1}})()||function(){var r=function e(t){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var n=typeof t;if("undefined"===n);else if("string"===n)""!==t&&this._fromString(t);else if(t instanceof e){var i=this;t.forEach(function(e,t){i.append(t,e)})}else{if(null===t||"object"!==n)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var r=0;r<t.length;r++){var o=t[r];if("[object Array]"!==Object.prototype.toString.call(o)&&2===o.length)throw new TypeError("Expected [string, any] as entry at index "+r+" of URLSearchParams's input");this.append(o[0],o[1])}else for(var a in t)t.hasOwnProperty(a)&&this.append(a,t[a])}},o=r.prototype;o.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},o.delete=function(e){delete this._entries[e]},o.get=function(e){return e in this._entries?this._entries[e][0]:null},o.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},o.has=function(e){return e in this._entries},o.set=function(e,t){this._entries[e]=[String(t)]},o.forEach=function(e,t){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)e.call(t,n[r],i,this)}},o.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),n(e)},o.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},o.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),n(e)},t&&(o[Symbol.iterator]=o.entries),o.toString=function(){var e=[];return this.forEach(function(t,n){e.push(i(n)+"="+i(t))}),e.join("&")},e.URLSearchParams=r}();var o=e.URLSearchParams.prototype;"function"!=typeof o.sort&&(o.sort=function(){var e=this,t=[];this.forEach(function(n,i){t.push([i,n]),e._entries||e.delete(i)}),t.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),e._entries&&(e._entries={});for(var n=0;n<t.length;n++)this.append(t[n][0],t[n][1])}),"function"!=typeof o._fromString&&Object.defineProperty(o,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach(function(e,n){t.push(n)});for(var n=0;n<t.length;n++)this.delete(t[n])}var i,o=(e=e.replace(/^\?/,"")).split("&");for(n=0;n<o.length;n++)i=o[n].split("="),this.append(r(i[0]),i.length>1?r(i[1]):"")}})}(void 0!==A?A:"undefined"!=typeof window?window:"undefined"!=typeof self?self:A),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(t){return!1}}()||function(){var t=e.URL,n=function t(n,i){"string"!=typeof n&&(n=String(n)),i&&"string"!=typeof i&&(i=String(i));var r,o=document;if(i&&(void 0===e.location||i!==e.location.href)){i=i.toLowerCase(),(r=(o=document.implementation.createHTMLDocument("")).createElement("base")).href=i,o.head.appendChild(r);try{if(0!==r.href.indexOf(i))throw new Error(r.href)}catch(t){throw new Error("URL unable to set base "+i+" due to "+t)}}var a=o.createElement("a");a.href=n,r&&(o.body.appendChild(a),a.href=a.href);var s=o.createElement("input");if(s.type="url",s.value=n,":"===a.protocol||!/:/.test(a.href)||!s.checkValidity()&&!i)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var c=new e.URLSearchParams(this.search),l=!0,u=!0,h=this;["append","delete","set"].forEach(function(e){var t=c[e];c[e]=function(){t.apply(c,arguments),l&&(u=!1,h.search=c.toString(),u=!0)}}),Object.defineProperty(this,"searchParams",{value:c,enumerable:!0});var d=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,
vendor: 1,749 bytes, line 1
1configurable:!1,writable:!1,value:function(){this.search!==d&&(d=this.search,u&&(l=!1,this.searchParams._fromString(this.search),l=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach(function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}
1catch(n){setInterval(function(){e.location.origin=t()},100)}}}(void 0!==A?A:"undefined"!=typeof window?window:"undefined"!=typeof self?self:A),function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(Ni||(Ni={}));var Li=function(){function t(){this.fetchStatus="no",this.refreshFetchStatus="complete",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data=null,this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[],this.auto_exposure=!1}return t.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_ab_test){var i=e.configManager.getSettingData("bav_ab_config");if(!h(i)||i){var r=t.enable_multilink,o=t.ab_channel_domain,a=t.enable_ab_visual,s=t.ab_cross,c=t.ab_cookie_domain,l=t.disable_ab_reset,u=t.auto_exposure_expriment,d=o||m(J[t.channel||"cn"]),f=e.adapters,p=f.storage,g=f.fetch;this.cacheStorgae=new p(!1),this.fetch=g,this.enable_multilink=r,this.enable_ab_visual=a,this.abKey="__tea_sdk_ab_version_".concat(t.app_id),this.ab_cross=s,this.ab_cookie_domain=c||"",this.fetchUrl="".concat(d).concat("/service/2/abtest_config/"),this.reportUrl="".concat(e.configManager.getUrl("event")),this.exposureLimit=t.exposure_limit||5,this.ab_batch_time=t.ab_batch_time||50,this.overlay_opacity=t.overlay_opacity||0,this.auto_exposure=u;var _=this.collect.Types;this.types=_;var v=e.configManager.getSettingData("bav_ab_refresh");this.collect.on(_.TokenChange,function(e){l||h(i)&&!v||"uuid"===e.type&&n.readyStatus&&(n.clearCache(),n.fetchAB())}),this.collect.on(_.TokenReset,function(){l||h(i)&&!v||n.readyStatus&&(n.clearCache(),n.fetchAB())}),this.collect.on(_.AbVar,function(e){var t=e.name,i=e.defaultValue,r=e.callback;n.getVar(t,i,r)}),this.collect.on(_.AbAllVars,function(e){n.getAllVars(e)}),this.collect.on(_.AbConfig,function(e){var t=e.params,i=e.callback;n.getABconfig(t,i)}),this.collect.on(_.AbExternalVersion,function(e){n.setExternalAbVersion(e)}),this.collect.on(_.AbOpenLayer,function(){n.openOverlayer()}),this.collect.on(_.AbCloseLayer,function(){n.closeOverlayer()}
1),this.collect.on(_.AbVersionChangeOn,function(e){n.changeListener.set(e,e)}),this.collect.on(_.AbVersionChangeOff,function(e){n.changeListener.get(e)&&n.changeListener.delete(e)}),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(this.fetchAB(),this.readyStatus=!0),this.collect.emit(_.AbReady)}}},t.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach(function(n){t.collect.hook.emit(e,n)})};for(var r in n)i(r)}},t.prototype.loadMode=function(){var e,t,n=function(){try{var e=JSON.parse(atob(window.name));return e||void 0}catch(e){return}}(),i="";if(n){var r=n.scenario,o=n.href;r?(this.editMode=!0,i=r):!o||-1===o.indexOf("datatester")&&-1===o.indexOf("visual-editor")||(this.editMode=!0,i="visual-editor")}this.enable_ab_visual&&(function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},xi(["*"]);var n,i="";Mi(t,V);var r="";try{var o=window.performance.getEntriesByType("resource");if(o&&o.length&&(o.forEach(function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(r=e.name)}),r||document.currentScript&&(r=document.currentScript.src),r&&(n=r.split("/"))&&n.length)){i="https:/";for(var a=2;a<n.length&&a!==n.length-1;a++)i+="/".concat(n[a]);i="".concat(i,"/visual-ab-core")}}catch(e){}Ii("tea:openVisualABEditor",function(n){var r=m(W),o=n.data;if("string"==typeof n.data)try{o=JSON.parse(n.data)}catch(e){o=void 0}if(o){var a=o.lang;if(o.appId!==t.app_id)return Ri(n,"appIdError"),void console.error("abtest appid is not belong the page appid please check");var s=o.version;if(s){var c=s?".".concat(s):".1.0.1";Gi=i?"".concat(i).concat(c,".js?query=").concat(Date.now()):"".concat(r,"?query=").concat(Date.now())}else Gi="".concat(r,"?query=").concat(Date.now());window.TEAVisualEditor.lang=a,window.TEAVisualEditor.__ab_domin=t.channel_domain||"",Ui({event:n,editorUrl:Gi,collectInstance:e})}})}(this.collect,this.config),"visual-editor"===i)?this.collect.destoryInstace():this.enable_multilink&&(e=this.collect,t=this.config,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id,Ii("tea:openTesterEventInspector",function(t){var n=t.data;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){n=void 0}if(n){var i=n.referrer,r=n.lang,o=n.appId;window.TEAVisualEditor.__editor_ajax_domain=i||"",window.TEAVisualEditor.__ab_appId=o||"",window.TEAVisualEditor.lang=r||"";var a=m("1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz22z1cz21z22z1cz20z49z1cz24z1cz1lz22z49z1gz1lz21z1nz1cz1az22z1mz20");Ui({event:t,editorUrl:"".concat(a,".js?query=").concat(Date.now()),collectInstance:e})}}))},t.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,n=e.ab_ext_version,i=e.ab_version_multilink,r=e.data,o=this.checkFromUrl();o?this.mulilinkVersions.push(o):this.mulilinkVersions=i||[],this.extVersions=n||[],this.versions=t||[],this.data=r;var a=this.versions.concat(this.extVersions);this.enable_multilink&&(a=a.concat(this.mulilinkVersions)),this.configVersions(a.join(","))},t.prototype.checkFromUrl=function(){var e=E(window.location.href);return e&&e.vid?e.vid:""},t.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(e=e.concat(this.mulilinkVersions)),this.configVersions(e.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach(function(t){"function"==typeof t&&t(e)})},t.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},t.prototype.getVar=function(e,t,n){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof n)throw new Error("callback must be a function");var i={name:e,defaultValue:t,callback:n,type:Ni.Var};this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用GetVar",level:"info",time:Date.now(),data:e,infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(i,e):this.callbacks.push(i)},t.prototype.getRealVar=function(e,t){var n=e.name,i=e.defaultValue,r=e.callback,o=this.data;if(o){if(l(o[n])){var a=o[n].vid;return"$ab_url"===t?this.mulilinkVersions.includes(a)||this.mulilinkVersions.push(a):this.versions.includes(a)||this.versions.push(a),this.updateVersions(),this.fe
1chEvent(a,t,i),r(o[n].val),void this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK执行GetVar,并曝光了实验".concat(n),level:"info",time:Date.now(),data:o[n],infoType:"sdk"})}r(i),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK执行GerVar默认回调",level:"info",time:Date.now(),data:this.data,infoType:"sdk"})}else r(i)},t.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:Ni.All};this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用GetAllVars",level:"info",time:Date.now(),infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},t.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 执行GetAllVars",level:"info",time:Date.now(),data:this.data,infoType:"sdk"})},t.prototype.exposureAll=function(e){try{if(Object.keys(e).length)for(var t in e){if("$ab_url"===t||"$ab_modification"===t)break;this.getRealVar({name:t,defaultValue:e[t].val,callback:function(){},type:Ni.Var},t)}}catch(e){console.warn("exposure all expriment err",JSON.stringify(e.message))}},t.prototype.fechEvent=function(e,t,n){try{if(this.config.disable_track_event)return;if(this.collect.sdkStop)return;if(!e)return;var i=this.collect.configManager.get(),r=i.header,o=i.user,a=this.getABCache();if(a&&a.uuid&&a.uuid!==o.user_unique_id)return;var s={event:"abtest_exposure",ab_sdk_version:"".concat(e),params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?n:window.location.href}),local_time_ms:Date.now()};r.custom=JSON.stringify(r.custom);var c={events:[s],user:o,header:r};this.reportExposure(c,t)}catch(e){this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 发生了异常",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},t.prototype.reportExposure=function(e,t){this.exposureCache.push(e),this.report(t)},t.prototype.report=function(e){var t=this;try{var n=this.collect.cryptoData(this.exposureCache);if(z())return void ce(this.collect.configManager.getUrl("img"),n);this.collect.requestManager.useRequest({url:this.reportUrl,data:n,timeout:1e5,useBeacon:"$ab_url"===e,encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header,zip:!0,type:"event"}),this.exposureCache.forEach(function(e){t.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_EVENT,info:"曝光埋点上报成功",time:Date.now(),data:[e],code:200,status:"success",infoType:"sdk"})}),this.exposureCache=[]}catch(e){console.log("ab report err",e)}},t.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},t.prototype.getABconfig=function(e,t){var n=Object.keys(e);n&&n.length&&this.collect.configManager.set(e),this.fetchAB(t)},t.prototype.get=function(e){if(this.ab_cross){var t=this.cacheStorgae.getCookie(e,this.ab_cookie_domain);return t?JSON.parse(t):null}return this.cacheStorgae.getItem(e)},t.prototype.set=function(e,t){this.ab_cross?this.cacheStorgae.setCookie(e,t,2592e6,this.ab_cookie_domain):this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t)},t.prototype.remove=function(){this.ab_cross?this.cacheStorgae.removeCookie(this.abKey,this.ab_cookie_domain):this.cacheStorgae.removeItem(this.abKey)},t.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,e?t[e]:t},t.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},t.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},t.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},t.prototype.openOverlayer=function(e){var t=this;if(function(e){if(!document.getElementById(Ci)){var t="body { opacity: ".concat(e," !important; }"),n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.id=Ci,i.type="text/css",i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),n.appendChild(i)}}(this.overlay_opacity),e)var n=setTimeout(function(){t.closeOverlayer(),clearTimeout(n)},e)},t.prototype.closeOverlayer=function(){var e;(e=document.getElementById(Ci))&&e.parentElement.removeChild(e)},t.prototype.fetchComplete=function(e,t){var n=this;if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var i=[];Object.keys(e).forEach(function(t){var n=e[t].vid;n&&i.push(n)}),this.versions=this.versions.filter(function(e){return i.includes(e)});var r=e.$ab_url,o=e.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroyInstance)return;this.getVar("$ab_modification",window.location.href,function(){!function(e){window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.__ab_config=e;var t=m("1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1jz1mz18z1bz1cz20z4az1hz21");v("".concat(t,"?query=").concat(Date.now()),function(){console.log("load visual render success")},function(){console.log("load visual render fail")})}(o.val),n.closeOverlayer(),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行可视化实验",level:"info",logType:"fetch",time:Date.now(),infoType:"sdk",data:{$ab_modification:o}})})}else if(r&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter(function(e){return i.includes(e)}),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行多链接实验",level:"info",logType:"fetch",time:Date.now(),infoType:"sdk",data:{$ab_url:r}});var a=r.val,s=r.vid;a&&s&&this.getVar("$ab_url",a,function(){n.editMode||(a!==window.location.href?setTimeout(function(){if(!n.collect.destroyInstance){var e="".concat(a);e=-1===e.indexOf("http")?"https://".concat(e):e;var t=w(e).host;
1try{var i=new URL(e);t!==location.host?i.searchParams.append("vid",s):window.history.replaceState("","",e),window.location.href=i.href}catch(t){window.location.href=e}}},100):n.closeOverlayer())})}this.auto_exposure&&this.exposureAll(e),this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach(function(e){return n[e.type===Ni.Var?"getRealVar":"getRealAllVars"](e,"")}),this.callbacks=[]},t.prototype.fetchAB=function(t){var n=this,i=this.collect.configManager.get(),r=i.header,o=i.user;this.config.enable_anonymousid&&delete o.web_id;var a=o.user_unique_id,s={header:e(e(e({aid:this.config.app_id},o||{}),r||{}),{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 发起AB实验请求",level:"info",logType:"fetch",time:Date.now(),data:s,infoType:"sdk"});var c=this.collect.cryptoData(s);this.collect.requestManager.useRequest({url:this.fetchUrl,data:c,success:function(e){n.fetchStatus="complete",n.refreshFetchStatus="complete";var i=e.data;"success"===e.message?(n.fetchComplete(i,a),t&&t(i)):(n.fetchComplete(null,a),t&&t(null)),n.collect.emit(n.types.AbComplete,i),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求成功",level:"info",logType:"fetch",time:Date.now(),data:i,infoType:"sdk"})},fail:function(){n.fetchStatus="complete",n.refreshFetchStatus="complete",n.fetchComplete(null,a),t&&t(null),n.collect.emit(n.types.AbTimeout),n.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求网络异常",level:"error",logType:"fetch",time:Date.now(),infoType:"sdk"})},timeout:this.config.ab_timeout||1e4,encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header})},t}();try{var Pi=_i();Pi&&(Pi.LogAb=function(e,t){(new Li).apply(e,t)})}catch(e){console.log(e)}var ji=function(){function t(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,l(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration))}return t.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},t.prototype.resetParams=function(e,t,n){this.url_path=e,this.url=n,this.title=t},t.prototype.enable=function(e,t,n){this.url_path=e||this.url_path,this.url=n||this.url,this.title=t||this.title,this.disableCallback=this.enablePageAlive(),this.options.params instanceof Function?this.customParmas=this.options.params():this.customParmas=this.options.params},t.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},t.prototype.sendEvent=function(t,n){void 0===n&&(n=!1);var i=n?this.aliveDTime:Date.now()-this.sessionStartTime;i<0||i>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||(this.collect.beconEvent(this.options.aliveName,e({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:i,is_support_visibility_change:y(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:t},this.customParmas)),this.sessionStartTime=Date.now(),this.resetParams(location.pathname,document.title,location.href))},t.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},t.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval(function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)},1e3)},t.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},t.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},t.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return p(document,"visibilitychange",t,!1),p(window,"pagehide",n,!1),function(){e.beforeunload(),g(document,"visibilitychange",t,!1),g(window,"beforeunload",n,!1),g(window,"pagehide",n,!1)}},t}(),qi=function(){function t(e,t){var n=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.visibilitychange=function(){"hidden"===document.visibilityState?n.activeEndTime=Date.now():"visible"===document.visibilityState&&(n.activeEndTime&&(n.totalTime+=n.activeEndTime-n.activeStartTime,n.activeTimes+=1),n.activeEndTime=void 0,n.activeStartTime=Date.now())},this.beforeunload=function(){if(n.totalTime+=(n.activeEndTime||Date.now())-n.activeStartTime,n.config.autotrack){try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:n.totalTime,page_title:document.title||location.pathname}))}catch(e){}}n.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),l(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.resetData()}return t.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},t.prototype.resetParams=function(e,t,n){this.url_path=e,this.url=n,this.title=t},t.prototype.enable=function(e,t,n){this.url_path=e||this.url_path,this.url=n||this.url,this.title=t||this.title,this.disableCallback=this.enablePageClose()},t.prototype.disable=function(){this.disableCallback()},t.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.options.params instanceof Function?this.customParmas=this.options.params():this.customParmas=this.options.params,this.resetParams(location.pathname,document.title,location.href)},t.prototype.sendEventPageClose=function(){var t=Date.now()-this.pageStartTime;this.totalTime<0||t<0||this.totalTime>=this.maxDuration||(this.collect.beconEvent(this.options.closeName,e({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:t,is_support_visibility_change:y()},this.customParmas)),this.pageStartTime=Date.now(),this.resetData())},t.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},t.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},t}(),Ki=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new ji(e,t),this.pageClose=new qi(e,t);var i=this.collect.Types;this.collect.on(i.ResetStay,function(e){var t=e.url_path,i=e.title,r=e.url;n.resetStayDuration(t,i,r)}),this.collect.on(i.RouteChange,function(e){e.init||t.disable_route_report||n.resetStayDuration()}),this.collect.on(i.SetStay,function(e){var t=e.url_path,i=e.title,r=e.url;n.setStayParmas(t,i,r)}),this.enable(this.url_path,this.title,this.url),this.ready(i.Stay),this.collect.emit(i.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach(function(n){t.collect.hook.emit(e,n)})};for(var r in n)i(r)}},e.prototype.enable=function(e,t,n){this.pageAlive.enable(e,t,n),this.pageClose.enable(e,t,n)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.pageAlive.setParams(e,t,n),this.pageClose.setParams(e,t,n),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n},infoType:"cus"})},e.prototype.reset=function(e,t,n){this.disable(),this.enable(e,t,n)},e.prototype.resetStayDuration=function(e,t,n){this.reset(e,t,n),this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n},infoType:"sdk"})},e}();try{var Vi=_i();Vi&&(Vi.LogStay=function(e,t){(new Ki).apply(e,t)})}catch(e){console.log(e)}var Hi=function(){function t(){}return t.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.retryLimit=14,this.currentCount=0,this.retryTimeRanger=2e3,this.bindInfoMap=new Map,this.collect.on(X.BindToken,function(e){n.addToCache(e)})},t.prototype.addToCache=function(e){var t=fe();this.bindInfoMap.set(t,e),this.fetchBind(t)},t.prototype.retry=function(e,t,n,i){var r=this;void 0===t&&(t=!1),t&&(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){if(r.currentCount>=r.retryLimit)return i(n),r.collect.sdkStop=!1,r.collect.emit(X.BindTokenReady),void r.reset();r.fetchBind(e),r.currentCount++,r.currentCount>0&&r.currentCount<=2&&(r.retryTimeRanger=1e4),r.currentCount>2&&r.currentCount<=4&&(r.retryTimeRanger=2e4),r.currentCount>4&&r.currentCount<=6&&(r.retryTimeRanger=6e4),r.currentCount>6&&r.currentCount<=8&&(r.retryTimeRanger=12e4),r.currentCount>8&&r.currentCount<=10&&(r.retryTimeRanger=18e4),r.currentCount>10&&r.currentCount<=12&&(r.retryTimeRanger=36e4),r.currentCount>12&&r.currentCount<=14&&(r.retryTimeRanger=54e4)},this.retryTimeRanger))},t.prototype.reset=function(){clearTimeout(this.timer),this.timer=null,this.currentCount=0,this.retryTimeRanger=2e3},t.prototype.fetchBind=function(t){var n=this,i=this.bindInfoMap.get(t),r=i.params,o=i.callback,a=i.retry,s=this.collect.configManager.getUrl("bind"),c={header:{aid:this.collect.configManager.get("app_id"),identities:e({},r)}};
1this.collect.requestManager.useRequest({url:s,data:c,success:function(e){10500===(null==e?void 0:e.status_code)?n.retry(t,a,e,o):(o(e),n.collect.sdkStop=!1,n.reset(),n.collect.emit(X.BindTokenReady))},fail:function(e){o(e),n.collect.sdkStop=!1,n.collect.emit(X.BindTokenReady)},time:3e4,encryption:this.config.enable_encryption,encryption_header:this.config.encryption_header})},t}(),Fi=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=b(function(){e.isSessionhasEvent&&e.endCurrentSession()},e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,t.enable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var i=this.collect.Types;this.collect.on(i.SessionResetTime,function(){n.process()})}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),Ji=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!(this.config.disable_track_event||this.config.disable_sdk_monitor||this.config.enable_encryption)){var i=e.adapters.fetch;this.fetch=i,this.url=e.configManager.getUrl("event");var r=this.collect.Types;this.collect.on(r.Ready,function(){n.sdkOnload()}),this.collect.on(r.SubmitError,function(e){var t=e.type,i=e.eventData,r=e.errorCode;"f_data"===t&&n.sdkError(i,r)}),this.collect.on(e.Types.SDKInnerError,function(e){var t=e.type,i=e.eventData,r=e.errorCode,o=e.msg;n.sdkInnerError(t,i,r,o)}),this.collect.on(e.Types.SDKRunTimeError,function(e){var t=e.type,i=e.eventData,r=e.errorCode,o=e.msg;n.sdkRunTimeError(t,i,r,o)})}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,i=t.user,r=n.app_id,o=n.app_name,a=n.sdk_version,s=i.web_id,c=i.anonymous_id,l={events:[{event:"onload",params:JSON.stringify({app_id:r,app_name:o||"",sdk_version:a,sdk_type:"script",sdk_config:this.config,sdk_desc:"TOB"}),local_time_ms:Date.now()}],user:{user_unique_id:this.config.enable_anonymousid?c:s},header:{}};setTimeout(function(){e.collect.requestManager.useRequest({url:e.url,data:[l],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})},16)}catch(e){}},e.prototype.sdkError=function(e,t){var n=this;try{var i=e[0],r=i.user,o=i.header,a=[];e.forEach(function(e){e.events.forEach(function(e){a.push(e)})});var s={events:a.map(function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(r)}),local_time_ms:Date.now()}}),user:{user_unique_id:r.user_unique_id},header:{}};setTimeout(function(){n.collect.requestManager.useRequest({url:n.url,data:[s],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})},16)}catch(e){}},e.prototype.sdkInnerError=function(e,t,n,i){var r=this;try{var o=t[0],a=o.user,s=o.header,c=[];t.forEach(function(e){e.events.forEach(function(e){c.push(e)})});var l={events:c.map(function(t){return{event:"on_error",params:JSON.stringify({type:e,error_code:n,app_id:s.app_id,app_name:s.app_name||"",error_event:t.event,sdk_version:s.sdk_version,local_time_ms:t.local_time_ms,tea_event_index:Date.now(),params:t.params,header:s,user:a,ua:window.navigator.userAgent,err_msg:i}),local_time_ms:Date.now()}}),user:a,header:{}};setTimeout(function(){r.collect.requestManager.useRequest({url:r.url,data:[l],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})},16)}catch(e){}},e.prototype.sdkRunTimeError=function(e,t,n,i){var r=this;try{var o=this.collect.configManager.get(),a=o.user,s=o.header,c={events:[{event:"on_error",params:JSON.stringify({type:e,errorCode:n,app_id:s.app_id,app_name:s.app_name||"",error_event:t.event,sdk_version:s.sdk_version,local_time_ms:t.local_time_ms,tea_event_index:Date.now(),header:s,user:a,ua:window.navigator.userAgent,err_msg:i}),local_time_ms:Date.now()}],user:a,header:{}};
1setTimeout(function(){r.collect.requestManager.useRequest({url:r.url,data:[c],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})},16)}catch(e){}},e}();function Wi(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0;if(e.hasAttribute&&er(e,"ss"))return!0}return!1}var Xi=function(e,t){return!!er(e,t)};function Zi(e){for(var t=e;t&&!Wi(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}var Yi=function(e){if(!e)return"";var t="";return e.textContent?t=e.textContent.trim():e.innerText&&(t=e.innerText.trim()),"input"!==e.tagName&&"INPUT"!==e.tagName||(t=e.value||""),t};function $i(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}var Qi=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},er=function(e,t){if("string"==typeof t)return Qi(e,t);if(u(t)){for(var n=!1,i=0;i<t.length;i++){if(Qi(e,t[i])){n=!0;break}}return n}},tr=function(e,t){var n={};if("string"==typeof t)Qi(e,t)&&(n[t]=e.getAttribute(t));else if(u(t))for(var i=0;i<t.length;i++){Qi(e,t[i])&&(n[t[i]]=e.getAttribute(t[i]))}return n},nr=function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some(function(e){return e.children.length>0})}return!0},ir=function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,n=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,n=!0):t=t.parentElement;return n};var rr=function(){function t(t,n,i){var r=this;this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&ir(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var n=e;return!!("none"!==n.style.display&&(Wi(n,"container")||t.track_attr&&Xi(n,t.track_attr)||nr(n)))})(e.target,r.options)&&r.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){r.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){r.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(t,n){n&&"pushState"===n&&r.eventHandel({eventType:"dom",eventName:"beat"},e({beat_type:0},t)),r.eventHandel({eventType:"dom",eventName:"page_view"},t)},this.getPageLoadEvent=function(e){r.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=i.getConfig().eventConfig,this.collect=n,this.options=t,this.beatTime=t.beat,this.statistics=!1}return t.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},t.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e&&(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv&&this.collect.on("route-change",function(e){var n=e.config,i=e.name;t.getPageViewEvent(n,i)}),this.config.beat)){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",function(){t.beatEvent(t.beatTime)});var n=0,i=null;window.addEventListener("scroll",function(){clearTimeout(i),i=setTimeout(r,500),n=document.documentElement.scrollTop||document.body.scrollTop});var r=function(){(document.documentElement.scrollTop||document.body.scrollTop)==n&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var o=window.performance&&window.performance.getEntriesByType("paint");if(o&&o.length)new PerformanceObserver(function(e){var n=e.getEntries(),i=n[n.length-1],r=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)}).observe({entryTypes:["largest-contentful-paint"]}),setTimeout(function(){t.statistics||(t.getPageLoadEvent(o[0].startTime||0),t.statistics=!0)},2e3);else this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}},t.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},t.prototype.beatEvent=function(e){var t=this;try{var n;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(n=setInterval(function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})},e)),_(function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(n)})}catch(e){}},t}(),or={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},ar=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function sr(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var n=[],i=[];return t.forEach(function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,n=e.parentElement;if(n)for(var i=n.children,r=0;r<i.length&&i[r]!==e;r++)i[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),Wi(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,o=t.index;n.unshift(r),i.unshift(o)}),{element_path:"/".concat(n.join("/")),positions:i}}function cr(e,t,n,i){var r={}
1,o=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return{left:t.left,top:t.top,element_width:n,element_height:i}}}(t),a=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,i=e.clientY,r=t.left,o=t.top,a=n-r>=0?n-r:0,s=i-o>=0?i-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,o),s=o.element_width,c=o.element_height,l=a.touch_x,u=a.touch_y,h=sr(t),d=h.element_path,f=h.positions,p=function(e){var t=Zi(e),n=[];return function e(t){var i=function(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")?t=e.getAttribute("data-tea-title"):e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}(t);if(i&&-1===n.indexOf(i)&&n.push(i),t.childNodes.length>0)for(var r=t.childNodes,o=0;o<r.length;o++)8!==r[o].nodeType&&e(r[o])}(t),n}(t),g=window.performance.timing.navigationStart,m=Date.now()-g,_=f.map(function(e){return"".concat(e)}),v=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(v=window.TEAVisualEditor.getOriginXpath({xpath:d,positions:_})),r.element_path=v&&v.xpath||d,r.positions=v&&v.positions||_,i&&!i.text&&(r.texts=p,r.element_title=Yi(t)),r.element_id=t.getAttribute("id")||"",r.element_class_name=t.getAttribute("class")||"",r.element_type=t.nodeType,r.element_width=Math.floor(s),r.element_height=Math.floor(c),r.touch_x=l,r.touch_y=u,r.page_manual_key="",r.elememt_manual_key="",r.since_page_start_ms=m,r.page_start_ms=g,r.page_path=location.pathname,r.page_host=location.host,n.track_attr&&Xi(t,n.track_attr)){var y=tr(t,n.track_attr);for(var b in y)r[b]=y[b]}if(n.custom_attr)try{if(Xi(t,n.custom_attr)){y=tr(t,n.custom_attr),b=decodeURIComponent(y[n.custom_attr]);var w=JSON.parse(b);if(Object.keys(w))for(var E in w)r[E]=w[E]}}catch(e){console.log("custom attr error")}var S=Zi(t);return"A"===S.tagName&&(r.href=S.getAttribute("href")),!1!==n.src&&("IMG"!==t.tagName||t.getAttribute("src").includes("base64")||(r.src=t.getAttribute("src"))),r}var lr=function(t,n,i,r,o){return e(e({event:t},cr(n,i,r,o)),{is_html:1,page_key:window.location.href,page_title:document.title})},ur=function(){function t(e,t){this.ignore={text:!1},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"$bav2b_exposure",scroll:"$bav2b_slide"},t&&!1===t.text&&(this.ignore.text=!0),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName),t&&t.scroll&&t.scroll.eventName&&(this.eventName.scroll=t.scroll.eventName)}return t.prototype.handleEvent=function(t,n){try{if($i(t.target))return null;var i="bav2b_click";switch(n){case"click":return i=this.eventName.click,lr(i,t,t.target,this.options,this.ignore);case"change":return e(e({},lr(i="bav2b_change",t,t.target,this.options)),function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(e){return{}}}(i,t.target));case"submit":return lr(i="bav2b_submit",t,t.target,this.options)}}catch(e){return console.error(e),null}},t.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage&&window.sessionStorage.getItem("_tea_cache_duration");if(t){var n=JSON.parse(t);e.refer_page_duration_ms=n?n.duration:""}e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("page event error ".concat(JSON.stringify(e)))}return e},t.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var n=e.lcp,i=window.performance.timing,r=i.loadEventEnd-i.navigationStart;t.page_init_cost_ms=parseInt(n||(r>0?r:0)),t.page_start_ms=i.navigationStart}catch(e){console.log("page_statistics event error ".concat(JSON.stringify(e)))}return t},t.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("beat event error ".concat(JSON.stringify(e)))}return e},t.prototype.handleExposureEvent=function(e,t){if($i(t.target))return null;var n=lr(e.event||this.eventName.exposure,t,t.target||t,this.options,this.ignore);
1if(n.$exposure_type=e.exposureType,this.options.exposure.callback){var i=this.options.exposure.callback(n);return i||Object.keys(i).length?i:(console.warn("exposure callback must return data!"),n)}return n},t.prototype.handleScrollEvent=function(e,t){var n=lr(e.event||this.eventName.scroll,t,t.target||t,this.options,this.ignore);if(n=Object.assign(n,e.params),!this.options.scroll.callback||(n=this.options.scroll.callback(n))||Object.keys(n).length)return n;console.warn("scroll callback must return data!")},t}(),hr=function(){function e(e){this.collect=e}return e.prototype.send=function(e,t){var n=t.event;delete t.event,e&&"becon"===e.eventSend?this.collect.beconEvent(n,t):this.collect.event(n,t)},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}(),dr="_TEA_VE_OPEN",fr="_TEA_VE_APIHOST",pr="lang",gr="_VISUAL_EDITOR_V",mr="_VISUAL_EDITOR_U";function _r(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||I.get(pr),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||I.get(fr),n=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||I.get(gr),i=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||I.get(mr),r=+new Date,o=new Date(r+18e5);I.set(dr,"1",{expires:o}),I.set(fr,t,{expires:o}),I.set(mr,i,{expires:o}),I.set(pr,e,{expires:o}),I.set(gr,n||"",{expires:o})}catch(e){console.log("set cookie err")}}var vr,yr=function(e){var t=e.event,n=e.editorUrl,i=e.autoTrackInstance;v(n,function(){Ri(t,"editorScriptloadSuccess"),i.destroy()},function(){t&&Ri(t,"editorScriptloadError")})},br=function(){function e(e,t,n){this.collector=e,this.config=t,this.loadInit(n)}return e.prototype.loadInit=function(e){var t=m("1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z1cz1bz1gz22z1mz20z49z20z18z1lz1ez1cz20z21z4az1hz21"),n="".concat(t,"?query=").concat(Date.now());window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=this.config.app_id;var i="",r=this.config.channel_domain,o="";if(xi(["*"]),r){var a="",s="";try{var c=window.performance.getEntriesByType("resource");if(c&&c.length){var l=this.config.remote_file_protocol?"".concat(this.config.remote_file_protocol,":"):location.protocol;if(l=l||"https:",c.forEach(function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(s=e.name)}),s||document.currentScript&&(s=document.currentScript.src),s&&(a=s.split("/"))&&a.length){o="".concat(l,"/");for(var u=2;u<a.length&&u!==a.length-1;u++)o+="/".concat(a[u]);if(o&&o.indexOf("/5.0")){var h=o.split("/5.0");o=h[0]||o}}}}catch(e){this.collector.emit("sdk-inner-error",{type:"sdk_error_parsing_remote_url",errorCode:1e3,msg:e.message||e.stack||"sdk_error_parsing_remote_url"})}}if(Mi(this.config,V),"1"===I.get(dr)){var d=function(){var e=I.get(fr);try{e=JSON.parse(e)}catch(e){}return e}(),f="";d&&(window.TEAVisualEditor.__editor_ajax_domain=d,f=I.get(mr)),yr({event:null,editorUrl:f||n,autoTrackInstance:e}),_r()}else try{Ii("tea:openVisualEditor",function(t){var a=t.data;if("string"==typeof t.data)try{a=JSON.parse(t.data)}catch(e){a=void 0}if(a){var s=a.referrer,c=a.lang;if(s&&(window.TEAVisualEditor.__editor_ajax_domain=s),i=n,r){var l=a.version,u=l?"/visual-editor-rangers-v".concat(l):"/visual-editor-rangers-v1.0.0";i=o?"".concat(o).concat(u,".js"):n,window.TEAVisualEditor.__editor_verison=l}window.TEAVisualEditor.__editor_url=i,window.TEAVisualEditor.lang=c,yr({event:t,editorUrl:i,autoTrackInstance:e}),_r()}}),window.TEAVisualEditor.openAutotrackEditor=function(){yr({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:e})}}catch(e){console.log("receive message error"),this.collector.emit("sdk-inner-error",{type:"sdk_error_recemessage",errorCode:1e3,msg:e.message||e.stack||"sdk_error_recemessage"})}try{Ii("tea:openHeatMapCore",function(t){var n=m("1fz22z22z1nz21z4mz4bz4bz1jz1dz4fz49z1bz18z22z18z4az24z1mz1jz1az1az1bz1lz4az1az1mz1kz4bz1mz19z1hz4bz1bz18z22z18z49z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1fz1cz18z22z1kz18z1nz49z1az1mz20z1c");yr({event:t,editorUrl:"".concat(n,".js?query=").concat(Date.now()),autoTrackInstance:e})})}catch(e){console.log("openHeatMapCore error"),this.collector.emit("sdk-inner-error",{type:"sdk_error_load_heatmap",errorCode:1e3,msg:e.message||e.stack||"sdk_error_load_heatmap"})}},e}(),wr=function(){function e(e,t){this._instance=null,this._intersection=e,this.config=t,this._intersection&&this.init()}return e.prototype.init=function(){var e=this;if(window.MutationObserver)try{if(this._instance=new MutationObserver(function(t){t.forEach(function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)})}),!document||!document.body)return void console.warn("please use sdk api init after body element");var t=!1!==this.config.autotrack.exposure.attributes;this._instance.observe(document.body,{childList:!0,attributes:t,subtree:!0,attributeOldValue:!1})}catch(e){console.log("your browser cannot support MutationObserver,so cannot report exposure event, please update")}else console.log("your browser cannot support MutationObserver,so cannot report exposure event, please update")},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exp
1osureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd.bind(t))}),Array.prototype.forEach.call(e.removedNodes,function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove.bind(t))})},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),n.mapChild(e,t)})},e.prototype.exposureAdd=function(e,t){try{this._intersection&&this._intersection.exposureAdd(e,t)}catch(e){console.log("intersection error",JSON.stringify(e.message))}},e.prototype.exposureRemove=function(e){try{this._intersection&&this._intersection.exposureRemove(e)}catch(e){console.log("intersection error",JSON.stringify(e.message))}},e._exposure_observer=null,e}();!function(e){e[e.EXPOSURE_ONCE=0]="EXPOSURE_ONCE",e[e.LIFECYCLE_SHOW_NEW=3]="LIFECYCLE_SHOW_NEW",e[e.RESUME_FORM_PAGE=6]="RESUME_FORM_PAGE",e[e.RESUME_FORM_BACK=7]="RESUME_FORM_BACK",e[e.NOT_EXPOSURE=-1]="NOT_EXPOSURE"}(vr||(vr={}));var Er,Sr=function(){function e(t,n,i){var r=this;this.backStatus=!1,this.instance=this.buildObserver(),this.collect=t,this.observeMap=e._observer_map,n.autotrack.exposure.ratio?this.ratio=n.autotrack.exposure.ratio:0===n.autotrack.exposure.ratio?this.ratio=0:this.ratio=.5,this.timeLimit=n.autotrack.exposure.stay||0,this.exposureType=vr.NOT_EXPOSURE,this.eventHandle=i,this.hashMap=new Map,this.backStatus=!1,this.lastState=null,this.collect.on("re-start-sdk",function(){r.visibilitychange()}),this.addListen()}return e.prototype.buildObserver=function(){var t=this;if(e._observer_instance)return console.log("your browser cannot support IntersectionObserver, so cannot report exposure event, please update"),null;if(window.IntersectionObserver){for(var n=[],i=0;i<=1;i+=.01)n.push(i);n.push(1);try{e._observer_instance=new IntersectionObserver(function(e){e.forEach(function(e){var n=e.target.observeId,i=t.observeMap.get(n),r=(e.target,e.isIntersecting,e.intersectionRatio);if(i.intersectionRatio=r,r<=.1&&(e.target.backStatus=!1),t.observeMap.set(n,i),r<t.ratio)return i.isIntersecting=!1,i.added=!1,i.exposured=!1,i.startTime=Date.now(),void t.observeMap.set(n,i);if(!i.added){if(i.startTime=Date.now(),i.added=!0,i.isIntersecting=!0,t.timeLimit){var o=setTimeout(function(){try{if(i.isIntersecting&&!i.exposured&&t.observeMap.get(n)){var r=t.observeMap.get(n).intersectionRatio;t.exposureEvent(e,r,n,i)}}catch(e){console.log("IntersectionObserver setTimeout error,msg: ".concat(JSON.stringify(e)))}},t.timeLimit);i.wait=o}t.observeMap.set(n,i)}Date.now()-i.startTime>=t.timeLimit&&!i.exposured&&t.exposureEvent(e,r,n,i)})},{threshold:n})}catch(e){console.log("IntersectionObserver error,msg: ".concat(JSON.stringify(e)))}return e._observer_instance}return console.log("your browser cannot support IntersectionObserver, so cannot report exposure event, please update"),null},e.prototype.exposureAdd=function(e,t){var n="mutation"===t?e.target:e,i=n.observeId,r=fe();if(i||this.observeMap.has(i)){var o=this.observeMap.get(i);if(o&&n!==o.instance)this.unobserve(n),this.observeMap.delete(i),n.observeId=r,n.visible=!1,this.observeMap.set(r,{instance:n.cloneNode(!0),isIntersecting:!1}),this.observe(n);else{if(!0===n.visible)return;this.handleBoundingExposure(n)}}else n.observeId=r,n.visible=!1,this.observeMap.set(r,{instance:n.cloneNode(!0),isIntersecting:!1}),this.observe(n)},e.prototype.exposureRemove=function(e){this.observeMap.has(e.observeId)&&(this.observeMap.delete(e.observeId),this.unobserve(e),e.observeId="",e.visible=!1)},e.prototype.exposureEvent=function(e,t,n,i){if(t>=this.ratio){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===i.exposured)return;i.startWait&&clearTimeout(i.startWait);var r=e.target.getAttribute("data-exposure-event");this.eventHandle({eventType:"dom",eventName:"exposure",event:r,exposureType:this.getExposureType(e.target)},e),e.target.visible=!0,e.target.hasExposure=!0,i.startTime=Date.now(),i.exposured=!0}else i.startTime=Date.now(),i.exposured=!1;this.observeMap.set(n,i)},e.prototype.observe=function(e){this.instance&&this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance&&this.instance.unobserve(e)},e.prototype.getExposureDomToExposure=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),function(t){e.handleBoundingExposure(t)})},e.prototype.visibilitychange=function(){var e=this,t=null;"visible"===document.visibilityState?this.timeLimit?t=setTimeout(function(){e.getExposureDomToExposure()},this.timeLimit):this.getExposureDomToExposure():(clearTimeout(t),this.customType=void 0)},e.prototype.handleBoundingExposure=function(e){if(this.getBoundingRatio(e)>=this.ratio){e.visible=!0;var t=e.getAttribute&&e.getAttribute("data-exposure-event");this.eventHandle({eventType:"dom",eventName:"exposure",event:t,exposureType:this.customType||vr.RESUME_FORM_BACK},e)}},e.prototype.getBoundingRatio=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.left,r=t.width,o=t.height,a=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return n>=0&&i>=0&&n<=s&&i<=a?(r>a?a:r)*(s-n)/(r*o):0},e.prototype.getExposureType=function(e){return e.visible?!1!==e.backStatus&&(this.backStatus||this.customType||2===window.performance.navigation.type)?this.exposureType=vr.RESUME_FORM_PAGE:this.exposureType=vr.LIFECYCLE_SHOW_NEW:(e.hasExposure,!1!==e.backStatus&&(this.backStatus||this.customType||2===window.performance.navigation.type)?this.exposureType=vr.RESUME_FORM_PAGE:this.exposureType=vr.EXPOSURE_ONCE),this.exposureType},e.prototype.addListen=function(){var e=this;this.collect.on("set-exposure-type",function(t){e.customType=t});var t=this.visibilitychange.bind(this);if(p(document,"visibilitychange",t,!1),window.addEventListener("hashchange",function(t){var n=e.hashMap.get(t.oldURL);n&&location.href===n.prev?(e.backStatus=!0,e.exposureType=vr.RESUME_FORM_PAGE):(e.backStatus=!1,e.hashMap.set(location.href,{current:t.newURL,prev:t.oldURL}))}),this.collect.bridgeReport){var n=window.history.pushState;history.pushState=function(t){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onpushstate&&history.onpushstate({state:t});var s=n.call.apply(n,a([history,t],o(i)));return e.lastState=t,s};var i=history.replaceState;history.replaceState=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var s=i.call.apply(i,a([history,t],o(n)));return e.lastState=t,s}}else this.collect.on("STATE_CHANGE",function(t){e.lastState=t});return window.addEventListener("popstate",function(t){var n=t.state;n&&n.current&&e.lastState&&e.lastState.back&&n.current===e.lastState.back?(e.backStatus=!0,e.exposureType=vr.RESUME_FORM_PAGE):e.backStatus=!1}),function(){g(document,"visibilitychange",t,!1)}},e._observer_instance=null,e._observer_map=new Map,e}(),kr=function(){function e(e,t,n){t.autotrack&&t.autotrack.exposure&&(this._intersection=new Sr(e,t,n),this._observer=new wr(this._intersection,t),this._intersection&&this._observer?this.initObserver():console.log("your browser version cannot support exposure event, please update~"))}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),function(t){e._intersection.exposureAdd(t,"intersect")})},e}();!function(e){e[e.SCROLL_UP=1]="SCROLL_UP",e[e.SCROLL_DOWN=2]="SCROLL_DOWN",e[e.SCROLL_LEFT=3]="SCROLL_LEFT",e[e.SCROLL_RIGHT=4]="SCROLL_RIGHT",e[e.NOT_SCROLL=-1]="NOT_SCROLL"}(Er||(Er={}));var zr,Dr=function(){function e(e,t){this.distance=30,e.autotrack&&e.autotrack.scroll&&(e.autotrack.scroll.distance&&(this.distance=e.autotrack.scroll.distance),this.eventHandle=t,this.addLinstenr(),this.mutation())}return e.prototype.addLinstenr=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-scroll]"),function(t){e.scrollHandle(t)})},e.prototype.mutation=function(){var e=this;if(window.MutationObserver)try{var t=new MutationObserver(function(t){t.forEach(function(t){"childList"===t.type&&e.modifyNodeObserve(t)})});if(!document||!document.body)return void console.warn("please use sdk api init after body element");t.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})}catch(e){console.log("your browser cannot support MutationObserver")}else console.log("your browser cannot support MutationObserver")},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,function(e){1===e.nodeType&&e.hasAttribute("data-scroll")&&t.scrollHandle(e),t.mapChild(e,t.scrollHandle.bind(t))}),Array.prototype.forEach.call(e.removedNodes,function(e){1===e.nodeType&&e.hasAttribute("data-scroll")&&t.scrollHandle(e,"remove"),t.mapChild(e,t.scrollHandle.bind(t))})},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,function(e){1===e.nodeType&&e.hasAttribute("data-scroll")&&t(e),n.mapChild(e,t)})},e.prototype.scrollHandle=function(e,t){var n=this;
1try{var i=e.scrollTop,r=e.scrollLeft,o=null,a=0,s=0,c=function(t){clearTimeout(o),o=setTimeout(function(){var o=e.scrollTop,h=e.scrollLeft,d=t.target&&t.target.getAttribute("data-scroll-event")||"";1===u||2===u?o===c&&(s=c-i,Math.abs(s)>=n.distance&&n.distance&&n.eventHandle({eventType:"dom",eventName:"scroll",event:d,params:{$direction:u,$offsetY:s,$offsetX:a}},t)):3!==u&&4!==u||h===l&&(a=l-r,Math.abs(a)>=n.distance&&n.distance&&n.eventHandle({eventType:"dom",eventName:"scroll",event:d,params:{$direction:u,$offsetY:s,$offsetX:a}},t)),i=c,r=l},100);var c=e.scrollTop,l=e.scrollLeft,u=Er.NOT_SCROLL;c>i?u=Er.SCROLL_DOWN:c<i?u=Er.SCROLL_UP:l>r?u=Er.SCROLL_LEFT:l<r&&(u=Er.SCROLL_RIGHT)};return"remove"===t?e.removeEventListener("scroll",c,!1):e.addEventListener("scroll",c,!1),function(){e.removeEventListener("scroll",c,!1)}}catch(e){console.warn("scroll event error",JSON.stringify(e))}},e}(),Tr={hashTag:!1,impr:!1},Ar=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var n=e.configManager.getSettingData("bav_log_collect");if((!h(n)||n)&&(!t.autotrack||!t.autotrack.collect_url||t.autotrack.collect_url())){var i=e.Types;this.ready(i.Autotrack),this.collect.emit(i.AutotrackReady)}}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==typeof t?t:{},t=Object.assign(Tr,t),this.destroyed=!1,this.options=t,this.Config=new ar(or,this.options),this.Exposure=new kr(this.collect,this.config,this.handle.bind(this)),this.Scroll=new Dr(this.config,this.handle.bind(this)),this.Listener=new rr(t,this.collect,this.Config),this.EventHandle=new ur(this.config,t),this.Request=new hr(this.collect),this.autoTrackStart=!0,this.init(),new br(this.collect,this.config,this)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this))},e.prototype.handle=function(e,t){try{if(this.config.autotrack.collect_url&&!this.config.autotrack.collect_url())return}catch(e){}this.collect.sdkStop||"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var n=e.eventName;if("click"===n||"change"===n||"submit"===n)(a=this.EventHandle.handleEvent(t,n))&&this.Request.send({eventType:"custom"},a);else if("page_view"===n||"page_statistics"===n){var i=void 0;(i="page_view"===n?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t))&&this.Request.send({eventType:"custom"},i)}else if("beat"===n){var r=this.EventHandle.handleBeadtEvent(t),o=e.eventSend;r&&this.Request.send({eventType:"custom",eventSend:o},r)}else if("exposure"===n){(a=this.EventHandle.handleExposureEvent(e,t))&&this.Request.send({eventType:"custom"},a)}else if("scroll"===n){var a;(a=this.EventHandle.handleScrollEvent(e,t))&&this.Request.send({eventType:"custom"},a)}}catch(e){console.log("handel dom event error ".concat(JSON.stringify(e)))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}();try{var xr=_i();xr&&(xr.LogAutoTrack=function(e,t){(new Ar).apply(e,t)})}catch(e){}!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(zr||(zr={}));var Rr={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},Ir=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var i=this.collect.Types,r=e.adapters.fetch;this.fetch=r,this.collect.on(i.Event,function(){n.addCount("log")}),this.collect.on(i.SubmitError,function(e){var t=e.type,i=e.eventDate,r=e.errorCode,o=e.response;n.addErrorCount(i,t,r,o)}),this.listener(),this.collect.emit(i.TracerReady)}},e.prototype.addCount=function(e,t,n){void 0===t&&(t="net"),void 0===n&&(n=1);try{this.tracerCache||(this.tracerCache=new Map);var i=void 0;
1if(this.tracerCache.has(e)){if((r=this.tracerCache.get(e)).has(t))i=r.get(t).params.count,i++,r.set(t,this.processTracer(i,e,t));else i=n,r.set(t,this.processTracer(n,e,t))}else{var r=new Map;i=n,r.set(t,this.processTracer(n,e,t)),this.tracerCache.set(e,r)}"net"===t&&i>=this.limit[e]&&this.report(!1)}catch(e){console.log(e)}},e.prototype.addErrorCount=function(e,t,n,i){var r=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(i&&i.hasOwnProperty("sc")?this.addCount("log",t,o.length-i.sc):this.addCount("log",t,o.length),this.errorCode[t]=n):o.forEach(function(e){var i="log";for(var o in Rr)if(-1!==Rr[o].indexOf(e.event)){i=o;break}r.addCount(i,t,1),r.errorCode[t]=n}))}}catch(e){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach(function(e){console.log(e),e.forEach(function(e){t.push(e)})}),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var n=this.collect.eventManager.merge(e);t&&window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify(n)):this.fetch(this.reportUrl,n),this.tracerCache=null}catch(e){}},e.prototype.processTracer=function(e,t,n){var i={count:e,state:n,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:V};"f_net"!==n&&"f_data"!==n||(i.errorCode=this.errorCode[n]);var r=this.collect.processEvent("applog_trace",i);if(r&&r.event)return delete r.is_bav,r},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e.leavePage()}),_(function(){e.leavePage()})},e.prototype.leavePage=function(){this.report(!0)},e}();try{var Or=_i();Or&&(Or.LogTracer=function(e,t){(new Ir).apply(e,t)})}catch(e){console.log(e)}var Mr=function(){function e(){this.verifyReady=!1,this.cleanStatus=!1}return e.prototype.apply=function(e,t){var n=this;z()||(this.collector=e,this.config=t,this.eventStorage=[],this.collector.on("submit-verify-h5",function(e){e&&e.length&&n.eventStore(e[0])}),this.checkUrl(),this.heartbeat())},e.prototype.checkUrl=function(){var e=window.location.href,t=E(e);t._r_d_&&t._r_c_k_?(this.verifyReady=!0,this.domain=t._r_d_,this.key=t._r_c_k_,this.checkCache()):this.collector.off("submit-verify-h5")},e.prototype.checkCache=function(){this.eventStorage.length&&this.postVerify(this.eventStorage)},e.prototype.heartbeat=function(){var e=this;this.heart=setInterval(function(){var t={event:"simulator_test__",local_time_ms:Date.now()},n=e.collector.configManager.get(),i=n.header,r={events:[t],user:n.user,header:i};e.eventStore(r)},6e4)},e.prototype.eventStore=function(e){this.cleanStatus||(this.verifyReady?this.postVerify(e):this.eventStorage.push(e))},e.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[],clearInterval(this.heart)},e.prototype.postVerify=function(e){var t=this;try{var n=JSON.parse(JSON.stringify(e));u(e)?n.forEach(function(e){t.fetchLog(e)}):this.fetchLog(n)}catch(e){console.log("web verify post error ~")}},e.prototype.fetchLog=function(e){this.collector.requestManager.useRequest({url:"".concat(this.domain,"/simulator/h5/log?connection_key=").concat(this.key),data:e,timeout:2e4})},e.prototype.leave=function(){var e=this;document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e.cleanVerify()}),_(function(){e.cleanVerify()})},e}(),Cr=function(){function e(){this.errorCache=new Map,this.sleepTime=1e3,this.maxTime=16e3,this.minTime=1e3,this.goodCount=0,this.maxGoodCount=2,this.maxSilceCount=50,this.sendStatus=!1,this.firstTrigger=!0,this.degradeStarted=!1,this.backoff_ratio=0,this.tempId=[],this.queue=Promise.resolve(),this.enableDegrade=!1}return e.prototype.apply=function(e,t){var r=this;try{if(e.destroy)return;this.collect=e,this.config=t,this.storage=new B("applog_sdk_event_store_".concat(t.app_id),"DEGRADE_EVENT_STORE"),this.enableDegrade=t.enable_degrade||!1,this.eventUrl=this.collect.configManager.getUrl("event"),this.eventKey="__applog_degrade_events",this.eventSleepTimeKey="__applog_degrade_events_sleep_time",this.collect.on("http-error",function(e){return n(r,void 0,void 0,function(){var t=this;return i(this,function(n){switch(n.label){case 0:return this.enableDegrade&&this.triggerDegrade(e),this.queue=this.queue.then(function(){return t.addErrorEventToCache(e)}),[4,this.queue];case 1:return n.sent(),this.enableDegrade&&this.firstTrigger&&(this.tryReportDataFromDB(),this.firstTrigger=!1),[2]}})})}),this.collect.on("submit-degrade",function(e){return n(r,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.addDegradeEventToCache(e)];case 1:return t.sent(),[2]}})})}),this.collect.on("http-ok",function(){r.deleteDataFromDB()}),this.checkStorage()}catch(e){this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:e.message||e.stack||"sdk_error_degrage"})}},e.prototype.getSleepTime=function(){return n(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return e=this,[4,this.storage.getItem(this.eventSleepTimeKey)];case 1:return e.sleepTime=t.sent()||this.sleepTime,console.log(this.sleepTime),[2]}})})},e.prototype.triggerDegrade=function(e){try{if(console.log("degradeInfo",e),"degrade"===e.status)return void this.addSleepTime();this.degradeStarted=!0,this.collect.degradeStarted=!0}catch(e){console.log("trigger degrade error",JSON.stringify(e))}},e.prototype.checkStorage=function(){return n(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.getItem(this.eventKey)];case 1:return(e=n.sent())&&e.size?(this.tryReportDataFromDB(),[3,3]):[2];case 2:return t=n.sent(),console.log("check storage error"),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:t.message||t.stack||"sdk_error_degrage_checkstorage"}),[3,3];case 3:return[2]}})})},e.prototype.getDatafromDBToSlice=function(){return n(this,void 0,void 0,function(){var e,t,n,a,s,c,l,u,h,d,f,p=this;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.storage.getItem(this.eventKey)];case 1:if(e=i.sent(),t=new Map,n=[],this.tempId=[],!e.size)return[2,[]];if(e.size<=this.maxSilceCount)t=e;else try{for(a=r(e),s=a.next();!s.done&&(c=o(s.value,2),l=c[0],u=c[1],t.size<this.maxSilceCount);s=a.next())t.set(l,u)}catch(e){d={error:e}}finally{try{s&&!s.done&&(f=a.return)&&f.call(a)}finally{if(d)throw d.error}}return t.forEach(function(e){var t;(null===(t=e.eventData)||void 0===t||t)&&(n.push(e.eventData[0]),p.tempId.push(e.id))}),[2,n];case 2:return h=i.sent(),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:h.message||h.stack||"sdk_error_degrage_getDatafromDBToSlice"}),[2,[]];case 3:return[2]}})})},e.prototype.addErrorEventToCache=function(e){return n(this,void 0,void 0,function(){var t,n;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=e.data,"degrade"===e.status?[2]:[4,this.addDegradeEventToCache(t)];case 1:return i.sent(),[3,3];case 2:return n=i.sent(),console.log("addErrorEventToCache error",JSON.stringify(n)),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:n.message||n.stack||"sdk_error_degrage_addErrorEventToCache"}),[3,3];case 3:return[2]}})})},e.prototype.addDegradeEventToCache=function(e){return n(this,void 0,void 0,function(){var t,n,r;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.storage.getItem(this.eventKey)];case 1:return(t=i.sent())||(t=new Map),n=fe(),t.set(n,{eventData:e,id:n}),this.setDataToDB(t),[3,3];case 2:return r=i.sent(),console.log("addDegradeEventToCache error",JSON.stringify(r)),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:r.message||r.stack||"sdk_error_degrage_addDegradeEventToCache"}),[3,3];case 3:return[2]}})})},e.prototype.setDataToDB=function(e){try{this.storage.setItem(this.eventKey,e)}catch(t){console.log("set data to DB error",t.message),this.dropEvents(e),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:t.message||t.stack||"sdk_error_degrage_setDataToDB"})}},e.prototype.dropEvents=function(e){try{var t=this.collect.configManager.get(),n=t.user,i=t.header;i.app_id=1338;var r=[];e.forEach(function(e){var t=e.event,n=e.local_time_ms;r.push({eventName:t,eventTime:n})});var o={events:[{event:"sdk_monitor",params:JSON.stringify({storage_fails:r}),local_time_ms:Date.now()}],user:n,header:i};
1this.collect.requestManager.useRequest({url:this.eventUrl,data:o,timeout:3e4,type:"event"})}catch(e){console.log("drop data error",JSON.stringify(e))}},e.prototype.tryReportDataFromDB=function(){var e=this;if(!this.sendStatus)try{this.sleepFn=setTimeout(function(){return n(e,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.getDatafromDBToSlice()];case 1:return(e=t.sent()).length?(this.fetchData(e),[2]):(clearTimeout(this.sleepFn),[2])}})})},this.sleepTime)}catch(e){console.warn("error check storage"),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:e.message||e.stack||"sdk_error_degrage_tryReportDataFromDB"})}},e.prototype.addSleepTime=function(){this.sendStatus=!1,this.sleepTime=2*this.sleepTime,this.sleepTime>this.maxTime&&(this.sleepTime=this.maxTime),this.storage.setItem(this.eventSleepTimeKey,this.sleepTime),this.sleepFn&&clearTimeout(this.sleepFn),this.tryReportDataFromDB()},e.prototype.deleteDataFromDB=function(){return n(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),this.sendStatus=!1,this.enableDegrade&&(this.goodCount+=1,this.goodCount===this.maxGoodCount&&(this.goodCount=0,this.sleepTime=this.sleepTime/2),this.sleepTime<=this.minTime&&(this.sleepTime=this.minTime,this.degradeStarted=!1,this.collect.degradeStarted=!1)),clearTimeout(this.sleepFn),[4,this.storage.getItem(this.eventKey)];case 1:return e=n.sent(),this.tempId.length&&e&&(this.tempId.forEach(function(t){e.delete(t)}),this.tempId=[],this.setDataToDB(e)),[4,this.reportRestData()];case 2:return n.sent(),[3,4];case 3:return t=n.sent(),console.warn("deleteDataFromDB error"),this.collect.emit("sdk-inner-error",{type:"sdk_error_inner",errorCode:1e3,msg:t.message||t.stack||"sdk_error_degrage_deleteDataFromDB"}),[3,4];case 4:return[2]}})})},e.prototype.reportRestData=function(){return n(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.storage.getItem(this.eventKey)];case 1:return(e=t.sent())&&e.size?(this.tryReportDataFromDB(),[3,3]):[2];case 2:return t.sent(),[3,3];case 3:return[2]}})})},e.prototype.random=function(){return Math.floor(1e4*Math.random())},e.prototype.fetchData=function(e){var t=this;this.sendStatus=!0,this.collect.requestManager.useRequest({url:this.eventUrl,data:e,timeout:3e4,type:"event",status:"degrade",success:function(){t.sendStatus=!1}})},e.prototype.destroy=function(){this.collect.off("http-error"),this.collect.off("http-ok")},e}();try{var Gr=_i();Gr&&(Gr.LogStore=function(e,t){(new Cr).apply(e,t)})}catch(e){console.log(e)}var Br=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var n=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(n.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_".concat(this.appid),this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==typeof this.config.autotrack&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onpushstate&&history.onpushstate({state:n});var s=t.call.apply(t,a([history,n],o(i)));if(e.collect.emit("STATE_CHANGE",n),e.lastLocation===location.href)return s;e.setReferCache(e.lastLocation);var c=e.getPopStateChangeEventData();return e.lastLocation=location.href,e.sendPv(c,"pushState"),s};var n=history.replaceState;history.replaceState=function(t){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var s=n.call.apply(n,a([history,t],o(i)));if(e.collect.emit("STATE_CHANGE",t),e.lastLocation===location.href)return s;e.setReferCache(e.lastLocation);var c=e.getPopStateChangeEventData();return e.lastLocation=location.href,e.sendPv(c),s}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.getLocation=function(){return this.lastLocation},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this,t=null;window.addEventListener("hashchange",function(n){if(e.lastLocation!==window.location.href&&(clearTimeout(t),e.allowHash)){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var i=e.getPopStateChangeEventData();e.sendPv(i)}}),window.addEventListener("popstate",function(n){e.lastLocation!==window.location.href&&(t=setTimeout(function(){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var t=e.getPopStateChangeEventData();e.sendPv(t)},10))})},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e}
1,e.prototype.pageConfig=function(){try{var e=this.storage.getItem(this.cache_key)||{},t=!1,n=this.storage.getItem("__tea_cache_first_".concat(this.appid));return t=!n||1!=n,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:e&&e.refer_manual_key||"",refer_page_title:e&&e.refer_title||"",page_path:this.collect.handlePath(),url_path:this.collect.handlePath(),page_host:location.host,is_first_time:"".concat(t)}}catch(e){return this.collect.emit(F.DEBUGGER_MESSAGE,{type:F.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e.prototype.handleRefer=function(){var e="";try{var t=this.storage.getItem(this.cache_key)||{};e=t.routeChange?t.refer_key:this.collect.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.setReferCache=function(e){var t=this.storage.getItem(this.cache_key)||{};t.refer_key=e,t.routeChange=!0,this.storage.setItem(this.cache_key,t)},e}();try{var Ur=_i();Ur&&(Ur.LogRoute=function(e,t){(new Br).apply(e,t)})}catch(e){console.log(e)}var Nr=["getConfig","getAbSdkVersion"],Lr=["init","usePlugin","autoInitializationRangers","on"],Pr=new Set(["init","usePlugin","autoInitializationRangers","on"]),jr=function(){function e(e){this.task=[],this.newProcessTask=[],this.processMap=!1,this.Collector=e,this.collectMap=new Map,this.processMap=new Map,this.taskMap=new Map}return e.prototype.processTask=function(){var e=this;if(Array.isArray(this.task))try{this.task.length&&(this.task.forEach(function(t){var n=e.processScope(t[0]),i=n.scope,r=n.cmd;e.taskMap.get(i)||e.taskMap.set(i,{taskLisMap:[],scope:i,inited:!1});var o=e.taskMap.get(i);o.taskLisMap.push({cmd:r,params:t}),e.taskMap.set(i,o)}),this.taskMap.size&&this.taskMap.forEach(function(t,n){var i=e.taskMap.get(n).taskLisMap;i.length&&function i(r){for(var s=r.length-1;s>=0;s--)if(Pr.has(r[s].cmd)||e.processMap.get(n)){Pr.has(r[s].cmd)&&(e.processMap.set(n,!0),"init"===r[s].cmd&&(t.inited=!0)),e.processCmd.apply(e,a([],o(r[s].params)));var c=e.taskMap.get(n);c.taskLisMap.splice(s,1),e.taskMap.set(n,c)}var l=e.taskMap.get(n).taskLisMap;l.length&&t.inited&&i(l.reverse())}(i.reverse())})),this.task=[]}catch(e){console.error("An error occurred while processing tasks:",e)}else console.warn("Expected an array for this.task, but got:",this.task)},e.prototype.processCmd=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(u(e)){var n=this.processScope(e[0]),i=n.scope,r=n.cmd;if(!this.processMap.get(i))return this.task.push(e),void this.processTask();if(e.splice(0,1),-1!==Nr.indexOf(r))return this.callCmd(i,r,e);this.callCmd(i,r,e)}},e.prototype.callCmd=function(e,t,n){try{if(-1!==Lr.indexOf(t)&&(this.collectMap.get(e)||(this.collect=new this.Collector(e),this.collectMap.set(e,this.collect))),!this.collectMap.get(e))return void console.log("init or use must be first call, cmd:".concat(t));var i=this.collectMap.get(e);if(i.__proto__.hasOwnProperty(t))if("event"===t)i.event.apply(i,a([t],o(n)));else{if(-1!==Nr.indexOf(t))return i[t].apply(i,a([],o(n)));i[t].apply(i,a([],o(n)))}else i.event.apply(i,a([t],o(n)))}catch(e){}},e.prototype.findIndex=function(e,t,n){var i=this,r=-1;try{e.forEach(function(e,o){var a=void 0!==n?e[n]:e,s=i.processScope(a).cmd;-1!==t.indexOf(s)&&(r=o)})}catch(e){return r}return r},e.prototype.processScope=function(e){var t="default";try{if("string"==typeof e&&e.indexOf(".")>-1){var n=e.split(".");t=n[0],e=n[1]}}catch(n){return{scope:t,cmd:e}}return{scope:t,cmd:e}},e}();Di.usePlugin(Li,"ab"),Di.usePlugin(Hi,"bind"),Di.usePlugin(Ki,"stay"),Di.usePlugin(Ar,"autotrack"),Di.usePlugin(Cr,"degrade"),Di.usePlugin(Mr,"verify_h5"),Di.usePlugin(Fi,"heartbeat"),Di.usePlugin(Ji,"monitor"),Di.usePlugin(Br,"route"),Di.usePlugin(Ir,"tracer"),function(e){if("undefined"!=typeof window){var t=function(){if("undefined"!=typeof window)return window.LogAnalyticsObject||window.TeaAnalyticsObject}();if(t&&window[t]){var n=window[t];n.sdkLoad?console.log("you page has load sdk file already, do not load another sdk file"):(e.task=n.q||[],window[t]=e.processCmd.bind(e),window[t].sdkLoad=!0,e.processTask())}}}(new jr(Di))}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.