1/*! For license information please see webApplicationInjector.js.LICENSE.txt 2Version: 0.0.5 */ 3(()=>{var t={887(t,e,n){var r,a,o;o=function(){var t,e,n=document,r=n.getElementsByTagName("head")[0],a="push",o="readyState",i="onreadystatechange",s={},c={},d={},l={};function u(t,e){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return 1}function p(t,e){u(t,function(t){return e(t),1})}function m(e,n,r){e=e[a]?e:[e];var o=n&&n.call,i=o?n:r,g=o?e.join(""):n,h=e.length;function w(t){return t.call?t():s[t]}function v(){if(! --h)for(var t in s[g]=1,i&&i(),d)u(t.split("|"),w)&&!p(d[t],w)&&(d[t]=[])}return setTimeout(function(){p(e,function e(n,r){return null===n?v():(r||/^https?:\/\//.test(n)||!t||(n=-1===n.indexOf(".js")?t+n+".js":t+n),l[n]?(g&&(c[g]=1),2==l[n]?v():setTimeout(function(){e(n,!0)},0)):(l[n]=1,g&&(c[g]=1),void f(n,v)))})},0),m}function f(t,a){var s,c=n.createElement("script");c.onload=c.onerror=c[i]=function(){c[o]&&!/^c|loade/.test(c[o])||s||(c.onload=c[i]=null,s=1,l[t]=2,a())},c.async=1,c.src=e?t+(-1===t.indexOf("?")?"?":"&")+e:t,r.insertBefore(c,r.lastChild)}return m.get=f,m.order=function(t,e,n){!function r(a){a=t.shift(),t.length?m(a,r):m(a,e,n)}()},m.path=function(e){t=e},m.urlArgs=function(t){e=t},m.ready=function(t,e,n){t=t[a]?t:[t];var r,o=[];return!p(t,function(t){s[t]||o[a](t)})&&u(t,function(t){return s[t]})?e():(r=t.join("|"),d[r]=d[r]||[],d[r][a](e),n&&n(o)),m},m.done=function(t){m([null],t)},m},t.exports?t.exports=o():void 0===(a="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=a)},468(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Heartbeat=void 0;class n{static startSendingHeartBeatToIframe(t){const e=n.getHeartBeatInterval(t);setInterval(()=>{parent.postMessage({pk:Math.random(),gatewayId:"heartBeatGateway",eventId:"heartBeat",data:{location:document.location.href}},"*")},e)}static getHeartBeatInterval(t){return parseInt(t.getAttribute("data-smartedit-heart-beat-interval")||n.DEFAULT_HEARTBEAT_INTERVAL,10)}}e.Heartbeat=n,n.DEFAULT_HEARTBEAT_INTERVAL="500"},522(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(887);class a{static getWebappScriptElementFromDocument(t){if(t.currentScript){if(!(t.currentScript instanceof HTMLScriptElement))throw new Error("getWebappScriptElementFromDocument() found non html script element");return t.currentScript}const e=t.querySelector(`script#${a.webappScriptId}`);if(e)return e;const n=t.querySelectorAll(`script[src*=${a.webappScriptName}]`);if(1!==n.length)throw new Error(`SmartEdit unable to load - invalid ${a.webappScriptName} script tag`);return n.item(0)}static extractQueryParameter(t,e){const n={};return t.replace(/([?&])([^&=]+)=([^&]+)?/g,(t,e,r,a)=>(n[r]=a,"")),n[e]}static injectJS(t,e=0){t.length&&e<t.length&&a.getScriptJs()(t[e],function(){a.injectJS(t,e+1)})}static injectCSS(t,e){if(!t||!e)return;const n=t.getElementsByTagName("link");for(const r of e)if(!this.findLinkByHref(n,r)){const e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=r,t.appendChild(e)}}static injectThemeCSS(t,e){if(!e||e.length<2)return;const n=t.getElementsByTagName("link");for(let r=0;r<e.length;r++)if(!this.findLinkByHref(n,e[r])){const n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.id=`themeCss${r}`,n.href=e[r],t.appendChild(n)}}static findLinkByHref(t,e){let n=0,r=t.item(n),a=!1;for(;null!==r;){if(r.href===e){a=!0;break}n++,r=t.item(n)}return a}static updateThemeCss(t){if(!t||t.length<2)return;const e=document.getElementById("themeCss0"),n=document.getElementById("themeCss1");e&&n&&(e.href=t[0],n.href=t[1])}static getScriptJs(){return r}}a.webappScriptId="smartedit-injector",a.webappScriptName="webApplicationInjector",a.smarteditMainCssId="smarteditMainCss",e.default=a},977(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(522);class a{static convertWhitelistingToRegexp(t){return(t=t||[]).map(t=>{const e=t.trim();if(a.whitelistingConfigRegex.test(e)){const t=["^","$"].join(e.replace(/\./g,"\\.").replace(/\*/g,"[-a-zA-Z0-9]*"));return new RegExp(t)}throw new Error(a.whitelistingErrorMsg)})}static getWhitelistFromScriptElement(t,e){let n=[a.getSanitizedHostFromLocation(e.location)];const o=t.getAttribute(a.allowOriginAttributeName)||"";o&&(n=n.concat(o.split(",")));let i="";const s=e.document.createElement("a");s.href=t.src;const c=r.default.extractQueryParameter(s.search,a.allowOriginQueryParamName);return c&&(i=decodeURI(c),i&&i.split(",").forEach(t=>n.push(t))),n}static isAllowed(t,e,n){if(!/^(https?:)\/\/([-.a-zA-Z0-9]+(:[0-9]{1,5})?)$/.test(t))return!1;const r=e.document.createElement("a");return r.href=t,("https:"!==e.location.protocol||"https:"===r.protocol)&&n.some(t=>(t.lastIndex=0,t.test(a.getSanitizedHostFromLocation(r))))}static getSanitizedHostFromLocation(t){const e=t.port||("https"===t.protocol.replace(/:/g,"")?"443":"80");return`${t.hostname}:${e}`}}a.whitelistingConfigRegex=new RegExp(/^(([-*a-zA-Z0-9]+[.])*([-a-zA-Z0-9]+[.]))?[-a-zA-Z0-9]+(:[0-9]{1,5})$/),a.allowOriginAttributeName="data-smartedit-allow-origin",a.allowOriginQueryParamName="allow-origin",a.whitelistingErrorMsg="\n\t\tAllowed whitelist characters are a-z, A-Z, 0-9, -, period, or *\n\t\tThe wildcard * can be used to represent a prefixed domain, Good example: *.domain.com:80\n\t\tbut not a suffix or port, Bad examples: subdomain.*.com subdomain.domain.com:*.\n\t\tEvery whitelisting must contain a specific port.\n\t",e.default=a}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}(()=>{"use strict";const t=n(468),e=n(522),r=n(977),a="smartEditBootstrap",o=e.default.getWebappScriptElementFromDocument(document);if(!o)throw new Error("Unable to location webappInjector script");const i=r.default.getWhitelistFromScriptElement(o,window),s=r.default.convertWhitelistingToRegexp(i);function c(){window.removeEventListener("load",c),window.removeEventListener("storefrontload",c),parent.postMessage({pk:Math.random(),gatewayId:a,eventId:"bootstrapSmartEdit",data:{location:document.location.href}},"*")}function d(t){parent.postMessage({gatewayId:a,eventId:"promiseAcknowledgement",data:{pk:t}},"*")}function l(t){parent.postMessage({gatewayId:a,eventId:"promiseReturn",data:{pk:t,type:"success"}},"*")}parent.postMessage({pk:Math.random(),gatewayId:a,eventId:"loading",data:{location:document.location.href,version:"0.0.5"}},"*"),window.addEventListener("load",c),window.addEventListener("storefrontload",c),window.addEventListener("message",function(t){const n=t.data.gatewayId===a,o=n&&"bundle"===t.data.eventId,i=n&&"theme"===t.data.eventId;if(!o&&!i)return;if(!r.default.isAllowed(t.origin,window,s))throw new Error(t.origin+" is not allowed to override this storefront.");if(o)return void function(t,n){if(window.smartedit=window.smartedit||{},d(t),n){const t=document.getElementsByTagName("head")[0];!function(t){if(!t.properties)return;for(const e in t.properties)t.properties.hasOwnProperty(e)&&(window.smartedit[e]=t.properties[e])}(n),function(t){if(!(t.js&&t.js.length>0))return;let n;n="string"==typeof t.js[0]?t.js:t.js.filter(t=>!t.namespaceToCheck||!window[t.namespaceToCheck]).map(t=>t.src);e.default.injectJS(n)}(n),n.css&&n.css.length>0&&e.default.injectCSS(t,n.css),n.themeCss&&n.themeCss.length>
30&&e.default.injectThemeCSS(t,n.themeCss)}l(t)}(t.data.pk,t.data.data.resources);i&&(c=t.data.pk,u=t.data.data.resources,d(c),e.default.updateThemeCss(u.themeCss),l(c));var c,u},!1),window.onbeforeunload=function(){parent.postMessage({pk:Math.random(),gatewayId:a,eventId:"unloading",data:{location:document.location.href}},"*")},t.Heartbeat.startSendingHeartBeatToIframe(o)})()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.