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OlF,KAAK9B,aAAayE,IAxLT,mCAyLlB,EAKA,SAAIwC,GACF,OAAOnF,KAAK9B,aAAayE,IAAImB,IAAc,CAAC,CAC9C,EAKA,SAAIqB,CAAMA,GACRnF,KAAK9B,aAAamF,IAAIS,EAAWqB,EACnC,EAKA,QAAIC,GACF,OAAOpF,KAAK9B,aAAayE,IAAIoB,IAAa,CAAC,CAC7C,EAKA,QAAIqB,CAAKA,GACPpF,KAAK9B,aAAamF,IAAIU,EAAUqB,EAClC,EAKA,gBAAIC,GACF,OAAOrF,KAAK9B,aAAayE,IAAIqB,EAC/B,EAKA,gBAAIqB,CAAaA,GACfrF,KAAK9B,aAAamF,IAAIW,EAAmBqB,EAC3C,EAEJ,C","sources":["webpack://stdcheck-exposed-wp-theme/./themes/stdcheck-exposed/src/js/coupon.js","webpack://stdcheck-exposed-wp-theme/./themes/stdcheck-exposed/src/js/std.js","webpack://stdcheck-exposed-wp-theme/./themes/stdcheck-exposed/src/js/services/queryParamService.js","webpack://stdcheck-exposed-wp-theme/./themes/stdcheck-exposed/src/js/services/storage.js"],"sourcesContent":["import { StorageService } from './services/storage';\nimport { QueryParamService } from './services/queryParamService';\n\n/**\n * JS component for actions in the coupon\n */\nexport function Coupon() {\n const storageService = new StorageService();\n const queryParamService = new QueryParamService();\n\n /**\n * Initialize the component.\n */\n function init() {\n validateCoupon();\n }\n\n /**\n * Send a request to STDcheck API to validate the url or local storage coupon code.\n */\n function validateCoupon() {\n const couponCode = queryParamService.getQueryParam('coupon') || storageService.coupon?.coupon_code;\n if (!couponCode) {\n return;\n }\n\n return fetch(`${process.env.API_URL}/coupon/${couponCode}`)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n if (data.deleted_at) {\n displayInvalidCouponWidget(data);\n\n return;\n }\n\n displayCouponWidget(data);\n })\n .catch(function () {\n storageService.coupon = null;\n });\n }\n\n /**\n * If the coupon has a name (to be displayed in the widget), create an element from\n * coupon_selected_widget template and append it to the DOM.\n *\n * @param { Coupon } coupon\n */\n function displayCouponWidget(coupon) {\n if (!coupon.coupon_name) {\n return;\n }\n\n document.getElementById('header-bar').replaceWith(createElementFromHTML(tmpl('coupon_selected_widget', coupon)));\n modifyHeaderLayout();\n storageService.coupon = {\n coupon_code: coupon.coupon_code,\n coupon_name: coupon.coupon_name,\n coupon_type: coupon.coupon_type,\n };\n }\n\n /**\n * Display invalid coupon widget when it is expired\n *\n * @param data\n */\n function displayInvalidCouponWidget(coupon) {\n document.getElementById('header-bar').replaceWith(createElementFromHTML(tmpl('coupon_invalid_widget', coupon)));\n modifyHeaderLayout();\n storageService.coupon = null;\n }\n\n /**\n * Modify the header layout by moving the My Account button and phone number to the header when a coupon is applied.\n */\n function modifyHeaderLayout() {\n document.querySelector('.header').classList.add('coupon-applied-header');\n document.getElementById('header-cta-button').classList.add('hide');\n document\n .querySelector('.header__menu ul')\n .appendChild(createElementFromHTML(tmpl('coupon_applied_header_buttons', {})));\n document\n .querySelectorAll('.coupon-applied-menu-buttons .animated-button-element')\n .forEach((button) => button.addEventListener('click', () => (window.location.href = button.dataset.href)));\n }\n\n return {\n init,\n };\n}\n","import { StorageService } from './services/storage';\nimport { Coupon } from './coupon';\n\n('use strict');\n\n$(document).ready(function () {\n storeAccountToken();\n const coupon = new Coupon();\n coupon.init();\n});\n\n/**\n * Store the account token.\n */\nfunction storeAccountToken() {\n const storageService = new StorageService();\n getCookie('account_token')\n .then(function (token) {\n storageService.token = { token: token };\n })\n .catch(function () {\n storageService.localStorage.remove('ngStorage-token');\n });\n}\n\n/**\n * Get a cookies value by its name.\n *\n * @param name name of the cookies value to get.\n * @returns {Promise<string>}\n */\nfunction getCookie(name) {\n return new Promise(function (resolve, reject) {\n if (\n !document.cookie.split('; ').some(function (cookieKeyValue) {\n const cookieKeyValueParts = cookieKeyValue.split('=');\n if (cookieKeyValueParts[0] === name) {\n resolve(cookieKeyValueParts[1]);\n return true;\n }\n\n return false;\n })\n ) {\n reject();\n }\n });\n}\n\n/**\n * Creates a HTML element from the string passed.\n * @param {string} htmlString Containing the string to be parsed into an html element.\n * @return {ChildNode} Returns the converted string as HTML\n */\nfunction createElementFromHTML(htmlString) {\n var div = document.createElement('div');\n div.innerHTML = htmlString.trim();\n\n // Change this to div.childNodes to support multiple top-level nodes\n return div.firstChild;\n}\n\nwindow.createElementFromHTML = createElementFromHTML;\n\n/**\n * This function will work as our javascript \"templating\" engine function.\n */\n(function () {\n 'use strict';\n var cache = {};\n\n window.tmpl = function tmpl(str, data) {\n // Figure out if we're getting a template, or if we need to\n // load the template - and be sure to cache the result.\n var fn = !/\\W/.test(str)\n ? (cache[str] = cache[str] || tmpl(document.getElementById(str).innerHTML))\n : // Generate a reusable function that will serve as a template\n // generator (and which will be cached).\n new Function(\n 'obj',\n 'var p=[],print=function(){p.push.apply(p,arguments);};' +\n // Introduce the data as local variables using with(){}\n \"with(obj){p.push('\" +\n // Convert the template into pure JavaScript\n str\n .replace(/[\\r\\t\\n]/g, ' ')\n .split('<%')\n .join('\\t')\n .replace(/((^|%>)[^\\t]*)'/g, '$1\\r')\n .replace(/\\t=(.*?)%>/g, \"',$1,'\")\n .split('\\t')\n .join(\"');\")\n .split('%>')\n .join(\"p.push('\")\n .split('\\r')\n .join(\"\\\\'\") +\n \"');}return p.join('');\"\n );\n\n // Provide some basic currying to the user\n return data ? fn(data) : fn;\n };\n})();\n\n/**\n * add events that should happen after document is ready.\n */\n(function () {\n 'use strict';\n\n let menuInput, menuInputContainer, findaLabMenuSubmitButton, storageService;\n\n $(document).ready(function () {\n storageService = new StorageService();\n // add lab hours button click events.\n $('body').delegate('[data-std-hours-link]', 'click', toggleHours);\n\n initFindALabMenuInput();\n });\n\n /**\n * Initializes the find a lab functionality in the menu.\n */\n function initFindALabMenuInput() {\n findaLabMenuSubmitButton = $('#menu-findNearLabSubmit');\n menuInput = $('#menu-findalab-zipcode');\n menuInputContainer = menuInput.parents('ul.submenu');\n\n [menuInput, findaLabMenuSubmitButton].forEach(function (element) {\n element.focus(function () {\n menuInputContainer.addClass('std-findalab-menu-show-dropdown-container');\n });\n element.blur(function (e) {\n if (\n e.relatedTarget === null ||\n (!$(e.relatedTarget).is(findaLabMenuSubmitButton) && !$(e.relatedTarget).is(menuInput))\n ) {\n menuInputContainer.removeClass('std-findalab-menu-show-dropdown-container');\n }\n });\n });\n\n $('#menu-findalab-form').on('submit', searchForLab);\n }\n\n /**\n * Redirects to the find a lab map with the entered zip code.\n */\n function searchForLab(e) {\n e.preventDefault();\n menuInputContainer.addClass('std-findalab-menu-show-dropdown-container');\n const zipCode = menuInput.val();\n if (!validateZipCode(zipCode)) {\n return;\n }\n\n storageService.zipCode = zipCode;\n document.location.href = findaLabMenuSubmitButton.data('findalab-url');\n }\n\n /**\n * Validates the find a lab zip code or displays an invalid zip code message when the zip is invalid.\n *\n * @param zipCode string the zip code to validate.\n */\n function validateZipCode(zipCode) {\n let valid = /^[0-9]{5}(?:-[0-9]{4})?$/.test(zipCode.replace(/\\s+$/g, ''));\n\n if (valid) {\n $('.menu-invalid-zip-code').addClass('is-hidden');\n } else {\n $('.menu-invalid-zip-code').removeClass('is-hidden');\n }\n\n return valid;\n }\n\n /**\n * Toggle the Hours of the lab location\n * @param {event} event The observable event\n */\n function toggleHours(event) {\n event.preventDefault();\n var $table = $(this).siblings('[data-std-hours-table]');\n $(this).text($table.is(':visible') ? 'Show Hours ▼' : 'Hide Hours ▲');\n $table.slideToggle(300);\n }\n})();\n\n(function () {\n $(document).ready(function () {\n $('.wistia_mousedown').click(function (event) {\n event.preventDefault();\n var videoId = $(this).data('id');\n loadScript('https://fast.wistia.com/assets/external/E-v1.js')\n .then(function () {\n showOverlayLoading();\n startVideo(videoId);\n })\n .catch(function () {\n console.error('Wistia javascript file not loaded.');\n });\n });\n });\n\n /**\n * Loads a JavaScript file and returns a Promise for when it is loaded\n */\n function loadScript(src) {\n return new Promise(function (resolve, reject) {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.crossOrigin = 'anonymous';\n script.onload = resolve;\n script.onerror = reject;\n script.src = src;\n document.head.appendChild(script);\n });\n }\n\n /**\n * Adds an overlay loading scene.\n */\n function showOverlayLoading() {\n var loading = document.createElement('div');\n loading.id = 'loading_popover_overlay';\n loading.className = 'wistia_popover_loading';\n loading.innerHTML = '<i class=\"fa fa-spinner fa-pulse\"></i>';\n document.body.appendChild(loading);\n }\n\n /**\n * Removes the overlay loading.\n */\n function hideOverlayLoading() {\n var loading = document.getElementById('loading_popover_overlay');\n if (!('remove' in Element.prototype)) {\n // IE 11\n loading.parentNode.removeChild(loading);\n } else {\n loading.remove();\n }\n }\n\n /**\n * Wait until wistia become available and plays video.\n */\n function startVideo(videoId) {\n setTimeout(function () {\n window._wq = window._wq || [];\n _wq.push({\n id: videoId,\n onReady: function (video) {\n video.play();\n hideOverlayLoading();\n },\n });\n }, 200);\n }\n})();\n","import { StorageService } from './storage';\n\n/**\n * Service class for query param.\n */\nexport function QueryParamService() {\n const storageService = new StorageService();\n\n /**\n * Handle the provided query param by determining if it is present and stores it in localstorage if available\n *\n * @param {string} queryParam The query param to be retrieved from URL\n * @param {string} attributeName The attribute name\n */\n function saveQueryParam(queryParam, attributeName) {\n let attributeValue = null;\n\n if (!(attributeValue = getQueryParam(queryParam))) {\n return;\n }\n\n // Store param in the local storage\n storageService.localStorage.set('ngStorage-' + attributeName, attributeValue);\n }\n\n /**\n * Returns a given query param retrieved from the URL\n *\n * @param {string} param Param name to be retrieved from the URL\n *\n * @returns {string} Returns the value from the URL. NULL if param not exists\n */\n function getQueryParam(param) {\n try {\n const url = new URL(window.location.href);\n return url.searchParams.get(param);\n } catch (error) {\n console.error(error);\n return getParameterByNameUsingRegex(param);\n }\n }\n\n /**\n * Gets the value of a query parameter from the current url using a regular expression\n *\n * @param {string} param Param name to be retrieved from the URL\n *\n * @returns {string|null} Query param value from the url, null if doesn't exist\n */\n function getParameterByNameUsingRegex(param) {\n param = param.replace(/[\\[\\]]/g, '\\\\$&');\n const regex = new RegExp('[?&]' + param + '(=([^&#]*)|&|#|$)');\n const results = regex.exec(window.location.href);\n if (!results) {\n return null;\n }\n\n if (!results[2]) {\n return '';\n }\n\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n }\n\n return {\n saveQueryParam,\n getQueryParam,\n getParameterByNameUsingRegex,\n };\n}\n","/**\n * Service class for accessing localStorage.\n */\nexport function StorageService() {\n /**\n * Keys used to reference data in localStorage\n */\n const CJ_EVENT_KEY = 'ngStorage-cjevent';\n const COUPON_KEY = 'ngStorage-coupon';\n const FEE_KEY = 'ngStorage-fee';\n const LAB_KEY = 'ngStorage-center';\n const REORDER_KEY = 'ngStorage-reorder';\n const TESTS_KEY = 'ngStorage-tests';\n const TOKEN_KEY = 'ngStorage-token';\n const ZIPCODE_KEY = 'ngStorage-zip_code';\n const IN_HOME_KEY = 'ngStorage-in-home-booking-result';\n const EMAIL_KEY = 'ngStorage-email';\n const FREE_KEY = 'ngStorage-free';\n const TRANSACTION_ID_KEY = 'transaction_id';\n const BETTER_LAB = 'ngStorage-betterlab';\n const IHC_PROVIDERS_KEY = 'ngStorage-ihc-providers';\n\n /**\n * Retrieves a value stored as JSON in localStorage\n *\n * @param {string} key the key to retrieve from storage\n *\n * @return {any} The value stored in localStorage\n */\n function getLocalStorage(key) {\n return JSON.parse(window.localStorage?.getItem(key) || null);\n }\n\n /**\n * Saves a value in localStorage as a JSON string\n *\n * @param {string} key The key to store the value in\n * @param {any} value The value to be stored\n *\n * @return {void}\n */\n function setLocalStorage(key, value) {\n window.localStorage?.setItem(key, JSON.stringify(value || null));\n }\n\n /**\n * Deletes a value from the storage.\n *\n * @param key {string} The value's key.\n *\n * @return void\n */\n function removeLocalStorage(key) {\n window.localStorage?.removeItem(key);\n }\n\n // Initialize tests in localStorage\n if (!getLocalStorage(TESTS_KEY)) {\n setLocalStorage(TESTS_KEY, []);\n }\n\n return {\n /**\n * Local Storage get, set and remove\n */\n localStorage: {\n get: getLocalStorage,\n set: setLocalStorage,\n remove: removeLocalStorage,\n },\n\n /**\n * Removes any reorder information from local storage\n */\n removeReorderInformation: function () {\n window.localStorage?.removeItem(REORDER_KEY);\n },\n\n /**\n * Removes previous order information from local storage\n */\n removePreviousOrderInformation: function () {\n window.localStorage?.removeItem(TRANSACTION_ID_KEY);\n window.localStorage?.removeItem(BETTER_LAB);\n },\n\n /**\n * Retrieve coupon data from local storage\n */\n get coupon() {\n return this.localStorage.get(COUPON_KEY) ?? {};\n },\n\n /**\n * Store coupon data in local storage\n */\n set coupon(coupon) {\n this.localStorage.set(COUPON_KEY, coupon);\n },\n\n /**\n * Retrieve fee data from localStorage\n */\n get fee() {\n return this.localStorage.get(FEE_KEY);\n },\n\n /**\n * Store fee data in localStorage\n */\n set fee(fee) {\n this.localStorage.set(FEE_KEY, fee);\n },\n\n /**\n * Retrieve lab data from local storage\n */\n get lab() {\n return this.localStorage.get(LAB_KEY) ?? {};\n },\n\n /**\n * Store lab data in local storage\n */\n set lab(lab) {\n this.localStorage.set(LAB_KEY, lab);\n },\n\n /**\n * Retrieve psc data from local storage\n */\n get psc() {\n return this.lab;\n },\n\n /**\n * Store psc data in local storage\n */\n set psc(psc) {\n this.lab = psc;\n },\n\n /**\n * Retrieve selected tests data from local storage\n */\n get tests() {\n return this.localStorage.get(TESTS_KEY) ?? [];\n },\n\n /**\n * Store selected tests data in local storage\n */\n set tests(tests) {\n this.localStorage.set(TESTS_KEY, tests);\n },\n\n /**\n * Retrieve token data from localStorage\n */\n get token() {\n return this.localStorage.get(TOKEN_KEY);\n },\n\n /**\n * Store token data in localStorage\n */\n set token(token) {\n this.localStorage.set(TOKEN_KEY, token);\n },\n\n /**\n * Retrieve CJ Affiliate data from localStorage\n */\n get cjevent() {\n return this.localStorage.get(CJ_EVENT_KEY);\n },\n\n /**\n * Store CJ Affiliate data in localStorage\n */\n set cjevent(cjevent) {\n this.localStorage.set(CJ_EVENT_KEY, cjevent);\n },\n\n /**\n * Retrieve zip code data from localStorage\n */\n get zipCode() {\n return this.localStorage.get(ZIPCODE_KEY);\n },\n\n /**\n * Store zip code data in localStorage\n */\n set zipCode(zipCode) {\n this.localStorage.set(ZIPCODE_KEY, zipCode);\n },\n\n get inHomeResult() {\n return this.localStorage.get(IN_HOME_KEY);\n },\n\n /**\n * Retrieve email data from local storage\n */\n get email() {\n return this.localStorage.get(EMAIL_KEY) ?? {};\n },\n\n /**\n * Store email data in local storage\n */\n set email(email) {\n this.localStorage.set(EMAIL_KEY, email);\n },\n\n /**\n * Retrieve free order data from local storage\n */\n get free() {\n return this.localStorage.get(FREE_KEY) ?? {};\n },\n\n /**\n * Store free order data in local storage\n */\n set free(free) {\n this.localStorage.set(FREE_KEY, free);\n },\n\n /**\n * Retrieve In-Home Collection provider IDs from local storage\n */\n get ihcProviders() {\n return this.localStorage.get(IHC_PROVIDERS_KEY);\n },\n\n /**\n * Store In-Home Collection provider IDs in local storage\n */\n set ihcProviders(ihcProviders) {\n this.localStorage.set(IHC_PROVIDERS_KEY, ihcProviders);\n },\n };\n}\n"],"names":["Coupon","storageService","queryParamService","modifyHeaderLayout","document","querySelector","classList","add","getElementById","appendChild","createElementFromHTML","tmpl","querySelectorAll","forEach","button","addEventListener","window","location","href","dataset","init","couponCode","getQueryParam","coupon","coupon_code","fetch","then","response","json","data","deleted_at","replaceWith","coupon_name","coupon_type","displayCouponWidget","catch","validateCoupon","cache","$","ready","Promise","resolve","reject","cookie","split","some","cookieKeyValue","cookieKeyValueParts","token","localStorage","remove","storeAccountToken","htmlString","div","createElement","innerHTML","trim","firstChild","str","fn","test","Function","replace","join","menuInput","menuInputContainer","findaLabMenuSubmitButton","searchForLab","e","preventDefault","addClass","zipCode","val","valid","removeClass","validateZipCode","toggleHours","event","$table","this","siblings","text","is","slideToggle","delegate","parents","element","focus","blur","relatedTarget","on","click","videoId","script","type","crossOrigin","onload","onerror","src","head","loading","id","className","body","setTimeout","_wq","push","onReady","video","play","Element","prototype","parentNode","removeChild","hideOverlayLoading","startVideo","console","error","QueryParamService","param","URL","searchParams","get","getParameterByNameUsingRegex","results","RegExp","exec","decodeURIComponent","saveQueryParam","queryParam","attributeName","attributeValue","set","StorageService","CJ_EVENT_KEY","COUPON_KEY","FEE_KEY","LAB_KEY","TESTS_KEY","TOKEN_KEY","ZIPCODE_KEY","EMAIL_KEY","FREE_KEY","IHC_PROVIDERS_KEY","getLocalStorage","key","JSON","parse","getItem","setLocalStorage","value","setItem","stringify","removeItem","removeReorderInformation","removePreviousOrderInformation","fee","lab","psc","tests","cjevent","inHomeResult","email","free","ihcProviders"],"sourceRoot":""}