{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/hLTcniQUwp0ja4ytX0HG/HmANkc1GZH8XdHYJe1bz/Pagination.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,useCallback}from\"react\";// Pagination settings\nconst ITEMS_PER_PAGE=12;// Styles\nconst PAGINATION_STYLES={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",marginTop:\"20px\"};const BUTTON_STYLES={padding:\"8px 12px\",margin:\"0 5px\",backgroundColor:\"#fff\",color:\"#333\",border:\"1px solid #ccc\",borderRadius:\"12px\",cursor:\"pointer\",fontSize:\"16px\",fontFamily:\"Arial, sans-serif\",fontWeight:\"normal\",transition:\"background-color 0.3s ease\"};const BUTTON_HOVER_STYLES={backgroundColor:\"#f0f0f0\"};const BUTTON_ACTIVE_STYLES={backgroundColor:\"#000\",color:\"#fff\",border:\"1px solid #000\",cursor:\"default\"};export function cardPaginator(Component){return props=>{const[currentPage,setCurrentPage]=useState(1);const[totalPages,setTotalPages]=useState(1);const updatePagination=useCallback(()=>{const layer=document.querySelector(`.${props.className}`);if(layer){const cards=layer.querySelectorAll(\"[aria-label='cmsitem']\");const totalItems=cards.length;const calculatedTotalPages=Math.ceil(totalItems/ITEMS_PER_PAGE);setTotalPages(calculatedTotalPages);const validPage=Math.min(Math.max(1,currentPage),calculatedTotalPages);setCurrentPage(validPage);cards.forEach((card,index)=>{const startIndex=(validPage-1)*ITEMS_PER_PAGE;const endIndex=startIndex+ITEMS_PER_PAGE;if(index>=startIndex&&index<endIndex){card.classList.remove(\"hidden\");}else{card.classList.add(\"hidden\");}});}},[props.className,currentPage]);useEffect(()=>{updatePagination();},[updatePagination]);const handlePageChange=page=>{const validPage=Math.min(Math.max(1,page),totalPages);setCurrentPage(validPage);};const renderPageButtons=()=>{const buttons=[];if(currentPage>1){buttons.push(/*#__PURE__*/_jsx(\"button\",{className:\"pagination-button\",onClick:()=>handlePageChange(currentPage-1),children:\"Previous\"},\"prev\"));}for(let i=1;i<=totalPages;i++){buttons.push(/*#__PURE__*/_jsx(\"button\",{className:`pagination-button ${i===currentPage?\"active\":\"\"}`,onClick:()=>handlePageChange(i),children:i},i));}if(currentPage<totalPages){buttons.push(/*#__PURE__*/_jsx(\"button\",{className:\"pagination-button\",onClick:()=>handlePageChange(currentPage+1),children:\"Next\"},\"next\"));}return buttons;};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props}),/*#__PURE__*/_jsx(\"div\",{style:PAGINATION_STYLES,children:renderPageButtons()}),/*#__PURE__*/_jsx(\"style\",{children:`\n                    .${props.className} .hidden {\n                        display: none;\n                    }\n                    .pagination-button {\n                        padding: ${BUTTON_STYLES.padding};\n                        margin: ${BUTTON_STYLES.margin};\n                        background-color: ${BUTTON_STYLES.backgroundColor};\n                        color: ${BUTTON_STYLES.color};\n                        border: ${BUTTON_STYLES.border};\n                        border-radius: ${BUTTON_STYLES.borderRadius};\n                        cursor: ${BUTTON_STYLES.cursor};\n                        font-size: ${BUTTON_STYLES.fontSize};\n                        font-family: ${BUTTON_STYLES.fontFamily};\n                        font-weight: ${BUTTON_STYLES.fontWeight};\n                        transition: ${BUTTON_STYLES.transition};\n                    }\n                    .pagination-button:hover:not(.active) {\n                        background-color: ${BUTTON_HOVER_STYLES.backgroundColor};\n                    }\n                    .pagination-button.active {\n                        background-color: ${BUTTON_ACTIVE_STYLES.backgroundColor};\n                        color: ${BUTTON_ACTIVE_STYLES.color};\n                        border: ${BUTTON_ACTIVE_STYLES.border};\n                        cursor: ${BUTTON_ACTIVE_STYLES.cursor};\n                    }\n                `})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"cardPaginator\":{\"type\":\"reactHoc\",\"name\":\"cardPaginator\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Pagination.map"],
  "mappings": "4EACA,IAAMA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EAAqB,MAAM;AAAA,kCAC3BA,EAAqB,MAAM;AAAA;AAAA,iBAE5C,CAAC,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["ITEMS_PER_PAGE", "PAGINATION_STYLES", "BUTTON_STYLES", "BUTTON_HOVER_STYLES", "BUTTON_ACTIVE_STYLES", "cardPaginator", "Component", "props", "currentPage", "setCurrentPage", "ye", "totalPages", "setTotalPages", "updatePagination", "te", "layer", "cards", "totalItems", "calculatedTotalPages", "validPage", "card", "index", "startIndex", "endIndex", "ue", "handlePageChange", "page", "renderPageButtons", "buttons", "p", "i", "u", "l"]
}
