PageSourceSearch

https://deessepro.com/cdn/shop/t/65/assets/owner-credit-banner.js?v=160075542085207967291784910505

js deessepro.com collected 2026-10-07 22:31:22 UTC 5,642 bytes, 2 lines download raw bytes

1(function(){"use strict";var PRO_HANDLE="pro-by-deesse-pro",PRO_PATH_PREFIX="/products/"+PRO_HANDLE,SS_KEY="ouOwnerCredit",LIST_PRICE=1440;function isProProduct(){var path=window.location.pathname;return path===PRO_PATH_PREFIX||path===PRO_PATH_PREFIX+"/"||path.indexOf(PRO_PATH_PREFIX+".")===0||path.indexOf(PRO_PATH_PREFIX+"?")===0}function readCreditFromUrl(){try{var params=new URLSearchParams(window.location.search),raw=params.get("owner_credit");if(!raw)return null;var n=parseInt(raw,10);return!isFinite(n)||n<=0||n>=LIST_PRICE?null:n}catch(_){return null}}function storeCredit(n){try{window.sessionStorage.setItem(SS_KEY,String(n))}catch(_){}}function loadStoredCredit(){try{var raw=window.sessionStorage.getItem(SS_KEY),n=raw?parseInt(raw,10):NaN;return isFinite(n)&&n>0?n:null}catch(_){return null}}function formatMoney(n){return"\xA3"+n.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}function injectStyles(){if(!document.getElementById("ou-credit-styles")){var css='.ou-credit-notice{position:relative;z-index:20;background:#121212;color:#fff;padding:12px 20px;text-align:center;font-family:"Neue Montreal","PP Neue Montreal",Assistant,-apple-system,"Helvetica Neue",Arial,sans-serif;font-size:13px;line-height:1.4;letter-spacing:.01em}.ou-credit-notice__inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 16px}.ou-credit-notice__eyebrow{font-family:"PPFraktionMono","SFMono-Regular",ui-monospace,Menlo,monospace;text-transform:uppercase;letter-spacing:.14em;font-size:11px;color:rgba(255,255,255,.72)}.ou-credit-notice__sep{color:rgba(255,255,255,.35)}.ou-credit-notice__price s{color:rgba(255,255,255,.5);margin-right:6px;text-decoration:line-through}.ou-credit-notice__price strong{font-weight:500;color:#fff}.ou-credit-notice__close{background:none;border:0;color:rgba(255,255,255,.6);font:inherit;cursor:pointer;padding:0 4px;margin-left:12px;font-size:16px;line-height:1}.ou-credit-notice__close:hover{color:#fff}.ou-cart-btn-strike{color:inherit;opacity:.55;text-decoration:line-through;margin-right:6px;font-weight:400}html.ou-credit-active .utility-bar{display:none!important}html.ou-credit-active gaia-header{top:calc(var(--ou-header-top,20px) + var(--ou-notice-h,42px))!important;transition:top .3s ease}',style=document.createElement("style");style.id="ou-credit-styles",style.textContent=css,document.head.appendChild(style)}}var creditActive=null;function renderBanner(credit){if(!document.getElementById("ou-credit-notice")){var net=LIST_PRICE-credit,el=document.createElement("div");el.id="ou-credit-notice",el.className="ou-credit-notice",el.setAttribute("role","status"),el.innerHTML='<div class="ou-credit-notice__inner"><span class="ou-credit-notice__eyebrow">Owner credit applied</span><span class="ou-credit-notice__sep">\xB7</span><span class="ou-credit-notice__price"><s>'+formatMoney(LIST_PRICE)+"</s><strong>"+formatMoney(net)+'</strong></span><span class="ou-credit-notice__sep">\xB7</span><span>Your \xA3'+credit+' credit is on your session and applies automatically at checkout.</span><button type="button" class="ou-credit-notice__close" aria-label="Dismiss">\xD7</button></div>',el.querySelector(".ou-credit-notice__close").addEventListener("click",function(){try{window.sessionStorage.removeItem(SS_KEY)}catch(_){}el.remove(),document.documentElement.classList.remove("ou-credit-active"),creditActive=null;var btns=document.querySelectorAll("[data-ou-cart-btn-original]");btns.forEach(function(b){var original=b.getAttribute("data-ou-cart-btn-original");original!=null&&(b.textContent=original,b.removeAttribute("data-ou-cart-btn-original"))})});var body=document.body;body&&body.insertBefore(el,body.firstChild);var root=document.documentElement,gaia=document.querySelector("gaia-header");if(gaia){var naturalTop=getComputedStyle(gaia).getPropertyValue("top");naturalTop&&naturalTop!=="auto"&&root.style.setProperty("--ou-header-top",naturalTop)}root.classList.add("ou-credit-active"),syncNoticeOffset(),window.addEventListener("resize",syncNoticeOffset)}}function syncNoticeOffset(){var notice=document.getElementById("ou-credit-notice");notice&&document.documentElement.style.setProperty("--ou-notice-h",notice.offsetHeight+"px")}var CART_BTN_RE=/Add to Cart\s*-\s*£\s*([\d,]+(?:\.\d{2})?)/i;function rewriteCartButtons(credit){for(var net=LIST_PRICE-credit,candidates=document.querySelectorAll("span, button"),i=0;i<candidates.length;i++){var el=candidates[i];if(!el.hasAttribute("data-ou-cart-btn-original")&&el.children.length===0){var t=el.textContent;if(t){var m=t.match(CART_BTN_RE);m&&(el.setAttribute("data-ou-cart-btn-original",t),el.innerHTML='Add to Cart - <span class="ou-cart-btn-strike">'+formatMoney(LIST_PRICE)+"</span>"+formatMoney(net))}}}}function activate(credit){if(creditActive=credit,injectStyles(),renderBanner(credit),rewriteCartButtons(credit),"MutationObserver"in window){var mo=new MutationObserver(function(){creditActive&&rewriteCartButtons(creditActive)});mo.observe(document.body,{childList:!0,subtree:!0,characterData:!0}
1)}}function boot(){if(isProProduct()){var credit=readCreditFromUrl();if(credit){storeCredit(credit);try{var u=new URL(window.location.href);u.searchParams.delete("owner_credit"),window.history.replaceState(window.history.state,"",u.pathname+u.search+u.hash)}catch(_){}}else credit=loadStoredCredit();credit&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){activate(credit)}):activate(credit))}}boot()})();
2//# sourceMappingURL=/cdn/shop/t/65/assets/owner-credit-banner.js.map?v=160075542085207967291784910505

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.