{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/QvcQDHFSyXpcgTzkSMpg/BWjyTbXErexuXPF5ZUK9/Masonry.js", "ssg:https://framerusercontent.com/modules/7XzJP0Q2NyyJyg9uVacP/met3zffn26WSKovWjmpV/MasonryLayout.js"],
  "sourcesContent": ["// Code from Nikolay Goncharuk on GitHub:\n// https://github.com/GoncharukBro/react-smart-masonry/blob/master/src/Masonry.tsx\n// https://github.com/GoncharukBro/react-smart-masonry/blob/master/src/useResize.ts\n//\n// Modified by Isaac Roberts\n// https://framestack.co/components/masonry-layout\n//\n// Copyright (c) 2021 Nikolay Goncharuk\n// MIT License\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useLayoutEffect,useMemo,useRef,Children,isValidElement}from\"react\";const DEFAULT_COLUMNS=1;const DEFAULT_GAP=0;export default function Masonry({breakpoints,columns=DEFAULT_COLUMNS,gap=DEFAULT_GAP,reverse=false,autoArrange=false,alignment=\"center\",children,style,...otherProps},forwardedRef){const elements=useRef([]);const[arrange,setArrange]=useState(false);// eslint-disable-next-line react-hooks/exhaustive-deps\nuseLayoutEffect(()=>{if(autoArrange&&!arrange)setArrange(true);return()=>{if(autoArrange&&arrange)setArrange(false);};});const layout=useMemo(()=>{if(columns<1)return[];const arrayOfChildren=Children.toArray(children);if(reverse)arrayOfChildren.reverse();const newLayout=Array.from({length:columns},()=>{return[];});const columnHeights=newLayout.map(()=>0);const getcolumnIndex=index=>{if(autoArrange&&arrange&&elements.current.length>0){const columnIndex=columnHeights.findIndex(item=>{return item===Math.min(...columnHeights);});const element=elements.current.find(item=>item.index===index);const elementHeight=element===null||element===void 0?void 0:element.element.getBoundingClientRect().height;columnHeights[columnIndex]+=elementHeight||0;return columnIndex;}return index%columns;};arrayOfChildren.forEach((child,index)=>{if(child&&/*#__PURE__*/isValidElement(child)){newLayout[getcolumnIndex(index)].push({element:child,index});}});return newLayout;},[arrange,autoArrange,children,columns,reverse]);const temporaryElements=[];const addElement=index=>element=>{if(element!==null){temporaryElements.push({element,index});elements.current=temporaryElements;}};return /*#__PURE__*/_jsx(\"div\",{ref:forwardedRef,style:{display:\"flex\",gap,...style},...otherProps,children:layout.map((column,columnIndex)=>/*#__PURE__*/_jsx(\"div\",{style:{flex:1,display:\"flex\",flexDirection:\"column\",alignItems:alignment,gap},children:column.map((item,itemIndex)=>/*#__PURE__*/_jsx(\"div\",{ref:addElement(item.index),children:item.element},itemIndex))},columnIndex))});}\nexport const __FramerMetadata__ = {\"exports\":{\"MasonryProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Masonry\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Masonry.map", "import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,// @ts-ignore\nuseQueryData}from\"framer\";import{cloneElement,useMemo}from\"react\";import Masonry from\"https://framerusercontent.com/modules/QvcQDHFSyXpcgTzkSMpg/BWjyTbXErexuXPF5ZUK9/Masonry.js\";import{getCollectionData}from\"https://framer.com/m/CMSLibrary-09eo.js\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function MasonryLayout(props){var _props_collectionList;const{type}=props;const collectionList=(_props_collectionList=props.collectionList)===null||_props_collectionList===void 0?void 0:_props_collectionList[0];const isCanvas=RenderTarget.current()===RenderTarget.canvas;let layers=useMemo(()=>{let value=[];switch(type){case\"cms\":const{query,childrenFunction}=getCollectionData(collectionList);if(!isCanvas&&query){var _c_props;const c=childrenFunction(useQueryData(query));if(Array.isArray(c)){value=c;}else if(Array.isArray(c===null||c===void 0?void 0:(_c_props=c.props)===null||_c_props===void 0?void 0:_c_props.children)){value=c.props.children;}}if(!collectionList||!query&&!isCanvas){return /*#__PURE__*/_jsx(Message,{title:\"Connect a CMS Collection List\",subtitle:\"Use the handle on the right side of the component to connect a collection list, or select it from the dropdown. The collection list must be outside of the page on the canvas.\"});}else if(isCanvas){return /*#__PURE__*/_jsx(Message,{title:\"Preview site to view masonry grid\",subtitle:\"Press the play button or visit the live website to view the masonry grid.\"});}break;case\"layers\":if(!props.layers.length){return /*#__PURE__*/_jsx(Message,{title:\"Connect layers\",subtitle:\"Use the handle on the right side of the component to connect layers outside of the page for a masonry grid.\"});}value=props.layers;break;}return props.randomize?shuffleArray(value):value;},[type,collectionList,props.layers,props.randomize]);if(props.columnWidth==\"fill\"){for(let i=0;i<layers.length;i++){if(layers[i]){var _layers_i_props,_layers_i;layers[i]=/*#__PURE__*/cloneElement(layers[i],{style:{...(_layers_i=layers[i])===null||_layers_i===void 0?void 0:(_layers_i_props=_layers_i.props)===null||_layers_i_props===void 0?void 0:_layers_i_props.style,width:\"100%\"}});}}}if(props.columns==1){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:props.gapV},children:layers});}else{return /*#__PURE__*/_jsx(Masonry,{columns:props.columns,gap:`${props.gapV}px ${props.gapH}px`,alignment:props.columnWidth==\"fit\"?props.align:\"stretch\",autoArrange:true,reverse:false,style:props.style,children:layers});}}MasonryLayout.displayName=\"Masonry Layout\";addPropertyControls(MasonryLayout,{type:{type:ControlType.Enum,defaultValue:\"layers\",options:[\"layers\",\"cms\"],optionTitles:[\"Layers\",\"CMS\"],displaySegmentedControl:true},collectionList:{type:ControlType.ComponentInstance,hidden:props=>props.type!==\"cms\"},layers:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},hidden:props=>props.type!==\"layers\"},columns:{type:ControlType.Number,defaultValue:3,min:1,step:1,displayStepper:true},columnWidth:{type:ControlType.Enum,defaultValue:\"fill\",options:[\"fit\",\"fill\"],optionTitles:[\"Fit\",\"Fill\"],displaySegmentedControl:true,title:\"Item Width\"},align:{type:ControlType.Enum,defaultValue:\"center\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true,hidden:props=>props.columnWidth!==\"fit\"},gapH:{type:ControlType.Number,defaultValue:10,min:0,hidden:props=>props.columns==1},gapV:{type:ControlType.Number,defaultValue:10,min:0},randomize:{type:ControlType.Boolean,defaultValue:false}});function Message({title,subtitle}){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",gap:16,backgroundColor:\"rgba(136, 85, 255, 0.1)\",borderRadius:6,border:\"1px dashed rgb(136, 85, 255)\",color:\"rgb(136, 85, 255)\",fontSize:16,padding:20,minHeight:200,textWrap:\"balance\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontWeight:600,textAlign:\"center\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,opacity:.7,lineHeight:1.5,textAlign:\"center\"},children:subtitle})]});}function shuffleArray(array){if(!array){return[];}for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[array[i],array[j]]=[array[j],array[i]];}return array;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MasonryLayout\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MasonryLayout.map"],
  "mappings": "yMAS8H,IAAMA,EAAgB,EAAQC,EAAY,EAAiB,SAARC,EAAyB,CAAC,YAAAC,EAAY,QAAAC,EAAQJ,EAAgB,IAAAK,EAAIJ,EAAY,QAAAK,EAAQ,GAAM,YAAAC,EAAY,GAAM,UAAAC,EAAU,SAAS,SAAAC,EAAS,MAAAC,EAAM,GAAGC,CAAU,EAAEC,EAAa,CAAC,IAAMC,EAASC,EAAO,CAAC,CAAC,EAAO,CAACC,EAAQC,CAAU,EAAEC,EAAS,EAAK,EACh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AAEA,IAAI,CAAC,IAAMW,EAAE,KAAK,MAAM,KAAK,OAAO,GAAGX,EAAE,EAAE,EAAE,CAACU,EAAMV,CAAC,EAAEU,EAAMC,CAAC,CAAC,EAAE,CAACD,EAAMC,CAAC,EAAED,EAAMV,CAAC,CAAC,CAAE,CAAC,OAAOU,CAAM",
  "names": ["DEFAULT_COLUMNS", "DEFAULT_GAP", "Masonry", "breakpoints", "columns", "gap", "reverse", "autoArrange", "alignment", "children", "style", "otherProps", "forwardedRef", "elements", "pe", "arrange", "setArrange", "ye", "fe", "layout", "se", "arrayOfChildren", "j", "newLayout", "columnHeights", "getcolumnIndex", "index", "columnIndex", "item", "element", "elementHeight", "child", "J", "temporaryElements", "addElement", "p", "column", "itemIndex", "MasonryLayout", "props", "_props_collectionList", "type", "collectionList", "isCanvas", "RenderTarget", "layers", "se", "value", "query", "childrenFunction", "getCollectionData", "_c_props", "c", "useQueryData", "p", "Message", "shuffleArray", "i", "_layers_i_props", "_layers_i", "q", "Masonry", "addPropertyControls", "ControlType", "title", "subtitle", "u", "array", "j"]
}
