{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/psGpi5fHiqi1bp39nTk7/tEWi3BDj9KzZqebK5iPn/SectionID_counter.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useMemo}from\"react\";import{addPropertyControls,ControlType,RenderTarget,// @ts-expect-error \u2013\u00A0Internal\nuseQueryData}from\"framer\";import{fontControls}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";function DragHandleCounter({dataSource}){const isEditingMode=RenderTarget.current()===RenderTarget.canvas;const count=useMemo(()=>{var _dataSource__props_children,_dataSource_;if(isEditingMode||!(dataSource===null||dataSource===void 0?void 0:(_dataSource_=dataSource[0])===null||_dataSource_===void 0?void 0:(_dataSource__props_children=_dataSource_.props.children)===null||_dataSource__props_children===void 0?void 0:_dataSource__props_children.props.query)){return 0// Will show in the editor\n;}return useQueryData(dataSource[0].props.children.props.query).length;},[dataSource,isEditingMode]);return count;}/**\n * @framerDisableUnlink\n */export default function ChildCounter(props){const[childCount,setChildCount]=useState(0);useEffect(()=>{if(props.filterType!==\"dragHandle\"){let element;if(props.filterType===\"sectionId\"){element=document.getElementById(props.sectionId);}else if(props.filterType===\"ariaLabel\"){element=document.querySelector(`[aria-label=\"${props.ariaLabel}\"]`);}if(element){setChildCount(element.children.length);}else{setChildCount(0);}}},[props.sectionId,props.ariaLabel,props.filterType]);const textStyle={...props.font,color:props.fontColor};return /*#__PURE__*/_jsx(\"div\",{style:textStyle,children:props.filterType===\"dragHandle\"?/*#__PURE__*/_jsx(DragHandleCounter,{dataSource:props.dataSource}):childCount});}ChildCounter.defaultProps={sectionId:\"\",ariaLabel:\"\",filterType:\"sectionId\",fontColor:\"#000000\",font:fontControls.defaultProps,dataSource:null};addPropertyControls(ChildCounter,{filterType:{type:ControlType.Enum,title:\"Filter By\",options:[\"sectionId\",\"ariaLabel\",\"dragHandle\"],optionTitles:[\"Section ID\",\"Aria Label\",\"Drag Handle\"]},sectionId:{type:ControlType.String,title:\"Section ID\",hidden:props=>props.filterType!==\"sectionId\",description:\"Add a section ID to the CMS collection from the right hand panel. Note: The collection item needs to be rendered to see the results in action.\"},ariaLabel:{type:ControlType.String,title:\"Aria Label\",hidden:props=>props.filterType!==\"ariaLabel\",description:\"Add an aria label from the accessibility section on the right hand side to the CMS collection. Note: The collection item needs to be rendered to see the results in action.\"},dataSource:{type:ControlType.ComponentInstance,title:\"Source\",hidden:props=>props.filterType!==\"dragHandle\",description:\"Connect to a CMS collection outside the canvas.\"},fontColor:{type:ControlType.Color,title:\"Font Color\"},font:{type:ControlType.Font,controls:\"extended\",description:\"[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ChildCounter\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SectionID_counter.map"],
  "mappings": "0MAAAA,IACyG,SAASC,EAAkB,CAAC,WAAAC,CAAU,EAAE,CAAC,IAAMC,EAAcC,EAAa,QAAQ,IAAIA,EAAa,OACvG,OAD0HC,EAAQ,IAAI,CAAC,IAAIC,EAA4BC,EAAa,OAAGJ,GAAe,EAAE,EAAAD,GAAa,OAAkCK,EAAaL,EAAW,CAAC,KAAK,MAAMK,IAAe,SAAeD,EAA4BC,EAAa,MAAM,YAAY,MAAMD,IAA8B,SAAcA,EAA4B,MAAM,OAAe,EACnjBE,EAAaN,EAAW,CAAC,EAAE,MAAM,SAAS,MAAM,KAAK,EAAE,MAAO,EAAE,CAACA,EAAWC,CAAa,CAAC,CAAe,CAEhG,SAARM,EAA8BC,EAAM,CAAC,GAAK,CAACC,EAAWC,CAAa,EAAEC,EAAS,CAAC,EAAEC,EAAU,IAAI,CAAC,GAAGJ,EAAM,aAAa,aAAa,CAAC,IAAIK,EAAWL,EAAM,aAAa,YAAaK,EAAQ,SAAS,eAAeL,EAAM,SAAS,EAAWA,EAAM,aAAa,cAAaK,EAAQ,SAAS,cAAc,gBAAgBL,EAAM,aAAa,GAAeE,EAATG,EAAuBA,EAAQ,SAAS,OAA4B,CAAtB,EAA2B,EAAE,CAACL,EAAM,UAAUA,EAAM,UAAUA,EAAM,UAAU,CAAC,EAAE,IAAMM,EAAU,CAAC,GAAGN,EAAM,KAAK,MAAMA,EAAM,SAAS,EAAE,OAAoBO,EAAK,MAAM,CAAC,MAAMD,EAAU,SAASN,EAAM,aAAa,aAA0BO,EAAKhB,EAAkB,CAAC,WAAWS,EAAM,UAAU,CAAC,EAAEC,CAAU,CAAC,CAAE,CAACF,EAAa,aAAa,CAAC,UAAU,GAAG,UAAU,GAAG,WAAW,YAAY,UAAU,UAAU,KAAKS,EAAa,aAAa,WAAW,IAAI,EAAEC,EAAoBV,EAAa,CAAC,WAAW,CAAC,KAAKW,EAAY,KAAK,MAAM,YAAY,QAAQ,CAAC,YAAY,YAAY,YAAY,EAAE,aAAa,CAAC,aAAa,aAAa,aAAa,CAAC,EAAE,UAAU,CAAC,KAAKA,EAAY,OAAO,MAAM,aAAa,OAAOV,GAAOA,EAAM,aAAa,YAAY,YAAY,gJAAgJ,EAAE,UAAU,CAAC,KAAKU,EAAY,OAAO,MAAM,aAAa,OAAOV,GAAOA,EAAM,aAAa,YAAY,YAAY,6KAA6K,EAAE,WAAW,CAAC,KAAKU,EAAY,kBAAkB,MAAM,SAAS,OAAOV,GAAOA,EAAM,aAAa,aAAa,YAAY,iDAAiD,EAAE,UAAU,CAAC,KAAKU,EAAY,MAAM,MAAM,YAAY,EAAE,KAAK,CAAC,KAAKA,EAAY,KAAK,SAAS,WAAW,YAAY,4CAA4C,CAAC,CAAC",
  "names": ["init_ssg_sandbox_shims", "DragHandleCounter", "dataSource", "isEditingMode", "RenderTarget", "se", "_dataSource__props_children", "_dataSource_", "useQueryData", "ChildCounter", "props", "childCount", "setChildCount", "ye", "ue", "element", "textStyle", "p", "fontControls", "addPropertyControls", "ControlType"]
}
