{"version":3,"file":"CMS_Filter.DFcI3av6.mjs","names":["filteredItems","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/HelQTRHAmnWPWsCDnTyf/v12V64DpUrRWue0rvQi7/CMS_Filter.js"],"sourcesContent":["// Broadcast 3.0 Code to be used with 3.0 components\nimport{jsx as _jsx}from\"react/jsx-runtime\";// Unique identifier for the broadcaster\nconst BROADCAST_ID=\"3.14px solid transparent\";function applyPagination(broadcaster){// If no pagination config exists or is disabled, show ALL filtered items\nif(!window.paginationConfig?.isEnabled||!window.allBroadcastItems){console.log(\"No pagination - showing ALL filtered items\");if(window.allBroadcastItems){const filteredItems=window.allBroadcastItems.filter(item=>{const filterAttributes=item.getAttributeNames().filter(name=>name.startsWith(\"data-filter-\"));if(filterAttributes.length>0){return filterAttributes.every(attr=>item.getAttribute(attr)===\"match\");}else{return true;}});// Hide all items first\nwindow.allBroadcastItems.forEach(item=>{item.style.display=\"none\";});// Show ALL filtered items (no limits)\nfilteredItems.forEach(item=>{item.style.display=\"\";});console.log(`Showing ALL ${filteredItems.length} filtered items (NO LIMITS)`);}return;}// Only get here if pagination is explicitly enabled\nconst{itemsPerPage,currentPage,mode}=window.paginationConfig;// Get items that pass all filters\nconst filteredItems=window.allBroadcastItems.filter(item=>{const filterAttributes=item.getAttributeNames().filter(name=>name.startsWith(\"data-filter-\"));if(filterAttributes.length>0){return filterAttributes.every(attr=>item.getAttribute(attr)===\"match\");}else{return true;}});console.log(`Filtered ${window.allBroadcastItems.length} items down to ${filteredItems.length}`);// Apply pagination based on mode\nlet itemsToShow=[];if(mode===\"pagination\"){// Traditional pagination - show only current page\nconst startIndex=(currentPage-1)*itemsPerPage;const endIndex=startIndex+itemsPerPage;itemsToShow=filteredItems.slice(startIndex,endIndex);console.log(`Pagination mode: page ${currentPage}, items ${startIndex}-${endIndex-1} of ${filteredItems.length} filtered items`);}else if(mode===\"loadMore\"||mode===\"autoScroll\"){// Load more / auto scroll - show all items up to current page\nconst totalItemsToShow=currentPage*itemsPerPage;itemsToShow=filteredItems.slice(0,totalItemsToShow);console.log(`${mode} mode: showing first ${totalItemsToShow} items (${itemsToShow.length} available)`);}else{// Fallback to show all if mode is unknown\nitemsToShow=filteredItems;console.log(`Unknown mode \"${mode}\", showing all ${filteredItems.length} items`);}// Hide ALL items first\nwindow.allBroadcastItems.forEach(item=>{item.style.display=\"none\";});// Show selected items\nitemsToShow.forEach(item=>{item.style.display=\"\";});console.log(`Applied ${mode} pagination: showing ${itemsToShow.length} items`);}// Initialize global function safely\nfunction initializeGlobalPagination(){if(typeof window!==\"undefined\"){window.updatePagination=function(config){console.log(\"updatePagination called with:\",config);// Only create config when pagination is actually enabled\nif(config.isEnabled){if(!window.paginationConfig){window.paginationConfig={itemsPerPage:config.itemsPerPage||12,currentPage:config.currentPage||1,isEnabled:true,mode:config.mode||\"pagination\"};}else{Object.assign(window.paginationConfig,{itemsPerPage:config.itemsPerPage||window.paginationConfig.itemsPerPage,currentPage:config.currentPage||window.paginationConfig.currentPage,isEnabled:config.isEnabled??window.paginationConfig.isEnabled,mode:config.mode||window.paginationConfig.mode});}window.paginationComponentExists=true;}else{// Completely clear pagination when disabled\nconsole.log(\"Disabling pagination - clearing config\");window.paginationConfig=undefined;window.paginationComponentExists=false;}console.log(\"Pagination config:\",window.paginationConfig);// Apply pagination immediately\nconst broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);if(broadcasterElements.length>0){applyPagination(broadcasterElements[0]);}else{console.log(\"No broadcaster found\");}};}}// Initialize on module load\ninitializeGlobalPagination();export function Broadcaster(){return{style:{border:BROADCAST_ID},animate:{scale:1,transition:{duration:.1}},onAnimationComplete(){console.log(\"Broadcaster onAnimationComplete triggered\");// Ensure global function is available\ninitializeGlobalPagination();const broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);console.log(\"Found broadcaster elements:\",broadcasterElements.length);if(broadcasterElements.length>0){const broadcaster=broadcasterElements[0];// Store all items\nwindow.allBroadcastItems=Array.from(broadcaster.children);console.log(`Stored ${window.allBroadcastItems.length} items`);// IMMEDIATELY hide all items to prevent flash\nwindow.allBroadcastItems.forEach(item=>{item.style.display=\"none\";});console.log(\"Hidden all items initially\");// Apply initial display logic (NO DEFAULT CONFIG)\napplyPagination(broadcaster);}else{console.log(\"No broadcaster found!\");}}};}export function BroadcastListener(){return{animate:{scale:1,transition:{duration:.1}},onAnimationComplete(){console.log(\"Broadcast listener activated\");},onTap(){console.log(\"Removing last item\");if(window.allBroadcastItems&&window.allBroadcastItems.length>0){const lastItem=window.allBroadcastItems.pop();if(lastItem&&lastItem.parentNode){lastItem.parentNode.removeChild(lastItem);console.log(\"Removed item, remaining:\",window.allBroadcastItems.length);// Reapply pagination/filtering with new item count\nconst broadcasterElements=document.querySelectorAll(`[style*=\"border: ${BROADCAST_ID}\"]`);if(broadcasterElements.length>0){applyPagination(broadcasterElements[0]);}}}}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withBroadcaster(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...Broadcaster(props)});};}withBroadcaster.displayName=\"Broadcaster\";export function withBroadcastListener(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...BroadcastListener(props)});};}withBroadcastListener.displayName=\"BroadcastListener\";\nexport const __FramerMetadata__ = {\"exports\":{\"withBroadcaster\":{\"type\":\"reactHoc\",\"name\":\"withBroadcaster\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BroadcastListener\":{\"type\":\"override\",\"name\":\"BroadcastListener\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBroadcastListener\":{\"type\":\"reactHoc\",\"name\":\"withBroadcastListener\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Broadcaster\":{\"type\":\"override\",\"name\":\"Broadcaster\",\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