@hsfx/attr 2.0.11 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{hsfxnormalizeTdkf8m4w.js → hsfxnormalizeVKiJWGQE.js} +1 -1
- package/dist/assets/hsfxnormalizeVKiJWGQE.js.br +0 -0
- package/dist/assets/hsfxnormalizeVKiJWGQE.js.gz +0 -0
- package/dist/main.js +2 -2
- package/dist/main.js.br +0 -0
- package/dist/main.js.gz +0 -0
- package/package.json +1 -1
- package/dist/assets/hsfxnormalizeTdkf8m4w.js.br +0 -0
- package/dist/assets/hsfxnormalizeTdkf8m4w.js.gz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as e,a as t,g as r,b as n,c as o}from"./hsfxutilsMPToI1FZ.js";function s(){return function(){const e=window.location.origin,t=e=>{const t=document.querySelector(`[data-hs-replace="${e}"]`);return t?.textContent?.trim()||""},r=t("company"),n=t("phone"),o=t("email"),s=t("city"),i=t("state"),a=t("zipcode"),c={"@context":"https://schema.org","@type":"LocalBusiness",name:r,url:e,telephone:n,email:o},l=document.querySelector('[data-hs-replace="business-logo"] img');l&&l.src&&(c.image=l.src);const d={"@type":"PostalAddress",addressLocality:s,addressRegion:i,postalCode:a,addressCountry:"US"},u=t("street-address");u&&(d.streetAddress=u),c.address=d;const m=t("business-latitude"),p=t("business-longitude");m&&p&&(c.geo={"@type":"GeoCoordinates",latitude:m,longitude:p});const h=["facebook","instagram","linkedin","pinterest","tiktok","x","youtube"].map(e=>(e=>{const t=document.querySelector(`[data-hs-replace="${e}"]`);return t?.href||""})(e)).filter(e=>e&&""!==e.trim()&&!e.includes("placeholder"));h.length>0&&(c.sameAs=h);const f=document.querySelector('[data-hs-schema="services"]');if(f){const e=f.querySelectorAll('[data-hs-schema-list="item"]'),t=Array.from(e).map(e=>e.textContent?.trim()).filter(e=>e&&""!==e);t.length>0&&(c.serviceType=t)}const y=document.querySelector('[data-hs-schema="areas"]');if(y){const e=y.querySelectorAll('[data-hs-schema-list="item"]'),t=Array.from(e).map(e=>({"@type":"City",name:e.textContent?.trim()||""})).filter(e=>e.name&&""!==e.name);t.length>0&&(c.areaServed=t)}const g=document.createElement("script");g.type="application/ld+json",g.text=JSON.stringify(c),document.head.appendChild(g);const b=document.querySelector('[data-hs-schema="breadcrumb"]')?.textContent?.trim()||"",A=window.location.pathname.split("/").filter(e=>""!==e);if(A.length>0){const t={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:e}]},r=A[0],n=r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.itemListElement.push({"@type":"ListItem",position:2,name:n,item:e+"/"+r}),b&&t.itemListElement.push({"@type":"ListItem",position:3,name:b,item:window.location.href});const o=document.createElement("script");o.type="application/ld+json",o.text=JSON.stringify(t),document.head.appendChild(o)}if(document.querySelector('[data-hs-accordion-type="faq"]')){const e=[];if(document.querySelectorAll('[data-hs-accordion="list"]').forEach(t=>{t.querySelectorAll('[data-hs-accordion-type="faq"]').forEach(t=>{const r=t.querySelector('[data-hs-accordion="toggle"]'),n=t.querySelector('[data-hs-accordion="content"]');if(r&&n){const t=r.textContent?.trim(),o=n.innerHTML.trim();e.push({"@type":"Question",name:t,acceptedAnswer:{"@type":"Answer",text:o}})}})}),e.length>0){const t={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e},r=document.createElement("script");r.type="application/ld+json",r.text=JSON.stringify(t),document.head.appendChild(r)}}const x=document.querySelector('[data-hs-schema-service="name"]'),S=document.querySelector('[data-hs-schema-service="description"]');if(x&&S){const e=x.textContent?.trim()||"",t=S.textContent?.trim()||"";if(e&&t){const r={"@context":"https://schema.org","@type":"Service",name:e,description:t},n=document.createElement("script");n.type="application/ld+json",n.text=JSON.stringify(r),document.head.appendChild(n)}}else(x||S)&&console.warn('[schema] Service page schema requires both "name" and "description" elements');const q=document.querySelector('[data-hs-schema-faq="question"]'),C=document.querySelector('[data-hs-schema-faq="answer"]'),E=document.querySelector('[data-hs-schema-faq="published"]'),w=document.querySelector('[data-hs-schema-faq="modified"]');if(q&&C&&E&&w){const e=q.textContent?.trim()||"",t=C.innerHTML.trim(),r=E.textContent?.trim()||"",n=w.textContent?.trim()||"";if(e&&t&&r&&n){const o={"@context":"https://schema.org","@type":"QAPage",mainEntity:{"@type":"Question",name:e,text:e,answerCount:1,datePublished:r,dateModified:n,acceptedAnswer:{"@type":"Answer",text:t}}},s=document.createElement("script");s.type="application/ld+json",s.text=JSON.stringify(o),document.head.appendChild(s)}}else if(q||C||E||w){const e=[];q||e.push("question"),C||e.push("answer"),E||e.push("published"),w||e.push("modified"),console.warn(`[schema] FAQ page schema missing required fields: ${e.join(", ")}`)}const v=document.querySelector('[data-hs-schema-blog="name"]'),N=document.querySelector('[data-hs-schema-blog="published"]'),$=document.querySelector('[data-hs-schema-blog="modified"]'),F=document.querySelector('[data-hs-schema-blog="summary"]'),L=document.querySelector('[data-hs-schema-blog="author-name"]'),k=document.querySelector('[data-hs-schema-blog="author-type"]');if(v&&N&&$&&F&&L&&k){const e=v.textContent?.trim()||"",r=N.textContent?.trim()||"",n=$.textContent?.trim()||"",o=F.textContent?.trim()||"",s=L.textContent?.trim()||"",i=k.textContent?.trim()||"Organization",a=document.querySelector('[data-hs-schema-blog="author-role"]'),c=document.querySelector('[data-hs-schema-blog="author-image"]'),l=a?.textContent?.trim()||"",d=c?.src||"",u=t("company"),m=document.querySelector('[data-hs-replace="business-logo"] img'),p=m?m.src:"";let h;"Person"===i?(h={"@type":"Person",name:s},l&&(h.jobTitle=l),d&&(h.image=d)):(h={"@type":"Organization",name:s},p&&(h.logo=p));const f={"@context":"https://schema.org","@type":"BlogPosting",headline:e,description:o,datePublished:r,dateModified:n,author:h,publisher:{"@type":"Organization",name:u||s,logo:{"@type":"ImageObject",url:p}},mainEntityOfPage:{"@type":"WebPage","@id":window.location.href}},y=document.createElement("script");y.type="application/ld+json",y.text=JSON.stringify(f),document.head.appendChild(y)}else if(v||N||$||F||L||k){const e=[];v||e.push("name"),N||e.push("published"),$||e.push("modified"),F||e.push("summary"),L||e.push("author-name"),k||e.push("author-type"),console.warn(`[schema] Blog page schema missing required fields: ${e.join(", ")}`)}}(),{result:"schema initialized",destroy:()=>{}}}function i(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n;for(;n=r.nextNode();)n.nodeValue?.trim()&&t.push(n);return t}function a(e){const t=[];return e.hasAttribute("href")&&t.push(e),t.push(...Array.from(e.querySelectorAll("[href]"))),t}function c(e){if(e.hasAttribute("src")){if(e.getAttribute("src"))return e}const t=e.querySelector("[src]");if(t){if(t.getAttribute("src"))return t}return null}function l(e,t,r){if(function(e,t){const r=t.attributes.properties.syncField;return null!==e.querySelector(`[${r}]`)}(t,r))return void function(e,t,r){const n=r.attributes.properties.syncField;e.querySelectorAll(`[${n}]`).forEach(e=>{const r=e.getAttribute(n),o=t.querySelector(`[${n}="${r}"]`);if(!o)return;const s=c(e),a=c(o);if(s&&a){const e=s.getAttribute("src");e&&a.setAttribute("src",e)}else if(e.hasAttribute("href")&&o.hasAttribute("href")){const t=e.getAttribute("href");t&&o.setAttribute("href",t)}else{const t=i(e),r=t.length>0?t[0].nodeValue:e.textContent.trim();if(r){const e=i(o);e.length>0?e[0].nodeValue=r:o.textContent=r}}})}(e,t,r);const n=i(e),o=n.length>0?n[0].nodeValue:"",s=a(e),l=s.length>0?s[0].getAttribute("href"):"";if(o){i(t).forEach(e=>{e.nodeValue=o})}if(l){a(t).forEach(e=>{e.setAttribute("href",l)})}}const d="hs-dupe-no-transition";let u=!1;async function m(t){!function(){if(u)return;const e=document.createElement("style");e.textContent=`\n .${d},\n .${d} * {\n transition: none !important;\n animation: none !important;\n }\n `,document.head.appendChild(e),u=!0}();const r={processedElements:[]};return e(t,"wrapper").forEach(e=>{const t=e.getAttribute("data-hs-dupe");if(!t||"child"!==t&&"self"!==t)return void console.warn('[dupe] Invalid mode. Use "child" or "self":',e);const n=e.getAttribute("data-hs-dupe-count");let o=n?parseInt(n,10):1;(isNaN(o)||o<1)&&(console.warn("[dupe] Invalid count, using default of 1:",e),o=1),o>20&&(console.warn(`[dupe] Count of ${o} exceeds maximum of 20. Capping at 20.`),o=20);const s={hidden:e.hasAttribute("data-hs-dupe-hidden"),noSelect:e.hasAttribute("data-hs-dupe-no-select")};"child"===t?function(e,t,r,n){const o=e.children[0];if(!o)return;const s=[];for(let i=0;i<t;i++){const t=o.cloneNode(!0);t.classList.add(d),p(t,r),e.appendChild(t),s.push(t),t.offsetHeight,requestAnimationFrame(()=>{t.classList.remove(d)})}n.processedElements.push({element:e,mode:"child",clones:s})}(e,o,s,r):"self"===t&&function(e,t,r,n){const o=e.parentNode;if(!o)return void console.warn("[dupe] Element has no parent, cannot duplicate self:",e);const s=[];let i=e;for(let a=0;a<t;a++){const t=e.cloneNode(!0);t.classList.add(d),t.removeAttribute("data-hs-dupe"),t.removeAttribute("data-hs-dupe-count"),t.removeAttribute("data-hs-dupe-hidden"),t.removeAttribute("data-hs-dupe-no-select"),p(t,r),i.nextSibling?o.insertBefore(t,i.nextSibling):o.appendChild(t),s.push(t),i=t,t.offsetHeight,requestAnimationFrame(()=>{t.classList.remove(d)})}n.processedElements.push({element:e,mode:"self",clones:s})}(e,o,s,r)}),{result:`dupe processed ${r.processedElements.length} elements`,destroy:()=>{}}}function p(e,t){if(t.hidden&&e.setAttribute("aria-hidden","true"),t.noSelect){const t=e;t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.msUserSelect="none"}}async function h(){const i={destroyFunctions:[]},a=o.normalize;try{const d=s();d&&"destroy"in d&&"function"==typeof d.destroy&&i.destroyFunctions.push(d.destroy);const u=(c=o.normalize?.replace,function(){const e=new Map,t=n(c,"element");document.querySelectorAll(t).forEach(t=>{const r=t.cloneNode(!0),o=n(c,"hide");r.querySelectorAll(o).forEach(e=>{const t=c.attributes.elements.hide.primary.match(/data-hs-replace-hide/)[0],r=e.getAttribute(t);r&&r.split(" ").filter(e=>e.trim()).some(t=>e.classList.contains(t))&&e.remove()});const s=c.attributes.elements.element.primary.match(/data-hs-replace/)[0],i=t.getAttribute(s),a=r.textContent?.trim()||null,l=t.getAttribute("href");if(i&&(a||l)){const t={text:a,href:l};if(e.has(i)){const r=e.get(i);Array.isArray(r)?r.push(t):e.set(i,[r,t])}else e.set(i,t)}});const r="hsfx-form-persist";try{const t=localStorage.getItem(r);if(t){const n=JSON.parse(t),o=parseInt(n.timestamp,10);Date.now()-o>864e5?localStorage.removeItem(r):Object.entries(n).forEach(([t,r])=>{"timestamp"!==t&&"string"==typeof r&&e.set(`form.${t}`,{text:r,href:null})})}}catch{}const o=(new Date).getFullYear().toString(),s=["January","February","March","April","May","June","July","August","September","October","November","December"][(new Date).getMonth()];if(e.set("year",{text:o,href:null}),e.set("month",{text:s,href:null}),0===e.size)return;const i=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:t=>{const r=t.textContent||"";for(const n of e.keys())if(r.includes(`{{${n}}}`))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}}),a=[];let l;for(;l=i.nextNode();)a.push(l);a.forEach(t=>{let r=t.textContent||"",n=!1;for(const[o,s]of e.entries()){const e=`{{${o}}}`;if(r.includes(e)){let t=null;t=Array.isArray(s)?s.map(e=>e.text||e.href).filter(Boolean).join(", "):s.text||s.href,t&&(r=r.replace(new RegExp(e,"g"),t),n=!0)}}n&&(t.textContent=r)}),document.querySelectorAll("a[href]").forEach(t=>{let r=t.getAttribute("href")||"",n=!1;for(const[o,s]of e.entries()){const e=`{{${o}}}`;if(r.includes(e)){let t=null;if(Array.isArray(s)){const e=s[0];t=e.href||e.text}else{if(s.href){t=s.href,r=s.href,n=!0;break}s.text&&(t=s.text)}t&&!n&&(r=r.replace(new RegExp(e,"g"),t),n=!0)}}n&&t.setAttribute("href",r)});const d=document.querySelector("[data-hs-replace-test]");if(d){const t={};for(const[n,o]of e.entries()){const e=`{{${n}}}`;if(Array.isArray(o)){const r=o.map(e=>e.text||e.href).filter(Boolean).join(", ");t[n]={placeholder:e,value:r,type:`Array (${o.length} items)`,items:o.map(e=>e.text||e.href||"(empty)")}}else{const r=o.text||o.href||"(empty)";t[n]={placeholder:e,value:r,...o.text&&{text:o.text},...o.href&&{href:o.href}}}}const r=document.createElement("pre");r.textContent=JSON.stringify(t,null,2),d.innerHTML="",d.appendChild(document.createTextNode(`Replace Module Debug (${e.size} replacements):`)),d.appendChild(r)}document.querySelector("[data-hs-form-persist-clear]")&&localStorage.removeItem(r)}(),{result:"replace initialized",destroy:()=>{}});u&&"destroy"in u&&"function"==typeof u.destroy&&i.destroyFunctions.push(u.destroy);const p=await async function(r){const n=e(r,"source"),o=new Map,s=new Map;n.forEach(e=>{const t=e.getAttribute(r.attributes.properties.syncId),n=e.getAttribute(r.attributes.properties.syncField);t&&o.set(t,e),n&&s.set(n,e)});const i=e(r,"target");let a=0,c=0;return i.forEach(n=>{const i=n.getAttribute(r.attributes.properties.syncId),d=n.getAttribute(r.attributes.properties.syncField),u=n.getAttribute(r.attributes.properties.syncValue);let m;if(d&&u){if(m=s.get(d),!m)return void c++}else{if(!i)return void c++;if(m=o.get(i),!m)return void c++}const p=t(r,"item",n);if(!p){const e=d||i||"unknown";return void console.warn(`[sync] Target list "${e}" missing item template`)}const h="child"===p.getAttribute(r.attributes.properties.syncMode),f=t(r,"ignore",n);let y,g;if(u){const t=e(r,"item",m),n=Array.from(t).find(e=>e.getAttribute(r.attributes.properties.syncValue)===u);if(!n)return void console.warn(`[sync] No source item found with value "${u}" in field "${d}"`);y=[n]}else if(y=Array.from(e(r,"item",m)),0===y.length)return void console.warn(`[sync] Source list "${i}" has no items`);if(h){const e=p.firstElementChild;if(!e)return void console.warn(`[sync] Target list "${i}" has sync-mode="child" but item wrapper has no children`);g=e.cloneNode(!0)}else g=p.cloneNode(!0),g.removeAttribute(r.attributes.elements.item.primary.split("=")[0]);let b=!1;if(f){let e=f.nextElementSibling;for(;e;){if(e===p){b=!0;break}e=e.nextElementSibling}}if(h){for(;p.firstChild;)p.removeChild(p.firstChild);y.forEach(e=>{const t=g.cloneNode(!0);l(e,t,r),p.appendChild(t)}),p.removeAttribute(r.attributes.elements.item.primary.split("=")[0])}else{Array.from(n.children).forEach(e=>{e!==f&&e.remove()});const e=Array.from(y).map(e=>{const t=g.cloneNode(!0);return l(e,t,r),t});f?b?e.forEach(e=>{n.appendChild(e)}):e.forEach(e=>{n.insertBefore(e,f)}):e.forEach(e=>{n.appendChild(e)})}a++}),{result:`sync initialized (${a} synced, ${c} skipped)`,destroy:()=>{}}}(a.sync);p&&"destroy"in p&&"function"==typeof p.destroy&&i.destroyFunctions.push(p.destroy);const h=await m(a.dupe);h&&"destroy"in h&&"function"==typeof h.destroy&&i.destroyFunctions.push(h.destroy);const f=await async function(){const t={processedWrappers:[]};return e(r.clickable,"wrapper").forEach(e=>{const r=e.querySelector(":scope > button"),n=e.querySelector(":scope > a");if(!r||!n)return;const o=n.getAttribute("href");let s,i;o&&""!==o&&"#"!==o?(s=n,i=r):(s=r,i=n);const a="button"===s.getAttribute("data-hs-clickable");a||s.setAttribute("data-hs-clickable","button"),i.remove(),t.processedWrappers.push({wrapper:e,keptElement:s,wasLink:s===n,addedAttribute:!a})}),{result:`clickable processed ${t.processedWrappers.length} wrappers`,destroy:()=>{}}}();return f&&"destroy"in f&&"function"==typeof f.destroy&&i.destroyFunctions.push(f.destroy),{result:"normalize initialized",destroy:()=>{i.destroyFunctions.reverse().forEach(e=>{try{e()}catch(t){console.error("[normalize] Error during cleanup:",t)}}),i.destroyFunctions.length=0}}}catch(d){throw console.error("[normalize] Initialization failed:",d),i.destroyFunctions.reverse().forEach(e=>{try{e()}catch(t){console.error("[normalize] Error during error cleanup:",t)}}),d}var c}export{h as init};
|
|
1
|
+
import{q as e,a as t,g as r,b as n,c as o}from"./hsfxutilsMPToI1FZ.js";function s(){return function(){const e=window.location.origin,t=e=>{const t=document.querySelector(`[data-hs-replace="${e}"]`);return t?.textContent?.trim()||""},r=t("company"),n=t("phone"),o=t("email"),s=t("city"),i=t("state"),a=t("zipcode"),c={"@context":"https://schema.org","@type":"LocalBusiness",name:r,url:e,telephone:n,email:o},l=document.querySelector('[data-hs-replace="business-logo"] img');l&&l.src&&(c.image=l.src);const d={"@type":"PostalAddress",addressLocality:s,addressRegion:i,postalCode:a,addressCountry:"US"},u=t("street-address");u&&(d.streetAddress=u),c.address=d;const m=t("business-latitude"),p=t("business-longitude");m&&p&&(c.geo={"@type":"GeoCoordinates",latitude:m,longitude:p});const h=["facebook","instagram","linkedin","pinterest","tiktok","x","youtube"].map(e=>(e=>{const t=document.querySelector(`[data-hs-replace="${e}"]`);return t?.href||""})(e)).filter(e=>e&&""!==e.trim()&&!e.includes("placeholder"));h.length>0&&(c.sameAs=h);const f=document.querySelector('[data-hs-schema="services"]');if(f){const e=f.querySelectorAll('[data-hs-schema-list="item"]'),t=Array.from(e).map(e=>e.textContent?.trim()).filter(e=>e&&""!==e);t.length>0&&(c.serviceType=t)}const y=document.querySelector('[data-hs-schema="areas"]');if(y){const e=y.querySelectorAll('[data-hs-schema-list="item"]'),t=Array.from(e).map(e=>({"@type":"City",name:e.textContent?.trim()||""})).filter(e=>e.name&&""!==e.name);t.length>0&&(c.areaServed=t)}const g=document.createElement("script");g.type="application/ld+json",g.text=JSON.stringify(c),document.head.appendChild(g);const b=document.querySelector('[data-hs-schema="breadcrumb"]')?.textContent?.trim()||"",A=window.location.pathname.split("/").filter(e=>""!==e);if(A.length>0){const t={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:e}]},r=A[0],n=r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.itemListElement.push({"@type":"ListItem",position:2,name:n,item:e+"/"+r}),b&&t.itemListElement.push({"@type":"ListItem",position:3,name:b,item:window.location.href});const o=document.createElement("script");o.type="application/ld+json",o.text=JSON.stringify(t),document.head.appendChild(o)}if(document.querySelector('[data-hs-accordion-type="faq"]')){const e=[];if(document.querySelectorAll('[data-hs-accordion="list"]').forEach(t=>{t.querySelectorAll('[data-hs-accordion-type="faq"]').forEach(t=>{const r=t.querySelector('[data-hs-accordion="toggle"]'),n=t.querySelector('[data-hs-accordion="content"]');if(r&&n){const t=r.textContent?.trim(),o=n.innerHTML.trim();e.push({"@type":"Question",name:t,acceptedAnswer:{"@type":"Answer",text:o}})}})}),e.length>0){const t={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e},r=document.createElement("script");r.type="application/ld+json",r.text=JSON.stringify(t),document.head.appendChild(r)}}const x=document.querySelector('[data-hs-schema-service="name"]'),S=document.querySelector('[data-hs-schema-service="description"]');if(x&&S){const e=x.textContent?.trim()||"",t=S.textContent?.trim()||"";if(e&&t){const r={"@context":"https://schema.org","@type":"Service",name:e,description:t},n=document.createElement("script");n.type="application/ld+json",n.text=JSON.stringify(r),document.head.appendChild(n)}}else(x||S)&&console.warn('[schema] Service page schema requires both "name" and "description" elements');const q=document.querySelector('[data-hs-schema-faq="question"]'),C=document.querySelector('[data-hs-schema-faq="answer"]'),E=document.querySelector('[data-hs-schema-faq="published"]'),w=document.querySelector('[data-hs-schema-faq="modified"]');if(q&&C&&E&&w){const e=q.textContent?.trim()||"",t=C.innerHTML.trim(),r=E.textContent?.trim()||"",n=w.textContent?.trim()||"";if(e&&t&&r&&n){const o={"@context":"https://schema.org","@type":"QAPage",mainEntity:{"@type":"Question",name:e,text:e,answerCount:1,datePublished:r,dateModified:n,acceptedAnswer:{"@type":"Answer",text:t}}},s=document.createElement("script");s.type="application/ld+json",s.text=JSON.stringify(o),document.head.appendChild(s)}}else if(q||C||E||w){const e=[];q||e.push("question"),C||e.push("answer"),E||e.push("published"),w||e.push("modified"),console.warn(`[schema] FAQ page schema missing required fields: ${e.join(", ")}`)}const v=document.querySelector('[data-hs-schema-blog="name"]'),N=document.querySelector('[data-hs-schema-blog="published"]'),$=document.querySelector('[data-hs-schema-blog="modified"]'),F=document.querySelector('[data-hs-schema-blog="summary"]'),L=document.querySelector('[data-hs-schema-blog="author-name"]'),k=document.querySelector('[data-hs-schema-blog="author-type"]');if(v&&N&&$&&F&&L&&k){const e=v.textContent?.trim()||"",r=N.textContent?.trim()||"",n=$.textContent?.trim()||"",o=F.textContent?.trim()||"",s=L.textContent?.trim()||"",i=k.textContent?.trim()||"Organization",a=document.querySelector('[data-hs-schema-blog="author-role"]'),c=document.querySelector('[data-hs-schema-blog="author-image"]'),l=a?.textContent?.trim()||"",d=c?.src||"",u=t("company"),m=document.querySelector('[data-hs-replace="business-logo"] img'),p=m?m.src:"";let h;"Person"===i?(h={"@type":"Person",name:s},l&&(h.jobTitle=l),d&&(h.image=d)):(h={"@type":"Organization",name:s},p&&(h.logo=p));const f={"@context":"https://schema.org","@type":"BlogPosting",headline:e,description:o,datePublished:r,dateModified:n,author:h,publisher:{"@type":"Organization",name:u||s,logo:{"@type":"ImageObject",url:p}},mainEntityOfPage:{"@type":"WebPage","@id":window.location.href}},y=document.createElement("script");y.type="application/ld+json",y.text=JSON.stringify(f),document.head.appendChild(y)}else if(v||N||$||F||L||k){const e=[];v||e.push("name"),N||e.push("published"),$||e.push("modified"),F||e.push("summary"),L||e.push("author-name"),k||e.push("author-type"),console.warn(`[schema] Blog page schema missing required fields: ${e.join(", ")}`)}}(),{result:"schema initialized",destroy:()=>{}}}function i(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n;for(;n=r.nextNode();)n.nodeValue?.trim()&&t.push(n);return t}function a(e){const t=[];return e.hasAttribute("href")&&t.push(e),t.push(...Array.from(e.querySelectorAll("[href]"))),t}function c(e){if(e.hasAttribute("src")){if(e.getAttribute("src"))return e}const t=e.querySelector("[src]");if(t){if(t.getAttribute("src"))return t}return null}function l(e,t,r){if(function(e,t){const r=t.attributes.properties.syncField;return null!==e.querySelector(`[${r}]`)}(t,r))return void function(e,t,r){const n=r.attributes.properties.syncField;e.querySelectorAll(`[${n}]`).forEach(e=>{const r=e.getAttribute(n),o=t.querySelector(`[${n}="${r}"]`);if(!o)return;const s=c(e),a=c(o);if(s&&a){const e=s.getAttribute("src");e&&a.setAttribute("src",e)}else if(e.hasAttribute("href")&&o.hasAttribute("href")){const t=e.getAttribute("href");t&&o.setAttribute("href",t)}else{const t=i(e),r=t.length>0?t[0].nodeValue:e.textContent.trim();if(r){const e=i(o);e.length>0?e[0].nodeValue=r:o.textContent=r}}})}(e,t,r);const n=i(e),o=n.length>0?n[0].nodeValue:"",s=a(e),l=s.length>0?s[0].getAttribute("href"):"";if(o){i(t).forEach(e=>{e.nodeValue=o})}if(l){a(t).forEach(e=>{e.setAttribute("href",l)})}}const d="hs-dupe-no-transition";let u=!1;async function m(t){!function(){if(u)return;const e=document.createElement("style");e.textContent=`\n .${d},\n .${d} * {\n transition: none !important;\n animation: none !important;\n }\n `,document.head.appendChild(e),u=!0}();const r={processedElements:[]};return e(t,"wrapper").forEach(e=>{const t=e.getAttribute("data-hs-dupe");if(!t||"child"!==t&&"self"!==t)return void console.warn('[dupe] Invalid mode. Use "child" or "self":',e);const n=e.getAttribute("data-hs-dupe-count");let o=n?parseInt(n,10):1;(isNaN(o)||o<1)&&(console.warn("[dupe] Invalid count, using default of 1:",e),o=1),o>20&&(console.warn(`[dupe] Count of ${o} exceeds maximum of 20. Capping at 20.`),o=20);const s={hidden:e.hasAttribute("data-hs-dupe-hidden"),noSelect:e.hasAttribute("data-hs-dupe-no-select")};"child"===t?function(e,t,r,n){const o=e.children[0];if(!o)return;const s=[];for(let i=0;i<t;i++){const t=o.cloneNode(!0);t.classList.add(d),p(t,r),e.appendChild(t),s.push(t),t.offsetHeight,requestAnimationFrame(()=>{t.classList.remove(d)})}n.processedElements.push({element:e,mode:"child",clones:s})}(e,o,s,r):"self"===t&&function(e,t,r,n){const o=e.parentNode;if(!o)return void console.warn("[dupe] Element has no parent, cannot duplicate self:",e);const s=[];let i=e;for(let a=0;a<t;a++){const t=e.cloneNode(!0);t.classList.add(d),t.removeAttribute("data-hs-dupe"),t.removeAttribute("data-hs-dupe-count"),t.removeAttribute("data-hs-dupe-hidden"),t.removeAttribute("data-hs-dupe-no-select"),p(t,r),i.nextSibling?o.insertBefore(t,i.nextSibling):o.appendChild(t),s.push(t),i=t,t.offsetHeight,requestAnimationFrame(()=>{t.classList.remove(d)})}n.processedElements.push({element:e,mode:"self",clones:s})}(e,o,s,r)}),{result:`dupe processed ${r.processedElements.length} elements`,destroy:()=>{}}}function p(e,t){if(t.hidden&&e.setAttribute("aria-hidden","true"),t.noSelect){const t=e;t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.msUserSelect="none"}}async function h(){const i={destroyFunctions:[]},a=o.normalize;try{const d=s();d&&"destroy"in d&&"function"==typeof d.destroy&&i.destroyFunctions.push(d.destroy);const u=(c=o.normalize?.replace,function(){const e=new Map,t=n(c,"element");document.querySelectorAll(t).forEach(t=>{const r=t.cloneNode(!0),o=n(c,"hide");r.querySelectorAll(o).forEach(e=>{const t=c.attributes.elements.hide.primary.match(/data-hs-replace-hide/)[0],r=e.getAttribute(t);r&&r.split(" ").filter(e=>e.trim()).some(t=>e.classList.contains(t))&&e.remove()});const s=c.attributes.elements.element.primary.match(/data-hs-replace/)[0],i=t.getAttribute(s),a=r.textContent?.trim()||null,l=t.getAttribute("href");if(i&&(a||l)){const t={text:a,href:l};if(e.has(i)){const r=e.get(i);Array.isArray(r)?r.push(t):e.set(i,[r,t])}else e.set(i,t)}});const r="hsfx-form-persist";try{const t=localStorage.getItem(r);if(t){const n=JSON.parse(t),o=parseInt(n.timestamp,10);Date.now()-o>864e5?localStorage.removeItem(r):Object.entries(n).forEach(([t,r])=>{"timestamp"!==t&&"string"==typeof r&&e.set(`form.${t}`,{text:r,href:null})})}}catch{}const o=(new Date).getFullYear().toString(),s=["January","February","March","April","May","June","July","August","September","October","November","December"][(new Date).getMonth()];e.set("year",{text:o,href:null}),e.set("month",{text:s,href:null});const i=/\{\{[^}]+\}\}/,a=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:e=>{const t=e.textContent||"";return i.test(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),l=[];let d;for(;d=a.nextNode();)l.push(d);l.forEach(t=>{let r=t.textContent||"",n=!1;for(const[s,i]of e.entries()){const e=`{{${s}}}`;if(r.includes(e)){let t=null;t=Array.isArray(i)?i.map(e=>e.text||e.href).filter(Boolean).join(", "):i.text||i.href,t&&(r=r.replace(new RegExp(e,"g"),t),n=!0)}}const o=/\{\{[^}]+\}\}/g;o.test(r)&&(r=r.replace(o,""),n=!0),n&&(t.textContent=r)}),document.querySelectorAll("a[href]").forEach(t=>{let r=t.getAttribute("href")||"",n=!1;for(const[s,i]of e.entries()){const e=`{{${s}}}`;if(r.includes(e)){let t=null;if(Array.isArray(i)){const e=i[0];t=e.href||e.text}else{if(i.href){t=i.href,r=i.href,n=!0;break}i.text&&(t=i.text)}t&&!n&&(r=r.replace(new RegExp(e,"g"),t),n=!0)}}const o=/\{\{[^}]+\}\}/g;o.test(r)&&(r=r.replace(o,""),n=!0),n&&t.setAttribute("href",r)});const u=document.querySelector("[data-hs-replace-test]");if(u){const t={};for(const[n,o]of e.entries()){const e=`{{${n}}}`;if(Array.isArray(o)){const r=o.map(e=>e.text||e.href).filter(Boolean).join(", ");t[n]={placeholder:e,value:r,type:`Array (${o.length} items)`,items:o.map(e=>e.text||e.href||"(empty)")}}else{const r=o.text||o.href||"(empty)";t[n]={placeholder:e,value:r,...o.text&&{text:o.text},...o.href&&{href:o.href}}}}const r=document.createElement("pre");r.textContent=JSON.stringify(t,null,2),u.innerHTML="",u.appendChild(document.createTextNode(`Replace Module Debug (${e.size} replacements):`)),u.appendChild(r)}document.querySelector("[data-hs-form-persist-clear]")&&localStorage.removeItem(r)}(),{result:"replace initialized",destroy:()=>{}});u&&"destroy"in u&&"function"==typeof u.destroy&&i.destroyFunctions.push(u.destroy);const p=await async function(r){const n=e(r,"source"),o=new Map,s=new Map;n.forEach(e=>{const t=e.getAttribute(r.attributes.properties.syncId),n=e.getAttribute(r.attributes.properties.syncField);t&&o.set(t,e),n&&s.set(n,e)});const i=e(r,"target");let a=0,c=0;return i.forEach(n=>{const i=n.getAttribute(r.attributes.properties.syncId),d=n.getAttribute(r.attributes.properties.syncField),u=n.getAttribute(r.attributes.properties.syncValue);let m;if(d&&u){if(m=s.get(d),!m)return void c++}else{if(!i)return void c++;if(m=o.get(i),!m)return void c++}const p=t(r,"item",n);if(!p){const e=d||i||"unknown";return void console.warn(`[sync] Target list "${e}" missing item template`)}const h="child"===p.getAttribute(r.attributes.properties.syncMode),f=t(r,"ignore",n);let y,g;if(u){const t=e(r,"item",m),n=Array.from(t).find(e=>e.getAttribute(r.attributes.properties.syncValue)===u);if(!n)return void console.warn(`[sync] No source item found with value "${u}" in field "${d}"`);y=[n]}else if(y=Array.from(e(r,"item",m)),0===y.length)return void console.warn(`[sync] Source list "${i}" has no items`);if(h){const e=p.firstElementChild;if(!e)return void console.warn(`[sync] Target list "${i}" has sync-mode="child" but item wrapper has no children`);g=e.cloneNode(!0)}else g=p.cloneNode(!0),g.removeAttribute(r.attributes.elements.item.primary.split("=")[0]);let b=!1;if(f){let e=f.nextElementSibling;for(;e;){if(e===p){b=!0;break}e=e.nextElementSibling}}if(h){for(;p.firstChild;)p.removeChild(p.firstChild);y.forEach(e=>{const t=g.cloneNode(!0);l(e,t,r),p.appendChild(t)}),p.removeAttribute(r.attributes.elements.item.primary.split("=")[0])}else{Array.from(n.children).forEach(e=>{e!==f&&e.remove()});const e=Array.from(y).map(e=>{const t=g.cloneNode(!0);return l(e,t,r),t});f?b?e.forEach(e=>{n.appendChild(e)}):e.forEach(e=>{n.insertBefore(e,f)}):e.forEach(e=>{n.appendChild(e)})}a++}),{result:`sync initialized (${a} synced, ${c} skipped)`,destroy:()=>{}}}(a.sync);p&&"destroy"in p&&"function"==typeof p.destroy&&i.destroyFunctions.push(p.destroy);const h=await m(a.dupe);h&&"destroy"in h&&"function"==typeof h.destroy&&i.destroyFunctions.push(h.destroy);const f=await async function(){const t={processedWrappers:[]};return e(r.clickable,"wrapper").forEach(e=>{const r=e.querySelector(":scope > button"),n=e.querySelector(":scope > a");if(!r||!n)return;const o=n.getAttribute("href");let s,i;o&&""!==o&&"#"!==o?(s=n,i=r):(s=r,i=n);const a="button"===s.getAttribute("data-hs-clickable");a||s.setAttribute("data-hs-clickable","button"),i.remove(),t.processedWrappers.push({wrapper:e,keptElement:s,wasLink:s===n,addedAttribute:!a})}),{result:`clickable processed ${t.processedWrappers.length} wrappers`,destroy:()=>{}}}();return f&&"destroy"in f&&"function"==typeof f.destroy&&i.destroyFunctions.push(f.destroy),{result:"normalize initialized",destroy:()=>{i.destroyFunctions.reverse().forEach(e=>{try{e()}catch(t){console.error("[normalize] Error during cleanup:",t)}}),i.destroyFunctions.length=0}}}catch(d){throw console.error("[normalize] Initialization failed:",d),i.destroyFunctions.reverse().forEach(e=>{try{e()}catch(t){console.error("[normalize] Error during error cleanup:",t)}}),d}var c}export{h as init};
|
|
Binary file
|
|
Binary file
|
package/dist/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/
|
|
2
|
-
import{c as e}from"./assets/hsfxutilsMPToI1FZ.js";const t={},s=function(e,s,o){let r=Promise.resolve();if(s&&s.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");r=e(s.map(e=>{if((e=function(e){return"https://cdn.jsdelivr.net/npm/@hsfx/attr@2.0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hsfxnormalizeVKiJWGQE.js","assets/hsfxutilsMPToI1FZ.js","assets/hsfxdefaultDHOokRk4.js","assets/hsfxanimationsBGqbwIJd.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as e}from"./assets/hsfxutilsMPToI1FZ.js";const t={},s=function(e,s,o){let r=Promise.resolve();if(s&&s.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");r=e(s.map(e=>{if((e=function(e){return"https://cdn.jsdelivr.net/npm/@hsfx/attr@2.0.11/dist/"+e}(e))in t)return;t[e]=!0;const s=e.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${o}`))return;const r=document.createElement("link");return r.rel=s?"stylesheet":"modulepreload",s||(r.as="script"),r.crossOrigin="",r.href=e,a&&r.setAttribute("nonce",a),document.head.appendChild(r),s?new Promise((t,s)=>{r.addEventListener("load",t),r.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function a(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(const e of t||[])"rejected"===e.status&&a(e.reason);return e().catch(a)})},o=e._global.apiName;(async()=>{if(window[o]&&!Array.isArray(window[o])&&window[o].loaded)return;const t=Array.isArray(window[o])?window[o]:[],r={normalize:()=>s(()=>import("./assets/hsfxnormalizeVKiJWGQE.js"),__vite__mapDeps([0,1])),default:()=>s(()=>import("./assets/hsfxdefaultDHOokRk4.js"),__vite__mapDeps([2,1])),animations:()=>s(()=>import("./assets/hsfxanimationsBGqbwIJd.js"),__vite__mapDeps([3,1]))};let a=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===a.length&&(a=[...document.querySelectorAll('script[type="module"][src*="@hsfx/attr"]')].filter(e=>{const t=e.src,s=import.meta.url,o=t.match(/@hsfx\/attr(@[\d.]+)?/)?.[0],r=s.match(/@hsfx\/attr(@[\d.]+)?/)?.[0];return o&&r&&o.split("@")[0]===r.split("@")[0]}));const n={isSPA:a.some(e=>"true"===e.getAttribute("data-hs-spa"))},l={normalize:{modules:["normalize"],parallel:!1},default:{modules:["default"],parallel:!0}},i=async e=>{const t=window[o];if(t.process.has(e))return t.modules[e]?.loading;t.process.add(e);const s=t.modules[e]||{};let a;t.modules[e]=s,s.loading=new Promise((e,t)=>{s.resolve=e,s.reject=t});try{const{init:o}=await r[e](),n=await o()||{};a=n.destroy;const l=n.result;return s.destroy=()=>{a?.(),t.process.delete(e)},s.restart=()=>{s.destroy?.(),t.load(e)},s.resolve?.(l),delete s.resolve,delete s.reject,l}catch(n){throw a?.(),s.reject?.(n),t.process.delete(e),n}},d=async e=>{const t=l[e];if(t.parallel){const e=t.modules.map(e=>i(e));await Promise.allSettled(e)}else for(const s of t.modules)await i(s)},c=async()=>{await Promise.allSettled([r.normalize(),r.default(),r.animations()]),await d("normalize");const e=d("default"),t=i("animations");await e,(()=>{const e=new CustomEvent(`${o}:dom-ready`);window.dispatchEvent(e)})();const{initScrollAnimations:a}=await s(async()=>{const{initScrollAnimations:e}=await import("./assets/hsfxutilsMPToI1FZ.js").then(e=>e.r);return{initScrollAnimations:e}},[]);Promise.all([t,a()]).catch(e=>{console.error(`[${o}] Phase 3 (animations + scroll trigger) failed:`,e)})},u=[];window[o]={scripts:a,settings:n,modules:{},process:new Set,load:i,loaded:!1,push(...e){for(const[t,s]of e)"function"==typeof s?this.modules[t]?.loading?.then(s):this.load(t)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await c(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const t=e.getAttribute("data-hs-module-type"),s=e.getAttribute("data-hs-module");if(t&&s){const e=`data-hs-${t}-${s}`;r[e]&&this.load(e)}})})},ready(e){"function"==typeof e&&(this.loaded?e():u.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:l}}};(async()=>{window[o].push(...t),document.querySelectorAll("iframe").forEach(e=>{const t=e.src;t&&(e.src="",e.src=t)}),await c(),window[o].loaded=!0,document.documentElement.classList.add(e._global.classes.ready),u.forEach(e=>{try{e()}catch{}}),u.length=0})().catch(()=>{})})();export{s as _};
|
package/dist/main.js.br
CHANGED
|
Binary file
|
package/dist/main.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|