Files
2026-11-16 01:39:59 +07:00

1 line
2.7 KiB
Plaintext

(()=>{"use strict";({551:function(i,e){var n=this&&this.__awaiter||function(i,e,n,o){return new(n||(n=Promise))((function(r,t){function d(i){try{c(o.next(i))}catch(i){t(i)}}function g(i){try{c(o.throw(i))}catch(i){t(i)}}function c(i){var e;i.done?r(i.value):(e=i.value,e instanceof n?e:new n((function(i){i(e)}))).then(d,g)}c((o=o.apply(i,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getUid2AdvertisingTokenWithRetry=e.__uid2SSProviderScriptLoad=e.Uid2SecureSignalProvider=void 0;class o{constructor(i=!1){this.registerSecureSignalProvider=()=>{const i=this.retrieveAdvertisingTokenHandler();i?(window.googletag=window.googletag||{cmd:[]},window.googletag.secureSignalProviders=window.googletag.secureSignalProviders||[],window.googletag.secureSignalProviders.push({id:"uidapi.com",collectorFunction:()=>n(this,void 0,void 0,(function*(){this.logging("collectorFunction invoked");const e=yield t(i);return this.logging(`collectorFunction pushes: ${e}`),e}))})):console.warn("Uid2SecureSignal: Please implement `getUid2AdvertisingToken`")},this.logging=i=>{this.debug&&console.log(`Uid2SecureSignal: ${i}`)},this.retrieveAdvertisingTokenHandler=()=>"function"==typeof window.getUid2AdvertisingToken?window.getUid2AdvertisingToken:window.__uid2&&"getAdvertisingTokenAsync"in window.__uid2?window.__uid2.getAdvertisingTokenAsync.bind(window.__uid2):void 0,this.debug=i,"function"==typeof window.getUid2AdvertisingToken&&(this.logging("register SecureSignalProvider"),this.registerSecureSignalProvider())}}function r(){var i;window.__uid2SecureSignalProvider=new o(function(){var i;const e=new URLSearchParams(window.location.search).get("uid2_ss_debug");return"TRUE"===(null==e?void 0:e.toLocaleUpperCase())||(null===(i=document.currentScript)||void 0===i?void 0:i.src.startsWith("https://cdn.integ.uidapi.com/"))}()),window.__uid2=window.__uid2||{callbacks:[]},null===(i=window.__uid2.callbacks)||void 0===i||i.push((i=>{"SdkLoaded"===i&&window.__uid2SecureSignalProvider.registerSecureSignalProvider()}))}function t(i,e=3){return new Promise(((o,r)=>n(this,void 0,void 0,(function*(){let t=0;!function d(g){var c,u,s;return n(this,void 0,void 0,(function*(){if(t>=e)return null===(c=window.__uid2SecureSignalProvider)||void 0===c||c.logging(`getUid2AdvertisingTokenWithRetry failed with error after retry: ${g}`),void r(g);t++;try{const e=yield i();null===(u=window.__uid2SecureSignalProvider)||void 0===u||u.logging(`getUid2AdvertisingTokenWithRetry resolved with: ${e}`),o(e)}catch(i){null===(s=window.__uid2SecureSignalProvider)||void 0===s||s.logging(`getUid2AdvertisingTokenWithRetry failed with error: ${i}`),d(i)}}))}()}))))}e.Uid2SecureSignalProvider=o,e.__uid2SSProviderScriptLoad=r,r(),e.getUid2AdvertisingTokenWithRetry=t}})[551](0,{})})();