!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.checkPixel=t():e.checkPixel=t()}("undefined"!=typeof window?window:self,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=80)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInWorker=t.windowSnapshot=t.GlobalThis=t.updateWindowSnapshotWhenInWorker=t.checkWindow=void 0;var r=void 0;t.GlobalThis=r;var o=void 0;t.windowSnapshot=o;var i=!1;t.isInWorker=i,"undefined"!=typeof window?(t.GlobalThis=r=window,t.windowSnapshot=o=window):"undefined"!=typeof self&&(t.GlobalThis=r=self,t.isInWorker=i=!0);t.checkWindow=function(e){return"object"==typeof e&&null!==e&&"window"in e&&e===e.window};t.updateWindowSnapshotWhenInWorker=function(e){return!(!i||!(0,t.checkWindow)(e))&&(t.windowSnapshot=o=e,!0)}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=200&&c.status<300){var a=c.response;if("string"==typeof a)try{a=JSON.parse(a)}catch(e){(0,o.JSLogger)({error:e,additionalMsg:"requestUrl: ".concat(t,", response: ").concat(a),funcName:"xhr.post.onload.parse"})}i(r(r({},a),{retryTimes:e.curRetry,xhrResponseUrl:null!==(n=c.responseURL)&&void 0!==n?n:""}))}else c.status>=400?e.handleReject(String(c.status),!0):(e.catchBy="status",e.handleReject())},c.onerror=function(){e.catchBy="onerror",e.handleReject()},p&&(c.timeout=l,c.ontimeout=function(){e.catchBy="ontimeout",e.handleReject()}),c.withCredentials=!0,c.send(u)}catch(t){e.xhrTryCatchErrorHandler(t)}}))},this.get=function(t,n){return new Promise((function(o,i){e.curReject=i;var a=null!=n?n:{},c=a.retry,s=void 0===c?0:c,u=a.retryDelay,l=void 0===u?1e3:u,d=e.curXhrInstance=new XMLHttpRequest;try{e.curRetry=0,e.retryConfig={retry:s,retryDelay:l,requestParams:{method:"GET",url:t,async:!0,headers:{},data:""}},d.responseType="json",d.open("GET",t),d.onload=function(){var t;d.status>=200&&d.status<300?o(r(r({},d.response),{retryTimes:e.curRetry,xhrResponseUrl:null!==(t=d.responseURL)&&void 0!==t?t:""})):d.status>=400?e.handleReject(String(d.status),!0):(e.catchBy="status",e.handleReject())},d.onerror=function(){e.catchBy="onerror",e.handleReject()},d.withCredentials=!0,d.send()}catch(t){e.xhrTryCatchErrorHandler(t)}}))},this.xhrTryCatchErrorHandler=function(t){e.catchBy="tryCatch",t&&t instanceof Error?e.handleReject(t.message):"string"==typeof t?e.handleReject(t):e.handleReject()},this.handleReject=function(t,n){var r,c,s,u,l,d,p;void 0===n&&(n=!1);var f=e,_=f.curRetry,h=f.retryConfig,v=f.curXhrInstance;if(_0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1||"string"==typeof e&&(e.indexOf("type=preload")>-1||e.indexOf("kwai_type=preload")>-1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQueryStringWithIframeCheck=t.getQueryString=void 0;var r=n(0),o=n(17),i=n(1);t.getQueryString=function(e,t,n){var r="";try{var o=new URL(null!=t?t:"");if(o.searchParams.has(e))r=o.searchParams.get(e)||"";else if(o.hash)if(o.hash.includes("?")){var a=o.hash.slice(o.hash.indexOf("?"));(c=new URLSearchParams(a)).has(e)&&(r=c.get(e)||"")}else{var c;(c=new URLSearchParams(o.hash.slice(1))).has(e)&&(r=c.get(e)||"")}}catch(e){(0,i.JSLogger)({error:e}),null==n||n(e)}return r?decodeURIComponent(r):""};t.getQueryStringWithIframeCheck=function(e,n,i){var a,c=(0,t.getQueryString)(e,n,i);if(!c&&(0,o.isInIframe)())try{c=(0,t.getQueryString)(e,null===(a=null===r.windowSnapshot||void 0===r.windowSnapshot?void 0:r.windowSnapshot.top)||void 0===a?void 0:a.location.href,i)}catch(e){}return c}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInIframe=void 0;var r=n(0);t.isInIframe=function(){return(0,r.checkWindow)(r.GlobalThis)&&r.GlobalThis.self!==r.GlobalThis.top}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSuffixIfExist=t.isObject=void 0;t.isObject=function(e){return"object"==typeof e&&null!==e};t.addSuffixIfExist=function(e,t,n){return void 0===n&&(n="-"),t?"".concat(e).concat(n).concat(t):e}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&-1!==(n=e.indexOf(t+"="))?(r=n+t.length+1,c=e.indexOf(";",r),s="",s=-1===c?e.substring(r):e.substring(r,c),[2,decodeURIComponent(s)]):[3,3];case 2:return u=o.sent(),(0,i.JSLogger)({error:u}),[3,3];case 3:return[2,""]}}))}))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0},t.prototype.visibilityChange=function(e,t){var n=this;t||this.isCompressSendSuccess||!this.isCollectEnd()||(0,p.sendCheckPixelAction)(this.params).then((function(e){n.isCompressSendSuccess=e,e&&n.setCookie()}))},t.prototype.pageWillLeave=function(){var e=this;!this.isCompressSendSuccess&&this.isCollectEnd()&&(0,p.sendCheckPixelAction)(this.params).then((function(t){t?e.setCookie():(0,_.APILogger)({apiPath:h.API[h.REPORT_TYPE.CHECK_PIXEL],actionStatus:v.ActionStatus.NOT_VALID_API_RETURNS,error:"status !== 200"})})).catch((function(e){(0,_.APILogger)({apiPath:h.API[h.REPORT_TYPE.CHECK_PIXEL],actionStatus:v.ActionStatus.ERROR,error:e})}))},t.prototype.setCookie=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){return(0,d.setCookieByName)({name:f.FINGERPRINT_COOKIE_ID,value:"1",seconds:86400}),[2]}))}))},t}(s.Plugin);t.FingerprintPlugin=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendCheckPixelAction=void 0;var r=n(4),o=n(31),i=n(9),a=r.API[r.REPORT_TYPE.CHECK_PIXEL];t.sendCheckPixelAction=function(e){return new Promise((function(t,n){try{var r=o.httpService.sendBeacon(a,e);t(r)}catch(r){i.xhrService.post(a,e,{async:!0,retry:2}).then((function(e){var r=e.status,o=e.err_msg;"200"!==String(r)&&n(o),t(!0)})).catch((function(e){n(e)}))}}))}}])}));