PageSourceSearch

https://tumichael.com/assets/js/vendor-optin.js

js tumichael.com collected 2026-10-04 07:01:53 UTC 2,482 bytes, 6 lines download raw bytes

1import{s as m}from"./vendor-dom.js";import"./vendor-device.js";import"./vendor-toast.js";import"./vendor-i18n.js";class h extends HTMLElement{data={};connectedCallback(){this.initData(),this.render(),this.bindEvents()}initData(){if(typeof window<"u"&&typeof window.pageContent=="function")try{this.data=window.pageContent()||{}}catch{this.data={}}}bindEvents(){const t=this.querySelector("#form-signup");t&&t.addEventListener("submit",n=>this.handleSubmit(n))}handleSubmit(t){t.preventDefault();const n=t.target,s=this.data.hero||{},e=s.webhook_URL,a=s.redirectURL||"/";if(!e){window.location.href=a;return}const i=new FormData(n);fetch(e,{method:"POST",body:i}).then(()=>{window.location.href=a}).catch(o=>{window.location.href=a})}render(){const t=this.data.hero;if(t){const e=this.querySelector("[data-hero-subtitle]");e&&t.subTitle&&(e.textContent=t.subTitle);const a=this.querySelector("[data-hero-title]");a&&t.title&&(a.textContent=t.title);const i=this.querySelector("[data-hero-description]");i&&t.description&&(i.textContent=t.description);const o=this.querySelector("[data-hero-button]");o&&t.button_text&&(o.textContent=t.button_text);const r=this.querySelector("[data-hero-img]");r&&t.imgURL&&(r.src=t.imgURL)}for(let e=1;e<=4;e++){const a=`section_${e}`,i=this.data[a],o=this.querySelector(`[data-section="${e}"]`);if(o){if(!i){o.remove();continue}const r=o.querySelector(`[data-sec${e}-subtitle]`);r&&i.subTitle&&(r.textContent=i.subTitle);const l=o.querySelector(`[data-sec${e}-title]`);l&&i.title&&(l.textContent=i.title);const d=o.querySelector(`[data-sec${e}-img]`);d&&i.imgURL&&(d.src=i.imgURL);const c=o.querySelector(`[data-sec${e}-benefits]`);if(c&&Array.isArray(i.benefits)){const u=c.getAttribute("data-check-icon")||"";c.innerHTML=i.benefits.map(b=>`
2            <li class="flex items-center space-x-3">
3              ${u}
4              <span>${m(b)}</span>
5            </li>
6          `).join("")}}}const n=this.data.CTA,s=this.querySelector("[data-cta-section]");if(s)if(!n)s.remove();else{const e=s.querySelector("[data-cta-title]");e&&n.title&&(e.textContent=n.title);const a=s.querySelector("[data-cta-highlight]");a&&n.title_highlight&&(a.textContent=n.title_highlight);const i=s.querySelector("[data-cta-subtitle]");i&&n.subTitle&&(i.textContent=n.subTitle);const o=s.querySelector("[data-cta-button]");o&&n.button_text&&(o.textContent=n.button_text)}}}customElements.get("tana-optin")||customElements.define("tana-optin",h);export{h as TanaOptin};

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.