PageSourceSearch

https://hordabrand.com/cdn/shop/t/116/assets/component.s.min.js?v=111223038203869884241790760835

js hordabrand.com collected 2026-10-02 20:14:54 UTC 3,071 bytes, 1 lines download raw bytes

1import{DeclarativeShadowElement}from"@theme/critical";import{requestIdleCallback}from"@theme/utilities";export class Component extends DeclarativeShadowElement{refs={};requiredRefs;get roots(){return this.shadowRoot?[this,this.shadowRoot]:[this]}connectedCallback(){super.connectedCallback(),registerEventListeners(),this.#e(),requestIdleCallback(()=>{for(const e of this.roots)this.#t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["ref"],attributeOldValue:!0})})}updatedCallback(){this.#t.takeRecords(),this.#e()}disconnectedCallback(){this.#t.disconnect()}#e(){const e={},t=this.roots.reduce((e,t)=>{for(const n of t.querySelectorAll("[ref]"))this.#n(n)&&e.add(n);return e},new Set);for(const n of t){const t=n.getAttribute("ref")??"",r=t.endsWith("[]"),s=r?t.slice(0,-2):t;if(r){const t=Array.isArray(e[s])?e[s]:[];t.push(n),e[s]=t}else e[s]=n}if(this.requiredRefs?.length)for(const t of this.requiredRefs)if(!(t in e))throw new MissingRefError(t,this);this.refs=e}#t=new MutationObserver(e=>{e.some(e=>"attributes"===e.type&&this.#n(e.target)||"childList"===e.type&&[...e.addedNodes,...e.removedNodes].some(this.#n))&&this.#e()});#n=e=>getClosestComponent(getAncestor(e))===this}function getAncestor(e){if(e.parentNode)return e.parentNode;const t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}function getClosestComponent(e){if(!e)return null;if(e instanceof Component)return e;if(e instanceof HTMLElement&&e.tagName.toLowerCase().endsWith("-component"))return e;const t=getAncestor(e);return t?getClosestComponent(t):null}let initialized=!1;function registerEventListeners(){if(initialized)return;initialized=!0;const e=["click","change","select","focus","blur","submit","input","keydown","keyup","toggle"],t=["focus","blur"],n=["pointerenter","pointerleave"];for(const t of[...e,...n]){const e=`on:${t}`;document.addEventListener(t,t=>{const n=r(t);if(!n)return;const s=t.target!==n?new Proxy(t,{get(e,t){if("target"===t)return n;const r=Reflect.get(e,t);return"function"==typeof r?r.bind(e):r}}):t,o=n.getAttribute(e)??"";let[i,a]=o.split("/");const c=o.match(/([\/\?][^\/\?]+)([\/\?][^\/\?]+)$/),u=c?c[2]:null,l=i?i.startsWith("#")?document.querySelector(i):n.closest(i):getClosestComponent(n);if(!(l instanceof Component&&a))return;a=a.replace(/\?.*/,"");const f=l[a];if("function"==typeof f)try{const e=[s];u&&e.unshift(parseData(u)),f.call(l,...e)}catch(e){console.error(e)}},{capture:!0})}function r(e){const r=e.composedPath?.()[0]??e.target;if(r instanceof Element)return r.hasAttribute(`on:${e.type}`)?r:n.includes(e.type)?null:e.bubbles||t.includes(e.type)?r.closest(`[on\\:${e.type}]`):null}}function parseData(e){const t=e[0],n=e.slice(1);return"?"===t?Object.fromEntries(Array.from(new URLSearchParams(n).entries()).map(([e,t])=>[e,parseValue(t)])):parseValue(n)}function parseValue(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return isNaN(t)||""===e.trim()?e:t}class MissingRefError extends Error{constructor(e,t){super(`Required ref "${e}" not found in component ${t.tagName.toLowerCase()}`)}}

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.