{"version":3,"file":"bootstrap.js","names":["AudienceSessionRestoreDetection","initDefault","SessionLoggedOutDetection","Navigation","selectorTrigger","document","getElementById","audienceMismatchChangeButton","selectorTriggers","trigger","addEventListener","showSelector","$","each","key","element","val","setAudienceSelectorData","e","target","currentTarget","setTimeout","classList","contains","querySelector","setAttribute","href","dataset","moduleid","preventDefault","on","toggleClass","closest","hasClass","removeClass","text","addClass"],"sources":["utils/bootstrap.js"],"sourcesContent":["import $ from 'jquery';\r\nimport \"utils/mtiFontTrackingCode\";\r\nimport { Navigation } from \"../components/Navigation\";\r\nimport { AudienceSessionRestoreDetection } from \"../components/AudienceSessionRestoreDetection\";\r\nimport { show as showSelector } from \"../components/AudienceSelector\";\r\nimport { SessionLoggedOutDetection } from \"../components/SessionLoggedOutDetection\";\r\n\r\n\r\n//Audience selector restoration detection\r\nAudienceSessionRestoreDetection.initDefault();\r\n\r\n//Session logged out detection\r\nSessionLoggedOutDetection.initDefault();\r\n\r\n//Startup navigation\r\nNavigation.initDefault();\r\n\r\n\r\n//Show audience selector from audince banner click\r\nconst selectorTrigger = document.getElementById('arChangeAudience');\r\nconst audienceMismatchChangeButton = document.getElementById('arAudienceMismatchChangeButton');\r\n\r\nvar selectorTriggers = [selectorTrigger, audienceMismatchChangeButton];\r\n\r\nfor (var trigger in selectorTriggers) {\r\n if (selectorTriggers[trigger]) {\r\n selectorTriggers[trigger].addEventListener('click', () => {\r\n showSelector();\r\n });\r\n }\r\n}\r\n\r\n//Clear default value for input with autocomplete-off\r\n$('[autocomplete=off]').each(function (key, element){\r\n $(element).val('');\r\n});\r\n\r\n\r\nconst setAudienceSelectorData = (e) => {\r\n showSelector();\r\n let target = e.currentTarget;\r\n\r\n //Could probably set the audience selector to return a promise after 'opening'\r\n //I'll do it later maybe\r\n setTimeout(() => {\r\n if (target.classList.contains('ar-audience-enforced-link')) {\r\n document.querySelector('#targetUrl').setAttribute('value', target.href);\r\n } else {\r\n document.querySelector('#moduleId').setAttribute('value', target.dataset.moduleid);\r\n }\r\n }, 200);\r\n\r\n e.preventDefault();\r\n}\r\n\r\n$('body').on('click', '.ar-hybrid-link[data-moduleid], .ar-audience-enforced-link', setAudienceSelectorData);\r\n\r\n$(document).on(\"click\", \".choose-account-type\", function() {\r\n $(\".ar-account-list-type\").toggleClass(\"show\");\r\n});\r\n\r\n$(document).on(\"click\", \".show-more-rte-btn\", function() {\r\n if($(this).closest('.show-more-rte-less').hasClass(\"hide-rte\")) {\r\n $(this).closest('.show-more-rte-less').removeClass(\"hide-rte\");\r\n $(this).text(\"Show less\");\r\n } else {\r\n $(this).closest('.show-more-rte-less').addClass(\"hide-rte\");\r\n $(this).text(\"Show more\");\r\n }\r\n});"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAAoF;AAGpF;AACAA,gEAA+B,CAACC,WAAW,EAAE;;AAE7C;AACAC,oDAAyB,CAACD,WAAW,EAAE;;AAEvC;AACAE,sBAAU,CAACF,WAAW,EAAE;;AAGxB;AACA,IAAMG,eAAe,GAAGC,QAAQ,CAACC,cAAc,CAAC,kBAAkB,CAAC;AACnE,IAAMC,4BAA4B,GAAGF,QAAQ,CAACC,cAAc,CAAC,gCAAgC,CAAC;AAE9F,IAAIE,gBAAgB,GAAG,CAACJ,eAAe,EAAEG,4BAA4B,CAAC;AAEtE,KAAK,IAAIE,OAAO,IAAID,gBAAgB,EAAE;EAClC,IAAIA,gBAAgB,CAACC,OAAO,CAAC,EAAE;IAC3BD,gBAAgB,CAACC,OAAO,CAAC,CAACC,gBAAgB,CAAC,OAAO,EAAE,YAAM;MACtD,IAAAC,sBAAY,GAAE;IAClB,CAAC,CAAC;EACN;AACJ;;AAEA;AACA,IAAAC,kBAAC,EAAC,oBAAoB,CAAC,CAACC,IAAI,CAAC,UAAUC,GAAG,EAAEC,OAAO,EAAC;EAChD,IAAAH,kBAAC,EAACG,OAAO,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC;AACtB,CAAC,CAAC;AAGF,IAAMC,uBAAuB,GA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