{"version":3,"file":"utilities-8ac3a8d1.js","sources":["../../../../app/frontend/components/shared/utilities.js"],"sourcesContent":["export function createIntersectionObsv(el, intersectionFn) {\n const observer = new IntersectionObserver((records) => {\n for (const record of records) {\n if (record.isIntersecting) {\n intersectionFn();\n observer.unobserve(el);\n };\n }\n }, {\n threshold: [1, 0],\n });\n return observer;\n}\n\nexport function isElementVisible(el){\n // https://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom\n return el.getClientRects().length !== 0\n}\n\n// https://www.freecodecamp.org/news/javascript-debounce-example/\nexport function debounce(func, timeout = 300){\n let timer;\n return (...args) => {\n clearTimeout(timer);\n timer = setTimeout(() => { func.apply(this, args); }, timeout);\n };\n}\n"],"names":["createIntersectionObsv","el","intersectionFn","observer","records","record","isElementVisible"],"mappings":"AAAO,SAASA,EAAuBC,EAAIC,EAAgB,CACzD,MAAMC,EAAW,IAAI,qBAAsBC,GAAY,CACrD,UAAWC,KAAUD,EACfC,EAAO,iBACTH,IACAC,EAAS,UAAUF,CAAE,EAG7B,EAAK,CACD,UAAW,CAAC,EAAG,CAAC,CACpB,CAAG,EACD,OAAOE,CACT,CAEO,SAASG,EAAiBL,EAAG,CAElC,OAAOA,EAAG,iBAAiB,SAAW,CACxC"}