let ProductLiftWidget=function(t){this.settings=t,this.position="right",this.z_index_base=9999999,this.ssoToken=null,this.openWidgets=new Set,this.widgetQueue=[],this.isProcessing=!1,this.lastActionTime=0,this.loadCSS(),this.attachEmbeds(),this.listenToTriggers(),this.observeDOM()};ProductLiftWidget.prototype.loadCSS=function(){let t=document.head,e=document.createElement("style");t.appendChild(e),e.appendChild(document.createTextNode("\n @keyframes ProductLiftslideInFromRight {\n 0% { transform: translateX(200%); }\n 100% { transform: translateX(0); }\n }\n .productlift-small-widget {\n transition: opacity 0.3s ease, transform 0.3s ease;\n }\n "))},ProductLiftWidget.prototype.attachEmbeds=function(){document.querySelectorAll("[data-productlift-embed]").forEach(t=>this.runEmbed(t))},ProductLiftWidget.prototype.listenToTriggers=function(){let t=this;document.addEventListener("click",function(e){let i=e.target,o=i.closest("[data-productlift-sidebar]"),s=i.closest("[data-productlift-feedback], [data-productlift-widget]");o||s?(e.preventDefault(),e.stopPropagation(),requestAnimationFrame(function(){let e=(new Date).getTime();e-t.lastActionTime<300||(t.lastActionTime=e,o?t.queueWidget(t.openSidebar.bind(t,o)):s&&t.queueWidget(t.openSmallWidget.bind(t,s)))})):i.closest(".productlift-opened")||t.closeAllWidgets()},!0),window.addEventListener("message",this.debounce(function(e){"productlift.close"===e.data&&t.closeAllWidgets()},50),!1)},ProductLiftWidget.prototype.debounce=function(t,e){let i;return function(...o){clearTimeout(i),i=setTimeout(()=>{clearTimeout(i),t(...o)},e)}},ProductLiftWidget.prototype.queueWidget=function(t){this.widgetQueue.push(t),this.isProcessing||this.processQueue()},ProductLiftWidget.prototype.processQueue=function(){if(0===this.widgetQueue.length)return void(this.isProcessing=!1);this.isProcessing=!0,this.widgetQueue.shift()(),setTimeout(()=>this.processQueue(),100)},ProductLiftWidget.prototype.identify=function(t){let e=this;fetch(this.settings.generateSSOKeyRoute,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>t.json()).then(t=>{e.ssoToken=t.ssoToken,e.modifyElements()}).catch(t=>console.error("Error:",t))},ProductLiftWidget.prototype.modifyElements=function(){document.querySelectorAll('[data-productlift-link], [class*="data-productlift-link"], iframe[data-productlift-link], iframe[class*="data-productlift-link"]').forEach(t=>{let e;if("a"===t.tagName.toLowerCase()?e=new URL(t.href):"iframe"===t.tagName.toLowerCase()&&(e=new URL(t.src)),e&&this.ssoToken)if(e.searchParams.set("sso",this.ssoToken),"a"===t.tagName.toLowerCase())t.href=e.toString();else if("iframe"===t.tagName.toLowerCase()){let i=t.src,o=e.toString();i!==o&&(t.src=o,t.src=t.src)}})},ProductLiftWidget.prototype.observeDOM=function(){new MutationObserver(t=>{t.forEach(t=>{"childList"===t.type&&this.modifyElements()})}).observe(document.body,{childList:!0,subtree:!0})},ProductLiftWidget.prototype.createIframe=function(t,e=!0){let i=navigator.userAgent.indexOf("Safari")>-1;navigator.userAgent.indexOf("Chrome")>-1&&i&&(i=!1);let o=document.createElement("iframe");return o.name="iframe_productlift",o.width="100%",o.height="100%",o.id="productlift-iframe",o.allowtransparency=!0,o.style.border="0",this.settings.originHref=window.location.href,o.referrerPolicy="origin",o.sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation allow-top-navigation-by-user-activation allow-modals",i&&(o.sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation allow-top-navigation-by-user-activation allow-modals"),this.ssoToken&&(t+=(t.includes("?")?"&":"?")+"sso="+encodeURIComponent(this.ssoToken)),o.src=t,e&&window.addEventListener("message",function(t){let e=t.data;o.style.height=e.height+100+"px"},!1),o},ProductLiftWidget.prototype.openSidebar=function(t){let e=t.getAttribute("data-productlift-sidebar");this.addBackgroundFade();let i=document.createElement("div");i.id="productlift_changelog",i.className="productlift-opened",i.style="box-sizing: border-box; max-width: 450px; height: 100%; width: calc(100% - 40px); background-color: #ffffff; color: rgb(104, 104, 104); z-index: "+this.z_index_base+"; position: fixed; top:0; bottom: 0; height: 100%; padding: 0; border-radius: 0;",i.style.display="flex","right"===this.position?(i.style.borderLeft="2px solid #ffffff",i.style.right="0px",i.style.animation="1s ease-out 0s 1 ProductLiftslideInFromRight"):i.style.left="0px";let o=this.createSpinner();i.appendChild(o),document.body.appendChild(i);let s=this.createIframe(this.settings.routes[e],!1);s.style.display="none",i.appendChild(s),s.addEventListener("load",function(){o.parentNode&&o.parentNode.removeChild(o),s.style.display="block"}),this.openWidgets.add(i)},ProductLiftWidget.prototype.openSmallWidget=function(t){let e=t.getAttribute("data-productlift-widget")||t.getAttribute("data-productlift-feedback"),i=this.settings.routes[e],o=this.settings.types[e],s=350,n=250;"small_feedback"===o&&(s=350,n=250),"add_post"===o&&(s=500,n=550),"whats_new_mini"===o&&(s=500,n=300);let d=t.getBoundingClientRect(),r=(d.bottom,window.pageYOffset,d.left,window.pageXOffset,document.createElement("div"));r.className="productlift-opened productlift-small-widget",r.style.position="fixed",r.style.zIndex=this.z_index_base.toString(),r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.borderRadius="6px",r.style.boxShadow="rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px",r.style.backgroundColor="#ffffff",r.style.overflow="hidden",r.style.transition="opacity 0.3s ease, transform 0.3s ease",r.style.opacity="0",r.style.transform="scale(0.95)";let a=this.createSpinner();r.appendChild(a),document.body.appendChild(r);let l=this.createIframe(i,!1);l.style.width="100%",l.style.height="100%",l.style.border="0",l.style.display="none",r.appendChild(l),this.adjustWidgetPosition(t,r,s,n),setTimeout(()=>{r.style.opacity="1",r.style.transform="scale(1)"},50),l.onload=function(){a.parentNode.removeChild(a),l.style.display="block"},this.openWidgets.add(r)},ProductLiftWidget.prototype.adjustWidgetPosition=function(t,e,i,o){let s=t.getBoundingClientRect(),n=window.innerWidth,d=window.innerHeight,r=n-40,a=d-40,l=Math.min(i,r),c=Math.min(o,a),p=s.left,f=s.bottom+window.pageYOffset+10;p+l>n-20&&(p=n-l-20),p=Math.max(20,p);let u=d-s.bottom,h=s.top;u>=c+20?f=s.bottom+10:h>=c+20?f=s.top-c-10:(f=20,c=Math.min(c,d-40)),e.style.position="fixed",e.style.width=`${l}px`,e.style.height=`${c}px`,e.style.left=`${p}px`,e.style.top=`${f}px`},ProductLiftWidget.prototype.runEmbed=function(t){let e=t.getAttribute("data-productlift-embed"),i=this.createIframe(this.settings.routes[e]);t.appendChild(i)},ProductLiftWidget.prototype.addBackgroundFade=function(){let t=document.createElement("div");t.className="productlift-opened",t.style="background-color: #000000; opacity: 0.5; z-index: "+(this.z_index_base-1)+"; position: fixed; top: 0; left: 0; height: 100%; width: 100%;",t.addEventListener("click",this.closeAllWidgets.bind(this),!1),document.body.appendChild(t),this.openWidgets.add(t)},ProductLiftWidget.prototype.closeAllWidgets=function(){this.openWidgets.forEach(t=>{t&&t.parentNode&&(t.classList.contains("productlift-small-widget")?(t.style.opacity="0",t.style.transform="scale(0.95)",setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},300)):t.parentNode.removeChild(t))}),this.openWidgets.clear(),document.querySelectorAll(".productlift-background-fade").forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)})},ProductLiftWidget.prototype.createSpinner=function(){let t=document.createElement("div");return t.className="loading-spinner",t.style.width="25px",t.style.height="25px",t.style.border="2.5px solid #f3f3f3",t.style.borderTop="2.5px solid #3498db",t.style.borderRadius="50%",t.style.animation="spin 1s linear infinite",t.style.margin="auto auto",t},window.ProductLiftIdentify=function(t){void 0!==ProductLift?ProductLift.identify(t):console.error("ProductLift is not initialized")};const style=document.createElement("style");var ProductLift = new ProductLiftWidget({"routes":{"8a0c325d-11dd-42eb-aae8-2a17779b8153":"https:\/\/roadmap.merchdominator.com\/t\/roadmap?widget_id=8a0c325d-11dd-42eb-aae8-2a17779b8153"},"types":{"8a0c325d-11dd-42eb-aae8-2a17779b8153":"embed"},"generateSSOKeyRoute":"https:\/\/roadmap.merchdominator.com\/api\/generate-sso-token"});style.type="text/css",style.innerHTML="@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }",document.getElementsByTagName("head")[0].appendChild(style),window.PQ&&window.PQ.length&&(window.PQ.forEach(t=>ProductLift.identify(t)),window.PQ=[]),window.ProductLiftIdentify=function(t){ProductLift.identify(t)};