1function S(){y(),h(),g({list:"[data-fb-menu-list]",row:"[data-fb-menu-row]",add:"[data-fb-menu-add]",remove:"[data-fb-menu-remove]",max:3,onClone:b}),g({list:"[data-fb-ib-list]",row:"[data-fb-ib-row]",add:"[data-fb-ib-add]",remove:"[data-fb-ib-remove]",max:4}),document.querySelectorAll("[data-fb-menu-row]").forEach(b),document.addEventListener("change",t=>{if(t.target&&t.target.matches("[data-fb-menu-type]")){const e=t.target.closest("[data-fb-menu-row]");e&&m(e)}})}function y(){const t=document.querySelector("[data-fb-setup]");if(!t)return;const e=Array.from(t.querySelectorAll("[data-fb-tab]")),n=Array.from(t.querySelectorAll("[data-fb-panel]"));if(!e.length||!n.length)return;const s=["bg-wa-deep","text-paper-0","font-medium"],l=["text-ink-700","hover:bg-paper-50"],r=a=>{n.forEach(o=>{o.classList.toggle("hidden",o.getAttribute("data-fb-panel")!==a)}),e.forEach(o=>{const d=o.getAttribute("data-fb-tab")===a;s.forEach(u=>o.classList.toggle(u,d)),l.forEach(u=>o.classList.toggle(u,!d))})};e.forEach(a=>a.addEventListener("click",()=>r(a.getAttribute("data-fb-tab")))),r(t.getAttribute("data-initial-tab")||e[0].getAttribute("data-fb-tab"))}function h(){const t=document.querySelector("[data-fb-greeting]"),e=document.querySelector("[data-fb-greeting-count]");if(!t)return;const n=document.querySelector("[data-fb-greeting-preview]"),s=n?n.textContent:"",l=()=>{const r=t.value||"";e&&(e.textContent=String(r.length)),n&&(n.textContent=r.trim()!==""?r:s)};t.addEventListener("input",l),l()}function m(t){const e=t.querySelector("[data-fb-menu-type]"),n=e&&e.value==="web_url",s=t.querySelector("[data-fb-menu-payload]"),l=t.querySelector("[data-fb-menu-url]");s&&(s.hidden=n),l&&(l.hidden=!n)}function b(t){m(t)}function g({list:t,row:e,add:n,remove:s,max:l,onClone:r}){const a=document.querySelector(t),o=document.querySelector(n);if(!a||!o)return;const d=c=>{c.querySelectorAll("input, textarea").forEach(i=>{i.value=""}),c.querySelectorAll("select").forEach(i=>{i.selectedIndex=0})};o.addEventListener("click",()=>{const c=a.querySelectorAll(e);if(c.length>=l)return;const i=c[0].cloneNode(!0);d(i),a.appendChild(i),typeof r=="function"&&r(i),u()}),a.addEventListener("click",c=>{const i=c.target.closest(s);if(!i)return;const p=a.querySelectorAll(e),f=i.closest(e);f&&(p.length<=1?(d(f),typeof r=="function"&&r(f)):f.remove(),u())});function u(){const c=a.querySelectorAll(e).length>=l;o.disabled=c,o.classList.toggle("opacity-40",c),o.classList.toggle("pointer-events-none",c)}u()}export{S as default};
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.