{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/9QihbUbICoiv3QdzQhLf/RZFdwKcSvnYfZ1xdARVt/RandomlySortCMS.js"],
  "sourcesContent": ["// Apply this code override to the \"Collection List\" and it will randomly re-order your \"Post\" containers\n// Modified from the following override:\n// https://gist.github.com/tswic-highdesert/23e82bdc9f1bc7fa5ef48c1cac0656e2\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export const withShuffledItems=Component=>{const ShuffledComponent=props=>{const componentRef=useRef(null);const shuffleAndDisplayItems=()=>{const container=componentRef.current;if(!container)return;// get child nodes of our collection\nlet items=Array.from(container.children);// Shuffle the array\nfor(let i=items.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[items[i],items[j]]=[items[j],items[i]];}// Re-append items to the container to reflect the new order in the DOM\nitems.forEach(item=>{// Move item to the end of the container, effectively reordering them\ncontainer.appendChild(item);});};useEffect(()=>{shuffleAndDisplayItems()// Shuffle and display items on component mount\n;},[])// Empty dependency array ensures this runs once after the initial render\n;return /*#__PURE__*/_jsx(Component,{ref:componentRef,...props});};return ShuffledComponent;};\nexport const __FramerMetadata__ = {\"exports\":{\"withShuffledItems\":{\"type\":\"reactHoc\",\"name\":\"withShuffledItems\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RandomlySortCMS.map"],
  "mappings": "uDAGsF,IAAMA,EAAkBC,GAAoCC,GAAO,CAAC,IAAMC,EAAaC,EAAO,IAAI,EAAQC,EAAuB,IAAI,CAAC,IAAMC,EAAUH,EAAa,QAAQ,GAAG,CAACG,EAAU,OAC/Q,IAAIC,EAAM,MAAM,KAAKD,EAAU,QAAQ,EACvC,QAAQE,EAAED,EAAM,OAAO,EAAEC,EAAE,EAAEA,IAAI,CAAC,IAAMC,EAAE,KAAK,MAAM,KAAK,OAAO,GAAGD,EAAE,EAAE,EAAE,CAACD,EAAMC,CAAC,EAAED,EAAME,CAAC,CAAC,EAAE,CAACF,EAAME,CAAC,EAAEF,EAAMC,CAAC,CAAC,CAAE,CAClHD,EAAM,QAAQG,GAAM,CACpBJ,EAAU,YAAYI,CAAI,CAAE,CAAC,CAAE,EAAE,OAAAC,EAAU,IAAI,CAACN,EAAuB,CACtE,EAAE,CAAC,CAAC,EACgBO,EAAKX,EAAU,CAAC,IAAIE,EAAa,GAAGD,CAAK,CAAC,CAAE",
  "names": ["withShuffledItems", "Component", "props", "componentRef", "pe", "shuffleAndDisplayItems", "container", "items", "i", "j", "item", "ue", "p"]
}
