{"version":3,"file":"withFilterUpdate.BooRSxst.mjs","names":["useMemo","paymentInterval"],"sources":["https:/framerusercontent.com/modules/U7Gk6MCDr8UfNeiBVJeN/x6uTfua4Jt5zSU0zpGTI/withFilterUpdate.js"],"sourcesContent":["/*\n    UPDATE FILTERS\n    Compound override for elements that are influenced by changes in GRADE / INTERVAL\n*/import{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{useStore}from\"https://framer.com/m/ElicejusStore-HHWF.js@AIAuRd3zvtbJvf10k1Uq\";export function withFilterUpdate(Component){return props=>{const{gradeFallback,onlyShowGrades,listAllGrades}=props;const[store]=useStore();const allowedGrades=useMemo(()=>{if(!onlyShowGrades)return[];return onlyShowGrades.split(\",\").map(s=>Number(s.trim())).filter(n=>!isNaN(n));},[onlyShowGrades]);const{computedGrade,paymentInterval}=useMemo(()=>{const elicejusGrade=store.elicejusGrade;const paymentInterval=store.elicejusPaymentInterval;if(listAllGrades&&(elicejusGrade==null||elicejusGrade===-1)){return{computedGrade:\"5,6,7,8,9,10,11,12\",paymentInterval};}if(elicejusGrade==null){return{computedGrade:undefined,paymentInterval};}if(allowedGrades.length>0&&!allowedGrades.includes(elicejusGrade)){return{computedGrade:allowedGrades[0],paymentInterval};}if(elicejusGrade<5||elicejusGrade>12){return{computedGrade:gradeFallback!==undefined?gradeFallback:undefined,paymentInterval};}return{computedGrade:elicejusGrade,paymentInterval};},[store.elicejusGrade,store.elicejusPaymentInterval,gradeFallback,allowedGrades,listAllGrades]);// ✅ Log the computed grade for debugging\n// console.log(\"🔍 computedGrade:\", computedGrade)\nreturn /*#__PURE__*/_jsx(Component,{...props,grade:computedGrade,paymentInterval:paymentInterval});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFilterUpdate\":{\"type\":\"reactHoc\",\"name\":\"withFilterUpdate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./withFilterUpdate.map"],"mappings":"+KAG8J,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,gBAAc,iBAAe,iBAAe,EAAW,CAAC,GAAO,GAAU,CAAO,EAAcA,MAAiB,EAA+B,EAAe,MAAM,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC,CAAjF,EAAE,CAAkF,CAAC,EAAe,CAAC,CAAM,CAAC,gBAAc,mBAAiBA,MAAY,CAAC,IAAM,EAAc,EAAM,cAAoBC,EAAgB,EAAM,wBAAod,OAAzb,IAAgB,GAAe,MAAM,IAAgB,IAAW,CAAC,cAAc,qBAAqB,gBAAA,EAAgB,CAAK,GAAe,KAAY,CAAC,cAAc,IAAA,GAAU,gBAAA,EAAgB,CAAK,EAAc,OAAO,GAAG,CAAC,EAAc,SAAS,EAAc,CAAQ,CAAC,cAAc,EAAc,GAAG,gBAAA,EAAgB,CAAK,EAAc,GAAG,EAAc,GAAU,CAAC,cAAc,IAAgB,IAAA,GAAwB,IAAA,GAAd,EAAwB,gBAAA,EAAgB,CAAQ,CAAC,cAAc,EAAc,gBAAA,EAAgB,EAAG,CAAC,EAAM,cAAc,EAAM,wBAAwB,EAAc,EAAc,EAAc,CAAC,CAEvqC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,EAA8B,kBAAgB,CAAC,mBAFrD,IAA2B,IAAsF"}