{"version":3,"names":["$","Drupal","campusCodes","piiFields","getFriendlyFormName","formId","startsWith","behaviors","ajaxCompleteSubmission","attach","context","settings","fn","concordeAjaxCompleteSubmission","data","formName","sessionStorage","getItem","program","campus","zip","window","dataLayer","push","event","console","log","multistepFieldTracking","setTimeout","on","e","this","closest","attr","length","fieldName","fieldValue","val","start","indexOf","end","substring","includes","setItem","pageFormStarted","initializeDataLayer","once","each","$form","multistep","params","URLSearchParams","location","search","hasClass","has","form_name","formDataLayer","form","find","rawCampus","initializeDlBehavior","click","menuType","menuItemName","text","chat_action","listName","listItem","pagesense","onDocDataLayerReady","jQuery"],"sources":["../../src/js/data-layer.init.js"],"sourcesContent":["(function ($, Drupal) {\n\n 'use strict';\n // Campus Codes\n const campusCodes = {\n '1': 'COAUR-1',\n '2': 'TXDAL-2',\n '3': 'CAGGV-3',\n '4': 'TXGRP-4',\n '5': 'MOMKC-5',\n '6': 'TNMEM-6',\n '7': 'CANHY-7',\n '8': 'ORPDX-8',\n '9': 'TXSAN-9',\n '10': 'CASBN-10',\n '11': 'CASAN-11',\n '12': 'MSHVN-12',\n '13': 'FLJAX-13',\n '14': 'FLMIR-14',\n '15': 'FLORL-15',\n '16': 'FLTPA-16',\n '17': 'ONLIN-17'\n };\n\n // PII Fields to exclude from GA\n const piiFields = ['firstname', 'lastname', 'email', 'dayphone', 'edit-firstname', 'edit-lastname', 'edit-email', 'edit-dayphone', 'name', 'your_title', 'your_phone', 'your_phone_number', 'ext', 'your_company', 'department', 'address', 'city', 'state'];\n\n // Form Names\n function getFriendlyFormName(formId) {\n if (formId.startsWith('webform-submission-enterprise-form-node')) {\n return 'Enterprise Form';\n } else if (formId.startsWith('webform-submission-enterprise-form-multi-steps-v3')) {\n return 'Enterprise Form - Multistep';}\n else if (formId.startsWith('webform-submission-enterprise-form-multi-steps')) {\n return 'Apply Form';\n } else if (formId.startsWith('webform-submission-schedule-tour')) {\n return 'Schedule Tour Form';\n } else if (formId.startsWith('webform-submission-virtual-info-session')) {\n return 'Virtual Info Session Form';\n } else if (formId.startsWith('webform-submission-partners-day-event')) {\n return 'Event Form';\n } else if (formId.startsWith('webform-submission-open-house-form')) {\n return 'Open House Form';\n } else if (formId.startsWith('webform-submission-personality-assessment-7')) {\n return 'Personality Assessment Form';\n } else {\n if(formId.startsWith('webform-submission-enterprise-form')) {\n return 'Enterprise Form';\n } else {\n return formId;\n }\n }\n }\n\n Drupal.behaviors.ajaxCompleteSubmission = {\n attach: function(context, settings) {\n $.fn.concordeAjaxCompleteSubmission = function(data) {\n var formName = sessionStorage.getItem('concorde_form_current');\n var program = sessionStorage.getItem('concorde_form_program');\n var campus = sessionStorage.getItem('concorde_form_campus');\n var zip = sessionStorage.getItem('concorde_form_zip');\n window.dataLayer.push({\n 'event': 'ce_formSubmit',\n 'formName': formName,\n 'program': program,\n 'campus': campus,\n 'zip': zip\n });\n console.log('EVENT: ajax ce_formSubmit');\n // console.log('formName: ' + formName);\n // console.log('program: ' + program);\n // console.log('campus: ' + campus);\n // console.log('zip: ' + zip);\n };\n }\n };\n\n Drupal.behaviors.multistepFieldTracking = {\n attach: function (context, settings) {\n setTimeout(function() {\n $('div[id^=\"edit-step-2\"] input:not([type=\"submit\"]), div[id^=\"edit-step-2\"] select', context).on('change', function(e) {\n var form = $(this).closest('form');\n var formId = $(this).closest('form').attr('id');\n var formName = sessionStorage.getItem('concorde_form_current');\n\n if ($('div[id^=\"edit-step-2\"]').closest('.js-modal-window').length) {\n formName += ' (Modal)';\n }\n\n var fieldName = $(this).attr('name');\n var fieldValue = $(this).val();\n var start = fieldName.indexOf('[');\n var end = fieldName.indexOf(']');\n if (start !== -1 && end !== -1) {\n fieldName = fieldName.substring(start + 1, end);\n }\n if (fieldName === 'LocationID') { fieldName = 'campus'; }\n if (fieldName === 'campus') { fieldValue = campusCodes[fieldValue] || fieldValue; }\n\n if(!piiFields.includes(fieldName) && fieldValue !== '') {\n // dataLayer.push({\n // 'event': 'ce_formField',\n // 'fieldName': fieldName,\n // 'formName': formName,\n // 'fieldValue': fieldValue\n // });\n // console.log('EVENT: ce_formField multistep');\n // console.log('formName: ' + formName);\n // console.log('fieldname: ' + fieldName);\n // console.log('fieldValue: ' + fieldValue);\n if (fieldName === 'zip') {\n sessionStorage.setItem('concorde_form_zip', fieldValue);\n }\n if (fieldName === 'campus') {\n sessionStorage.setItem('concorde_form_campus', fieldValue);\n }\n if (fieldName === 'program') {\n sessionStorage.setItem('concorde_form_program', fieldValue);\n }\n }\n });\n }, 1000);\n }\n };\n\n var pageFormStarted = false;\n\n Drupal.behaviors.initializeDataLayer = {\n attach: function (context) {\n $(once('initializeDataLayerBehavior', 'form.webform-submission-form', context)).each(function() {\n var $form = $(this);\n var formId = $form.attr('id');\n var formName = getFriendlyFormName(formId);\n var multistep = false;\n var params = new URLSearchParams(window.location.search);\n if ($form.hasClass('multistep-form')) {\n multistep = true;\n }\nconsole.log(multistep);\n\n $form.on('focus', 'input, select', function(e) {\n if (!pageFormStarted) {\n if ($form.closest('.js-modal-window').length) {\n formName += ' (Modal)';\n }\n\n if (params.has('page') && multistep) {\n return;\n }\n\n dataLayer.push({\n 'event': 'webform_start',\n 'form_name': formName\n });\n\n // console.log('form start fired (data layer push disabled)');\n\n sessionStorage.setItem('concorde_form_current', formName);\n sessionStorage.setItem('concorde_form_zip', '');\n sessionStorage.setItem('concorde_form_campus', '');\n sessionStorage.setItem('concorde_form_program', '');\n\n pageFormStarted = true;\n sessionStorage.setItem('page_form_started', 'true');\n\n\n }\n });\n });\n }\n };\n\n Drupal.behaviors.formDataLayer = {\n attach: function (context, settings) {\n\n setTimeout(function() {\n $('form.webform-submission-form input, form.webform-submission-form select', context).on('change', function(e) {\n var form = $(this).closest('form');\n var formId = $(this).closest('form').attr('id');\n var formName = getFriendlyFormName(formId);\n if (form.closest('.js-modal-window').length) {\n formName += ' (Modal)';\n }\n var fieldName = $(this).attr('name');\n var fieldValue = $(this).val();\n var start = fieldName.indexOf('[');\n var end = fieldName.indexOf(']');\n if (start !== -1 && end !== -1) {\n fieldName = fieldName.substring(start + 1, end);\n }\n if (fieldName === 'LocationID') { fieldName = 'campus'; }\n if (fieldName === 'campus') { fieldValue = campusCodes[fieldValue] || fieldValue; }\n var multistep = false;\n var params = new URLSearchParams(window.location.search);\n\n\n if(!piiFields.includes(fieldName) && fieldValue !== '') {\n dataLayer.push({\n 'event': 'ce_formField',\n 'fieldName': fieldName,\n 'formName': formName,\n 'fieldValue': fieldValue\n });\n\n // console.log('EVENT: ce_formField standard');\n // console.log('formName: ' + formName);\n // console.log('fieldname: ' + fieldName);\n // console.log('fieldValue: ' + fieldValue);\n\n if (fieldName === 'zip') {\n sessionStorage.setItem('concorde_form_zip', fieldValue);\n }\n if (fieldName === 'campus') {\n sessionStorage.setItem('concorde_form_campus', fieldValue);\n }\n if (fieldName === 'program') {\n sessionStorage.setItem('concorde_form_program', fieldValue);\n }\n }\n });\n }, 1000);\n\n $(once('initializeFormSubmitDataLayerBehavior', 'form.webform-submission-form', context)).each(function() {\n const form = $(this);\n form.on('submit', function(e) {\n if (form.data('formSubmitted')) {\n // e.preventDefault();\n // return;\n // console.log('form already submitted');\n }\n\n form.data('formSubmitted', true);\n\n let formId = form.attr('id');\n let formName = getFriendlyFormName(formId);\n\n if (form.closest('.js-modal-window').length) {\n formName += ' (Modal)';\n }\n\n let program = form.find('.concorde_webform_campus_area_program_program').val();\n let rawCampus = form.find('.concorde_webform_campus_area_program_campus').val();\n let campus = campusCodes[rawCampus] || rawCampus;\n let zip = form.find('.form-item-zip input').val();\n var multistep = false;\n var params = new URLSearchParams(window.location.search);\n if (form.hasClass('multistep-form')) {\n multistep = true;\n }\n\n if (!multistep) {\n dataLayer.push({\n 'event': 'ce_formSubmit',\n 'formName': formName,\n 'program': program,\n 'campus': campus,\n 'zip': zip\n });\n }\n\n // console.log('EVENT: ce_formSubmit normal');\n // console.log('formName: ' + formName);\n // console.log('program: ' + program);\n // console.log('campus: ' + campus);\n // console.log('zip: ' + zip);\n\n });\n });\n\n }\n };\n\n function onDocDataLayerReady(context) {\n\n const $elements = $(once('initializeDlBehaviors', 'body', context));\n $elements.each(function() {\n\n // Primary navigation\n $('#primary-nav ul.navbar-nav a').click(function (e) {\n dataLayer.push({\n 'event': 'ce_navigationClick', 'menuType': 'header', 'menuItemName': $(this).text() });\n });\n\n // Footer navigation\n $('#footer_links a').click(function (e) {\n dataLayer.push({\n 'event': 'ce_navigationClick', 'menuType': 'footer', 'menuItemName': $(this).text() });\n });\n\n // Breadcrumb navigation\n $('ol.breadcrumb a').click(function (e) {\n dataLayer.push({\n 'event': 'ce_navigationClick', 'menuType': 'breadcrumb', 'menuItemName': $(this).text() });\n });\n\n // Secondary Nav\n $('#secondary-nav a').click(function (e) {\n dataLayer.push({\n 'event': 'ce_navigationClick', 'menuType': 'sticky nav', 'menuItemName': $(this).text() });\n });\n\n // Chat\n $('body').on('click', '.chat-now-btn', function(e) {\n dataLayer.push({\n 'event': 'chat_interact', 'chat_action': 'chat open' });\n // console.log('chat open');\n });\n\n //Accordion\n $('.acc-item').click(function (e) {\n window.dataLayer.push({\n 'event': 'ce_expandList',\n 'listName': $(this).closest('[data-list-name]').data(\"list-name\"),\n 'listItem': $(this).data(\"list-item\")\n });\n });\n\n // Chat close\n $('body').on('click', '#chatbot-close-button, div.jetsense-chatbot-minimize', function(e) {\n dataLayer.push({\n 'event': 'chat_interact', 'chat_action': 'chat terminated' });\n // console.log('chat terminated');\n });\n\n // Home hero CTA\n $('.path-frontpage #hero a.btn').click(function (e) {\n window.pagesense = window.pagesense || [];\n window.pagesense.push(['trackEvent', 'hero_cta_click']);\n });\n\n\n });\n }\n\n Drupal.behaviors.initializeDlBehavior = {\n attach: function (context) {\n onDocDataLayerReady(context);\n }\n };\n\n})(jQuery, Drupal);\n"],"mappings":"0BAAA,SAAWA,EAAGC,GAIZ,MAAMC,EAAc,CAClB,EAAK,UACL,EAAK,UACL,EAAK,UACL,EAAK,UACL,EAAK,UACL,EAAK,UACL,EAAK,UACL,EAAK,UACL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