\n
\n
\n\t\t\t\t\t\n\t\t\t\t
\n
\n
\n
\n
${title || ''}
\n
\n
\n\t\t\t\t\t\t\t\t\t${text || ''}\n
\n
\n
\n\t\t\t\t\t\t${closeConfirm ? `
\n
\n
\n
`;\n\n\tif(!userMessage){\n\t\tuserMessage = document.createElement('div');\n\t\tuserMessage.id = id;\n\t\tuserMessage.classList = 'mainModalWrapper';\n\t}\n\tuserMessage.innerHTML = '';\n\tuserMessage.innerHTML = containerStructure;\n\n\tconst closeButton = userMessage.querySelector('#modalClose');\n\tcloseButton.addEventListener( 'click', () => {\n\t\tuserMessage.remove();\n\t});\n\n\tif (closeConfirm) {\n\t\tconst closeButtonBottom = userMessage.querySelector('.optional-button-container');\n\t\tcloseButtonBottom.addEventListener( 'click', () => {\n\t\t\tuserMessage.remove();\n\t\t});\n\t}\n\tif (appendToId) {\n\t\tconst appendToElement = document.querySelector(`#${appendToId}`);\n\t\tif (appendToElement && embedded) {\n\t\t\tconst entriesContainer = document.getElementById('userProfileEntriesContainer');\n\t\t\tconst entries = entriesContainer.querySelectorAll('.user-profile-item-row');\n\n\t\t\tif (entries.length >= 2) {\n\t\t\t\t\t\n\t\t\t\tconst parent = entries[1].parentNode;\t\t\t\n\t\t\t\tparent.insertBefore(userMessage, entries[1].nextSibling); \n\t\t\t}\n\t\t} else {\n\t\t\tappendToElement.append(userMessage);\n\t\t}\n\t}\n\n\n\t// remove message after text string length * 50ms with fade\n\t// this sets a minimim of 2.5 seconds before removing the modal and a max of 7000 per AC from DSBU-1282\n\t/** Dev note: If a modal that has to be manually dismissed is needed, the following will need to\n\t\t** be paramaratized and wrapped in an if block\n\t* */\n\tif (autoDismiss) {\n\t\tlet removeModalTime = Math.min(Math.max(text.length * 55, 2500), 7000);\n\t\tremoveModalTime = removeModalTime > 2800 ? removeModalTime : 3000\n\t\tsetTimeout( () => {\n\t\t\tuserMessage.classList.add('fade-out');\n\t\t\tsetTimeout(() => {\n\t\t\t\tuserMessage.remove();\n\t\t\t}, 1500);\n\t\t}, removeModalTime);\n\t}\n\treturn userMessage;\n};\n\n\nexport const getContentId = async ( typeString = 'Content ID' ) => {\n\tconst contentId = await getDataLayerObject(typeString);\n\tlogger.log('utils.js | contentId: Content ID is ', contentId);\n\treturn contentId;\n};\n\nexport const getSection = async ( typeString = 'Section' ) => {\n\tconst obtainSection = await getDataLayerObject(typeString);\n\tlogger.log('utils.js | section: Section is ', obtainSection);\n\treturn obtainSection;\n}\n\nexport const getHomePaper = () => {\n\tconst userInfo = window.localStorage.getItem('__MNG_Session');\n\tif ( userInfo ) {\n\t\tconst userInfoParsed = JSON.parse(userInfo);\n\t\tif ( userInfoParsed.idToken ) {\n\t\t\tconst idToken = decodeToken(userInfoParsed.idToken);\n\t\t\tif (idToken.home_paper) {\n\t\t\t\tlogger.log('Util.js | home paper: Home paper is ', idToken.home_paper);\n\t\t\t\treturn idToken.home_paper.replace( 'www.', '' ).replace( 'develop.', '' ).replace( 'preprod.', '' );\n\t\t\t}\n\t\t}\n\t}\n\t// If homepaper isn't set, is going to return the current domain\n\tlogger.log('Util.js | home paper: Home paper is not set ', getSiteUrl());\n\treturn getSiteUrl();\n}\n\nexport const getTheFollowingMonth = () => {\n\tconst currentDate = new Date();\n\tconst currentMonth = currentDate.getMonth();\n\tconst nextMonthDate = new Date(currentDate.setMonth(currentMonth + 1));\n\tconst options = { month: 'long' };\n\treturn new Intl.DateTimeFormat('en-US', options).format(nextMonthDate);\n}\n\nexport const logDDMetric = ( logEventName ) => {\n\tif( settings.datadogEnabled ){\n\t\twindow.DD_RUM.addTiming( logEventName );\n\t}\n}\n\nexport default {\n\tgetCurrentUrl,\n\tgetCookie,\n\tsetCookie,\n\tdeleteCookie,\n\tdeleteStorageObject,\n\tdocumentBodyLoaded,\n\tsubscribeElementToEvent,\n\tsimpleEmailValidation,\n\tgetEncryptedUuid,\n\tcheckAppleSubStatus,\n\tgetAuth0Client,\n\trerunConnextEntitlements,\n\tconnextReady,\n\tsiteIsTribune,\n\tbcLowaCheck,\n\twaitForElementToExist,\n\tcheckOneTapOptions,\n\tisStringConvertibleToInt,\n\taddDynamicLinkToNode,\n\tgetHomePaper,\n\tescapeHTML,\n\tgetTheFollowingMonth,\n\tlogDDMetric,\n\tcreateModal\n};\n","import {\n\tgetContentId,\n\tentitlementsReady, connextReady,\n\trerunConnextEntitlements, digisubsDataLayerLoaded, pageType, getSiteUrl, getSection,\n} from '../utils';\nimport logger from '../logger';\n\nclass SophiBase {\n\n\trunConnextIfSilentTimer;\n\n\treRunConnextCounter;\n\n\tsimpleHostname;\n\n\tsophiHostname;\n\n\tsophiCallStartTime;\n\n\tsection;\n\n\tcontentId;\n\n\tvisitorType;\n\n\tconstructor () {\n\t\tthis.simpleHostname = getSiteUrl();\n\t\tconst loc = window.location.hostname;\n\t\tif ( window.sophi_config.sophiHostname !== '' ) this.sophiHostname = window.sophi_config.sophiHostname;\n\t\telse this.sophiHostname = loc;\n\t\tthis.reRunConnextCounter = 0;\n\n\t\tthis.onDeviceEnabled = window.sophi_config?.sophiOnDevice ? window.sophi_config.sophiOnDevice === '1' : false;\n\t\tthis.sdkEnabled = window.sophi_config?.enableSDK ? window.sophi_config.enableSDK === '1' : false;\n\n\t\tthis.log( `site settings: onDeviceEnabled = ${this.onDeviceEnabled}, sdkEnabled = ${this.sdkEnabled}` );\n\t}\n\n\tasync init () {\n\t\tthis.log( 'Starting normal SDK flow.' );\n\t\tif ( !this.sdkEnabled ) return;\n\t\tconst shouldCallSophi = await this.setupSophiDecision();\n\t\tif ( shouldCallSophi ) await this.makeSophiCall();\n\t}\n\n\tasync setupSophiDecision () {\n\t\tthis.log( 'Added A/B test listener...' );\n\t\treturn new Promise( ( resolve ) => {\n\t\t\ttry {\n\t\t\t\twindow.addEventListener( 'sophi.abTests:ready', async () => {\n\t\t\t\t\t// Define the error callback\n\t\t\t\t\tconst onError = ( error ) => {\n\t\t\t\t\t\tconsole.error( 'onError callback, rerunning Connext if silent:', error );\n\t\t\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.log( 'AB Tests loaded successfully!' );\n\t\t\t\t\t// Check if the function is available and then execute\n\t\t\t\t\tif ( window.sophi?.abTests && typeof window.sophi.abTests.getAllExperiments === 'function' ) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst experiments = await window.sophi.abTests.getAllExperiments();\n\n\t\t\t\t\t\t\tif ( !this.onDeviceEnabled && !experiments || ( experiments && experiments.length < 1 ) ) {\n\t\t\t\t\t\t\t\tthis.log( 'experiments variable was not in the expected format.', experiments );\n\t\t\t\t\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst entitlements = await entitlementsReady();\n\n\t\t\t\t\t\t\tif ( 'isEntitled' in entitlements ) {\n\t\t\t\t\t\t\t\tthis.visitorType = entitlements.isEntitled ? 'subscriber' : 'registered';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.visitorType = 'anonymous';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// set global var for regiwall use.\n\t\t\t\t\t\t\twindow.sophiUserType = this.visitorType;\n\n\t\t\t\t\t\t\t// check for regilite signup to swap userType.\n\t\t\t\t\t\t\tconst isRegilite = window.localStorage.getItem( 'sophiRegiliteUser' );\n\n\t\t\t\t\t\t\tif ( isRegilite === 'yes' && window.sophiUserType === 'anonymous' ) {\n\t\t\t\t\t\t\t\tthis.log( 'as regilite and is anonymous, setting to registered' );\n\t\t\t\t\t\t\t\twindow.sophiUserType = 'registered';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst pageTypeCheck = await pageType();\n\t\t\t\t\t\t\tif ( pageTypeCheck !== 'article' ) {\n\t\t\t\t\t\t\t\tthis.log( 'Page type was not article, returning.', experiments );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tawait digisubsDataLayerLoaded();\n\n\t\t\t\t\t\t\tconst sophiGroup = experiments[0]?.assignedGroup;\n\t\t\t\t\t\t\tthis.log( 'onSuccess callback:', sophiGroup );\n\t\t\t\t\t\t\twindow.dataLayer.push( {\n\t\t\t\t\t\t\t\tevent: 'sophi_cookie',\n\t\t\t\t\t\t\t\tsophi_type: `${this.simpleHostname}UserIsInVariantOrHoldout`,\n\t\t\t\t\t\t\t\tsophi_cookie_val: sophiGroup\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\twindow.sophiCookie = sophiGroup;\n\n\t\t\t\t\t\t\tif ( sophiGroup === 'control' || this.visitorType === 'subscriber' ) {\n\t\t\t\t\t\t\t\tthis.log( `User is in ${sophiGroup}, and is ${this.visitorType}. Ending sophi flow.` );\n\t\t\t\t\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\t\t\t\t\tresolve( false );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.section = await getSection();\n\t\t\t\t\t\t\tthis.contentId = await getContentId();\n\t\t\t\t\t\t\tthis.log( 'Content ID ', this.contentId );\n\t\t\t\t\t\t\tresolve( true );\n\t\t\t\t\t\t} catch ( error ) {\n\t\t\t\t\t\t\tonError( error );\n\t\t\t\t\t\t\tresolve( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.log( 'window.sophi.abTests.getAllExperiments is not available' );\n\t\t\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\t\t\tresolve( false );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} catch ( e ) {\n\t\t\t\tthis.log( 'Event listener', e );\n\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\tresolve( false );\n\t\t\t}\n\t\t} );\n\t}\n\n\tasync rerunConnextIfIsSilent () {\n\t\tconst connextIsReady = await connextReady( 'onInit' );\n\t\tif ( connextIsReady && Connext.GetOptions().Silentmode ) {\n\t\t\tthis.log( 'Silent mode, running Connext now.' );\n\t\t\tif ( this.reRunConnextCounter < 1 ) rerunConnextEntitlements();\n\t\t\tthis.reRunConnextCounter += 1;\n\t\t\tif ( this.runConnextIfSilentTimer ) clearTimeout( this.runConnextIfSilentTimer );\n\t\t}\n\t}\n\n\thandleSophiResponse ( response ) {\n\t\tconst sophiAPITime = Date.now() - this.sophiCallStartTime;\n\n\t\tthis.log( `response with response time of ${sophiAPITime} ms: `, response );\n\t\tdelete response.trace;\n\n\t\twindow.dataLayer.push( {\n\t\t\tevent: 'sophi_decision',\n\t\t\tsophi_type: 'getDecision',\n\t\t\tsophi_time: sophiAPITime,\n\t\t\tsophi_response: JSON.stringify( response )\n\t\t} );\n\t\twindow.sophiWallConfig = response;\n\t\tthis.rerunConnextIfIsSilent();\n\t}\n\n\tasync makeSophiCall () {\n\t\treturn new Promise( ( resolve ) => {\n\t\t\ttry {\n\t\t\t\tconst sdk = window.sophi.paywall.init( { hostname: this.sophiHostname, getContentId } );\n\t\t\t\tthis.log( '2.0 SDK init complete: ', sdk );\n\n\t\t\t\tif ( !window.sophi.paywall ) {\n\t\t\t\t\tthis.log( 'window.sophi.paywall was undefined. About to run Connext' );\n\t\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twindow.dataLayer.push( {\n\t\t\t\t\tevent: 'sophi_cookie',\n\t\t\t\t\tsophi_type: 'beforeSDKCall',\n\t\t\t\t\tsophi_cookie_val: window.sophiCookie\n\t\t\t\t} );\n\t\t\t\tthis.log( `about to call SDK, cookie is ${window.sophiCookie}` );\n\t\t\t\tthis.sophiCallStartTime = Date.now();\n\t\t\t} catch ( e ) {\n\t\t\t\tthis.log( 'logic error 1', e );\n\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t}\n\n\t\t\tlet timer = 4000;\n\t\t\tif ( window.sophi_config?.sophiGetDesicionTimer !== '' && typeof window.sophi_config.sophiGetDesicionTimer !== 'number' ) {\n\t\t\t\ttimer = parseInt( window.sophi_config.sophiGetDesicionTimer, 10 );\n\t\t\t}\n\t\t\tthis.log( 'timer is equal to: ', timer );\n\t\t\twindow.sophi.paywall.getDecision( {\n\t\t\t\tcontentId: this.contentId,\n\t\t\t\tsection: this.section,\n\t\t\t\tvisitor: window.sophiUserType,\n\t\t\t\ttimeout: timer\n\t\t\t} )\n\t\t\t\t.then( response => {\n\t\t\t\t\tthis.handleSophiResponse( response );\n\t\t\t\t\tresolve();\n\t\t\t\t} ).catch( error => {\n\t\t\t\t\tconst sophiAPITime = Date.now() - this.sophiCallStartTime;\n\n\t\t\t\t\tthis.log( `error sdk, response time of ${sophiAPITime} ms: `, error );\n\t\t\t\t\twindow.dataLayer.push( { event: 'sophi_error', sophi_time: sophiAPITime, sophi_err_msg: error } );\n\t\t\t\t\t// run Connext if Connext Silent Mode is enabled\n\t\t\t\t\tthis.rerunConnextIfIsSilent();\n\t\t\t\t\tresolve();\n\t\t\t\t} );\n\t\t} );\n\t}\n\n\t/* eslint-disable class-methods-use-this */\n\tlog ( ...params ) {\n\t\tlogger.log( 'Sophi: ', ...params );\n\t}\n}\n\nexport default SophiBase;\n","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import superPropBase from \"./superPropBase.js\";\nexport default function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nexport default function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import SophiBase from './sophi-base'\nimport { pageType, getSection } from '../utils'\n\n/* eslint-disable import/prefer-default-export */\n\nexport class Sophi extends SophiBase {\n\tasync init(){\n\n\t\tif( this.sdkEnabled ) return;\n\t\t\n\t\tif( typeof demeter === 'undefined'){\n\t\t\tthis.log('demeter undefined, aborting on-device init.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( this.onDeviceEnabled ) {\n\t\t\tthis.log('On-Device module is enabled.');\n\t\t} else {\n\t\t\tthis.log('On-Device module is NOT enabled, aborting.');\n\t\t\treturn;\n\t\t}\n\n\t\t// ignoring the promise here otherwise the abtest event happens before the promise is fulfilled\n\t\tdemeter('config', {\n\t\t\targs: {\n\t\t\t\tlogLevel: window.authentication_config.debug ? 'warn' : 'debug' // default log level is \"warn\"\n\t\t\t}\n\t\t})\n\n\t\tdemeter('enableAllFeatures');\n\n\t\t// Skip client-side Sophi decision if SSPW is active\n\t\tif( window.sophi_config.enableSophiSSPW !== '1' ) {\n\t\t\tthis.log('About to setup Sophi decision.');\n\t\t\tconst success = await this.setupSophiDecision();\n\t\t\tif( success ) await this.makeSophiCall();\n\t\t} else {\n\t\t\tthis.log('SSPW is active, skipping client-side Sophi decision call.');\n\t\t\tthis.handleServerSidePaywall();\n\t\t}\n\t}\n\n\thandleSophiResponse(response) {\n\t\tthis.listenForEventForDemeter();\n\t\tsuper.handleSophiResponse(response);\n\t}\n\n\tasync listenForEventForDemeter() {\n\t\tthis.log('Starting sophi listenForEventForDemeter...');\n\t\tconst pageTypeCheck = await pageType();\n\t\tconst section = await getSection();\n\n\t\tdemeter('pageview', {\n\t\t\targs: {\n\t\t\t\tarticle: pageTypeCheck === 'article' ?? false, // Identifies if this is an article page\n\t\t\t\tsection // Top level section of the article\n\t\t\t}\n\t\t});\n\t\tthis.log(`demeter pagetype tracking sent, pagetype is ${pageTypeCheck} and section is ${section}`);\n\n\t\tthis.log('adding paywall listener');\n\t\tdocument.addEventListener(\n\t\t\t'onPaywallShown',\n\t\t\t(e) => {\n\n\t\t\t\tconst wallType = e.detail?.EventData?.name?.includes('regwall') ? 'regwall' : 'paywall';\n\t\t\t\tthis.log(`paywall event, is ${wallType}`);\n\n\t\t\t\tdemeter('wall', {\n\t\t\t\t\targs: {\n\t\t\t\t\t\twallType, // Type of wall being displayed (paywall/regwall)\n\t\t\t\t\t\tsection // Top level section of the article where wall was triggered\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.log(`demeter paywall tracking sent, wall type is ${wallType}`);\n\t\t\t}\n\t\t);\n\n\t}\n\n\tasync makeSophiCall() {\n\t\treturn new Promise((resolve) => {\n\t\t\ttry {\n\t\t\t\tthis.sophiCallStartTime = Date.now();\n\t\t\t\tdemeter('getDecision', {\n\t\t\t\t\targs: { visitor: this.visitorType }, // \"registered\" or \"anonymous\"\n\t\t\t\t}).then(decision =>{\n\t\t\t\t\tthis.handleSophiResponse( decision.outcome );\n\t\t\t\t\tresolve();\n\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\tconst sophiAPITime = Date.now() - this.sophiCallStartTime;\n\n\t\t\t\tthis.log(`error sdk, response time of ${sophiAPITime} ms: `, error);\n\t\t\t\twindow.dataLayer.push({ event: 'sophi_error', sophi_time: sophiAPITime, sophi_err_msg: error });\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t}\n\n\tasync handleServerSidePaywall() {\n\t\tthis.log('Checking for server-side paywall...');\n\t\tconst section = await getSection();\n\t\tconst pageTypeCheck = await pageType();\n\n\t\tconst sophiDecision = window.dataLayer.find(item => item.event === 'sophiDecision');\n\t\tif ( sophiDecision ) {\n\t\t\tlet message = '';\n\t\t\tif ( sophiDecision.wall_decision === 'paywall' ) {\n\t\t\t\tmessage = `SSPW decision from dataLayer: paywall returned, source is ${sophiDecision.decision_source} - wall: ${sophiDecision.wall_decision}`;\n\t\t\t} else if ( sophiDecision.wall_decision === 'regwall' ) {\n\t\t\t\t// TODO: This should change when regwall is implemented\n\t\t\t\tmessage = `SSPW decision from dataLayer: regwall returned, ignoring decision, source is ${sophiDecision.decision_source} - wall: ${sophiDecision.wall_decision}`;\n\t\t\t} else if ( sophiDecision.wall_decision === 'nowall' ) {\n\t\t\t\tmessage = 'SSPW decision from dataLayer: nowall returned';\n\t\t\t} else if ( sophiDecision.decision_source === 'timeout' ) {\n\t\t\t\tmessage = `SSPW decision from dataLayer: request to sophi timed out, source is =${sophiDecision.decision_source} - wall: ${sophiDecision.wall_decision}`;\n\t\t\t}\n\t\t\tthis.log(`${message}`);\n\t\t} else {\n\t\t\tthis.log('No Sophi decision found in dataLayer.');\n\t\t}\n\t\n\t\tconst serverPaywall = document.getElementById('server-paywall');\n\t\n\t\tif ( serverPaywall ) {\n\t\t\tthis.log('Server-side paywall detected.');\n\t\n\t\t\tdemeter('wall', {\n\t\t\t\targs: {\n\t\t\t\t\twallType: 'paywall',\n\t\t\t\t\tsection\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.log(`demeter wall tracking sent for server-side paywall. Section is ${section}`);\n\t\t} else {\n\t\t\tdemeter('pageview', {\n\t\t\t\targs: {\n\t\t\t\t\tarticle: pageTypeCheck === 'article' ?? false,\n\t\t\t\t\tsection\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.log('No server-side paywall detected. Element not found.');\n\t\t\tthis.log(`demeter pagetype tracking sent, pagetype is ${pageTypeCheck} and section is ${section}`);\n\t\t}\n\t}\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import SophiBase from './sophi-base'\nimport { Sophi } from './sophi'\n\nif( window.sophi_config?.sophiOnDevice === '1' ){\n\tconst sophi = new Sophi();\n\tsophi.init();\n} else {\n\tconst sophiLegacy = new SophiBase();\n\tsophiLegacy.init();\n}"],"names":["module","exports","utils","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","defaults","Cancel","config","Promise","resolve","reject","onCanceled","requestData","data","requestHeaders","headers","responseType","done","cancelToken","unsubscribe","signal","removeEventListener","isFormData","request","XMLHttpRequest","auth","username","password","unescape","encodeURIComponent","Authorization","btoa","fullPath","baseURL","url","onloadend","responseHeaders","getAllResponseHeaders","response","responseText","status","statusText","value","err","open","method","toUpperCase","params","paramsSerializer","timeout","onreadystatechange","readyState","responseURL","indexOf","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","transitional","clarifyTimeoutError","isStandardBrowserEnv","xsrfValue","withCredentials","xsrfCookieName","read","undefined","xsrfHeaderName","forEach","val","key","toLowerCase","setRequestHeader","isUndefined","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","type","abort","subscribe","aborted","send","bind","Axios","mergeConfig","axios","createInstance","defaultConfig","context","instance","prototype","extend","create","instanceConfig","CancelToken","isCancel","VERSION","all","promises","蜜兔直播","isAxiosError","default","message","this","toString","__CANCEL__","executor","TypeError","resolvePromise","promise","token","then","_listeners","i","l","length","onfulfilled","_resolve","reason","throwIfRequested","listener","push","index","splice","source","c","InterceptorManager","dispatchRequest","validator","validators","interceptors","arguments","assertOptions","silentJSONParsing","boolean","forcedJSONParsing","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","Array","apply","concat","shift","newConfig","onFulfilled","onRejected","error","getUri","replace","handlers","use","options","eject","id","fn","h","isAbsoluteURL","combineURLs","requestedURL","enhanceError","code","Error","transformData","throwIfCancellationRequested","call","transformRequest","merge","common","adapter","transformResponse","toJSON","name","description","number","fileName","lineNumber","columnNumber","stack","config1","config2","getMergedValue","target","isPlainObject","isArray","slice","mergeDeepProperties","prop","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","Object","keys","configValue","validateStatus","fns","normalizeHeaderName","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","process","isArrayBuffer","isBuffer","isStream","isFile","isBlob","isArrayBufferView","buffer","isURLSearchParams","isObject","rawValue","parser","encoder","isString","JSON","parse","trim","e","stringify","stringifySafely","strictJSONParsing","maxContentLength","maxBodyLength","thisArg","args","encode","serializedParams","parts","v","isDate","toISOString","join","hashmarkIndex","relativeURL","write","expires","path","domain","secure","cookie","isNumber","Date","toGMTString","document","match","RegExp","decodeURIComponent","remove","now","test","payload","originURL","msie","navigator","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","window","location","requestURL","parsed","normalizedName","ignoreDuplicateOf","split","line","substr","callback","arr","thing","deprecatedWarnings","version","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","result","getPrototypeOf","isFunction","obj","hasOwnProperty","constructor","FormData","ArrayBuffer","isView","pipe","URLSearchParams","product","assignValue","a","b","str","stripBOM","content","charCodeAt","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","defineProperty","enumerable","get","Symbol","iterator","asyncGeneratorStep","gen","_next","_throw","arg","info","self","_classCallCheck","Constructor","_defineProperties","props","descriptor","configurable","writable","_createClass","protoProps","staticProps","atob","authentication_config","sessionManagementEnabled","sessionManagement","debug","sessionServer","entitlementsEnabled","dropdownEnabled","enableReaderDashboardLink","oneTapEnabled","useTribMainGoogle","isAdfreeArticle","auth0Domain","auth0ClientId","entitlementsEndpoint","entitlementsApiKey","entitlementsAPIKey","linaCheckOnArticles","serverEntitlements","googleClientId","newsletterId","connextStorageKey","auth0SubKey","auth0Authenticated","secret","pluginSecret","newslettersEnabled","bcLowaSegements","blueconicEnabled","datadogEnabled","enableDatadog","log","settings","_console","_len","_key","_regeneratorRuntime","t","r","asyncIterator","u","toStringTag","define","wrap","Generator","Context","makeInvokeMethod","tryCatch","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","values","g","defineIteratorMethods","_invoke","AsyncIterator","invoke","_typeof","__await","callInvokeWithMethodAndArg","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isNaN","displayName","isGeneratorFunction","mark","setPrototypeOf","__proto__","awrap","async","reverse","pop","prev","stop","rval","handle","complete","finish","delegateYield","getCurrentUrl","windowLocationhref","URL","getSiteUrl","documentIsLoadedCompletely","digisubsDataLayerLoaded","dataLayer","logger","dataLayerLoaded","setInterval","_asyncToGenerator","_callee7","_context7","clearInterval","getDataLayerObject","_x7","_ref13","_callee11","getObject","dataLayerSearch","dataLayerLoop","_context11","element","some","pageType","_ref14","_callee12","typeString","getPageType","_args12","_context12","entitlementsReady","MNGAuthentication","_ref18","_x8","_callee16","event","detail","_context16","connextReady","eventToWaitFor","connextTimeout","Connext","clearTimeout","simpleEmailValidation","email","emailPattern","valid","TLDsearch","TLDsearchList","includes","findIndex","ref","validatePhoneNumber","rerunConnextEntitlements","rerunOnlyIfSilent","GetOptions","Silentmode","Run","getContentId","_ref21","_callee19","contentId","_args19","_context19","getSection","_ref22","_callee20","obtainSection","_args20","_context20","_init","_setupSophiDecision","_rerunConnextIfIsSilent","_makeSophiCall","SophiBase","_window$sophi_config","_window$sophi_config2","simpleHostname","loc","sophi_config","sophiHostname","reRunConnextCounter","onDeviceEnabled","sophiOnDevice","sdkEnabled","enableSDK","_callee","_context","setupSophiDecision","makeSophiCall","_callee3","_this","_context3","_callee2","_window$sophi","onError","_experiments$","experiments","entitlements","sophiGroup","_context2","rerunConnextIfIsSilent","sophi","abTests","getAllExperiments","visitorType","isEntitled","sophiUserType","localStorage","getItem","assignedGroup","sophi_type","sophi_cookie_val","sophiCookie","section","t0","_callee4","_context4","runConnextIfSilentTimer","sophiAPITime","sophiCallStartTime","trace","sophi_time","sophi_response","sophiWallConfig","_callee5","_this2","_context5","_window$sophi_config3","sdk","paywall","init","timer","sophiGetDesicionTimer","parseInt","getDecision","visitor","handleSophiResponse","sophi_err_msg","_getPrototypeOf","_get","property","receiver","Reflect","base","object","getOwnPropertyDescriptor","_setPrototypeOf","_possibleConstructorReturn","ReferenceError","_createSuper","Derived","hasNativeReflectConstruct","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","NewTarget","Sophi","_SophiBase","_listenForEventForDemeter","_handleServerSidePaywall","subClass","superClass","_inherits","_super","demeter","logLevel","enableSophiSSPW","handleServerSidePaywall","listenForEventForDemeter","_ref","pageTypeCheck","article","_e$detail","_e$detail$EventData","_e$detail$EventData$n","wallType","EventData","decision","outcome","sophiDecision","_ref2","find","item","wall_decision","decision_source","getElementById"],"sourceRoot":"webpack://"}