!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof def&&def.amd?def("ph-platform",["exports"],t):t((e.phw=e.phw||{},e.phw.platform={}))}(this,function(e){"use strict";var d=function(){return(d=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var i in t=arguments[a])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=(t.prototype.fecthPhApp=function(){return this.phApp},t.prototype.getDDOFromCache=function(e){var t=this.phApp.ddo,a=this.phApp.pageGroup||{};return t[e]||a[e]},t.prototype.getCsrfToken=function(){var e=document.getElementById("csrfToken");return this.phApp.csrfToken=e&&e.innerText||"",this.phApp.csrfToken||(this.phApp.csrfToken=this.phApp.sessionParams&&this.phApp.sessionParams.csrfToken),this.phApp.csrfToken},t.prototype.getImageUrl=function(){var n=this,i=["cdnUrl","refNum","locale","deviceType"],o="";return i.forEach(function(e,t){var a=n.phApp[e];a&&0<a.trim().length&&(o+=a,"/"!==a[a.length-1]&&i.length-1<t&&(o+="/"))}),o},t.prototype.convertWidgetTagToComponentName=function(e){return e&&e.trim().length?e.substring(e.lastIndexOf("-")+1)+"/"+e.substring(0,e.lastIndexOf("-")):e},t.prototype.getSiteSettings=function(e){var t=this.getDDOFromCache("siteConfig");if(t&&t.data)return e?t.data.siteSettings[e]||t.data[e]:t.data.siteSettings},t);function t(){this.phApp=window.phApp||{},this.phApp.ddo=this.phApp.ddo||{}}var n=[{key:"domainName",regex:/{{domainName}}/g,value:""},{key:"linkDomain",regex:/{{linkDomain}}/g,value:""},{key:"imgSrc",regex:/{{imgSrc}}/g,value:""}],g={videowrapper:"video",imagewrapper:"image",linkwrapper:"link"},i=(o.prototype.constructCntReplaceMap=function(){var e=(this.phApp.rootDomain||this.phApp.baseDomain||"").replace("https://","");this.contentReplaceables.domainName=e,this.contentReplaceables.linkDomain=this.phApp.baseUrl,this.contentReplaceables.imgSrc=this.platformUtils.getImageUrl()},o.prototype.applyContextToContentModel=function(t){var a=this;for(var e in t=JSON.stringify(t)||"",this.contentReplaceables){t=(t=t.replace(/&lt;/g,"<")).replace(/&gt;/g,">"),n.forEach(function(e){t=t.replace(e.regex,a.contentReplaceables[e.key])});try{return JSON.parse(t)}catch(e){}}},o.prototype.flattenContentModel=function(e,m,u,t){var h=this;if(!m||!e)return m;var f=e.content||e,y=t||{};u=u||{},Object.keys(f).forEach(function(i){if("_cid"!=i)if("_refType"!=i){var e=f[i]?f[i].type:void 0,o=f[i]?f[i].refType:void 0;if(e){var t=f[i]?f[i].value:void 0;t||"string"!=typeof f[i]||(t=f[i]);var a=typeof t;t||(a="string");var n=u[t];if(n&&(a=typeof n),"dynamictext"==e)m[i]=t;else switch(a){case"object":if(Array.isArray(t)){var s=t;m[i]=[];var r=[];s.forEach(function(e,t){var a={},n=u[e];n&&((m[i][t]=a)._cid=e,a.position=t+1,y&&y.quoteImage&&n&&(n.quoteImage=y.quoteImage),"object"==typeof e&&(n=e,a={}),h.flattenContentModel(n,a,u,y),r.push(a))}),r.forEach(function(e,t){m[i][t]=e})}else{var d=t,c={};m[i]=c;var p=u[d]||{};if(p._cid=d,o&&(p._refType=o),"object"==typeof d&&(p=d||{},c={}),o&&g[o]){var l=u[t]||t||{};l&&(Object.keys(l).forEach(function(e){var t=l[e];if("object"==typeof t&&t.refType==g[o]){var a=u[t.value]||t.value||{};for(var n in a)a.hasOwnProperty(n)&&!l[n]&&(l[n]=a[n]);delete l[e],p=l}}),"videowrapper"===o&&y.playImg&&(l.playImg=y.playImg))}h.flattenContentModel(p,c,u,y),c&&(m[i]=c)}break;default:t&&(m[i]=t)}}}else m[i]=f[i];else m[i]=f[i]})},o.prototype.fillContentBasedOnMapper=function(e,t,a,n,i,o){var s;if(t&&a)if(t.split(".").forEach(function(e){s=s?s[e]:n[e]}),-1!=a.indexOf(".")){var r=a.split(".");if(r&&r.length){var d=r.pop();r.reduce(function(e,t){return e[t]=e[t]||{}},i)[d]=s}}else i[a]=s},o.prototype.mapViewContentModels=function(e){if(e&&e.content){var t=e.content;for(var a in e.origContentItems={},t)if(t.hasOwnProperty(a)){var n=t[a]||{};if(e.origContentItems[a]=JSON.parse(JSON.stringify(n)),n&&n.mappingModel){var i=n.mappingModel,o=e.modelMappings[i]&&e.modelMappings[i].mapping,s={};if(o){for(var r in o)o.hasOwnProperty(r)&&this.fillContentBasedOnMapper(a,o[r],r,n,s,e);s.mappingModel=o}t[a]=s}}}},o.prototype.compileContentModel=function(a,i){var o=this;return(i=i||{})&&(this.mapViewContentModels(i.data?i.data:i),Object.keys(a||{}).forEach(function(e,t){(a[e]||[]).forEach(function(e){var t={},a=e["data-ph-content-id"],n=i.data&&(i.data.content||i.data);n&&n[a]&&(o.flattenContentModel(n[a],t,n,n[a]),n[a].rawContent=n[a].content,t=o.applyContextToContentModel(t),n[a].content||(n[a].content=t))})})),i},o);function o(){this.contentReplaceables={},this.platformUtils=new a,this.phApp=this.platformUtils.fecthPhApp(),this.constructCntReplaceMap()}var c="X-CSRF-TOKEN",s=(r.prototype.getDDOFromCache=function(e){return this.phApp.ddo[e]},r.prototype.fetchCachedDdo=function(e){return this.getDDOFromCache(e)},r.prototype.fetchEnvironment=function(){var e={};return this.phApp&&(e.componentBase=this.phApp.widgetScriptUrl||this.phApp.cdnUrl+"/common/js/caas-platform/widgets/"),e},r.prototype.formatParams=function(t){return"?"+Object.keys(t).map(function(e){return e+"="+encodeURIComponent(t[e])}).join("&")},r);function r(){var t=this;this.platformUtils=new a,this.makeRequest=function(n,i,e){var o=t.phApp.widgetApiEndpoint,s=new XMLHttpRequest,r=t;return new Promise(function(a,e){var t=r.getDDOFromCache(i);t?a(t):(s.open("POST",o,!0),n.ddoKey=i,s.setRequestHeader("Content-type","application/json"),s.setRequestHeader(c,r.platformUtils.getCsrfToken()),s.onreadystatechange=function(e){if(this.readyState==XMLHttpRequest.DONE||4===this.readyState){if(200==this.status){var t=JSON.parse(s.responseText);(t=t[i])&&500!=t.status&&(t=t[i]||t,r.phApp.loadingPage=!1)}a(t)}},s.send(JSON.stringify(n)))})},this.makeGetRequest=function(n,i,e){var o=n.url||t.phApp.widgetApiEndpoint,s=new XMLHttpRequest,r=t;return delete n.url,new Promise(function(a,e){var t=r.getDDOFromCache(i);t?a(t):(s.open("GET",o+r.formatParams(n),!0),s.setRequestHeader("Content-type","application/json"),s.setRequestHeader(c,r.platformUtils.getCsrfToken()),s.onreadystatechange=function(e){if(this.readyState==XMLHttpRequest.DONE||4===this.readyState){if(200==this.status){var t=JSON.parse(s.responseText);(t=t[i])&&500!=t.status&&(t=t[i]||t,r.phApp.loadingPage=!1)}a(t)}},s.send(null))})},this.phApp=this.platformUtils.fecthPhApp()}var p=["data-ph-id"],l="instance-id",m="data-ph-widget-id",u="instance-id",h=["[",m,"]"].join(""),f="data-ph-content-id",y=["pcs-card-v1","pcs-component-v1"],v=(k.prototype.constructWgtTempElm=function(e){if(!e||"object"==typeof e)return e||document;var t=document.createElement("div");return t.innerHTML=e,t},k.prototype.prepareWidgetBlocks=function(e,t){var a=this.constructWgtTempElm(e),n=a.querySelectorAll(h);!n.length&&a&&a.getAttribute&&a.getAttribute(m)&&(n=[a]);for(var i=n.length,o=0;o<i;o++){var s=n[o];this.prepareWidgetBlock(s,t)}},k.prototype.prepareWidgetBlock=function(e,t){if(!this.handleHideOnDevice(e)){var a=e.getAttribute(m),n=e.getAttribute(u),i=e.getAttribute(f);this.phApp.ddo=this.phApp.ddo||{};var o=this.phApp.ddo.caasPageViews&&this.phApp.ddo.caasPageViews.data,s=o&&o.views&&o.views[a],r=o&&o.aliases&&(o.aliases[t+"-"+n]||o.aliases[n])||{};!Object.keys(r).length&&n&&(o.aliases[n]=[],r=o.aliases[n]);var d=o&&o.settings&&o.settings[n];if(s&&s.html&&r){var c=this.constructWgtTempElm(s.html);r.html=this.addExtraLogicToView(c,r,d,n||t);var p=this.addwidgetElemWithAttr(s,a,n,i,e);this.replacePhWidgetWithCmpt(e,p),this.prepareWidgetBlocks(r.html,t||n)}}},k.prototype.addExtraLogicToView=function(e,i,t,a){for(var o=e.querySelectorAll("[data-ph-content-id]"),n=function(e){var t=o[e],a=t.getAttribute("ph-alias");if(Object.keys(i).length&&a){var n=i.find(function(e){return e.alias==a});n&&n["data-ph-content-id"]&&t.setAttribute("data-ph-content-id",n["data-ph-content-id"]),s.handleElemAttributes(t,a)}},s=this,r=0;r<o.length;r++)n(r);return this.applyInstanceIdsToSettingsBlock(e,a),e.innerHTML},k.prototype.handleElemAttributes=function(e,t){e.removeAttribute("ph-alias");var a={};for(var n in e.attributes)e.attributes[n]&&e.attributes[n].nodeName&&e.attributes[n].nodeValue&&(a[e.attributes[n].nodeName]=[e.attributes[n].nodeValue]);var i=["exposeAliasToTemplate('",t,"','",e.getAttribute("data-ph-content-id"),"')"].join("");for(var o in e.setAttribute("v-bind:alias",i),a)e.removeAttribute(o);for(var s in a)e.setAttribute(s,a[s])},k.prototype.fetchElemBindables=function(e,t){if(t=t||{},e&&e.attributes)for(var a=0;a<Object.keys(e.attributes).length;a++){var n="data-pha-",i=e.attributes[a].name||"";i.startsWith(n)&&-1==p.indexOf(i)&&(t[i=i.replace(n,"")]=e.attributes[a].value)}return t},k.prototype.addwidgetElemWithAttr=function(e,t,a,n,i){var o=e.widgetTag,s=document.createElement(o),r={"data-widget":o,"data-ph-widget-id":t,"widget-id":t,"instance-id":a,"content-id":n,class:[o,e.view,e.theme].join("-")};-1==y.indexOf(o)&&(r.class=r.class+" pcs-widget");var d=this.fetchElemBindables(i,r);for(var c in d)r.hasOwnProperty(c)&&r[c]&&r[c]&&s.setAttribute(c,r[c]);return o&&-1===this.componentsToLoad.indexOf(o)&&-1===this.widgetTags.indexOf(o)&&this.widgetTags.push(o),s},k.prototype.addWidgetTagsToNestedWidgets=function(e){if(e&&e.views)for(var t in e.views)if(e.views[t]){var a=e.views[t].html,n=a&&this.constructWgtTempElm(a),i=n&&n.querySelectorAll(h);if(i&&i.length){for(var o=0;o<i.length;o++){var s=i[o],r=s.getAttribute(m),d=s.getAttribute(u),c=s.getAttribute(f);if(e.views[r]){var p=this.addwidgetElemWithAttr(e.views[r],r,d,c,s);this.replacePhWidgetWithCmpt(s,p)}}e.views[t].html=n.innerHTML}}},k.prototype.replacePhWidgetWithCmpt=function(e,t){var a=e&&e.nodeName.toLowerCase(),n=t;if(-1==y.indexOf(a)){var i=document.createElement("section");i.classList.add("pcs-widget");var o=e.getAttribute("instance-id"),s=e.getAttribute("data-ph-id");e.removeAttribute("data-ph-id"),o&&i.setAttribute("instance-id",o),s&&i.setAttribute("data-ph-id",s),i.appendChild(t),n=i}e.parentElement.insertBefore(n,e);for(var r=0;r<e.attributes.length;r++)if("class"!=e.attributes[r].name)t.setAttribute(e.attributes[r].name,e.attributes[r].value);else for(var d=e&&e.classList,c=0;c<d.length;c++)t.classList.contains(d[c])||t.classList.add(d[c]);e.parentElement.removeChild(e)},k.prototype.applyInstanceIdsToSettingsBlock=function(e,t){if(e){var a=[{key:l,value:t}];this.fetchNestedWidgetsAndApplyInstanceAttrs(e,a)}},k.prototype.fetchNestedWidgetsAndApplyInstanceAttrs=function(e,t){if(e&&t.length)for(var a=e.querySelectorAll("["+l+"]"),n=0;n<a.length;n++)for(var i=a[n],o=0;o<t.length;o++){var s=i.getAttribute(l);t[o].key==l&&s&&t[o].value?(s=t[o].value+"-"+s,i.setAttribute(t[o].key,s)):i.setAttribute(t[o].key,t[o].value)}},k.prototype.handleHideOnDevice=function(e){var t=e.getAttribute("hide-on-mobile"),a=e.getAttribute("hide-on-desktop"),n=this.phApp.deviceType,i=!1;return n&&"mobile"===n&&"true"===t?i=!0:n&&"desktop"===n&&"true"===a&&(i=!0),!!i&&(e.parentElement&&e.parentElement.removeChild&&e.parentElement.removeChild(e),i)},k);function k(){this.widgetTags=[],this.componentsToLoad=[],this.platformUtils=new a,this.phApp=this.platformUtils.fecthPhApp()}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var w,b=(function(e,t){function s(e,t){if(e){var a=p[e];if(c[e]=t,a)for(;a.length;)a[0](e,t),a.splice(0,1)}}function r(e,t){e.call&&(e={success:e}),t.length?(e.error||m)(t):(e.success||m)(e)}function l(a,n,i,o){var s,r,e=document,t=i.async,d=(i.numRetries||0)+1,c=i.before||m,p=a.replace(/^(css|img)!/,"");o=o||0,/(^css!|\.css$)/.test(a)?((r=e.createElement("link")).rel="stylesheet",r.href=p,(s="hideFocus"in r)&&r.relList&&(s=0,r.rel="preload",r.as="style")):/(^img!|\.(png|gif|jpg|svg)$)/.test(a)?(r=e.createElement("img")).src=p:((r=e.createElement("script")).src=a,r.async=void 0===t||t),!(r.onload=r.onerror=r.onbeforeload=function(e){var t=e.type[0];if(s)try{r.sheet.cssText.length||(t="e")}catch(e){18!=e.code&&(t="e")}if("e"==t){if((o+=1)<d)return l(a,n,i,o)}else if("preload"==r.rel&&"style"==r.as)return r.rel="stylesheet";n(a,t,e.defaultPrevented)})!==c(a,r)&&e.head.appendChild(r)}function a(e,t,a){var n,i;if(t&&t.trim&&(n=t),i=(n?a:t)||{},n){if(n in d)throw"LoadJS";d[n]=!0}function o(t,a){!function(e,n,t){var a,i,o=(e=e.push?e:[e]).length,s=o,r=[];for(a=function(e,t,a){if("e"==t&&r.push(e),"b"==t){if(!a)return;r.push(e)}--o||n(r)},i=0;i<s;i++)l(e[i],a,t)}(e,function(e){r(i,e),t&&r({success:t,error:a},e),s(n,e)},i)}if(i.returnPromise)return new Promise(o);o()}var m,d,c,p;e.exports=(m=function(){},d={},c={},p={},a.ready=function(e,t){return function(e,a){e=e.push?e:[e];var t,n,i,o=[],s=e.length,r=s;for(t=function(e,t){t.length&&o.push(e),--r||a(o)};s--;)n=e[s],(i=c[n])?t(n,i):(p[n]=p[n]||[]).push(t)}(e,function(e){r(t,e)}),a},a.done=function(e){s(e,[])},a.reset=function(){d={},c={},p={}},a.isDefined=function(e){return e in d},a)}(w={exports:{}},w.exports),w.exports),j=[{key:"af",name:"Afrikaans"},{key:"am",name:"Amharic"},{key:"ar-dz",name:"Arabic (Algeria)"},{key:"ar-kw",name:"Arabic (Kuwait)"},{key:"ar-ly",name:"Arabic (Lybia)"},{key:"ar-ma",name:"Arabic (Morocco)"},{key:"ar-sa",name:"Arabic (Saudi Arabia)"},{key:"ar-tn",name:" Arabic (Tunisia)"},{key:"ar",name:"Arabic"},{key:"az",name:"Azerbaijani"},{key:"be",name:"Belarusian"},{key:"bg",name:"Bulgarian"},{key:"bi",name:"Bislama"},{key:"bm",name:"Bambara"},{key:"bn",name:"Bengali"},{key:"bo",name:"Tibetan"},{key:"br",name:"Breton"},{key:"bs",name:"Bosnian"},{key:"ca",name:"Catalan"},{key:"cs",name:"Czech"},{key:"cv",name:"Chuvash"},{key:"cy",name:"Welsh"},{key:"da",name:"Danish"},{key:"de-at",name:"German (Austria)"},{key:"de-ch",name:"German (Switzerland)"},{key:"de",name:"German"},{key:"dv",name:"Maldivian"},{key:"el",name:"Greek"},{key:"en-au",name:"English (Australia)"},{key:"en-ca",name:"English (Canada)"},{key:"en-gb",name:"English (United Kingdom)"},{key:"en-ie",name:"English (Ireland)"},{key:"en-il",name:"English (Israel)"},{key:"en-in",name:"English (India)"},{key:"en-nz",name:"English (New Zealand)"},{key:"en-sg",name:"English (Singapore)"},{key:"en-tt",name:"English (Trinidad & Tobago)"},{key:"en",name:"English"},{key:"eo",name:"Esperanto"},{key:"es-do",name:"Spanish (Dominican Republic)"},{key:"es-pr",name:"Spanish (Puerto Rico)"},{key:"es-us",name:"Spanish (United States)"},{key:"es",name:"Spanish"},{key:"et",name:"Estonian"},{key:"eu",name:"Basque"},{key:"fa",name:"Persian"},{key:"fi",name:"Finnish"},{key:"fo",name:"Faroese"},{key:"fr-ca",name:"French (Canada)"},{key:"fr-ch",name:"French (Switzerland)"},{key:"fr",name:"French"},{key:"fy",name:"Frisian"},{key:"ga",name:"Irish or Irish Gaelic"},{key:"gd",name:"Scottish Gaelic"},{key:"gl",name:"Galician"},{key:"gom-latn",name:"Konkani Latin script"},{key:"gu",name:"Gujarati"},{key:"he",name:"Hebrew"},{key:"hi",name:"Hindi"},{key:"hr",name:"Croatian"},{key:"ht",name:"Haitian Creole (Haiti)"},{key:"hu",name:"Hungarian"},{key:"hy-am",name:"Armenian"},{key:"id",name:"Indonesian"},{key:"is",name:"Icelandic"},{key:"it-ch",name:"Italian (Switzerland)"},{key:"it",name:"Italian"},{key:"ja",name:"Japanese"},{key:"jv",name:"Javanese"},{key:"ka",name:"Georgian"},{key:"kk",name:"Kazakh"},{key:"km",name:"Cambodian"},{key:"kn",name:"Kannada"},{key:"ko",name:"Korean"},{key:"ku",name:"Kurdish"},{key:"ky",name:"Kyrgyz"},{key:"lb",name:"Luxembourgish"},{key:"lo",name:"Lao"},{key:"lt",name:"Lithuanian"},{key:"lv",name:"Latvian"},{key:"me",name:"Montenegrin"},{key:"mi",name:"Maori"},{key:"mk",name:"Macedonian"},{key:"ml",name:"Malayalam"},{key:"mn",name:"Mongolian"},{key:"mr",name:"Marathi"},{key:"ms-my",name:"Malay"},{key:"ms",name:"Malay"},{key:"mt",name:"Maltese (Malta)"},{key:"my",name:"Burmese"},{key:"nb",name:"Norwegian Bokmål"},{key:"ne",name:"Nepalese"},{key:"nl-be",name:"Dutch (Belgium)"},{key:"nl",name:"Dutch"},{key:"nn",name:"Nynorsk"},{key:"oc-lnc",name:"Occitan, lengadocian dialecte"},{key:"pa-in",name:"Punjabi (India)"},{key:"pl",name:"Polish"},{key:"pt-br",name:"Portuguese (Brazil)"},{key:"pt",name:"Portuguese"},{key:"ro",name:"Romanian"},{key:"ru",name:"Russian"},{key:"rw",name:"Kinyarwanda (Rwanda)"},{key:"sd",name:"Sindhi"},{key:"se",name:"Northern Sami"},{key:"si",name:"Sinhalese"},{key:"sk",name:"Slovak"},{key:"sl",name:"Slovenian"},{key:"sq",name:"Albanian"},{key:"sr-cyrl",name:"Serbian Cyrillic"},{key:"sr",name:"Serbian"},{key:"ss",name:"siSwati"},{key:"sv",name:"Swedish"},{key:"sw",name:"Swahili"},{key:"ta",name:"Tamil"},{key:"te",name:"Telugu"},{key:"tet",name:"Tetun Dili (East Timor)"},{key:"tg",name:"Tajik"},{key:"th",name:"Thai"},{key:"tk",name:"Turkmen"},{key:"tl-ph",name:"Tagalog (Philippines)"},{key:"tlh",name:"Klingon"},{key:"tr",name:"Turkish"},{key:"tzl",name:"Talossan"},{key:"tzm-latn",name:"Central Atlas Tamazight Latin"},{key:"tzm",name:"Central Atlas Tamazight"},{key:"ug-cn",name:"Uyghur (China)"},{key:"uk",name:"Ukrainian"},{key:"ur",name:"Urdu"},{key:"uz-latn",name:"Uzbek Latin"},{key:"uz",name:"Uzbek"},{key:"vi",name:"Vietnamese"},{key:"x-pseudo",name:"Pseudo"},{key:"yo",name:"Yoruba Nigeria"},{key:"zh-cn",name:"Chinese (China)"},{key:"zh-hk",name:"Chinese (Hong Kong)"},{key:"zh-tw",name:"Chinese (Taiwan)"},{key:"zh",name:"Chinese"}],A=window,T=b||Object.freeze({default:b,__moduleExports:b}),C={jquery:"common/js/vendor/jquery.min-1.1.js",jqueryMigrate:"common/js/vendor/jquery-migrate.min-1.1.js",slick:"common/js/vendor/slick-v3.min.js",plyrPolyfill:"common/js/vendor/polyfill.min.js",plyrScript:"common/js/vendor/plyr.min.3.5.6.js",plyrStyle:"common/js/vendor/plyr.3.5.6.css",hark:"common/js/vendor/hark.bundle-v1.1.0.js",resumable:"common/js/vendor/resumable-v1.1.min.js",dayjs:"common/js/vendor/dayjs/dayjs.min.js",dayjsutc:"common/js/vendor/dayjs/utc.js",dayjstz:"common/js/vendor/dayjs/timezone.js",dayjsDuration:"common/js/vendor/dayjs/duration.js",advancedFormat:"common/js/vendor/dayjs/advancedFormat.js",localizedFormat:"common/js/vendor/dayjs/localizedFormat.js",customParseFormat:"common/js/vendor/dayjs/customParseFormat.js",dayjslocale:"common/js/vendor/dayjs/locale/",mapBoxSdk:"common/js/vendor/mapbox-sdk.js",videojs:"common/js/vendor/video.min.js","videojs-record":"common/js/vendor/videojs.record.js",videjsStyle:"common/js/vendor/video-js.min.css",videojsrecordstyle:"common/js/vendor/videojs.record.min.css",localforage:"common/js/vendor/localforage.min.js",recordRTC:"common/js/vendor/record-rtc.min.js",dropzoneJs:"common/js/vendor/dropzone.min.js",isJs:"common/js/vendor/isjs.js","mobile-detect":"common/js/vendor/mobile-detect.min.js",jszip:"common/js/vendor/jszip.min.js",jsziputils:"common/js/vendor/jszip-utils.min.js",filesaver:"common/js/vendor/filesaver.min.js"},S=(P.prototype.fetchEagerLoadScriptVersions=function(){var e=this.platformUtils.getDDOFromCache("caasLazyLoadWidgetVersions");e&&e.status&&"success"===e.status&&(this.versionedScripts=e.data||{})},P.prototype.loadLibScripts=function(e,t){var a=this,n={};if(this.phApp&&this.phApp.caasPlatform){n.polyfill=this.phApp.caasPlatform.polyfill||"",n.vendor=this.phApp.caasPlatform.vendor||"",n.common=this.phApp.caasPlatform.common||"";var i=[n.polyfill,n.vendor,n.common];T(i,{success:function(){a.bootstrapWidgets(e,t)},async:!1})}else this.counter<50&&(this.timer=setTimeout(function(){a.counter++,clearTimeout(a.timer),a.bootstrapWidgets(e,t)},150))},P.prototype.bootstrapWidgets=function(e,t){var a=this;if(window.hasOwnProperty("Vue")&&window.hasOwnProperty("PcsCommon"))if(window.hasOwnProperty("phw")&&e.length){var n=[];this.env&&this.env.componentBase&&e.forEach(function(e){window.hasOwnProperty("Vue")&&!A.Vue.options.components[e]&&(a.platformUtils.convertWidgetTagToComponentName(e),n.push(a.versionedScripts[e]||a.env.componentBase+e+".js"))}),T(n,{success:function(){t()},async:!0}),n.length||t()}else t();else this.loadLibScripts(e,t)},P.prototype.initialiseVue=function(e){window.hasOwnProperty("phw")&&window.hasOwnProperty("Vue")&&(Object.keys(phw).forEach(function(e){var t=phw[e].default?phw[e].default.component:phw[e].component;t&&(t.options.template="<div></div>",A.Vue.component(t.options.name,t))}),phw.localVue=new A.Vue({el:e}))},P.prototype.initialiseEmbedVue=function(e,t,n){if(window.hasOwnProperty("phw")&&window.hasOwnProperty("Vue")){e.forEach(function(e){var t=phw[e].default?phw[e].default.component:phw[e].component,a=t&&t.options.props;a&&n&&Object.keys(n).forEach(function(e){e&&a[e]&&(t.options.props[e].default=n[e])}),t&&(t.options.template="<div></div>",A.Vue.component(t.options.name,t))});var a='[data-embed-widget-id ="'+t+'"]',i=document.querySelector(a);n=n||{},i&&(phw.localVue=new A.Vue({el:i}))}},P.prototype.loadScriptById=function(i,o,e){var s=this;return void 0===o&&(o=!0),void 0===e&&(e=!0),new Promise(function(e,t){if(T.isDefined(i))T.ready(i,function(){e(!0)});else{"dayjslocale"===i&&(C[i]+=s.dayjsLocale+".js");var a=C[i];if(a){if(!a.startsWith("http")&&!a.startsWith("://")){var n=s.phApp.scriptsBaseUrl||s.phApp.cdnUrl;n&&!n.endsWith("/")&&(n+="/"),a=n+a}T(a,i,{async:o}),T.ready(i,function(){e(!0)})}else e(!1)}})},P.prototype.loadDayJsScripts=function(){var t=this,a=this.phApp.locale||"en";if(a=a.replace("_","-"),this.dayjsLocale=j.find(function(e){return e.key===a}),void 0===this.dayjsLocale)if(1!==(a=a.split("-")).length){var e=j.find(function(e){return e.key===a[0]});this.dayjsLocale=void 0===e?"en":e.key}else this.dayjsLocale=this.dayjsLocale.key;else this.dayjsLocale=this.dayjsLocale.key;["dayjs","dayjsutc","dayjstz","advancedFormat","dayjsDuration","localizedFormat","customParseFormat","dayjslocale"].forEach(function(e){t.loadScriptById(e)})},P.prototype.loadScript=function(e,t,a,n){if(void 0===a&&(a=!0),void 0===n&&(n=!0),!T.isDefined(t))return e.startsWith("http")||e.startsWith("://")||(e=this.phApp.cdnUrl+"/common/js/vendor/"+e),T(e,{returnPromise:!0,async:!0})},P.prototype.loadScripts=function(e,t,a,n){if(void 0===a&&(a=!0),void 0===n&&(n=!0),!T.isDefined(t))return T(e,{returnPromise:!0,async:a})},P);function P(){this.platformUtils=new a,this.serviceUtils=new s,this.domUtils=new v,this.versionedScripts={},this.counter=0,this.env=this.serviceUtils.fetchEnvironment(),this.phApp=this.platformUtils.fecthPhApp(),A.hasOwnProperty("phw")&&(A.phw.scriptsMap=C),this.fetchEagerLoadScriptVersions(),this.loadDayJsScripts()}var E,O=window.phApp||{},W=new a,I=new i,V=new s,M=new v,D=new S,N="caasPageViews",L="caasContentV1",z="data-ph-widget-id",q=["[",z,"]"].join(""),B=0,U=[];function x(){!function e(){var i=W.fecthPhApp();var t=W.getCsrfToken();var a=i.ddo&&i.ddo.caasPageViews&&i.ddo.caasPageViews.status;if((!i.inlinePreview&&"success"!=a&&!i.loadingPage||!t)&&B<50)return void(E=setTimeout(function(){B++,clearTimeout(E),e()},150));var o={};o.deviceType=i.deviceType;o.refNum=i.refNum;o.lang=i.locale||"en_us";o.siteType=i.siteType;o.pageId=i.pageId;o.pageName=i.pageName;o.country=i.country;if(i.ddo.caasPageViews&&i.ddo.caasContentV1){if(i.ddo[L]){var n=i.ddo[N],s=n&&n.data&&n.data.aliases||{};I.compileContentModel(s,i.ddo[L])}R(void 0)}else i.loadingPage=!0,V.makeRequest(o,N).then(function(a){i.ddo[N]=a;var e=W.getSiteSettings("navItems"),t=i.viewsFromPage,n=V.makeRequest;e&&e.cdnCaasContentEnabled&&e.cdnCaasContentUrl&&t&&((o={refNum:i.refNum,locale:i.locale||"en_us",siteType:i.siteType,pageId:i.pageId,channel:i.deviceType}).url=e.cdnCaasContentUrl,n=V.makeGetRequest),n(o,L).then(function(e){var t=a&&a.data&&a.data.aliases||{};e=I.compileContentModel(t,e)||{},i.ddo[L]=e,R(void 0)})})}();var e=document.querySelector("body");e&&e.getAttribute("role")||!e||e.setAttribute("role","main")}function R(e){var t=O.ddo.caasPageViews&&O.ddo.caasPageViews.data;M.addWidgetTagsToNestedWidgets(t),M.widgetTags=[];var a=M.constructWgtTempElm(void 0),n=e||a.querySelectorAll(q);!n.length&&a&&a.getAttribute&&a.getAttribute(z)&&(n=[a]);for(var i=n.length,o=0;o<i;o++){var s=n[o],r=s.getAttribute("instance-id");M.widgetTags=[],M.prepareWidgetBlock(s);var d=document.querySelector('[instance-id="'+r+'"]');U.push({tags:M.widgetTags,elem:d})}!function e(){if(U.length){var t=U.splice(0,1);D.bootstrapWidgets(t[0].tags,function(){D.initialiseVue(t[0].elem),e()})}}(),M.widgetTags=[]}function F(e,t){if(e&&t)for(var a=0,n=e.getAttributeNames();a<n.length;a++){var i=n[a],o=e.getAttribute(i);t.setAttribute(i,o)}}if(!O.isEmbed)if(O.loadingPage)var H=setInterval(function(){O.loadingPage||(clearInterval(H),setTimeout(function(){x()},10))},100);else if(O.lazyPage){var J=document.querySelectorAll("[data-ph-widget-id]"),G=[],_=O.ddo[N]&&O.ddo[N].data||{};for(var K in _.views)_.views[K].widgetTag&&G.push(_.views[K].widgetTag);D.bootstrapWidgets(G,function(){for(var e=0;e<J.length;e++){var t=J[e].getAttribute("data-ph-widget-id"),a=(d=t,void 0,((c=O.ddo[N])&&c.data&&c.data.views||{})[d]),n=_&&_.aliases,i=I.compileContentModel(n,O.ddo[L])||{};if(O.ddo[L]=i,a){var o=document.createElement("section");o.setAttribute("instance-id",J[e].getAttribute("instance-id")),o.classList.add("pcs-widget");var s=document.createElement(a.widgetTag);F(J[e],s),o.appendChild(s);var r=a.widgetTag+"-"+a.view+"-"+a.theme;s.classList.add(r),s.classList.add("pcs-widget"),J[e].parentElement.replaceChild(o,J[e]),D.initialiseVue(o)}}var d,c})}else x();e.fetchWidgetContent=function(e){var t={};for(var a in e=e||{},t.lang=O.locale||"en_us",t.pageId=e.pageId||O.pageId,t.deviceType=O.deviceType,e)t.hasOwnProperty(a)||(t[a]=e[a]);return V.makeRequest(t,"caasWidgetContent").then(function(e){if(e&&e.status&&"success"===e.status)return e})},e.fetchCaasGetSiteContent=function(e){var t={};for(var a in e=e||{},t.lang=O.locale||"en_us",t.pageId=e.pageId||O.pageId,t.deviceType=O.deviceType,e)t.hasOwnProperty(a)||(t[a]=e[a]);return V.makeRequest(t,"caasGetSiteContent").then(function(e){if(e&&e.status&&"success"===e.status)return e})},e.fetchWidgetView=function(e){var t={};for(var a in e=e||{},t.lang=O.locale||"en_us",t.pageId=O.pageId,t.deviceType=O.deviceType,e)t.hasOwnProperty(a)||(t[a]=e[a]);return V.makeRequest(t,"caasWidgetView").then(function(e){if(e&&e.status&&"success"===e.status)return e})},e.init=x,e.initiateInnerWidgets=function(e){e&&R(e)},e.prepareWidgetBlocks=function(e){return M.prepareWidgetBlocks(e)},e.compileContentModel=function(e,t){return I.compileContentModel(e,t)},e.bootstrapWidgets=function(e){D.bootstrapWidgets(M.widgetTags,e)},e.addWidgetTagsToNestedWidgets=function(e){M.addWidgetTagsToNestedWidgets(e)},e.loadScript=function(e,t,a,n){return void 0===a&&(a=!0),void 0===n&&(n=!0),D.loadScript(e,t,a,n)},e.loadScriptById=function(e,t,a){return void 0===t&&(t=!0),void 0===a&&(a=!0),D.loadScriptById(e,t,a)},e.initEmbedWidget=function(e){if(e&&e.target){var t,a=[],n=[];if((t="string"==typeof e.target?document.querySelector(e.target):e.target)&&e.viewData&&e.contentData){var i=e.viewData&&e.viewData.views||{},o=Math.random().toString(36).slice(2);t.setAttribute("data-embed-widget-id",o),O.ddo=O.ddo||{},O.ddo.caasPageViews=O.ddo.caasPageViews||{},O.ddo.caasPageViews.status="success",O.ddo.caasPageViews.data=O.ddo.caasPageViews.data||{},O.ddo.caasPageViews.data.views=O.ddo.caasPageViews.data.views||{},Object.keys(i).forEach(function(e){if(i[e].widgetTag){a.push(i[e].widgetTag);var t=function(e){var t=e.split("-"),a="";return t.forEach(function(e){a+=e[0].toUpperCase()+e.slice(1)}),a}(i[e].widgetTag);n.push(t),O.ddo.caasPageViews.data.views[e]=i[e]}});var s=e.viewData.aliases||{},r=Object.keys(s)&&Object.keys(s)[0];O.ddo.caasPageViews.data.aliases=O.ddo.caasPageViews.data.aliases||{},O.ddo.caasPageViews.data.aliases[r]=e.viewData.aliases[r],console.log("executing embed script"),function(e,t){if(t&&t.content){var a=I.compileContentModel(e,t)||{};O.ddo[L]=O.ddo[L]||{},Object.keys(O.ddo[L]).length&&O.ddo[L].data&&a&&a.data?O.ddo[L].data=d({},O.ddo[L],a.data):O.ddo[L]=a,O.ddo[L].status="success"}else O.ddo[L]=O.ddo[L]||{},O.ddo[L].data=O.ddo[L].data||{},O.ddo[L].status="success"}(s,{data:JSON.parse(JSON.stringify(e.contentData)),content:JSON.parse(JSON.stringify(e.contentData.content)),status:"success"}),M.addWidgetTagsToNestedWidgets(e.viewData),M.prepareWidgetBlock(t),D.bootstrapWidgets(a,function(){D.initialiseEmbedVue(n,o,e.data)})}}},e.initVideoWidget=function(e){var t;if(e&&e.target){if(t="string"==typeof e.target?document.querySelector(e.target):e.target){t.style.display="block";var a=t.getAttribute("data-pcs-type");if(a&&"attr"==a){var n=document.createElement("div"),i={content:{},settings:e};n.setAttribute(t.getAttribute("data-pcs-type-value"),JSON.stringify(i)),t.appendChild(n),new Vue({el:t,data:{content:{}}})}}}else console.log("Invalid payload or missing required parameters ",e)},Object.defineProperty(e,"__esModule",{value:!0})});
