{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/CMSLibrary-09eo.js", "ssg:https://framerusercontent.com/modules/XcP5LiiHqt34ThbShkmm/slqRTucHUrCtAUkhpDSr/CMSAutoHide_v05.js"],
  "sourcesContent": ["export function getCollectionData(collectionList){var _collectionList_props,_collectionList_props_children_props,_collectionList_props_children,_collectionList_props1,_collectionList_props_children_props_children_props,_collectionList_props_children_props_children,_collectionList_props_children_props1,_collectionList_props_children1,_collectionList_props2,_queryParent_props;let queryParent=null;if(collectionList===null||collectionList===void 0?void 0:(_collectionList_props=collectionList.props)===null||_collectionList_props===void 0?void 0:_collectionList_props.query){queryParent=collectionList;}else if(collectionList===null||collectionList===void 0?void 0:(_collectionList_props1=collectionList.props)===null||_collectionList_props1===void 0?void 0:(_collectionList_props_children=_collectionList_props1.children)===null||_collectionList_props_children===void 0?void 0:(_collectionList_props_children_props=_collectionList_props_children.props)===null||_collectionList_props_children_props===void 0?void 0:_collectionList_props_children_props.query){queryParent=collectionList.props.children;}else if(collectionList===null||collectionList===void 0?void 0:(_collectionList_props2=collectionList.props)===null||_collectionList_props2===void 0?void 0:(_collectionList_props_children1=_collectionList_props2.children)===null||_collectionList_props_children1===void 0?void 0:(_collectionList_props_children_props1=_collectionList_props_children1.props)===null||_collectionList_props_children_props1===void 0?void 0:(_collectionList_props_children_props_children=_collectionList_props_children_props1.children)===null||_collectionList_props_children_props_children===void 0?void 0:(_collectionList_props_children_props_children_props=_collectionList_props_children_props_children.props)===null||_collectionList_props_children_props_children_props===void 0?void 0:_collectionList_props_children_props_children_props.query){queryParent=collectionList.props.children.props.children;}const query=queryParent===null||queryParent===void 0?void 0:(_queryParent_props=queryParent.props)===null||_queryParent_props===void 0?void 0:_queryParent_props.query;let queryData=null;if(query===null||query===void 0?void 0:query.from){if(query.from.data){queryData=query.from.data;}else if(query.from.left){let left=query.from.left;for(let i=0;i<100;i++){if(left.type==\"Collection\"){queryData=left.data;break;}else if(left.left){left=left.left;}else{break;}}}}// Get property controls\nconst propertyControlsById=(queryData===null||queryData===void 0?void 0:queryData.propertyControls)||{};const propertyControlsByName={};for(const id in propertyControlsById){const control=propertyControlsById[id];propertyControlsByName[control.title]={id,...control};}// Get children function\nlet childrenFunction=null;if(collectionList){var _collectionList_props3,_clpc_props,_clpc_props_children_props,_clpc_props_children,_clpc_props1;const clpc=(_collectionList_props3=collectionList.props)===null||_collectionList_props3===void 0?void 0:_collectionList_props3.children;if(typeof clpc==\"function\"){childrenFunction=clpc;}else if(typeof(clpc===null||clpc===void 0?void 0:(_clpc_props=clpc.props)===null||_clpc_props===void 0?void 0:_clpc_props.children)==\"function\"){childrenFunction=clpc.props.children;}else if(typeof(clpc===null||clpc===void 0?void 0:(_clpc_props1=clpc.props)===null||_clpc_props1===void 0?void 0:(_clpc_props_children=_clpc_props1.children)===null||_clpc_props_children===void 0?void 0:(_clpc_props_children_props=_clpc_props_children.props)===null||_clpc_props_children_props===void 0?void 0:_clpc_props_children_props.children)==\"function\"){childrenFunction=clpc.props.children.props.children;}}return{query,queryParent,queryData,propertyControlsById,propertyControlsByName,childrenFunction};}export function addFieldsToSelect(fields,query,propertyControlsByName){const alias=query.alias;const select=Array.isArray(query===null||query===void 0?void 0:query.select)?[...query.select]:[];for(const fieldName of fields){var _propertyControlsByName_fieldName;const fieldId=(_propertyControlsByName_fieldName=propertyControlsByName[fieldName])===null||_propertyControlsByName_fieldName===void 0?void 0:_propertyControlsByName_fieldName.id;if(!fieldId){continue;}let matchFound=false;for(const item of select){if(item.name===fieldId&&item.type===\"Identifier\"&&item.collection===alias){matchFound=true;continue;}}if(matchFound){continue;}select.push({collection:alias,name:fieldId,type:\"Identifier\"});}return select;}\nexport const __FramerMetadata__ = {\"exports\":{\"getCollectionData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addFieldsToSelect\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSLibrary.map", "/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,// @ts-ignore\nuseQueryData}from\"framer\";import{useEffect,useRef}from\"react\";import{getCollectionData}from\"https://framer.com/m/CMSLibrary-09eo.js\";export default function CMSHideEmptyFrame(props){const{collectionList,visibilityMode}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);let totalItems=0;if(!isCanvas&&Array.isArray(collectionList)&&collectionList.length>0){const counts=collectionList.map(collection=>{const{query}=getCollectionData(collection);const data=useQueryData(query)||[];return data.length;});totalItems=counts.reduce((sum,count)=>sum+count,0);}else{totalItems=1;}useEffect(()=>{if(isCanvas)return;const shouldHide=visibilityMode===\"hideWhenEmpty\"&&totalItems===0||visibilityMode===\"hideWhenNotEmpty\"&&totalItems>0;if(shouldHide){requestAnimationFrame(()=>{const wrapper=ref.current?.parentElement;const frameEl=wrapper?.parentElement;if(ref.current)ref.current.style.display=\"none\";if(wrapper)wrapper.style.display=\"none\";if(frameEl)frameEl.style.display=\"none\";});}},[totalItems,visibilityMode,isCanvas]);const iconSvg=visibilityMode===\"hideWhenEmpty\"?/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",fill:\"#9A66FF\",viewBox:\"0 0 256 256\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z\"})}):/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",fill:\"#9A66FF\",viewBox:\"0 0 256 256\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z\"})});return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:40,height:40,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:isCanvas?\"rgba(154, 102, 255, 0.3)\":\"transparent\",borderRadius:20,pointerEvents:\"none\"},children:isCanvas&&iconSvg});}CMSHideEmptyFrame.displayName=\"CMSAutoHide v0.5\";addPropertyControls(CMSHideEmptyFrame,{collectionList:{type:ControlType.Array,title:\"CMS Collections\",control:{type:ControlType.ComponentInstance},description:\"Connect one or more CMS Collections. Visibility will depend on summed item counts.\",defaultValue:[],maxCount:10},visibilityMode:{type:ControlType.Enum,title:\"Mode\",options:[\"hideWhenEmpty\",\"hideWhenNotEmpty\"],optionTitles:[\"Content\",\"Placeholder\"],defaultValue:\"hideWhenEmpty\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",description:\"If total CMS items equals zero:\\nContent - HIDE parent frame\\nPlaceholder - SHOW parent frame\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSHideEmptyFrame\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSAutoHide_v05.map"],
  "mappings": "sHAAO,SAASA,EAAkBC,EAAe,CAAC,IAAIC,EAAsBC,EAAqCC,EAA+BC,EAAuBC,EAAoDC,EAA8CC,EAAsCC,EAAgCC,EAAuBC,EAAmB,IAAIC,EAAY,KAAQ,EAAAX,GAAiB,OAAsCC,EAAsBD,EAAe,SAAS,MAAMC,IAAwB,SAAcA,EAAsB,MAAOU,EAAYX,EAAwB,EAAAA,GAAiB,OAAsCI,EAAuBJ,EAAe,SAAS,MAAMI,IAAyB,SAAeD,EAA+BC,EAAuB,YAAY,MAAMD,IAAiC,SAAeD,EAAqCC,EAA+B,SAAS,MAAMD,IAAuC,SAAcA,EAAqC,MAAOS,EAAYX,EAAe,MAAM,SAAkB,EAAAA,GAAiB,OAAsCS,EAAuBT,EAAe,SAAS,MAAMS,IAAyB,SAAeD,EAAgCC,EAAuB,YAAY,MAAMD,IAAkC,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K,KAAK,UAAU,QAAQ,cAAc,SAAsBA,EAAK,OAAO,CAAC,EAAE,2lBAA2lB,CAAC,CAAC,CAAC,EAAeA,EAAK,MAAM,CAAC,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,KAAK,UAAU,QAAQ,cAAc,SAAsBA,EAAK,OAAO,CAAC,EAAE,s4BAAs4B,CAAC,CAAC,CAAC,EAAiQ,CAAC,CAAE,CAAClB,EAAkB,YAAY,mBAAmBmB,EAAoBnB,EAAkB,CAAC,eAAe,CAAC,KAAKoB,EAAY,MAAM,MAAM,kBAAkB,QAAQ,CAAC,KAAKA,EAAY,iBAAiB,EAAE,YAAY,qFAAqF,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,eAAe,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,QAAQ,CAAC,gBAAgB,kBAAkB,EAAE,aAAa,CAAC,UAAU,aAAa,EAAE,aAAa,gBAAgB,wBAAwB,GAAK,0BAA0B,WAAW,YAAY;AAAA;AAAA,gCAA+F,CAAC,CAAC",
  "names": ["getCollectionData", "collectionList", "_collectionList_props", "_collectionList_props_children_props", "_collectionList_props_children", "_collectionList_props1", "_collectionList_props_children_props_children_props", "_collectionList_props_children_props_children", "_collectionList_props_children_props1", "_collectionList_props_children1", "_collectionList_props2", "_queryParent_props", "queryParent", "query", "queryData", "left", "i", "propertyControlsById", "propertyControlsByName", "id", "control", "childrenFunction", "_collectionList_props3", "_clpc_props", "_clpc_props_children_props", "_clpc_props_children", "_clpc_props1", "clpc", "CMSHideEmptyFrame", "props", "collectionList", "visibilityMode", "isCanvas", "RenderTarget", "ref", "pe", "totalItems", "collection", "query", "getCollectionData", "useQueryData", "sum", "count", "ue", "wrapper", "frameEl", "p", "addPropertyControls", "ControlType"]
}
