{"version":3,"sources":["../../../components/_patterns/00-base/global/ie11.js"],"names":["$","Drupal","isIE11","test","navigator","userAgent","loadjs","window","drupalSettings","path","baseUrl","themePath","join","messageInterface","Message","add","t","type","url","behaviors","removeClassesIE11","attach","context","dataAttributeKeyCamel","_","camelCase","each","removeClass","data","jQuery"],"mappings":"aAAA,CAAC,SAAcA,CAAd,CAAiBC,CAAjB,CAAyB,CACxB,KAAMC,CAAAA,CAAM,CAAG,gBAAgBC,IAAhB,CAAqBC,SAAS,CAACC,SAA/B,CAAf,CAEA,GAAI,CAACH,CAAL,CACE;AACA,SAGF;AAEA;AACAI,MAAM,CACH,GAAE,CACDC,MAAM,CAACC,cAAP,CAAsBC,IAAtB,CAA2BC,OAD1B,CAEDH,MAAM,CAACC,cAAP,CAAsBC,IAAtB,CAA2BE,SAF1B,EAGDC,IAHC,CAGI,EAHJ,CAGQ,2DAJP,CAXkB,CAmBxBN,MAAM,CACH,GAAE,CACDC,MAAM,CAACC,cAAP,CAAsBC,IAAtB,CAA2BC,OAD1B,CAEDH,MAAM,CAACC,cAAP,CAAsBC,IAAtB,CAA2BE,SAF1B,EAGDC,IAHC,CAGI,EAHJ,CAGQ,yCAJP,CAnBkB,CA0BxB;AACA;AACA;AACA;AACA;AA9BwB,KA+BlBC,CAAAA,CAAgB,CAAG,GAAIZ,CAAAA,CAAM,CAACa,OA/BZ,CA6CxB;AAFAD,CAAgB,CAACE,GAAjB,CAAqBd,CAAM,CAACe,CAAP,glBAArB,CAA0C,CAAEC,IAAI,CAAE,OAAR,CAA1C,CA3CwB,CA8CxBX,MAAM,CAAE,GAAEL,CAAM,CAACiB,GAAP,CAAWV,cAAc,CAACC,IAAf,CAAoBE,SAA/B,CAA0C,gBAA9C,CA9CkB,CAgDxBV,CAAM,CAACkB,SAAP,CAAiBC,iBAAjB,CAAqC,CACnCC,MAAM,CAAE,SAA+BC,CAA/B,CAAwC,CAC9C,GAAI,CAACpB,CAAL,CAAa,SADiC,KAIxCqB,CAAAA,CAAqB,CAAGC,CAAC,CAACC,SAAF,uBAJgB,CAM9CzB,CAAC,CAAE,SAAD,qBAA0B,GAA3B,CAA+BsB,CAA/B,CAAD,CAAyCI,IAAzC,CACE,UAAwC,CACtC1B,CAAC,CAAC,IAAD,CAAD,CAAQ2B,WAAR,CAAoB3B,CAAC,CAAC,IAAD,CAAD,CAAQ4B,IAAR,CAAaL,CAAb,CAApB,CACD,CAHH,CAKD,CAZkC,CActC,CA9DD,EA8DGM,MA9DH,CA8DW5B,MA9DX,C","sourcesContent":["(function ie11($, Drupal) {\n const isIE11 = /msie|trident/i.test(navigator.userAgent);\n\n if (!isIE11) {\n // Bail if we're not using IE11.\n return false;\n }\n\n // Now we can run any IE only JS.\n\n // Load custom properties polyfill.\n loadjs(\n `${[\n window.drupalSettings.path.baseUrl,\n window.drupalSettings.path.themePath,\n ].join('')}/libraries/ie11-custom-properties/ie11CustomProperties.js`,\n );\n\n // Load polyfilled version of Alpine.\n loadjs(\n `${[\n window.drupalSettings.path.baseUrl,\n window.drupalSettings.path.themePath,\n ].join('')}/libraries/alpinejs/dist/alpine-ie11.js`,\n );\n\n // Voyager targets modern browsers so we should warn users old older browsers\n // that their experience won't be as good as it could be. We showed a similar\n // message on Bidx1 (BIDX1-388) at the client's request. If the client has\n // paid extra for IE11 support then we should not show this message,\n // or show a toned down version of it.\n const messageInterface = new Drupal.Message();\n const ieMessage =\n 'You are using Microsoft Internet Explorer 11, which was first released ' +\n 'in 2013. For a better experience on this website and across the whole ' +\n 'internet, we recommend you use ' +\n 'Microsoft Edge, ' +\n 'Google Chrome, ' +\n 'or Mozilla Firefox – ' +\n 'or view this site on a different device if you cannot change browser. ' +\n 'Despite our best efforts, this site may not function in such an ' +\n 'old browser, or it may be slower or only partially functional.';\n\n messageInterface.add(Drupal.t(ieMessage), { type: 'error' });\n\n // Load IE only CSS for fallback for things like CSS grid or custom properties.\n loadjs(`${Drupal.url(drupalSettings.path.themePath)}/dist/ie11.css`);\n\n Drupal.behaviors.removeClassesIE11 = {\n attach: function removeClassesIE11Init(context) {\n if (!isIE11) return false;\n\n const dataAttributeKey = 'remove-classes-ie11';\n const dataAttributeKeyCamel = _.camelCase(dataAttributeKey);\n\n $(`[data-${dataAttributeKey}]`, context).each(\n function removeClassesIE11RemoveClass() {\n $(this).removeClass($(this).data(dataAttributeKeyCamel));\n },\n );\n },\n };\n})(jQuery, Drupal);\n"],"file":"ie11.js"}