(()=>{var e={1390:e=>{e.exports={API_ROOT:window.wsum?window.wsum.api:"",GATED_MODAL_COOKIE:"__wsum-content",NOTICE_POPUP_COOKIE:"__wsum-notice",ADWALLET_BOT_COOKIE:"adwalletBot"}}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}(()=>{"use strict";var e=o(1390);const t=(e,t,o=!1)=>new Promise(((n,i)=>{if(window.sessionStorage.getItem(e)&&!o){const t=JSON.parse(window.sessionStorage.getItem(e));if(null===t.expire||t.expire>Date.now())return void n(t[e])}fetch(...t).then((async e=>{const t=await e.json();return{success:200===e.status,json:t}})).then((({success:t,json:o})=>{if(t){const t={[e]:o,expire:Date.now()+3e5};window.sessionStorage.setItem(e,JSON.stringify(t)),n(o)}else i(o)})).catch((e=>{i(e)}))})),n={async get(e,t={}){const o=await fetch(e,{credentials:"include",headers:{"Content-Type":"application/json"},...t}).then((e=>e.json())).catch((e=>({message:e})));return o.code&&(o.error=!0),o},async getCached(e,o,n=!1,i={}){const s=await t(e,[o,{credentials:"include",headers:{"Content-Type":"application/json"},...i}],n);return s.code&&(s.error=!0),s},async post(e,t={},o={}){const n=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},...o,body:JSON.stringify(t)}).then((e=>e.json())).catch((e=>({error:!0,message:e})));return n.code&&(n.error=!0),n}};class i{success(){this.isBookmarked=!this.isBookmarked,this.isBookmarked?(this.button.classList.add(this.options.bookmarkedClass),window.wsumBookmarks.add(this.postData),this.openPopUp()):(this.button.classList.remove(this.options.bookmarkedClass),window.wsumBookmarks.remove(this.postData))}removePopUp(){this.popUp&&(this.popUp.remove(),this.popUp=null)}closePopUp(){this.timeOut&&(clearTimeout(this.timeOut),this.timeOut=null),this.popUp&&(this.popUp.classList.remove("active"),setTimeout((()=>{this.removePopUp(),this.button.focus()}),200))}openPopUp(){this.removePopUp(),this.popUp=document.createElement("div"),this.popUp.className="wsum-modal wsum-modal--bookmark",this.popUp.innerHTML='\n      <div class="wsum-modal__dialog">\n        <div class="wsum-modal--bookmark__icon">\n          <i class="icon-bookmark"></i>\n        </div>\n        <h5 class="wsum-modal--bookmark__heading">\n          Bookmarked\n        </h5>\n        <p class="wsum-modal--bookmark__copy">\n          You can find bookmarked content in your account.\n        </p>\n      </div>\n    ',document.documentElement.appendChild(this.popUp),this.popUp.classList.add("active"),this.popUp.addEventListener("click",this.closePopUp),this.timeOut=setTimeout((()=>{this.closePopUp()}),4e3)}async bookmarkItem(t){t.preventDefault(),t.stopPropagation();const o=`${e.API_ROOT}/user-${this.isBookmarked?"remove":"add"}-bookmark`;this.button.setAttribute("disabled","disabled"),this.button.classList.add(this.options.fetchingClass);const i=await n.post(o,{id:Number(this.postID)}),{error:s}=i;s||this.success(),this.button.removeAttribute("disabled"),this.button.classList.remove(this.options.fetchingClass)}init(){this.postID?(this.isBookmarked=window.wsumBookmarks.has(Number(this.postID)),this.isBookmarked&&this.button.classList.add(this.options.bookmarkedClass),this.button.addEventListener("click",this.bookmarkItem),this.button.classList.remove(this.options.fetchingClass),this.button.removeAttribute("disabled")):this.button.classList.remove(this.options.fetchingClass)}destroy(){this.postID&&this.button.removeEventListener("click",this.bookmarkItem)}constructor(e,t={}){this.button=e,this.options={bookmarkedClass:"wsum-bookmark--bookmarked",fetchingClass:"wsum-bookmark--fetching",...t},this.postID=this.button.dataset.id,this.postData=JSON.parse(this.button.dataset.bookmark),this.isBookmarked=!1,this.bookmarkItem=this.bookmarkItem.bind(this),this.closePopUp=this.closePopUp.bind(this),this.timeOut=null,this.popUp=null,this.init()}}const s={init(){document.addEventListener("bookmarks-ready",(()=>{document.querySelectorAll(".wsum-bookmark").forEach((e=>new i(e)))}))}};class r{async get(t=!1){this.fetching=!0;const o=await n.getCached("wsum-user-bookmarks",`${e.API_ROOT}/get-user-bookmarks`,t,{method:"POST"}),{error:i,data:s}=o;return i||Object.keys(s).forEach((e=>{this[e]=s[e]})),this.fetching=!1,o}clear(){this.ids=[],this.videos=[],this["top-100"]=[],this["courses-resorts"]=[],this.articles=[],this.players=[],this.authors=[],window.sessionStorage.removeItem("wsum-user-bookmarks")}cacheItems(){window.sessionStorage.setItem("wsum-user-bookmarks",JSON.stringify({"wsum-user-bookmarks":{error:!1,data:{ids:this.ids,videos:this.videos,"top-100":this["top-100"],"courses-resorts":this["courses-resorts"],articles:this.articles,players:this.players,authors:this.authors}},expire:Date.now()+3e5}))}has(e){return this.ids.includes(e)}add(e){const{id:t}=e;this.has(t)||this.ids.push(t);const o=this.getPostKey(e),n=this[o].findIndex((t=>Number(t.id)===Number(e.id)));n>-1||(this[o].push(e),this.cacheItems())}getPostKey(e){const{type:t,is_top_100:o=!1}=e;return"article"===t?o?"top-100":"articles":{golf_video:"videos",players:"players",contributor:"authors",course:"courses-resorts",resort:"courses-resorts","course-new":"courses-resorts","resort-new":"courses-resorts"}[t]||t}remove(e){const{id:t}=e;if(this.has(t)){const e=this.ids.indexOf(t);this.ids.splice(e,1)}const o=this.getPostKey(e),n=this[o].findIndex((t=>Number(t.id)===Number(e.id)));o&&n>-1&&(this[o].splice(n,1),this.cacheItems())}async init(){const{userIsLoggedIn:e}=window.wsum;"1"===e&&(await this.get(),document.dispatchEvent(new CustomEvent("bookmarks-ready")))}constructor(){this.ids=[],this.videos=[],this["top-100"]=[],this["courses-resorts"]=[],this.articles=[],this.players=[],this.authors=[],this.fetching=!0,this.init()}}const a={init(){window.wsumBookmarks=new r}},c={get(e){const t=document.cookie.match(`(^|;) ?${e}=([^;]*)(;|$)`);return t?t[2]:null},set(e,t,o){const n=new Date;n.setTime(n.getTime()+864e5*o),document.cookie=`${e}=${t};path=/;expires=${n.toGMTString()}`},remove(e){const t=new Date;t.setTime(t.getTime()-6e4),document.cookie=`${e}=;path=/;expires=${t.toGMTString()}`}};class u{doLogout(t){t.preventDefault(),c.remove(e.GATED_MODAL_COOKIE),window.dataLayer&&window.dataLayer.push({event:"igt.userLogout",insideGolf:{action:{id:"insideGolf_logout",creative:this.page_title,position:window.location.href}}}),window.sessionStorage.clear(),window.location.href=this.endpoint}init(){this.button.addEventListener("click",this.doLogout)}destroy(){this.button.removeEventListener("click",this.doLogout)}constructor(t){this.button=t,this.endpoint=`${e.API_ROOT}/auth/logout`;const o=document.querySelector(".article__title");this.page_title=o?o.innerText:"",this.doLogout=this.doLogout.bind(this),this.init()}}const l={init(){document.querySelectorAll(".wsum-logout").forEach((e=>new u(e)))}};
/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/
var d=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],h=d.join(","),p="undefined"==typeof Element,f=p?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,m=!p&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},v=function e(t,o){var n;void 0===o&&(o=!0);var i=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===i||"true"===i||o&&t&&e(t.parentNode)},b=function(e,t,o){if(v(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(h));return t&&f.call(e,h)&&n.unshift(e),n=n.filter(o)},w=function e(t,o,n){for(var i=[],s=Array.from(t);s.length;){var r=s.shift();if(!v(r,!1))if("SLOT"===r.tagName){var a=r.assignedElements(),c=e(a.length?a:r.children,!0,n);n.flatten?i.push.apply(i,c):i.push({scopeParent:r,candidates:c})}else{f.call(r,h)&&n.filter(r)&&(o||!t.includes(r))&&i.push(r);var u=r.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(r),l=!v(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(r));if(u&&l){var d=e(!0===u?r.children:u.children,!0,n);n.flatten?i.push.apply(i,d):i.push({scopeParent:r,candidates:d})}else s.unshift.apply(s,r.children)}}return i},g=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},k=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!g(e)?0:e.tabIndex},y=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},O=function(e){return"INPUT"===e.tagName},E=function(e){return function(e){return O(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||m(e),n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!i||i===e}(e)},T=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},L=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=f.call(e,"details>summary:first-of-type")?e.parentElement:e;if(f.call(i,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return T(e)}else{if("function"==typeof n){for(var s=e;e;){var r=e.parentElement,a=m(e);if(r&&!r.shadowRoot&&!0===n(r))return T(e);e=e.assignedSlot?e.assignedSlot:r||a===e.ownerDocument?r:a.host}e=s}if(function(e){var t,o,n,i,s=e&&m(e),r=null===(t=s)||void 0===t?void 0:t.host,a=!1;if(s&&s!==e)for(a=!!(null!==(o=r)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(r)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!a&&r;){var c,u,l;a=!(null===(u=r=null===(c=s=m(r))||void 0===c?void 0:c.host)||void 0===u||null===(l=u.ownerDocument)||void 0===l||!l.contains(r))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},N=function(e,t){return!(t.disabled||v(t)||function(e){return O(e)&&"hidden"===e.type}(t)||L(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!!f.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},C=function(e,t){return!(E(t)||k(t)<0||!N(e,t))},S=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},I=function e(t){var o=[],n=[];return t.forEach((function(t,i){var s=!!t.scopeParent,r=s?t.scopeParent:t,a=function(e,t){var o=k(e);return o<0&&t&&!g(e)?0:o}(r,s),c=s?e(t.candidates):r;0===a?s?o.push.apply(o,c):o.push(r):n.push({documentOrder:i,tabIndex:a,item:t,isScope:s,content:c})})),n.sort(y).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},_=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==f.call(e,h)&&C(t,e)},P=d.concat("iframe").join(","),D=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==f.call(e,P)&&N(t,e)};
/*!
* focus-trap 7.5.4
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/
function A(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function x(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?A(Object(o),!0).forEach((function(t){F(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):A(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function F(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var R=function(e,t){if(e.length>0){var o=e[e.length-1];o!==t&&o.pause()}var n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},G=function(e,t){var o=e.indexOf(t);-1!==o&&e.splice(o,1),e.length>0&&e[e.length-1].unpause()},U=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},B=function(e){return U(e)&&!e.shiftKey},j=function(e){return U(e)&&e.shiftKey},K=function(e){return setTimeout(e,0)},M=function(e,t){var o=-1;return e.every((function(e,n){return!t(e)||(o=n,!1)})),o},q=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return"function"==typeof e?e.apply(void 0,o):e},$=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},V=[],J=function(e,t){var o,n=(null==t?void 0:t.document)||document,i=(null==t?void 0:t.trapStack)||V,s=x({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:B,isKeyBackward:j},t),r={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(e,t,o){return e&&void 0!==e[t]?e[t]:s[o||t]},c=function(e,t){var o="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return r.containerGroups.findIndex((function(t){var n=t.container,i=t.tabbableNodes;return n.contains(e)||(null==o?void 0:o.includes(n))||i.find((function(t){return t===e}))}))},u=function(e){var t=s[e];if("function"==typeof t){for(var o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];t=t.apply(void 0,i)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=n.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},l=function(){var e=u("initialFocus");if(!1===e)return!1;if(void 0===e||!D(e,s.tabbableOptions))if(c(n.activeElement)>=0)e=n.activeElement;else{var t=r.tabbableGroups[0];e=t&&t.firstTabbableNode||u("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(r.containerGroups=r.containers.map((function(e){var t=function(e,t){var o;return o=(t=t||{}).getShadowRoot?w([e],t.includeContainer,{filter:C.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:S}):b(e,t.includeContainer,C.bind(null,t)),I(o)}(e,s.tabbableOptions),o=function(e,t){return(t=t||{}).getShadowRoot?w([e],t.includeContainer,{filter:N.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):b(e,t.includeContainer,N.bind(null,t))}(e,s.tabbableOptions),n=t.length>0?t[0]:void 0,i=t.length>0?t[t.length-1]:void 0,r=o.find((function(e){return _(e)})),a=o.slice().reverse().find((function(e){return _(e)})),c=!!t.find((function(e){return k(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:o,posTabIndexesFound:c,firstTabbableNode:n,lastTabbableNode:i,firstDomTabbableNode:r,lastDomTabbableNode:a,nextTabbableNode:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.indexOf(e);return i<0?n?o.slice(o.indexOf(e)+1).find((function(e){return _(e)})):o.slice(0,o.indexOf(e)).reverse().find((function(e){return _(e)})):t[i+(n?1:-1)]}}})),r.tabbableGroups=r.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),r.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find((function(e){return e.posTabIndexesFound}))&&r.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function e(t){var o=t.activeElement;if(o)return o.shadowRoot&&null!==o.shadowRoot.activeElement?e(o.shadowRoot):o},p=function e(t){!1!==t&&t!==h(document)&&(t&&t.focus?(t.focus({preventScroll:!!s.preventScroll}),r.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(l()))},f=function(e){var t=u("setReturnFocus",e);return t||!1!==t&&e},m=function(e){var t=e.target,o=e.event,n=e.isBackward,i=void 0!==n&&n;t=t||$(o),d();var a=null;if(r.tabbableGroups.length>0){var l=c(t,o),h=l>=0?r.containerGroups[l]:void 0;if(l<0)a=i?r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:r.tabbableGroups[0].firstTabbableNode;else if(i){var p=M(r.tabbableGroups,(function(e){var o=e.firstTabbableNode;return t===o}));if(p<0&&(h.container===t||D(t,s.tabbableOptions)&&!_(t,s.tabbableOptions)&&!h.nextTabbableNode(t,!1))&&(p=l),p>=0){var f=0===p?r.tabbableGroups.length-1:p-1,m=r.tabbableGroups[f];a=k(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else U(o)||(a=h.nextTabbableNode(t,!1))}else{var v=M(r.tabbableGroups,(function(e){var o=e.lastTabbableNode;return t===o}));if(v<0&&(h.container===t||D(t,s.tabbableOptions)&&!_(t,s.tabbableOptions)&&!h.nextTabbableNode(t))&&(v=l),v>=0){var b=v===r.tabbableGroups.length-1?0:v+1,w=r.tabbableGroups[b];a=k(t)>=0?w.firstTabbableNode:w.firstDomTabbableNode}else U(o)||(a=h.nextTabbableNode(t))}}else a=u("fallbackFocus");return a},v=function(e){var t=$(e);c(t,e)>=0||(q(s.clickOutsideDeactivates,e)?o.deactivate({returnFocus:s.returnFocusOnDeactivate}):q(s.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=$(e),o=c(t,e)>=0;if(o||t instanceof Document)o&&(r.mostRecentlyFocusedNode=t);else{var n;e.stopImmediatePropagation();var i=!0;if(r.mostRecentlyFocusedNode)if(k(r.mostRecentlyFocusedNode)>0){var a=c(r.mostRecentlyFocusedNode),u=r.containerGroups[a].tabbableNodes;if(u.length>0){var d=u.findIndex((function(e){return e===r.mostRecentlyFocusedNode}));d>=0&&(s.isKeyForward(r.recentNavEvent)?d+1<u.length&&(n=u[d+1],i=!1):d-1>=0&&(n=u[d-1],i=!1))}}else r.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return k(e)>0}))}))||(i=!1);else i=!1;i&&(n=m({target:r.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(r.recentNavEvent)})),p(n||(r.mostRecentlyFocusedNode||l()))}r.recentNavEvent=void 0},y=function(e){if(!(t=e,"Escape"!==(null==t?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===q(s.escapeDeactivates,e)))return e.preventDefault(),void o.deactivate();var t;(s.isKeyForward(e)||s.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.recentNavEvent=e;var o=m({event:e,isBackward:t});o&&(U(e)&&e.preventDefault(),p(o))}(e,s.isKeyBackward(e))},O=function(e){var t=$(e);c(t,e)>=0||q(s.clickOutsideDeactivates,e)||q(s.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},E=function(){if(r.active)return R(i,o),r.delayInitialFocusTimer=s.delayInitialFocus?K((function(){p(l())})):p(l()),n.addEventListener("focusin",g,!0),n.addEventListener("mousedown",v,{capture:!0,passive:!1}),n.addEventListener("touchstart",v,{capture:!0,passive:!1}),n.addEventListener("click",O,{capture:!0,passive:!1}),n.addEventListener("keydown",y,{capture:!0,passive:!1}),o},T=function(){if(r.active)return n.removeEventListener("focusin",g,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",O,!0),n.removeEventListener("keydown",y,!0),o},L="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===r.mostRecentlyFocusedNode}))}))&&p(l())})):void 0,P=function(){L&&(L.disconnect(),r.active&&!r.paused&&r.containers.map((function(e){L.observe(e,{subtree:!0,childList:!0})})))};return(o={get active(){return r.active},get paused(){return r.paused},activate:function(e){if(r.active)return this;var t=a(e,"onActivate"),o=a(e,"onPostActivate"),i=a(e,"checkCanFocusTrap");i||d(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=n.activeElement,null==t||t();var s=function(){i&&d(),E(),P(),null==o||o()};return i?(i(r.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!r.active)return this;var t=x({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},e);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,T(),r.active=!1,r.paused=!1,P(),G(i,o);var n=a(t,"onDeactivate"),c=a(t,"onPostDeactivate"),u=a(t,"checkCanReturnFocus"),l=a(t,"returnFocus","returnFocusOnDeactivate");null==n||n();var d=function(){K((function(){l&&p(f(r.nodeFocusedBeforeActivation)),null==c||c()}))};return l&&u?(u(f(r.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(r.paused||!r.active)return this;var t=a(e,"onPause"),o=a(e,"onPostPause");return r.paused=!0,null==t||t(),T(),P(),null==o||o(),this},unpause:function(e){if(!r.paused||!r.active)return this;var t=a(e,"onUnpause"),o=a(e,"onPostUnpause");return r.paused=!1,null==t||t(),d(),E(),P(),null==o||o(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return r.containers=t.map((function(e){return"string"==typeof e?n.querySelector(e):e})),r.active&&d(),P(),this}}).updateContainerElements(e),o};class W{openModal(){if(this.modal.classList.add("active"),document.body.style.overflow="hidden",this.isOpen=!0,window.dataLayer&&!this.tracked&&(window.dataLayer.push({event:"eec.promotionView",ecommerce:{promoView:{promotions:[{id:"gated_content_modal",name:"gated_content_modal",creative:this.page_title,position:window.location.href}]}}}),this.tracked=!0),!this.cookie){const t=new Date;c.set(e.GATED_MODAL_COOKIE,t.getTime(),3e4)}const t=document.documentElement,o=(window.pageYOffset||t.scrollTop)-(t.clientTop||0);window.scroll({top:o-1}),setTimeout((()=>{this.focusTrap=J(this.modal),this.focusTrap.activate()}),200)}closeModal(){this.focusTrap.deactivate(),this.focusTrap=null,this.modal.classList.remove("active"),document.body.removeAttribute("style"),this.isOpen=!1,c.remove(e.GATED_MODAL_COOKIE),this.intervalCheck&&(clearInterval(this.intervalCheck),this.intervalCheck=null)}init(){const e=this.cookie?1e3:5e3;setTimeout((()=>{this.openModal(),this.intervalCheck=setInterval((()=>{this.openModal()}),5e3)}),e),this.trackCTA&&this.trackCTA.addEventListener("click",(()=>{window.dataLayer&&window.dataLayer.push({event:"eec.promotionClick",ecommerce:{promoClick:{promotions:[{id:"gated_content_modal",name:"gated_content_modal",creative:this.page_title,position:window.location.href}]}}})}))}constructor(t){this.modal=t,this.isOpen=!1,this.focusTrap=null,this.intervalCheck=null,this.cookie=c.get(e.GATED_MODAL_COOKIE),this.adWalletCookie=c.get(e.ADWALLET_BOT_COOKIE),this.trackCTA=this.modal.querySelector('[data-track="promo_click"]'),this.page_title=document.getElementsByClassName("article__title")[0]?.innerText,this.tracked=!1,this.adWalletCookie&&"true"===this.adWalletCookie||this.init()}}const Y={init(){document.querySelectorAll(".wsum-modal--gate").forEach((e=>new W(e)))}};class z{open(){this.container.classList.add("active"),this.isOpen=!0}close(){this.container.classList.remove("active"),this.isOpen=!1}accept(){this.close(),c.set(e.NOTICE_POPUP_COOKIE,"acknowledged",7)}toggleSubmit(){this.submitButton.disabled=!this.checkbox.checked}init(){this.closeButton.addEventListener("click",this.close),this.submitButton.addEventListener("click",this.accept),this.checkbox.addEventListener("input",this.toggleSubmit),this.acknowledgeCookie||this.open()}constructor(t){this.container=t,this.closeButton=this.container.querySelector(".wsum-notice__close"),this.checkbox=this.container.querySelector(".wsum-notice__checkbox input"),this.submitButton=this.container.querySelector(".wsum-notice__submit"),this.acknowledgeCookie=c.get(e.NOTICE_POPUP_COOKIE),this.isOpen=!1,this.close=this.close.bind(this),this.accept=this.accept.bind(this),this.toggleSubmit=this.toggleSubmit.bind(this),this.init()}}const H={init(){const e=document.querySelector(".wsum-notice");return e?new z(e):null}},X={getPageViewEvent:(e=!1,t=!1,o=!1)=>e?o?t?"igt.subsUserPageView":"igt.unsubsUserPageView":"igt.subsUserPageView":"igt.guestPageView",getLinkEvent:(e=!1,t=!1,o=!1)=>e?o?t?"igt.subsUserLinkClick":"igt.unsubsUserLinkClick":"igt.subsUserLinkClick":"igt.guestLinkClick",init(){if(window.track_data){const{step:e=""}=window.track_data;window.dataLayer&&e&&window.dataLayer.push({event:"eec.checkout",ecommerce:{checkout:{actionField:{step:e}}}})}if(window.dataLayer&&window.wsum){const e=document.querySelector(".article__title"),t=e?e.innerText:"",{userIsLoggedIn:o,userIsSubscribed:n,userIsCostumer:i}=window.wsum;window.dataLayer.push({event:"igt.pageView",insideGolf:{action:{id:"insideGolf_pageView",creative:t,position:window.location.href},user:{isLoggedIn:"1"===o,isSubscribed:"1"===n,isCostumer:"1"===i}}}),window.dataLayer.push({event:this.getPageViewEvent("1"===o,"1"===n,"1"===i),insideGolf:{action:{id:"insideGolf_pageView",creative:t,position:window.location.href}}});const s=document.getElementsByTagName("a");s&&s.length&&Array.from(s).forEach((e=>{e.addEventListener("click",(()=>{const{href:s}=e;window.dataLayer.push({event:"igt.linkClick",insideGolf:{action:{id:"insideGolf_click",creative:t,position:window.location.href,url:s},user:{isLoggedIn:"1"===o,isSubscribed:"1"===n,isCostumer:"1"===i}}}),window.dataLayer.push({event:this.getLinkEvent("1"===o,"1"===n,"1"===i),insideGolf:{action:{id:"insideGolf_click",creative:t,position:window.location.href,url:s}}})}))}))}}};var Q;Q=()=>{s.init(),a.init(),l.init(),Y.init(),H.init(),X.init()},"loading"!==document.readyState?Q():document.addEventListener("DOMContentLoaded",(()=>{Q()}))})()})();
//# sourceMappingURL=wsumApp.js.map