PageSourceSearch

https://www.template.net/assets/CommonStarredTemplates-BSNKUruC.mjs

js template.net collected 2026-09-24 15:19:00 UTC 1,304 bytes, 1 lines download raw bytes

1import{r as s}from"./globals-BMcmkdEs.mjs";import{D as u,u as m}from"./globals-store-Au-yZUsz.mjs";import{Z as l}from"./index-FWpnoxBm.mjs";import{u as d}from"./starred.store-YcW4LtAg.mjs";import"./workspace-Dr5TlatR.mjs";function T(){const e=d(t=>t.productIds),c=d(t=>t.isFetched),i=l.useToastManager();s.useEffect(()=>{e.length&&n()},[c,e]);const n=s.useCallback(()=>{document.querySelectorAll(".product .starred-icon-wrapper").forEach(a=>{const o=a.dataset.productId;a.setAttribute("data-is-starred",e.includes(Number(o))?"true":"false")});const r=document.querySelector("#btn-star-template");r&&r.setAttribute("data-is-starred",e.includes(Number(window.appData.product?.id))?"true":"false")},[e]);return s.useEffect(()=>{if(e.length)return document.addEventListener("reload-starred-templates",n),()=>{document.removeEventListener("reload-starred-templates",n)}},[e]),s.useEffect(()=>{async function t(r){const{detail:a}=r;if(m.getState().isLoggedIn){const o=await d.getState().toggleStarTemplate(a.productId,a.isStarrParam);i.add({type:"success",description:o})}else{document.emitEvent("toggle-modal-Auth",{onSuccess:async()=>{await t(r)},isSignIn:!1});return}}return document.addEventListener(u.STAR_TEMPLATE,t),()=>{document.removeEventListener(u.STAR_TEMPLATE,t)}},[e]),null}export{T 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.