function inIframe(){try{return window.self!==window.top}catch(t){return!1}}function tryParseJson(t){if("string"==typeof t)try{return JSON.parse(t)}catch(t){return!1}return!1}!function(t,e,r,s,i){t.TrustpilotObject=i,t.tp=t.tp||function(){(t.tp.q=t.tp.q||[]).push(arguments)},a=e.createElement(r),a.async=1,a.src=s,a.type="text/java"+r,f=e.getElementsByTagName(r)[0],f.parentNode.insertBefore(a,f)}(window,document,"script",trustpilot_settings.TrustpilotScriptUrl,"tp"),tp("register",trustpilot_settings.key),inIframe()&&window.addEventListener("message",function(t){var e=new URL(window.location).hostname;if(t.data&&-1!==t.origin.indexOf(e))if("undefined"!=typeof TrustpilotPreview){if("string"!=typeof t.data||"submit"!==t.data)return jsonData=tryParseJson(t.data),void(jsonData&&(jsonData.trustbox?TrustpilotPreview.setSettings(jsonData.trustbox):jsonData.customised&&TrustpilotPreview.updateActive(jsonData.customised)));TrustpilotPreview.sendTrustboxes()}else{var r=tryParseJson(t.data);if(r&&r.trustboxes){var s=document.createElement("script");s.type="text/javascript",s.src=trustpilot_settings.WidgetScriptUrl,document.head.appendChild(s);var i=document.createElement("script");i.type="text/javascript",i.onload=function(){const e=t.source.parent.document.getElementById("configuration_iframe").contentWindow;TrustpilotPreview.init([trustpilot_settings.PreviewCssUrl,trustpilot_settings.PreviewWPCssUrl],r,e,t.source)},i.src=trustpilot_settings.PreviewScriptUrl,document.head.appendChild(i)}}}); //# sourceMappingURL=headerScript.min.js.map