1!function(){"use strict";const e=window.pmdNavigaPaywallConfig||{};if(!window.pmdAnalytics||"function"!=typeof window.pmdAnalytics.trackEvent)return;const n="pmd:naviga-engage-event",t={onPaywallShown:"paywall_shown",onConversationDetermined:"meter_conversation_determined",onActionClosed:"paywall_closed",onButtonClick:"paywall_click",onLoginShown:"paywall_login_shown",onLoginSuccess:"paywall_login_success",onLoginError:"paywall_login_error",onRegistrationSuccess:"registration_success",onMeterLevelSet:"meter_level_set",onActivationSuccess:"subscription_activation_success"},o={onAuthorized:"registered",onLoggedIn:"registered"};let i=null,r=!1,c=!1,a=null,s=!1,u=!1;const l=[];function d(e){if(s&&window.amplitude)return void e(window.amplitude);if(l.push(e),u)return;u=!0;let n=0;!function e(){n++;const t=window.amplitude;if(t&&"function"==typeof t.identify&&"function"==typeof t.Identify&&"function"==typeof t.setUserId)for(s=!0;l.length;)try{l.shift()(t)}catch(e){console.warn("PMD Analytics: Naviga bridge Amplitude call failed.",e)}else n<100&&setTimeout(e,100)}()}const f={Aui:"naviga_anonymous_id",CampaignId:"campaign_id",CampaignName:"campaign_name",ConversationId:"conversation_id",ConversationName:"conversation_name",ActionType:"action_type",ActionTypeId:"action_type_id",ActionName:"action_name",ActionDescription:"action_description",MeterLevel:"meter_level",UserState:"user_state",Views:"conversation_views",ViewCount:"view_count",Limit:"paywall_limit"};function p(e){const n={paywall_vendor:"naviga"};"string"==typeof window.pageTag&&window.pageTag&&(n.page_tag=window.pageTag),function(e){if(!e||"object"!=typeof e)return[];const n=e.EventData,t=[e];return n&&"object"==typeof n&&(t.push(n),n.Properties&&"object"==typeof n.Properties&&t.push(n.Properties)),t}(e).forEach(function(e){Object.keys(f).forEach(function(t){const o=e[t],i=f[t];"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||i in n||(n[i]=o)})});const t=function(e){const n=e&&e.EventData?e.EventData:null,t=n&&n.Properties?n.Properties:null,o=t?t.PaywallInfo:null,i=o&&o.ArticleLeft?o.ArticleLeft:null;let r=t?t.ArticleLeft:void 0;return i&&o.MinView&&void 0!==i[o.MinView]&&(r=i[o.MinView]),"unlimited"===r?-1:"number"==typeof r?r:null}(e);return null!==t&&(n.articles_left=t),Object.assign(n,function(e){const n=e&&e.EventData?e.EventData:null,t={};if(!n||"object"!=typeof n)return t;"string"==typeof n.Method&&""!==n.Method&&(t.meter_level_method=n.Method),"number"==typeof n.Id&&(t.meter_level_id=n.Id);const o=n.Rule;return o&&"object"==typeof o&&"string"==typeof o.Name&&""!==o.Name&&(t.meter_rule_name=o.Name),t}(e)),n}function m(e){i!==e&&(i=e,window.pmdAnalyticsConfig&&window.pmdAnalyticsConfig.defaultProperties&&(window.pmdAnalyticsConfig.defaultProperties.user_status=e),d(function(n){const t=new n.Identify;t.set("user_status",e),n.identify(t)}),"anonymous"!==e&&w())}function w(){if(!e.setUserId||c)return;const n=function(e){const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=document.cookie.match(new RegExp("(?:^|;\\s*)"+n+"=([^;]*)"));try{return t?decodeURIComponent(t[1]):""}catch(e){return t?t[1]:""}}(e.sessionCookie||"auth0_sub");var t;n&&(c=!0,(t=n,window.crypto&&window.crypto.subtle&&void 0!==window.TextEncoder?window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then(function(e){return Array.prototype.map.call(new Uint8Array(e),function(e){return e.toString(16).padStart(2,"0")}).join("")}):Promise.reject(new Error("WebCrypto unavailable"))).then(function(e){a="a0_"+e,d(function(e){e.setUserId(a)})}).catch(function(){}))}document.documentElement.classList.contains("naviga-state--registered")?m("registered"):m("anonymous");const y={};Object.keys(o).forEach(function(e){y[e]=function(){m(o[e])}}),y.onNotAuthorized=function(){r=!1,m("anonymous")},y.onHasNoActiveSubscription=function(){r=!0,m("registered")},y.onHasAccess=function(){"registered"!==i||r||m("subscribed")},Object.keys(t).forEach(function(e){y[e]=function(n){window.pmdAnalytics.trackEvent(t[e],p(n))}}),["onLoginSuccess","onRegistrationSuccess","onActivationSuccess"].forEach(function(e){const n=y[e];y[e]=function(e){n(e),w()}}),function(e){document.addEventListener(n,function(n){const t=n&&n.detail?n.detail:null;t&&e[t.name]&&e[t.name](t.payload)})}(y),w(),e.debug&&document.addEventListener(n,function(e){const n=e&&e.detail?e.detail
1:null;console.log("[PMD Analytics] Engage event: "+(n?n.name:"?"),t[n&&n.name]||"(not tracked)",n?p(n.payload):null)}),function(){const n=function(e){return(Array.isArray(e)?e:[]).filter(function(e){return"string"==typeof e&&""!==e}).map(function(e){return e.toLowerCase()})},t=n(e.checkoutHosts),o=n(e.checkoutHostPatterns);if(!t.length&&!o.length)return;const i=e.deviceIdParam||"amp_device_id",r=e.userIdParam||"amp_user_id",c=function(e){const n=e.target;if(!(n instanceof Element))return;const c=n.closest("a[href]");if(!c)return;let s;try{s=new URL(c.href,location.href)}catch(e){return}if(!function(e){const n=e.toLowerCase();if(n===location.hostname.toLowerCase())return!1;if(-1!==t.indexOf(n))return!0;const i=n.split(".");return o.some(function(e){return i.some(function(n){return-1!==n.indexOf(e)})})}(s.hostname))return;let u=!1;if(!s.searchParams.has(i)){const e=function(){if(window.pmdAmplitudeDeviceId)return window.pmdAmplitudeDeviceId;try{const e=localStorage.getItem("pmd_amplitude_device_id");if(e)return e}catch(e){}try{if(window.amplitude&&"function"==typeof window.amplitude.getDeviceId)return window.amplitude.getDeviceId()||null}catch(e){}return null}();e&&(s.searchParams.set(i,e),u=!0)}a&&!s.searchParams.has(r)&&(s.searchParams.set(r,a),u=!0),u&&(c.href=s.toString())};document.addEventListener("click",c,!0),document.addEventListener("auxclick",c,!0)}()}(); 2//# sourceMappingURL=naviga-paywall-bridge.js.map
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.